diff --git a/src/lib/components/ui/Dropdown.svelte b/src/lib/components/ui/Dropdown.svelte new file mode 100644 index 0000000..bf6a80d --- /dev/null +++ b/src/lib/components/ui/Dropdown.svelte @@ -0,0 +1,22 @@ + + + diff --git a/src/lib/components/ui/Menu.svelte b/src/lib/components/ui/Menu.svelte new file mode 100644 index 0000000..56beaed --- /dev/null +++ b/src/lib/components/ui/Menu.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/Toggle.svelte b/src/lib/components/ui/Toggle.svelte new file mode 100644 index 0000000..0abb252 --- /dev/null +++ b/src/lib/components/ui/Toggle.svelte @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/src/routes/overview.svelte b/src/routes/overview.svelte index 3024343..3383ea7 100644 --- a/src/routes/overview.svelte +++ b/src/routes/overview.svelte @@ -9,7 +9,8 @@ Cell5GStat, CellRadioStat, } from '$lib/types'; - export async function load({ fetch }) { + export async function load({ fetch, session }) { + session['refresh'] = '0'; const status: StatusResponse = await fetch(`/api/${Endpoint.STATUS}`).then((res: Response) => res.json(), ); @@ -58,7 +59,11 @@ import H1 from '$lib/components/ui/H1.svelte'; import DeviceInformation from '$lib/widgets/DeviceInformation.svelte'; import NetworkInformation from '$lib/widgets/NetworkInformation.svelte'; - import { onDestroy } from 'svelte'; + import { onDestroy, onMount } from 'svelte'; + import { page, session } from '$app/stores'; + import Toggle from '$lib/components/ui/Toggle.svelte'; + import Dropdown from '$lib/components/ui/Dropdown.svelte'; + import Menu from '$lib/components/ui/Menu.svelte'; export let routerCfg: DeviceAppStatus; export let devices: DeviceCfg[]; @@ -72,12 +77,16 @@ routerCfg.UpTime++; }, 1000); + let refreshInterval = setInterval(() => { + $session['refresh'] = `${routerCfg.UpTime}`; + }, 5000); onDestroy(() => { clearInterval(uptimeInterval); + clearInterval(refreshInterval); }); -

Overview

+

Overview