Files
vrsub/web/workflow.html
T
cat-shark b16e0e9f3c feat: 任务断点续跑/暂停中断/LLM 过滤优化与调度容错
调度与状态机:
- 修复 PAUSED 任务被拾起后复活执行(点击暂停反而开始任务):next_queued_run
  只取 QUEUED,execute_run 以 PAUSED 进入直接返回,暂停必须显式 resume
- 重启恢复:启动时 recover_interrupted_runs 把遗留 RUNNING 置 QUEUED(保留产物)
- 暂停信号 paused.flag:暂停接口写、继续/重试清除,OCR 逐帧检查秒级中断,
  节点内被暂停保持 PAUSED 不误报 FAILED
- 调度轮询容错:_loop 异常不杀死线程(曾致任务永久停留 QUEUED)

subtitle-ocr 节点级断点:
- ocr_partial.jsonl 逐帧存档,重启/暂停后只处理未处理帧,产物与一次跑完一致
- 进度日志携带窗口平均耗时与线程数;取消后抑制进度日志井喷

llm-filter 过滤质量与限流自适应:
- 上下文净化:喂给 LLM 的是过滤后的字幕(规则层垃圾从上下文剔除)
- 正则确定性过滤:裸网址域名、HTML/水印模式直接删除
- 429/5xx 指数退避重试;worker 限流错误 report_failure 内存临时降最大线程数
  并缩容(无错误窗口回升),失败条目降并发后重试一轮
- 保留长文本保护(noise 不删 ≥min_keep_len 文本,LLM 判定不稳的必要兜底)

前端:
- 工作流编排页支持选择工作流编辑(加载最新/历史版本)、版本历史面板、
  新建/编辑双模式;管理后台编辑跳转 workflow.html?edit=<id>

工作流:ocr-subtitle v7(filter pool_max_workers=20、pool_fast_threshold=1)
2026-08-19 01:27:41 +08:00

87 lines
3.1 KiB
HTML
Executable File

<!doctype html>
<!-- VRSub 工作流编排页:以 DAG JSON 创建/更新工作流并发布。 -->
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>VRSub 工作流</title>
<link rel="stylesheet" href="/assets/styles.css?v=2" />
</head>
<body>
<header class="topbar">
<a class="brand" href="/">VRSub</a>
<nav>
<a href="/">应用中心</a>
<a href="/tasks.html">任务管理</a>
<a href="/admin.html">管理后台</a>
<a href="/workflow.html">工作流</a>
</nav>
</header>
<main class="container">
<h1>工作流编排</h1>
<!-- 工作流编辑器:新建或加载已有工作流的最新/指定版本进行编辑。
保存动作会为工作流追加一个新版本(工作流即数据,改参数不改代码)。 -->
<section class="panel">
<h2>工作流编辑器</h2>
<p id="editMode" class="muted">新建工作流:填写 ID 与 DAG 后保存。</p>
<label for="workflowId">工作流 ID(编辑模式下锁定)</label>
<input id="workflowId" type="text" placeholder="如 subtitle-demo" />
<label for="workflowName">名称</label>
<input id="workflowName" type="text" placeholder="如 视频字幕生成" />
<label for="workflowDescription">描述</label>
<input id="workflowDescription" type="text" placeholder="可选" />
<label for="workflowDefinition">DAG JSON(含各节点参数与依赖边)</label>
<textarea id="workflowDefinition" rows="22"></textarea>
<div class="actions">
<button id="saveWorkflow" class="primary">创建工作流</button>
<button id="resetWorkflow" class="ghost">新建工作流</button>
<button id="publishWorkflow" class="ghost">发布</button>
</div>
</section>
<!-- 版本历史:查看指定工作流的全部版本,可把任意版本加载回编辑器。 -->
<section class="panel" id="versionPanel" hidden>
<h2 id="versionPanelTitle">版本历史</h2>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>版本</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="versionList"></tbody>
</table>
</div>
<div class="actions">
<button id="closeVersions" class="ghost">关闭</button>
</div>
</section>
<!-- 工作流列表:支持加载到编辑器、查看版本、发布与删除。 -->
<section class="panel">
<h2>工作流列表</h2>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>版本</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="workflowList"></tbody>
</table>
</div>
</section>
</main>
<script src="/assets/app.js?v=2"></script>
</body>
</html>