2023-01-02 15:22:33 -05:00
|
|
|
<script lang="ts">
|
2024-02-14 06:38:57 -08:00
|
|
|
import { copyToClipboard } from '$lib/utils';
|
|
|
|
|
import { mdiKeyVariant } from '@mdi/js';
|
2024-05-23 23:16:38 +02:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
2023-07-01 00:50:47 -04:00
|
|
|
import Button from '../elements/buttons/button.svelte';
|
2023-08-25 19:44:52 +02:00
|
|
|
import FullScreenModal from '../shared-components/full-screen-modal.svelte';
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
export let secret = '';
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2023-12-15 03:54:21 +01:00
|
|
|
const dispatch = createEventDispatcher<{
|
|
|
|
|
done: void;
|
|
|
|
|
}>();
|
2023-07-01 00:50:47 -04:00
|
|
|
const handleDone = () => dispatch('done');
|
2023-01-02 15:22:33 -05:00
|
|
|
</script>
|
|
|
|
|
|
2024-04-08 21:02:09 +00:00
|
|
|
<FullScreenModal id="api-key-secret-modal" title="API key" icon={mdiKeyVariant} onClose={() => handleDone()}>
|
|
|
|
|
<div class="text-immich-primary dark:text-immich-dark-primary">
|
|
|
|
|
<p class="text-sm dark:text-immich-dark-fg">
|
|
|
|
|
This value will only be shown once. Please be sure to copy it before closing the window.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2024-04-08 21:02:09 +00:00
|
|
|
<div class="my-4 flex flex-col gap-2">
|
|
|
|
|
<!-- <label class="immich-form-label" for="secret">API Key</label> -->
|
|
|
|
|
<textarea class="immich-form-input" id="secret" name="secret" readonly={true} value={secret} />
|
|
|
|
|
</div>
|
2023-01-02 15:22:33 -05:00
|
|
|
|
2024-04-16 05:06:15 +00:00
|
|
|
<svelte:fragment slot="sticky-bottom">
|
2024-05-23 23:16:38 +02:00
|
|
|
<Button on:click={() => copyToClipboard(secret)} fullwidth>Copy to Clipboard</Button>
|
2024-04-08 21:02:09 +00:00
|
|
|
<Button on:click={() => handleDone()} fullwidth>Done</Button>
|
2024-04-16 05:06:15 +00:00
|
|
|
</svelte:fragment>
|
2023-01-02 15:22:33 -05:00
|
|
|
</FullScreenModal>
|