diff --git a/frontend-web/src/core/scheduled-tasks/types.ts b/frontend-web/src/core/scheduled-tasks/types.ts index a7eaa734..63cfac2e 100644 --- a/frontend-web/src/core/scheduled-tasks/types.ts +++ b/frontend-web/src/core/scheduled-tasks/types.ts @@ -22,6 +22,8 @@ export type HtmlPageConfig = { negative_prompt?: string | null; reference_favorite_id?: string | null; model_name?: string | null; + /** 仅当参考选了内置模板(tpl:)时生效:关闭则直接用模板默认数据,开启才检索抽取。 */ + template_extract?: boolean; }; /** 选中内置「模板数据转换器」agent 后,要把源 JSON 填充进的 HTML 模板。 diff --git a/frontend-web/src/pages/ScheduledTasksPage.tsx b/frontend-web/src/pages/ScheduledTasksPage.tsx index fecba38c..cf8ee1df 100644 --- a/frontend-web/src/pages/ScheduledTasksPage.tsx +++ b/frontend-web/src/pages/ScheduledTasksPage.tsx @@ -133,6 +133,8 @@ const emptyForm = { html_negative_prompt: "", html_reference_favorite_id: "", html_model_name: "", + // 参考选了内置模板(tpl:)时的「数据抽取」开关:关闭=用模板默认数据,开启=检索抽取。 + html_template_extract: false, }; /** 覆盖 Textarea 默认 field-sizing-content,避免输入过多时撑破弹窗 */ @@ -320,6 +322,7 @@ export default function ScheduledTasksPage() { html_negative_prompt: html.negative_prompt ?? "", html_reference_favorite_id: html.reference_favorite_id ?? "", html_model_name: html.model_name ?? "", + html_template_extract: !!html.template_extract, }); // Prefer the canonical cron_expr over the user-typed schedule_text: the // latter may be natural language ("每天9点") that parseCron can't read, @@ -388,6 +391,10 @@ export default function ScheduledTasksPage() { // Send the user's selection; fall back to the first configured model, // else null (backend then uses the system default). No hardcoded GLM-5. model_name: form.html_model_name.trim() || availableModels[0]?.name || null, + // 仅当参考是内置模板(tpl:)时有意义:关闭=用模板默认数据,开启=检索抽取。 + template_extract: form.html_reference_favorite_id.startsWith("tpl:") + ? form.html_template_extract + : false, }, }; }; @@ -1370,6 +1377,23 @@ export default function ScheduledTasksPage() { )} + {/* 参考选了内置模板(tpl:)时:数据抽取开关。关闭=用模板默认数据。 */} + {form.html_reference_favorite_id.startsWith("tpl:") && ( +
+
+

执行数据抽取

+

+ 关闭则直接用所选模板的默认数据生成(含全部子页面);开启才检索并按模板结构抽取数据填充。 +

+
+ + setForm((value) => ({ ...value, html_template_extract: v })) + } + /> +
+ )}

生成模型