feat(web): 日志页——任务 / 定时与自动 / 登录 / 审计合一,实时追加与暂停,勾选后问智能体;计划并入「定时任务」页签,侧栏系统组只留日志、运行状态、设置
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
2ce1841628
commit
805ba33ddf
21 files changed
+1693
-846
No files matched your search
@@ -20,13 +20,15 @@ describe("计划页标签", () => {
|
||||
});
|
||||
|
||||
it("planPath:节锚点与 ?job= 高亮", () => {
|
||||
expect(planPath()).toBe("/console/schedules");
|
||||
expect(planPath({ section: "auto" })).toBe("/console/schedules#auto");
|
||||
expect(planPath({ section: "checks", job: "check.pending" })).toBe("/console/schedules?job=check.pending#checks");
|
||||
expect(planPath()).toBe("/console/logs?tab=schedules");
|
||||
expect(planPath({ section: "auto" })).toBe("/console/logs?tab=schedules#auto");
|
||||
expect(planPath({ section: "checks", job: "check.pending" })).toBe(
|
||||
"/console/logs?tab=schedules&job=check.pending#checks",
|
||||
);
|
||||
});
|
||||
|
||||
it("运行记录跳任务页按定时任务筛选", () => {
|
||||
expect(scheduleStreamPath("trash.purge")).toBe("/console/tasks?tab=all&kind=schedule&ref=trash.purge");
|
||||
it("运行记录跳日志页按定时任务筛选", () => {
|
||||
expect(scheduleStreamPath("trash.purge")).toBe("/console/logs?objectType=scheduled_job&objectId=trash.purge");
|
||||
});
|
||||
|
||||
it("formatUsd:两位小数,不足一分写 < $0.01", () => {
|
||||
|
||||
@@ -13,16 +13,17 @@ export const GROUP_ORDER: ScheduleGroup[] = ["collect", "download", "organize",
|
||||
/** 计划页「自动任务」一节的分组(智能体巡检单独一节,放在最上面);维护类合成一组「数据清理」 */
|
||||
export const TASK_GROUPS: ScheduleGroup[] = ["collect", "download", "organize", "maintain"];
|
||||
|
||||
/** 计划页两节的锚点:/console/schedules#auto、#checks */
|
||||
/** 定时任务视图两节的锚点:/console/logs?tab=schedules#auto、#checks(界面第二轮:计划页并入日志页的「定时任务」页签) */
|
||||
export type PlanSection = "auto" | "checks";
|
||||
export const PLAN_PATH = "/console/schedules";
|
||||
export const PLAN_PATH = "/console/logs?tab=schedules";
|
||||
export function planPath(opts: { section?: PlanSection; job?: string } = {}): string {
|
||||
const q = opts.job ? `?job=${encodeURIComponent(opts.job)}` : "";
|
||||
const q = opts.job ? `&job=${encodeURIComponent(opts.job)}` : "";
|
||||
return `${PLAN_PATH}${q}${opts.section ? `#${opts.section}` : ""}`;
|
||||
}
|
||||
|
||||
/** 任务页里某个定时任务触发的任务(businessKind=schedule) */
|
||||
export const scheduleStreamPath = (id: string) => `/console/tasks?tab=all&kind=schedule&ref=${encodeURIComponent(id)}`;
|
||||
/** 日志页里某个定时任务的全部运行记录(含它触发的任务与修改留痕) */
|
||||
export const scheduleStreamPath = (id: string) =>
|
||||
`/console/logs?objectType=scheduled_job&objectId=${encodeURIComponent(id)}`;
|
||||
|
||||
export const GROUP_LABEL: Record<ScheduleGroup, string> = {
|
||||
collect: "采集",
|
||||
|
||||
@@ -18,9 +18,9 @@ import { DraftCheckDialog } from "./draft-check-dialog.tsx";
|
||||
import { formatUsd } from "./labels.ts";
|
||||
import { RunsSheet } from "./runs-sheet.tsx";
|
||||
|
||||
// 计划页(FE-6,/console/schedules):「智能体巡检」= 到点发起智能体会话的定时任务(卡片,放最上面:
|
||||
// 定时任务(FE-6 的计划页;界面第二轮并入日志页「定时任务」页签,/console/logs?tab=schedules):「智能体巡检」= 到点发起智能体会话的定时任务(卡片,放最上面:
|
||||
// 数量少、由用户自己建、会花钱,是这页最需要看的);「自动任务」= 程序按固定周期执行的定时任务
|
||||
// (按分类折叠的紧凑列表,维护类合成「数据清理」)。自动任务的运行记录跳任务页按该定时任务筛选。
|
||||
// (按分类折叠的紧凑列表,维护类合成「数据清理」)。自动任务的运行记录跳日志页按该定时任务筛选。
|
||||
|
||||
/** 每秒一跳的当前时间(倒计时用) */
|
||||
export function useNow(ms = 1000) {
|
||||
|
||||
Reference in new issue
Block a user