diff --git a/src/App.tsx b/src/App.tsx index 5572bc9..a77d841 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,9 @@ import { Skeleton } from "@/components/ui/skeleton" import { api, useNodes } from "@/lib/api" import { Link, useNodeRoute } from "@/lib/route" -type Me = { authed: boolean; github: boolean; site_name: string; public_page: boolean } +// `history_days` is absent from hubs predating the hourly tier, which kept a +// week for anonymous callers. +type Me = { authed: boolean; github: boolean; site_name: string; public_page: boolean; history_days?: number } // Split out because recharts is most of the bundle and the list draws no chart. // Warmed as soon as the app starts, so the first chart opened does not wait on it. @@ -187,7 +189,7 @@ export default function App() {
}> - +
diff --git a/src/components/NodeDetail.tsx b/src/components/NodeDetail.tsx index 5758c75..0ca28a0 100644 --- a/src/components/NodeDetail.tsx +++ b/src/components/NodeDetail.tsx @@ -8,7 +8,7 @@ import { Skeleton } from "@/components/ui/skeleton" import { deployed, Dot, Flag } from "@/components/ServerTable" import { api, type Node } from "@/lib/api" import { - axisBytes, axisTop, bytes, clockFor, despike, quarters, rate, timeTicks, uptime, + axisBytes, axisTop, bytes, clockFor, despike, quarters, rate, tickClock, timeTicks, uptime, windows, } from "@/lib/format" import { cn } from "@/lib/utils" @@ -46,13 +46,6 @@ type Probes = Record */ type Loss = Record -const RANGES = [ - { hours: 1, label: "1 小时" }, - { hours: 6, label: "6 小时" }, - { hours: 24, label: "24 小时" }, - { hours: 168, label: "7 天" }, -] - // The expanded row's latency window: a day, the widest in which every ping // remains on the chart. const LATENCY_HOURS = 24 @@ -93,11 +86,13 @@ function Panel({ title, children }: { title: React.ReactNode; children: React.Re ) } +// Tighter on a phone, so the seven windows of a year of history fit one row of +// a 360px screen. function Tab({ active, onClick, children }: { active: boolean; onClick: () => void; children: string }) { return (