feat(流水线): 资产管理 + 计划编排 + 运行监测 + 切号/发布修复
- 流水线收口为四栏:资产管理 / 动作 / 计划调度 / 运行监测 - 资产管理:账号总表与设备筛选、素材 13 列、模板批量导入(数量+文件名校验)、 单条上传、删除账号(归档不删原件)、发布记录 - 计划调度:segments 多动作组/任务编排(发布素材/循环/条件/回主页)、 内置切号可见可编辑、每账号切号前亮屏 - 运行监测:计划/账号/设备三维度、按需截图、按账号拆分显示 - 修复:图片相册索引误报、切号重试与重复点「我」、发布任务校验跳过、 多号同机假账号目录、编辑器 expect_el 未声明变量 - 文档与测试同步(14/14)
This commit is contained in:
+8
-2
@@ -149,6 +149,7 @@ def _step_filters():
|
||||
job_id=request.args.get("job_id", ""),
|
||||
result=request.args.get("result", ""),
|
||||
run_id=request.args.get("run_id", ""),
|
||||
account=request.args.get("account", ""),
|
||||
keyword=request.args.get("q", ""),
|
||||
since=logger.norm_ts(request.args.get("since", "")),
|
||||
until=logger.norm_ts(request.args.get("until", ""), end=True))
|
||||
@@ -157,7 +158,8 @@ def _step_filters():
|
||||
def _step_to_dict(r):
|
||||
return {"id": r.id, "run_id": r.run_id, "job_id": r.job_id,
|
||||
"job_name": r.job_name, "serial": r.serial,
|
||||
"device_name": r.device_name, "step_path": r.step_path,
|
||||
"device_name": r.device_name, "account": r.account,
|
||||
"step_path": r.step_path,
|
||||
"step_label": r.step_label, "step_type": r.step_type,
|
||||
"selector": r.selector, "result": r.result, "detail": r.detail,
|
||||
"duration_ms": r.duration_ms, "created_at": r.created_at}
|
||||
@@ -188,11 +190,12 @@ def api_step_logs_runs():
|
||||
from core import step_log
|
||||
f = _step_filters()
|
||||
rows = step_log.runs(serial=f["serial"], job_id=f["job_id"],
|
||||
since=f["since"], until=f["until"],
|
||||
account=f["account"], since=f["since"], until=f["until"],
|
||||
limit=request.args.get("limit", 100))
|
||||
return jsonify({"ok": True, "runs": [
|
||||
{"run_id": r.run_id, "job_id": r.job_id, "job_name": r.job_name,
|
||||
"serial": r.serial, "device_name": r.device_name,
|
||||
"account": r.account,
|
||||
"started_at": r.started_at, "ended_at": r.ended_at,
|
||||
"steps": int(r.steps or 0), "failures": int(r.failures or 0)}
|
||||
for r in rows]})
|
||||
@@ -209,12 +212,15 @@ def api_step_logs_filters():
|
||||
.filter(TaskStepLog.serial != "").distinct().limit(500).all())
|
||||
jobs = (db.session.query(TaskStepLog.job_id, TaskStepLog.job_name)
|
||||
.filter(TaskStepLog.job_id != "").distinct().limit(500).all())
|
||||
accounts = (db.session.query(TaskStepLog.account)
|
||||
.filter(TaskStepLog.account != "").distinct().limit(500).all())
|
||||
return jsonify({"ok": True,
|
||||
"devices": sorted(({"serial": s, "device_name": n}
|
||||
for s, n in devices),
|
||||
key=lambda x: x["device_name"] or x["serial"]),
|
||||
"jobs": sorted(({"job_id": i, "job_name": n} for i, n in jobs),
|
||||
key=lambda x: x["job_name"] or x["job_id"]),
|
||||
"accounts": sorted(a for (a,) in accounts),
|
||||
"results": ["ok", "miss", "error", "unknown", "skip", "cap"],
|
||||
"keep_days": step_log.KEEP_DAYS,
|
||||
"max_rows_per_run": step_log.MAX_ROWS_PER_RUN})
|
||||
|
||||
Reference in New Issue
Block a user