types fix

This commit is contained in:
shimon
2023-11-27 17:56:58 +02:00
parent f8ed69ef97
commit 4e60597742
2 changed files with 9 additions and 5 deletions
@@ -6,7 +6,6 @@
import type { UsagePeriods } from '$lib/layout';
import { createEventDispatcher } from 'svelte';
import { BarChart } from '$lib/charts';
import type { Metric } from '$lib/sdk/usage';
export let period: UsagePeriods;
@@ -14,8 +13,11 @@
const dispatch = createEventDispatcher();
$: network = $usage?.network as Metric[];
$: bandwith = humanFileSize(totalMetrics($usage?.network as Metric[]));
$: network = $usage?.network as unknown as Array<{
date: number;
value: number;
}>;
$: bandwith = humanFileSize(totalMetrics($usage?.network));
$: if (period) {
showPeriod = false;
@@ -6,7 +6,6 @@
import { createEventDispatcher } from 'svelte';
import { LineChart } from '$lib/charts';
import { formatNum } from '$lib/helpers/string';
import type { Metric } from '$lib/sdk/usage';
export let period: UsagePeriods;
@@ -14,7 +13,10 @@
const dispatch = createEventDispatcher();
$: requests = $usage?.requests as Metric[];
$: requests = $usage?.requests as unknown as Array<{
date: number;
value: number;
}>;
$: if (period) {
showPeriod = false;