fix(web): 巡检目标模板的占位符显示成名称(FIX-7)

执行时 renderGoal 已正确替换(补单测);界面显示的是模板本身,{{now}} 等改成「当前时间」标签。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-30 00:00:03 +08:00
1 parent 417af9f253
commit 23bd8cfe45
5 files changed
+97 -6

No files matched your search

@@ -25,13 +25,15 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~
import { Switch } from "~/components/ui/switch.tsx";
import { Textarea } from "~/components/ui/textarea.tsx";
import { errorMessage } from "~/lib/api.ts";
import { CHECK_TRIGGER_LABEL, splitInterval, UNIT_MS } from "./labels.ts";
import { CHECK_TRIGGER_LABEL, GOAL_PLACEHOLDER_LABEL, splitInterval, UNIT_MS } from "./labels.ts";
/** 巡检只开放只读 / 预览 / 提案类能力 */
const READONLY_CAPS = Object.values(CAPABILITY_CATALOG).filter((c) =>
(["read", "preview", "propose"] as string[]).includes(c.kind),
);
const PLACEHOLDERS = "{{now}} {{date}} {{openDecisions}} {{stalledDownloads}} {{activeSubscriptions}}";
const PLACEHOLDERS = Object.entries(GOAL_PLACEHOLDER_LABEL)
.map(([k, v]) => `{{${k}}} ${v}`)
.join("、");
type Unit = "m" | "h";
type Draft = {