mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 10:04:55 +08:00
@@ -231,15 +231,26 @@ bat parse schedule list --state-dir /tmp/bat-schedule
|
||||
`schedule run --force` 会忽略到期时间立即执行指定计划,`--schedule-max-runs N`
|
||||
限制本轮最多执行 N 个到期计划。
|
||||
|
||||
## bat-api 调度接口
|
||||
## bat-api 调度与 dashboard 接口
|
||||
|
||||
dashboard 通过 `bat-api` 转发到 Rust `bat.sock`,不维护第二份计划状态。Rust RPC 方法为:
|
||||
内嵌 dashboard 由 `bat-api` 直接服务于 `GET /admin/dashboard/`。页面静态资产免
|
||||
token 读取,但资源、调度、任务、日志、解析和翻译控制都通过 `bat-api` 转发到
|
||||
Rust `bat.sock`,不维护第二份计划状态或翻译状态。Rust RPC 方法为:
|
||||
|
||||
- `schedule.list`
|
||||
- `schedule.add`
|
||||
- `schedule.update`
|
||||
- `schedule.remove`
|
||||
- `schedule.run`
|
||||
- `task.list`
|
||||
- `task.status`
|
||||
- `task.logs`
|
||||
- `task.cancel`
|
||||
- `daemon.logs`
|
||||
- `daemon.doctor`
|
||||
- `parse.status`
|
||||
- `parse.text_units`
|
||||
- `parse.errors`
|
||||
|
||||
`bat-api` 对应接口为 `GET /admin/schedules` 和
|
||||
`POST /admin/control/schedule-add|schedule-update|schedule-remove|schedule-run`,
|
||||
@@ -250,6 +261,18 @@ contract:`id`、`group`、`action`、`args`、`next_run_unix_seconds`、
|
||||
`enabled`;`schedule.list` 额外接受 `id`、`group`、`enabled` 过滤,
|
||||
`schedule.run` 额外接受 `group`、`force` 和 `max_runs`。
|
||||
|
||||
任务和诊断接口同样要求管理 token:`GET /admin/diagnostics` 转发
|
||||
`daemon.doctor`,`GET /admin/logs?tail=200` 转发 `daemon.logs`,
|
||||
`GET /admin/tasks`、`GET /admin/tasks/status?task_id=...` 和
|
||||
`GET /admin/tasks/logs?task_id=...` 转发 `task.*` 查询。取消任务使用
|
||||
`POST /admin/control/task-cancel`,请求字段为 `task_id`。
|
||||
|
||||
解析查询接口为 `GET /admin/parse/status`、
|
||||
`GET /admin/parse/text-units` 和 `GET /admin/parse/errors`,均只读转发当前
|
||||
Rust release 的 `parse.*` 数据。`text-units` 与 `errors` 支持 `offset`、
|
||||
`limit`、`destination`、`path_pattern`、`archive_entry`、`path_id`、`class_id`、
|
||||
`field_path` 和 `format` query,`limit` 范围为 `1..=1000`。
|
||||
|
||||
翻译任务状态可由已鉴权的 dashboard 通过 `GET /admin/translation/tasks`
|
||||
查询,query 过滤项包括 `offset`、`limit`、`task_id`、`release_id`、
|
||||
`destination`、`path_pattern`、`archive_entry`、`status`、`worker_status`、
|
||||
@@ -259,8 +282,12 @@ Rust `translation.tasks` / `translation.handoff`,不在 Go 侧维护状态。
|
||||
|
||||
翻译任务状态也可由已鉴权的 dashboard 通过
|
||||
`POST /admin/control/translation-task-update` 回写,请求字段为
|
||||
`task_id`、`status`,以及可选的 `failure_reason`、`provider_run_id`;
|
||||
该接口只转发 `translation.task.update`。
|
||||
`task_id`、`status`,以及可选的 `failure_reason`、`provider`、
|
||||
`provider_run_id` 和 `translation_results`;该接口只转发
|
||||
`translation.task.update`。人工校对流程提交译文时必须使用 `status=completed`,
|
||||
并为每个 `translation_results[]` 提供 `unit_id`、`source_text` 和
|
||||
`translated_text`,Rust 会用当前 `official-textunit-index.json` 校验 unit、
|
||||
source text、destination 和 archive entry 后再落库。
|
||||
|
||||
`POST /admin/control/translation-worker-run` 会触发 Rust 侧
|
||||
`translation.worker.run`,请求字段为 `provider`、`fixture_path`、
|
||||
|
||||
Reference in New Issue
Block a user