From 68391375125cd7c49fa535dcda945846853a9f25 Mon Sep 17 00:00:00 2001 From: Eirene Date: Wed, 31 Jan 2024 16:02:53 +0800 Subject: [PATCH] ui: add widgets to Fault page --- .../src/lib/client/components/icons/index.ts | 1 + .../components/icons/informationCircle.svelte | 4 + apps/front/src/routes/+layout.svelte | 8 ++ apps/front/src/routes/+page.svelte | 4 +- apps/front/src/routes/fault/+page.svelte | 120 ++++++++++++++++-- 5 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 apps/front/src/lib/client/components/icons/informationCircle.svelte diff --git a/apps/front/src/lib/client/components/icons/index.ts b/apps/front/src/lib/client/components/icons/index.ts index a43b619..0b4aa1f 100644 --- a/apps/front/src/lib/client/components/icons/index.ts +++ b/apps/front/src/lib/client/components/icons/index.ts @@ -11,6 +11,7 @@ export { default as IconCpuChip } from './cpuChip.svelte'; export { default as IconCursorArrowRays } from './cursorArrowRays.svelte'; export { default as IconExclamationTriangle } from './exclamationTriangle.svelte'; export { default as IconHome } from './home.svelte'; +export { default as IconInformationCircle} from './informationCircle.svelte'; export { default as IconMagnifyingGlass } from './magnifyingGlass.svelte'; export { default as IconMap } from './map.svelte'; export { default as IconUser } from './user.svelte'; diff --git a/apps/front/src/lib/client/components/icons/informationCircle.svelte b/apps/front/src/lib/client/components/icons/informationCircle.svelte new file mode 100644 index 0000000..713c0e2 --- /dev/null +++ b/apps/front/src/lib/client/components/icons/informationCircle.svelte @@ -0,0 +1,4 @@ + + + diff --git a/apps/front/src/routes/+layout.svelte b/apps/front/src/routes/+layout.svelte index ae265bc..808fb9e 100644 --- a/apps/front/src/routes/+layout.svelte +++ b/apps/front/src/routes/+layout.svelte @@ -7,6 +7,8 @@ IconBars3, IconBell, IconMagnifyingGlass, IconXMark } from '$lib/client/components/icons'; import { fly, fade } from 'svelte/transition' + import {page} from "$app/stores"; + import {onMount} from "svelte"; let showSidePanel = false, width function toggleSidePanel() { @@ -18,6 +20,12 @@ const toggleDropdown = (): void => { isDropdownOpen = !isDropdownOpen; }; + + onMount(()=>{ + return page.subscribe(() => { + showSidePanel = false; + }) + }) {#if $auth.isSignedIn} diff --git a/apps/front/src/routes/+page.svelte b/apps/front/src/routes/+page.svelte index 52eded7..9a1ad5d 100644 --- a/apps/front/src/routes/+page.svelte +++ b/apps/front/src/routes/+page.svelte @@ -15,7 +15,7 @@