feat(web): 日志页——任务 / 定时与自动 / 登录 / 审计合一,实时追加与暂停,勾选后问智能体;计划并入「定时任务」页签,侧栏系统组只留日志、运行状态、设置

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-06 18:09:56 +08:00
1 parent 2ce1841628
commit 805ba33ddf
21 files changed
+1693 -846

No files matched your search

+1 -15
View File
@@ -15,7 +15,6 @@ export const BUSINESS_KIND_LABEL: Record<EngineBusinessKind, string> = {
decision: "待处理事项",
media: "作品",
};
export const BUSINESS_KINDS = Object.keys(BUSINESS_KIND_LABEL) as EngineBusinessKind[];
/** 来源:四类(定时/事件/手动/Agent);API Key 调用算手动 */
export type TaskSource = "schedule" | "event" | "manual" | "agent";
@@ -25,13 +24,6 @@ export const SOURCE_LABEL: Record<TaskSource, string> = {
manual: "手动",
agent: "智能体",
};
/** 来源 → 服务端 triggeredBy 筛选值(逗号分隔多值) */
export const SOURCE_TRIGGERED_BY: Record<TaskSource, string> = {
schedule: "schedule",
event: "event",
manual: "user,api_key",
agent: "agent",
};
export function sourceOf(t: EngineTriggeredBy | null | undefined): TaskSource | null {
if (!t) return null;
if (t === "user" || t === "api_key") return "manual";
@@ -86,10 +78,6 @@ export function engineRunStatus(r: Pick<EngineRun, "status" | "business">) {
return OUTCOME_STATUS[outcome];
return runStatus(r.status);
}
export const RUN_STATUS_OPTIONS = ["pending", "running", "completed", "failed", "canceled"].map((value) => ({
value,
label: runStatus(value).label,
}));
/** 行标题:业务对象名 > 业务类型 + 短 id > 工作流做什么 */
export function runTitle(r: Pick<EngineRun, "business" | "workflowName">): string {
@@ -118,7 +106,7 @@ export function businessLink(b: EngineRun["business"], input?: unknown): { to: s
case "agent":
return { to: `/console/agent/${id}`, label: "智能体会话" };
case "schedule":
return { to: `/console/schedules?job=${id}`, label: "定时任务" };
return { to: `/console/logs?tab=schedules&job=${id}`, label: "定时任务" };
case "feed":
// RSS 属于站点(IA-2):旧 RSS 页按 ?feed= 查所属站点后跳到站点的 RSS Tab
return { to: `${consolePath("sources")}?feed=${encodeURIComponent(id)}`, label: "RSS" };
@@ -133,5 +121,3 @@ export function businessLink(b: EngineRun["business"], input?: unknown): { to: s
return null;
}
}
export const ENGINE_ACTIVE = new Set(["pending", "running", "sleeping"]);