From 3d6adeffc4e94f164e91ab6894567647e38f80ae Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 22 Sep 2022 15:48:16 +0200 Subject: [PATCH] ui: more UI improvements --- .../lib/components/CopyPasswordField.svelte | 4 +- .../src/routes/applications/[id]/_Menu.svelte | 194 ++++++++++- .../routes/applications/[id]/_Secret.svelte | 212 ++++++------ .../routes/applications/[id]/_Storage.svelte | 63 ++-- .../routes/applications/[id]/__layout.svelte | 302 ++---------------- .../routes/applications/[id]/danger.svelte | 80 +++++ .../src/routes/applications/[id]/index.svelte | 4 +- .../applications/[id]/logs/_BuildLog.svelte | 108 +++---- .../applications/[id]/logs/build.svelte | 58 ++-- .../applications/[id]/logs/index.svelte | 9 +- .../applications/[id]/previews/index.svelte | 7 + .../routes/applications/[id]/secrets.svelte | 72 ++--- .../routes/applications/[id]/storages.svelte | 38 ++- apps/ui/src/tailwind.css | 3 + 14 files changed, 597 insertions(+), 557 deletions(-) create mode 100644 apps/ui/src/routes/applications/[id]/danger.svelte diff --git a/apps/ui/src/lib/components/CopyPasswordField.svelte b/apps/ui/src/lib/components/CopyPasswordField.svelte index 14a3ca376..24ed90f94 100644 --- a/apps/ui/src/lib/components/CopyPasswordField.svelte +++ b/apps/ui/src/lib/components/CopyPasswordField.svelte @@ -15,7 +15,7 @@ export let placeholder = ''; export let inputStyle = ''; - let disabledClass = 'bg-coolback disabled:bg-coolblack w-full'; + let disabledClass = 'bg-coolback disabled:bg-coolblack lg:w-64 w-full'; let isHttps = browser && window.location.protocol === 'https:'; function copyToClipboard() { @@ -82,7 +82,7 @@ /> {/if} -
+
{#if isPasswordField}
(showPassword = !showPassword)}> diff --git a/apps/ui/src/routes/applications/[id]/_Menu.svelte b/apps/ui/src/routes/applications/[id]/_Menu.svelte index b1b71331b..33247d740 100644 --- a/apps/ui/src/routes/applications/[id]/_Menu.svelte +++ b/apps/ui/src/routes/applications/[id]/_Menu.svelte @@ -1,21 +1,203 @@ -
diff --git a/apps/ui/src/routes/applications/[id]/_Storage.svelte b/apps/ui/src/routes/applications/[id]/_Storage.svelte index f67686eeb..2fe473f51 100644 --- a/apps/ui/src/routes/applications/[id]/_Storage.svelte +++ b/apps/ui/src/routes/applications/[id]/_Storage.svelte @@ -59,32 +59,39 @@ } - - - - - {#if isNew} -
- +
+
+ + {#if isNew} +
New Persistent Storage
+ {/if} +
+ + {#if isNew} +
+ +
+ {:else} +
+
+ +
+
+ +
+
+ {/if}
- {:else} -
-
- -
-
- -
-
- {/if} - +
+
diff --git a/apps/ui/src/routes/applications/[id]/__layout.svelte b/apps/ui/src/routes/applications/[id]/__layout.svelte index bc934c0ed..105bf6c24 100644 --- a/apps/ui/src/routes/applications/[id]/__layout.svelte +++ b/apps/ui/src/routes/applications/[id]/__layout.svelte @@ -55,7 +55,6 @@ export let application: any; export let settings: any; import { page } from '$app/stores'; - import DeleteIcon from '$lib/components/DeleteIcon.svelte'; import { del, get, post } from '$lib/api'; import { goto } from '$app/navigation'; import { onDestroy, onMount } from 'svelte'; @@ -100,23 +99,6 @@ } } - async function deleteApplication(name: string, force: boolean) { - const sure = confirm($t('application.confirm_to_delete', { name })); - if (sure) { - $status.application.initialLoading = true; - try { - await del(`/applications/${id}`, { id, force }); - return await window.location.assign(`/`); - } catch (error) { - if (error.message.startsWith(`Command failed: SSH_AUTH_SOCK=/tmp/coolify-ssh-agent.pid`)) { - forceDelete = true; - } - return errorNotification(error); - } finally { - $status.application.initialLoading = false; - } - } - } async function restartApplication() { try { $status.application.initialLoading = true; @@ -192,52 +174,20 @@
- {#if $location} - - - - - - - Open - -