diff --git a/apps/web/src/components/layout/system-monitor-popover.tsx b/apps/web/src/components/layout/system-monitor-popover.tsx index 239d39d..94c7285 100644 --- a/apps/web/src/components/layout/system-monitor-popover.tsx +++ b/apps/web/src/components/layout/system-monitor-popover.tsx @@ -1,80 +1,32 @@ -import { useMemo, type CSSProperties, type ReactNode } from 'react' import { useQuery } from '@tanstack/react-query' -import { - Activity, - Bell, - ChevronRight, - RefreshCw, - Server, - Wallet, -} from 'lucide-react' - +import { Activity, ArrowRight } from 'lucide-react' import { Link } from '@tanstack/react-router' import { Badge } from '@/components/reui/badge' import { Button } from '@cfdm/ui/components/button' import { cn } from '@cfdm/ui/lib/utils' -import { Item, ItemMedia } from '@cfdm/ui/components/item' import { Popover, PopoverContent, PopoverTrigger } from '@cfdm/ui/components/popover' -import { Progress } from '@cfdm/ui/components/progress' import { api } from '@/lib/api-client' import { dashboardStatsQueryOptions } from '@/queries/dashboard' import { snapshotQueryOptions } from '@/queries/snapshot' -type MonitorMetric = { +type Tone = 'er' | 'wn' | 'ok' + +/** Одна проверка монитора: строка в списке проблем (если не ok) и плитка с полосой. */ +type MonitorCheck = { id: string label: string value: string - unit: string percent: number - icon: ReactNode - tone: 'success' | 'warning' | 'destructive' | 'info' - alert: boolean + tone: Tone + title: string + text: string + to: '/sync-journal' | '/settings/notifications' | '/accounts' | '/vps' | '/dashboard' } -function toneColor(tone: MonitorMetric['tone']) { - switch (tone) { - case 'success': - return 'var(--color-success)' - case 'warning': - return 'var(--color-warning)' - case 'destructive': - return 'var(--color-destructive)' - default: - return 'var(--color-info)' - } -} - -function MetricCell({ metric }: { metric: MonitorMetric }) { - const color = toneColor(metric.tone) - return ( -