Moved profile management into options UI.

This commit is contained in:
Ryan Breen
2023-01-27 10:38:37 -05:00
parent 0ea7f11356
commit b0faf6146e
6 changed files with 237 additions and 282 deletions

View File

@@ -17,48 +17,9 @@
<option x-text="prof" :value="index"></option>
</template>
</select>
<button @click="newProfile">New</button>
<button @click="confirmDelete = true" x-show="!confirmDelete"
:disabled="profileNames.length <= 1">Delete</button>
<button @click="await deleteProfile()" x-show="confirmDelete">Confirm Delete</button>
</div>
</div>
<div class="profile-name">
<label for="profile-name">Profile Name</label>
<input type="text" id="profile-name" x-model="name">
</div>
<div class="key">
<label for="priv-key">Private Key</label>
<input id="priv-key" x-model="privKey" :type="visibleKey ? 'text' : 'password'">
</div>
<div class="buttons">
<button @click="visibleKey = !visibleKey" x-text="visibleKey ? 'Hide' : 'Show'"></button>
<button @click="await saveProfile()" :disabled="!needsSaving">Save</button>
<button @click="confirmClear = true" x-show="!confirmClear">Clear Data</button>
<button @click="await clearData()" x-show="confirmClear">Confirm Clear</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>
<div class="help">
<button @click='window.open("https://ursus.camp/nostore", "_blank")'>Get Help</button>
<button @click="await openOptions()">Advanced</button>