From aece1fa7d30f24d354ff7764e864f59070031d2a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 13 Dec 2022 13:04:47 +0100 Subject: [PATCH] wip: trpc --- .../src/lib/components/svg/RemoteLink.svelte | 10 ++++ .../components/svg/sources/GithubIcon.svelte | 24 +++++---- .../components/svg/sources/GitlabIcon.svelte | 44 ++++++++------- .../routes/applications/[id]/+layout.svelte | 16 +++--- .../src/routes/applications/[id]/+layout.ts | 1 + .../applications/[id]/_components/Menu.svelte | 53 +++---------------- .../[id]/_components/States/Loading.svelte | 5 ++ .../[id]/_components/States/Stopped.svelte | 6 +++ .../[id]/_components/States/index.ts | 4 ++ 9 files changed, 80 insertions(+), 83 deletions(-) create mode 100644 apps/client/src/lib/components/svg/RemoteLink.svelte create mode 100644 apps/client/src/routes/applications/[id]/_components/States/Loading.svelte create mode 100644 apps/client/src/routes/applications/[id]/_components/States/Stopped.svelte create mode 100644 apps/client/src/routes/applications/[id]/_components/States/index.ts diff --git a/apps/client/src/lib/components/svg/RemoteLink.svelte b/apps/client/src/lib/components/svg/RemoteLink.svelte new file mode 100644 index 000000000..7622822a2 --- /dev/null +++ b/apps/client/src/lib/components/svg/RemoteLink.svelte @@ -0,0 +1,10 @@ + + + diff --git a/apps/client/src/lib/components/svg/sources/GithubIcon.svelte b/apps/client/src/lib/components/svg/sources/GithubIcon.svelte index b56210177..38ef50829 100644 --- a/apps/client/src/lib/components/svg/sources/GithubIcon.svelte +++ b/apps/client/src/lib/components/svg/sources/GithubIcon.svelte @@ -1,11 +1,15 @@ - - + + + + diff --git a/apps/client/src/lib/components/svg/sources/GitlabIcon.svelte b/apps/client/src/lib/components/svg/sources/GitlabIcon.svelte index 3e8c8a84c..7ddfa21c1 100644 --- a/apps/client/src/lib/components/svg/sources/GitlabIcon.svelte +++ b/apps/client/src/lib/components/svg/sources/GitlabIcon.svelte @@ -1,21 +1,25 @@ - - + + + + diff --git a/apps/client/src/routes/applications/[id]/+layout.svelte b/apps/client/src/routes/applications/[id]/+layout.svelte index 7d06d091d..89e214266 100644 --- a/apps/client/src/routes/applications/[id]/+layout.svelte +++ b/apps/client/src/routes/applications/[id]/+layout.svelte @@ -4,8 +4,8 @@ import { onDestroy, onMount } from 'svelte'; import type { LayoutData } from './$types'; import * as Buttons from './_components/Buttons'; - import Degraded from './_components/States/Degraded.svelte'; - import Healthy from './_components/States/Healthy.svelte'; + import * as States from './_components/States'; + import Menu from './_components/Menu.svelte'; export let data: LayoutData; @@ -85,13 +85,17 @@ class="pt-4 flex flex-row items-start justify-center lg:justify-end space-x-2 order-1 lg:order-2" > {#if $status.application.initialLoading} - + {:else if $status.application.overallStatus === 'degraded'} - (stopping = true)} on:stopped={() => (stopping = false)} /> + (stopping = true)} + on:stopped={() => (stopping = false)} + /> {:else if $status.application.overallStatus === 'healthy'} - + {:else if $status.application.overallStatus === 'stopped'} - + {/if} diff --git a/apps/client/src/routes/applications/[id]/+layout.ts b/apps/client/src/routes/applications/[id]/+layout.ts index e0baec1b9..3bbc66f62 100644 --- a/apps/client/src/routes/applications/[id]/+layout.ts +++ b/apps/client/src/routes/applications/[id]/+layout.ts @@ -32,6 +32,7 @@ export const load: LayoutLoad = async ({ params, url }) => { throw redirect(307, '/applications'); } const configurationPhase = checkConfiguration(application); + console.log({ configurationPhase }); // if ( // configurationPhase && // pathname !== `/applications/${params.id}/configuration/${configurationPhase}` diff --git a/apps/client/src/routes/applications/[id]/_components/Menu.svelte b/apps/client/src/routes/applications/[id]/_components/Menu.svelte index 0403e8aad..ff1106d04 100644 --- a/apps/client/src/routes/applications/[id]/_components/Menu.svelte +++ b/apps/client/src/routes/applications/[id]/_components/Menu.svelte @@ -2,6 +2,9 @@ export let application: any; import { status } from '$lib/store'; import { page } from '$app/stores'; + import GitlabIcon from '$lib/components/svg/sources/GitlabIcon.svelte'; + import GithubIcon from '$lib/components/svg/sources/GithubIcon.svelte'; + import RemoteLink from '$lib/components/svg/RemoteLink.svelte';