Fixed API-Key UI

This commit is contained in:
Mawoka
2022-09-29 18:46:45 +02:00
parent 4f220bf810
commit 375317c3c6
@@ -105,8 +105,10 @@
}; };
const delete_api_key = async (key: string) => { const delete_api_key = async (key: string) => {
if (confirm('Do you really want to delete this API-Key?')) {
await fetch(`/api/v1/users/api_keys?api_key=${key}`, { method: 'DELETE' }); await fetch(`/api/v1/users/api_keys?api_key=${key}`, { method: 'DELETE' });
api_keys = get_api_keys(); api_keys = get_api_keys();
}
}; };
const getSessions = async () => { const getSessions = async () => {
@@ -209,13 +211,16 @@
<Spinner /> <Spinner />
{:then keys} {:then keys}
{#each keys as key} {#each keys as key}
<p <div>
on:contextmenu|preventDefault={() => { {key.key}
<button
on:click={() => {
delete_api_key(key.key); delete_api_key(key.key);
}} }}
> class="admin-button"
{key.key} >Delete
</p> </button>
</div>
{/each} {/each}
{/await} {/await}
</div> </div>