mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-08-04 13:42:46 +00:00
scaffolded apikey retrieval
This commit is contained in:
parent
ad9b840ddb
commit
98df17298f
2 changed files with 27 additions and 4 deletions
|
|
@ -338,7 +338,7 @@
|
|||
});
|
||||
|
||||
await apiKeysResponse.json().then((data) => {
|
||||
apiKeys = data.preAuthKeys;
|
||||
apiKeys = data.apiKeys;
|
||||
});
|
||||
return apiKeys;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,27 @@
|
|||
<script lang="ts">
|
||||
import { getAPIKeys } from '$lib/common/apiFunctions.svelte';
|
||||
import { APIKey } from '$lib/common/classes';
|
||||
import { alertStore } from '$lib/common/stores';
|
||||
import { onMount } from 'svelte';
|
||||
let keyList = [new APIKey()];
|
||||
|
||||
function getAPIKeysAction() {
|
||||
getAPIKeys()
|
||||
.then((keys) => {
|
||||
keyList = keys;
|
||||
console.log(keyList);
|
||||
})
|
||||
.catch((error) => {
|
||||
$alertStore = error;
|
||||
});
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
getAPIKeysAction();
|
||||
});
|
||||
</script>
|
||||
|
||||
<button type="button" class="tooltip" data-tip="stuff">
|
||||
<!-- clock -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
||||
</button>
|
||||
<!-- clock -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue