fix(api): 修复墙检测任务超时占用与状态展示

为超过 5 分钟未领取或未上报的 pending/checking
任务自动标记失败,避免长期占用 active 状态并阻塞新检测

同时区分前端“等待节点领取”和“检测中”展示,
补充跳过原因提示,并更新相关测试与文档
This commit is contained in:
yinjianm
2026-04-28 01:44:07 +08:00
parent ff50030364
commit 329d52f89f
7 changed files with 104 additions and 17 deletions
+12 -2
View File
@@ -120,10 +120,20 @@ export function getNodeGfwMeta(node: AdminNodeItem): NodeGfwMeta {
}
}
if (status === 'pending' || status === 'checking') {
if (status === 'pending') {
return {
label: `${inheritedPrefix}等待节点领取`,
searchText: `${inherited ? '随父节点 继承 ' : ''}等待节点领取 等待检测 gfw pending`,
tagType: 'primary',
tone: 'checking',
inherited,
}
}
if (status === 'checking') {
return {
label: `${inheritedPrefix}检测中`,
searchText: `${inherited ? '随父节点 继承 ' : ''}检测中 等待检测 gfw checking pending`,
searchText: `${inherited ? '随父节点 继承 ' : ''}检测中 正在检测 gfw checking`,
tagType: 'primary',
tone: 'checking',
inherited,
+3 -2
View File
@@ -376,7 +376,8 @@ async function handleCheckGfw(ids: number[], label: string) {
if (started > 0) {
ElMessage.success(`${label}已发起墙状态检测,${started} 个父节点等待上报`)
} else if (skipped > 0) {
ElMessage.info('所选节点均为子节点,墙状态随父节点显示')
const reason = response.data?.skipped?.[0]?.reason
ElMessage.info(reason || '所选节点暂未发起新的墙状态检测')
} else {
ElMessage.info('没有可检测的节点')
}
@@ -666,7 +667,7 @@ watch(
<ElOption label="疑似被墙" value="blocked" />
<ElOption label="部分异常" value="partial" />
<ElOption label="检测失败" value="failed" />
<ElOption label="检测中" value="checking" />
<ElOption label="等待/检测中" value="checking" />
<ElOption label="未检测" value="unchecked" />
<ElOption label="随父节点" value="inherited" />
</ElSelect>