diff --git a/web/src/routes/servers/[alias]/+page.svelte b/web/src/routes/servers/[alias]/+page.svelte index b4e87e5..d8aedca 100644 --- a/web/src/routes/servers/[alias]/+page.svelte +++ b/web/src/routes/servers/[alias]/+page.svelte @@ -3,11 +3,14 @@ import { ApiError, fetchStatsSummary, fetchTelemt } from '$lib/api/client.js'; import type { HealthData, StatsSummaryData, SystemInfoData } from '$lib/api/telemt-v1.js'; import { formatDurationSeconds } from '$lib/format.js'; - import * as Card from '$lib/components/ui/card/index.js'; - import KpiTrendCard from '$lib/components/kpi-trend-card.svelte'; + import KpiStatCard from '$lib/components/kpi-stat-card.svelte'; import KpiPanelCard from '$lib/components/kpi-panel-card.svelte'; import ClockIcon from '@lucide/svelte/icons/clock'; import CpuIcon from '@lucide/svelte/icons/cpu'; + import PlugIcon from '@lucide/svelte/icons/plug'; + import ShieldAlertIcon from '@lucide/svelte/icons/shield-alert'; + import TimerOffIcon from '@lucide/svelte/icons/timer-off'; + import UsersIcon from '@lucide/svelte/icons/users'; import { Alert, AlertDescription, AlertTitle } from '$lib/components/ui/alert/index.js'; import { Button } from '$lib/components/ui/button/index.js'; import { Skeleton } from '$lib/components/ui/skeleton/index.js'; @@ -41,6 +44,18 @@ return 0; } + function trendFooter(current: number | null, prev: number | null, invert = false): string { + if (current == null || prev == null || !Number.isFinite(current) || !Number.isFinite(prev)) { + return 'первое обновление'; + } + const delta = current - prev; + if (delta === 0) return 'к прошлому обновлению: без изменений'; + const sign = delta > 0 ? '+' : '-'; + const absDelta = Math.abs(delta); + const mood = invert ? (delta < 0 ? 'лучше' : 'хуже') : delta > 0 ? 'рост' : 'снижение'; + return `к прошлому обновлению: ${sign}${absDelta} (${mood})`; + } + async function loadFor(a: string) { loading = true; err = null; @@ -93,10 +108,12 @@ let handshakeT = $derived(num(summary?.handshake_timeouts_total)); -
+
-

Dashboard

-

{alias}

+

Сервер: обзор

+

+ Ключевые метрики и состояние Telemt для {alias}. +