feat: 发现处置状态扩展为 8 个

在 待处理/误报/忽略/已处理 基础上新增:
- in_progress 处理中(已受理、修复/验证中)
- confirmed 已确认(真实漏洞未修复)
- duplicate 重复
- risk_accepted 风险接受(确认存在但业务接受)

改动:db 常量 + ValidFindingStatus 白名单、schema 注释、status.ts 色板/文案、
types.ts 联合类型、两处下拉的 FINDING_STATUSES(下拉与状态筛选自动带出)。
状态无 CHECK 约束,旧库无需迁移。
This commit is contained in:
Autumn-27 committed 2026-08-18 10:37:13 -04:00
1 parent 58a277e2d1
commit 7b3eec2166
6 files changed
+34 -8

No files matched your search

@@ -40,9 +40,13 @@ import type { Finding, FindingStats, FindingStatus, Severity } from "@/lib/types
const FINDING_STATUSES: FindingStatus[] = [
"pending",
"in_progress",
"confirmed",
"resolved",
"false_positive",
"ignored",
"resolved",
"duplicate",
"risk_accepted",
];
const EMPTY_STATS: FindingStats = {
@@ -18,9 +18,13 @@ import type { Finding, FindingStatus } from "@/lib/types";
const FINDING_STATUSES: FindingStatus[] = [
"pending",
"in_progress",
"confirmed",
"resolved",
"false_positive",
"ignored",
"resolved",
"duplicate",
"risk_accepted",
];
function Row({
+5 -1
View File
@@ -65,9 +65,13 @@ const severity: Record<string, StatusMeta> = {
const finding: Record<string, StatusMeta> = {
pending: { label: "待处理", tone: "amber" },
in_progress: { label: "处理中", tone: "blue" },
confirmed: { label: "已确认", tone: "red" },
resolved: { label: "已处理", tone: "green" },
false_positive: { label: "误报", tone: "slate" },
ignored: { label: "忽略", tone: "neutral" },
resolved: { label: "已处理", tone: "green" },
duplicate: { label: "重复", tone: "neutral" },
risk_accepted: { label: "风险接受", tone: "violet" },
};
const engine: Record<string, StatusMeta> = {
+10 -2
View File
@@ -239,8 +239,16 @@ export interface TaskNode {
// ---- Findings ----
export type Severity = "high" | "medium" | "low";
// 漏洞处置状态:待处理 / 误报 / 忽略 / 已处理。
export type FindingStatus = "pending" | "false_positive" | "ignored" | "resolved";
// 漏洞处置状态:待处理 / 处理中 / 已确认 / 已处理 / 误报 / 忽略 / 重复 / 风险接受。
export type FindingStatus =
| "pending"
| "in_progress"
| "confirmed"
| "resolved"
| "false_positive"
| "ignored"
| "duplicate"
| "risk_accepted";
// FindingAsset 是一个漏洞绑定的资产(已在后端预渲染 label)。
export interface FindingAsset {