Files
nostash/Shared (Extension)/Resources/popup.html
2023-01-14 15:03:52 -05:00

53 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="popup.css">
<script defer src="popup.build.js"></script>
</head>
<body x-data="popup">
<div class="profiles">
<label for="profile">Profile</label>
<select x-model="activeProfile" name="profile" id="profile" @change="getPrivKeyForProfile()">
<template x-for="(prof, index) in profiles">
<option x-text="prof.name" :value="index"></option>
</template>
</select>
<button @click="newProfile">New</button>
</div>
<div class="profile-name">
<label for="profile-name">Profile Name</label>
<input type="text" id="profile-name" x-model="profile.name">
</div>
<div class="key">
<label for="priv-key">Private Key</label>
<input id="priv-key" x-model="profile.privKey" :type="visibleKey ? 'text' : 'password'">
</div>
<div class="buttons">
<button @click="visibleKey = !visibleKey" x-text="visibleKey ? 'Hide' : 'Show'"></button>
<button @click="saveKey()">Save</button>
</div>
<div x-show="hasValidPubKey">
<label for="pub-key">Pub Key:</label>
<input type="text" id="pub-key" x-model="pubKey" disabled>
</div>
<div class="allowed-sites" x-show="hosts.length > 0">
<h3>Allowed Sites</h3>
<table>
<template x-for="(host, index) in hosts" :key="host.host">
<tr>
<td class="allowed" x-text="host.allowed ? 'Yes' : 'No'"></td>
<td x-text="host.host"></td>
<td><button @click="deleteSite(index)">Delete</button></td>
</tr>
</template>
</table>
</div>
</body>
</html>