From 58a1adb17fd7b27b5585d6186029edf985e9d705 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Mon, 5 Oct 2026 08:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=A1=B5=EF=BC=9A=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=8F=91=E8=B5=B7=E7=9A=84=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E5=9C=A8=E5=90=8D=E5=AD=97=E6=97=81=E6=A0=87=E3=80=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run 带 schedule_id 时在运行名旁显示「定时」标记,悬停写是哪个定时任务,点一下去那个定时任务(整行是打开运行的按钮,标记拦住冒泡,不打开运行)。定时任务的名字按需取一次列表、一分钟内最多一次,定时任务页读过列表时顺手记下;取不到(老服务端、暂时连不上)标记照样显示,只是不写名字。 --- frontend/src/pages/runs/RunList.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/runs/RunList.tsx b/frontend/src/pages/runs/RunList.tsx index 70ad18a0..cf2ed8ff 100644 --- a/frontend/src/pages/runs/RunList.tsx +++ b/frontend/src/pages/runs/RunList.tsx @@ -16,6 +16,7 @@ import { headlineMs, idTail, isLiveRun, runShape, runTiming, timingTitle, type ParsedQuery, } from './model' import { ClassChip, LiveElapsed, TierChip } from './parts' +import { ScheduleTag, useScheduleNames } from '../schedules/parts' import type { ApprovalQueue, RunList, StatusCounts } from './useRunsData' // ------------------------------------------------------------------------- @@ -191,6 +192,8 @@ export function RunRows({ }) { const changed = useChangedRows(list.rows) const now = useTicker(60_000) + // 定时任务发起的运行在名字旁标「定时」,悬停写是哪个定时任务:名字按需取一次 + const scheduleNames = useScheduleNames(list.rows.map((r) => r.schedule_id)) if (list.state === 'loading') { return
@@ -241,6 +244,7 @@ export function RunRows({ flash={changed.get(run.id)} now={now} onOpen={onOpen} + scheduleName={run.schedule_id ? scheduleNames.get(run.schedule_id) : undefined} /> ))} @@ -295,10 +299,12 @@ function useChangedRows(rows: Run[]): Map { return changed } -function RunRow({ run, code, approval, selected, dup, flash, now, onOpen }: { +function RunRow({ run, code, approval, selected, dup, flash, now, onOpen, scheduleName }: { run: Run; code: StatusCode; approval?: Approval; selected: boolean; dup: boolean /** 状态刚变过:第几次变化(换 key 重播闪光) */ flash?: number; now: number; onOpen: (id: string) => void + /** 发起它的定时任务的名字(不是定时任务发起的、或名字还没取到时没有) */ + scheduleName?: string }) { const meta = statusMeta(code) const timing = runTiming(run) @@ -341,6 +347,7 @@ function RunRow({ run, code, approval, selected, dup, flash, now, onOpen }: { {idTail(run.workflow_id)} )} + {run.schedule_id && }