diff --git a/src/dashboard/App.svelte b/src/dashboard/App.svelte index a66df0c..9137b93 100644 --- a/src/dashboard/App.svelte +++ b/src/dashboard/App.svelte @@ -10,12 +10,15 @@ import { data, countInGroup } from './lib' import { env } from 'process' + let top = 20 + let full = 50 + let loading = true let init = false let counted - let top = 20 - let start = dayjs().subtract(3, 'days').toDate() - let end = new Date() + + let start + let end let topData = { labels: [], data: [], @@ -48,8 +51,7 @@ onMount(() => { setTimeout(() => { init = true - // calculate() - }, 250) + }, 25) }) @@ -61,10 +63,6 @@ max-width: 50em; } - /* .date > .spacer { - width: 1em; - } */ - .link { margin-left: 2em; } @@ -73,23 +71,31 @@ th { padding: 0.25em; } + + h3 { + margin-right: 1em; + }
-
-

Top {top}

+

Ora

+
+

Time Range

{#if loading}
{:else if counted} +

Top {top}

+ Chart +

Top {full}

- {#each counted as { host, total, human }} + {#each counted.slice(0, 100) as { host, total, human }} diff --git a/src/dashboard/components/DateInput.svelte b/src/dashboard/components/DateInput.svelte index 8b84622..a5b2500 100644 --- a/src/dashboard/components/DateInput.svelte +++ b/src/dashboard/components/DateInput.svelte @@ -16,4 +16,10 @@ $: output(internal) + + diff --git a/src/dashboard/components/RangeChooser.svelte b/src/dashboard/components/RangeChooser.svelte index 06079a7..8ff0d68 100644 --- a/src/dashboard/components/RangeChooser.svelte +++ b/src/dashboard/components/RangeChooser.svelte @@ -17,6 +17,9 @@ start = new Date(0) end = new Date() } + + // Init + set('week')()
Time Spent Host
{human}