diff --git a/apps/ui/src/lib/components/CopyVolumeField.svelte b/apps/ui/src/lib/components/CopyVolumeField.svelte new file mode 100644 index 000000000..62009ca0f --- /dev/null +++ b/apps/ui/src/lib/components/CopyVolumeField.svelte @@ -0,0 +1,38 @@ + + + +
+

{value}

+
+
+ + + + + +
+
+
diff --git a/apps/ui/src/routes/applications/[id]/_Storage.svelte b/apps/ui/src/routes/applications/[id]/_Storage.svelte index 6e91c7d8f..0e0e13b8b 100644 --- a/apps/ui/src/routes/applications/[id]/_Storage.svelte +++ b/apps/ui/src/routes/applications/[id]/_Storage.svelte @@ -7,12 +7,23 @@ import { del, post } from '$lib/api'; import { page } from '$app/stores'; import { createEventDispatcher } from 'svelte'; - + import { browser } from '$app/env'; import { t } from '$lib/translations'; import { errorNotification } from '$lib/common'; import { addToast } from '$lib/store'; + import CopyVolumeField from '$lib/components/CopyVolumeField.svelte'; const { id } = $page.params; - + let isHttps = browser && window.location.protocol === 'https:'; + export let value: string; + function copyToClipboard() { + if (isHttps && navigator.clipboard) { + navigator.clipboard.writeText(value); + addToast({ + message: 'Copied to clipboard.', + type: 'success' + }); + } + } const dispatch = createEventDispatcher(); async function saveStorage(newStorage = false) { try { @@ -69,18 +80,14 @@
{#if storage.applicationId} {#if storage.oldPath} - + /> {:else} - {/if} {/if} diff --git a/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte index b6abcf736..4d507bb71 100644 --- a/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte +++ b/apps/ui/src/routes/databases/[id]/_Databases/_CouchDb.svelte @@ -2,6 +2,8 @@ export let database: any; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; import { t } from '$lib/translations'; + import { status } from '$lib/store'; + import Explainer from '$lib/components/Explainer.svelte';
@@ -9,11 +11,13 @@
- +
- +
- +
- +
- +
diff --git a/apps/ui/src/routes/databases/[id]/_Databases/_EdgeDB.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_EdgeDB.svelte index 9c08e18fc..c9ab78a70 100644 --- a/apps/ui/src/routes/databases/[id]/_Databases/_EdgeDB.svelte +++ b/apps/ui/src/routes/databases/[id]/_Databases/_EdgeDB.svelte @@ -11,11 +11,12 @@
- +
- +
Root Password
diff --git a/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte index 95389a6aa..eda6abf41 100644 --- a/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte +++ b/apps/ui/src/routes/databases/[id]/_Databases/_MariaDB.svelte @@ -12,12 +12,12 @@
{$t('database.default_database')}
- +
- +
- +
- +
- +
- +
- + Postgres User Password {/if}
- +