web: show single-agent targets on the visitor page and open a detail page from the card [CI]
ci/woodpecker/push/dev-backend-image Pipeline is running
ci/woodpecker/push/dev-image Pipeline is running
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline was successful

This commit is contained in:
justme committed 2026-10-22 07:02:31 +08:00
1 parent 7ad226f29c
commit caee03b8cc
7 files changed
+466 -3

No files matched your search

+2 -2
View File
@@ -20,12 +20,12 @@ type Level = 'ok' | 'warn' | 'bad' | 'none'
const levelOf = (loss: number | null | undefined): Level => (loss === null || loss === undefined ? 'none' : loss <= 0.5 ? 'ok' : loss < 3 ? 'warn' : 'bad')
const clock = (ms: number, showDate: boolean) => new Date(ms).toLocaleString('zh-CN', { ...(showDate ? { month: '2-digit', day: '2-digit' } : {}), hour: '2-digit', minute: '2-digit', hour12: false })
export const clock = (ms: number, showDate: boolean) => new Date(ms).toLocaleString('zh-CN', { ...(showDate ? { month: '2-digit', day: '2-digit' } : {}), hour: '2-digit', minute: '2-digit', hour12: false })
const hhmm = (ms: number) => new Date(ms).toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit', hour12: false })
/** 时间轴刻度:在整点(或整半点、整几小时)的格子边界上画一条细线并标时间,最多约 6 个;零点那条标日期。 */
function axisTicks(t: number[], stepMin: number, hours: number): { pos: number; label: string }[] {
export function axisTicks(t: number[], stepMin: number, hours: number): { pos: number; label: string }[] {
if (t.length === 0) return []
const interval = [30, 60, 120, 180, 360, 720, 1440].find((m) => (hours * 60) / m <= 6) ?? 1440
const offset = new Date(t[0]).getTimezoneOffset() * 60_000