diff --git a/apps/ui/src/lib/components/Usage.svelte b/apps/ui/src/lib/components/Usage.svelte index 00915b767..66b201da3 100644 --- a/apps/ui/src/lib/components/Usage.svelte +++ b/apps/ui/src/lib/components/Usage.svelte @@ -22,9 +22,9 @@ usage: false, cleanup: false }; - import { appSession } from '$lib/store'; + import { addToast, appSession } from '$lib/store'; import { onDestroy, onMount } from 'svelte'; - import { get } from '$lib/api'; + import { get, post } from '$lib/api'; import { errorNotification } from '$lib/common'; async function getStatus() { if (loading.usage) return; @@ -48,13 +48,36 @@ return errorNotification(error); } }); + async function manuallyCleanupStorage() { + try { + loading.cleanup = true; + await post('/internal/cleanup', {}); + return addToast({ + message: 'Cleanup done.', + type: 'success' + }); + } catch (error) { + return errorNotification(error); + } finally { + loading.cleanup = false; + } + }
-

Hardware details

+
+

Hardware Details

+ {#if $appSession.teamId === '0'} + + {/if} +
-
+
Total Memory
@@ -77,7 +100,9 @@
-
+
Total CPUs
@@ -98,7 +123,9 @@
-
+
Total Disk
@@ -115,7 +142,9 @@
Free Disk
-
{usage?.disk.freePercentage}%
+
+ {usage?.disk.freePercentage}% +
diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index e5ba5c05e..dde8186c5 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -36,10 +36,6 @@ import ServiceIcons from '$lib/components/svg/services/ServiceIcons.svelte'; import { dev } from '$app/env'; - let loading = { - cleanup: false - }; - let numberOfGetStatus = 0; function getRndInteger(min: number, max: number) { @@ -75,253 +71,165 @@ numberOfGetStatus--; } } - async function manuallyCleanupStorage() { - try { - loading.cleanup = true; - await post('/internal/cleanup', {}); - return addToast({ - message: 'Cleanup done.', - type: 'success' - }); - } catch (error) { - return errorNotification(error); - } finally { - loading.cleanup = false; - } - }
{$t('index.dashboard')}
- {#if $appSession.teamId === '0'} - - {/if}
{#if $appSession.teamId === '0'} {/if} {#if applications.length > 0} -

Resources

+

Applications

{#each applications as application} -
- {#await getStatus(application)} - - {:then status} - {#if status === 'Running'} - - {:else} - - {/if} - {/await} -
- -
- - Application - {#if application.settings.isBot} - | BOT - {/if} - -

{application.name}

-
-

Services

{#each services as service} -
- {#await getStatus(service)} - - {:then status} - {#if status === 'Running'}1 - - {:else} - - {/if} - {/await} -
- -
- - Service - -

{service.name}

-
-

Databases

{#each databases as database} -
- {#await getStatus(database)} - - {:then status} - {#if status === 'Running'}1 - - {:else} - - {/if} - {/await} -