feat(web): 首页只回答三件事、计划页巡检置顶与分组折叠、任务列表去噪(DEAI-2)

首页:顶部一行状态(自动化开关 + 只在异常时出现的服务 / 下载盘 / 站点账号 / 下载器问题),
下面只有「在忙什么」「要我处理」「最近入库」三块;去掉运行状态、计划、缓存、来源健康、
满足率与 0 值铺陈;0 订阅时写「还没有订阅。去搜索添加」。只读对账移出首页,设置里放进
自动化 →「高级」(与存储预算、流水保留、缓存有效期一起默认收起)。

计划页:「智能体巡检」移到最上面——巡检数量少、由用户自己建、每次会花钱,是这页最需要
看的;自动任务任务多、多数不用管,放在下面。自动任务按分类分组、每组可折叠:有失败或
运行中的组默认展开,其余收起为「N 个任务 · 下次 xx」一行,折叠状态记在 localStorage;
维护类整组叫「数据清理」,未接入调度的备份不列。巡检卡只留名称、开关、间隔、上次结果与
费用,目标 / 能力 / 预算 / 模型 / 最近会话收进「详情」。去掉顶部 6 个计数卡。定时任务说明
去掉表名、字段名与实现备注。

任务页:默认隐藏系统任务(无业务对象的引擎步骤、定时任务的成功运行),可一键显示;
标题不再用 ID;耗时移入技术信息;< 1 秒写「< 1 秒」;费用两位小数,不足一分写「< $0.01」。
下载盘相关文案改用「暂停线 / 恢复线」。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 20:48:35 +08:00
1 parent f0d4935fa7
commit 260f3ab27f
23 files changed
+559 -816

No files matched your search

+1 -1
View File
@@ -94,7 +94,7 @@ export const RUN_STATUS_OPTIONS = ["pending", "running", "completed", "failed",
export function runTitle(r: Pick<EngineRun, "business" | "workflowName">): string {
const b = r.business;
if (b?.title) return b.title;
if (b) return `${BUSINESS_KIND_LABEL[b.kind]} ${b.refId.length > 12 ? b.refId.slice(0, 8) : b.refId}`;
if (b) return BUSINESS_KIND_LABEL[b.kind];
return workflowLabel(r.workflowName);
}
@@ -254,7 +254,7 @@ export function TaskDetailBody({ r, onOpenRun }: { r: EngineRunDetail; onOpenRun
return (
<>
<DetailSection title="业务摘要">
<DetailSection title="概况">
<KvList
items={[
{
@@ -262,11 +262,11 @@ export function TaskDetailBody({ r, onOpenRun }: { r: EngineRunDetail; onOpenRun
value: b ? (
link ? (
<Link to={link.to} className="inline-flex items-center gap-1 underline underline-offset-4">
{BUSINESS_KIND_LABEL[b.kind]} · {b.title ?? b.refId}
{b.title ? `${BUSINESS_KIND_LABEL[b.kind]} · ${b.title}` : BUSINESS_KIND_LABEL[b.kind]}
<ExternalLink className="h-3 w-3" />
</Link>
) : (
`${BUSINESS_KIND_LABEL[b.kind]} · ${b.title ?? b.refId}`
`${BUSINESS_KIND_LABEL[b.kind]}${b.title ? ` · ${b.title}` : ""}`
)
) : (
"无"
@@ -279,7 +279,6 @@ export function TaskDetailBody({ r, onOpenRun }: { r: EngineRunDetail; onOpenRun
label: "开始",
value: r.startedAt ? `${formatDateTime(r.startedAt)}(${formatRelative(r.startedAt)})` : "未开始",
},
{ label: "耗时", value: formatDuration(spanSec(r)) },
]}
/>
</DetailSection>
@@ -304,9 +303,11 @@ export function TaskDetailBody({ r, onOpenRun }: { r: EngineRunDetail; onOpenRun
</ul>
</DetailSection>
<Collapsible title={`引擎步骤(${r.stepAttempts.length})`}>
<Collapsible title={`技术信息 · 引擎步骤(${r.stepAttempts.length})`}>
<KvList
items={[
{ label: "耗时", value: formatDuration(spanSec(r)) },
{ label: "关联对象 ID", value: b?.refId ?? null, mono: true },
{ label: "工作流", value: `${r.workflowName}${r.version ? ` ${r.version}` : ""}`, mono: true },
{ label: "运行 ID", value: r.id, mono: true },
{ label: "尝试次数", value: r.attempts },
+22 -10
View File
@@ -10,7 +10,7 @@ import { FilterBar, FilterSelect } from "~/components/console/filter-bar.tsx";
import { StatusBadge } from "~/components/console/status-badge.tsx";
import { RunsSheet } from "~/components/schedules/runs-sheet.tsx";
import { Button } from "~/components/ui/button.tsx";
import { formatDuration, formatRelative, spanSec } from "~/lib/labels.ts";
import { formatRelative } from "~/lib/labels.ts";
import { qk } from "~/lib/query-keys.ts";
import { useSse } from "~/lib/sse.ts";
import {
@@ -70,6 +70,8 @@ export type StreamFilters = {
source: string;
since: string;
workflow: string;
/** "1" = 显示系统任务 */
system: string;
};
function SourceBadge({ r }: { r: EngineRun }) {
@@ -146,8 +148,13 @@ export function TaskStream({
true,
active ? 10_000 : false,
);
const rows = list.data?.pages.flatMap((p) => p.items);
const filtered = Object.values(filters).some(Boolean);
const all = list.data?.pages.flatMap((p) => p.items);
// 系统任务(没有业务对象的引擎步骤、定时任务的成功运行)默认不列;按对象 / 定时任务筛选或勾选时显示
const showSystem = filters.system === "1" || !!filters.ref || filters.kind === "schedule" || !!filters.workflow;
const isSystem = (r: EngineRun) => !r.business || (r.business.kind === "schedule" && r.status === "completed");
const rows = showSystem ? all : all?.filter((r) => !isSystem(r));
const hidden = (all?.length ?? 0) - (rows?.length ?? 0);
const filtered = Object.entries(filters).some(([k, v]) => k !== "system" && !!v);
return (
<>
@@ -196,6 +203,14 @@ export function TaskStream({
options={SINCE}
allLabel="不限"
/>
<Button
variant={filters.system === "1" ? "secondary" : "ghost"}
size="sm"
aria-pressed={filters.system === "1"}
onClick={() => setFilter("system", filters.system === "1" ? "" : "1")}
>
{filters.system === "1" ? "隐藏系统任务" : hidden ? `显示系统任务(${hidden})` : "显示系统任务"}
</Button>
{filters.workflow ? (
<Button variant="outline" size="sm" onClick={() => setFilter("workflow", "")}>
{workflowLabel(filters.workflow)}
@@ -234,11 +249,9 @@ export function TaskStream({
cell: (r) => (
<div className="min-w-0 max-w-[15rem] sm:max-w-sm">
<p className="truncate font-medium text-foreground">{runTitle(r)}</p>
<p className="truncate text-meta text-muted-foreground">
{r.business
? `${workflowLabel(r.workflowName)} · ${BUSINESS_KIND_LABEL[r.business.kind]}`
: `未关联业务对象 · ${r.id.slice(0, 8)}`}
</p>
{r.business?.title ? (
<p className="truncate text-meta text-muted-foreground">{workflowLabel(r.workflowName)}</p>
) : null}
</div>
),
},
@@ -253,7 +266,7 @@ export function TaskStream({
},
{
key: "time",
header: "开始 / 耗时",
header: "开始",
hideBelow: "sm",
cell: (r) => (
<div className="whitespace-nowrap">
@@ -264,7 +277,6 @@ export function TaskStream({
? `排队 ${formatRelative(r.createdAt)}`
: `未开始 · ${formatRelative(r.createdAt)}`}
</p>
<p className="text-meta text-muted-foreground tabular-nums">{formatDuration(spanSec(r))}</p>
</div>
),
},