feat(定时任务): 选内置模板时加「执行数据抽取」开关,关闭则直接用默认数据
- html_config.template_extract(默认关,仅参考选 tpl:<id> 时显示开关): 关闭→跳过检索/转换,直接用模板默认数据填充;开启→才执行检索+转换抽取 - 后端 _run_html_template_reference 在只展示分支后先判开关 - 前端 ScheduledTasksPage:参考选内置模板时显示 Switch,存进 html_config.template_extract,编辑回显 - 测试覆盖 开/关 两条路径 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4898ea0a85
commit
6673121f3f
4 files changed
+45
-1
No files matched your search
+18
@@ -1585,6 +1585,24 @@ class ScheduledTaskService:
|
||||
used_default=True,
|
||||
)
|
||||
|
||||
# 数据抽取开关(html_config.template_extract):关闭 → 直接用模板默认数据,不检索/
|
||||
# 不转换;开启 → 才执行下面的检索+转换抽取。
|
||||
if not bool(cfg.get("template_extract")):
|
||||
data_obj = template_fill.reference_data(tpl_id)
|
||||
return await self._finalize_template_html(
|
||||
task,
|
||||
spec=spec,
|
||||
template_id=tpl_id,
|
||||
html=template_fill.fill_template(
|
||||
tpl_id, data_obj, update_date=scheduled_for.astimezone(ZoneInfo(task.get("timezone") or "UTC")).date()
|
||||
),
|
||||
run_id=run_id,
|
||||
scheduled_for=scheduled_for,
|
||||
content=f"未开启数据抽取,已用模板「{spec.name}」默认数据(含全部子页面)",
|
||||
source_chars=0,
|
||||
used_default=True,
|
||||
)
|
||||
|
||||
# 用户的描述与任务 prompt 都为空 → 不检索/不转换,直接用模板原有数据。
|
||||
prompt = str(task.get("prompt") or "").strip()
|
||||
description = str(task.get("description") or "").strip()
|
||||
|
||||
Reference in new issue
Block a user