feat: 发现页支持按任务筛选/行内看报告与改名称类别严重度;任务列表输入去卡顿
- 发现列表新增「按任务」下拉(有漏洞的任务+条数),task_id 下推 SQL 筛选 - 展开行懒加载并渲染详细报告(Markdown),修 table 溢出:table-fixed + whitespace-normal + break-words + pre 换行 - 展开行前置「名称/类别/严重等级」可编辑并保存:patchFinding 增 name/vulnclass, DB 抽 setFindingCol 同步节点 payload - 详情页状态区加「漏洞 ID」,列表证据行去掉裸 id - 任务新建表单拆出独立组件消除输入卡顿;轮询 3s→10s+去重,时长 tick 仅 running 时跑
This commit is contained in:
1 parent
24a94cf8e5
commit
d9474814b5
6 files changed
+719
-378
No files matched your search
+28
-4
@@ -1537,15 +1537,17 @@ func (s *Server) patchFinding(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
var body struct {
|
||||
Status *string `json:"status"`
|
||||
Severity *string `json:"severity"`
|
||||
Status *string `json:"status"`
|
||||
Severity *string `json:"severity"`
|
||||
Name *string `json:"name"`
|
||||
VulnClass *string `json:"vulnclass"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
writeErr(w, 400, "bad json: "+err.Error())
|
||||
return
|
||||
}
|
||||
if body.Status == nil && body.Severity == nil {
|
||||
writeErr(w, 400, "nothing to update: provide status and/or severity")
|
||||
if body.Status == nil && body.Severity == nil && body.Name == nil && body.VulnClass == nil {
|
||||
writeErr(w, 400, "nothing to update: provide status/severity/name/vulnclass")
|
||||
return
|
||||
}
|
||||
if body.Status != nil {
|
||||
@@ -1578,6 +1580,28 @@ func (s *Server) patchFinding(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if body.Name != nil {
|
||||
n, err := s.m.pg.SetFindingName(id, strings.TrimSpace(*body.Name))
|
||||
if err != nil {
|
||||
writeErr(w, 500, err.Error())
|
||||
return
|
||||
}
|
||||
if n == 0 {
|
||||
writeErr(w, 404, "finding not found")
|
||||
return
|
||||
}
|
||||
}
|
||||
if body.VulnClass != nil {
|
||||
n, err := s.m.pg.SetFindingVulnClass(id, strings.TrimSpace(*body.VulnClass))
|
||||
if err != nil {
|
||||
writeErr(w, 500, err.Error())
|
||||
return
|
||||
}
|
||||
if n == 0 {
|
||||
writeErr(w, 404, "finding not found")
|
||||
return
|
||||
}
|
||||
}
|
||||
f, err := s.m.pg.GetFinding(id)
|
||||
if err != nil {
|
||||
writeErr(w, 500, err.Error())
|
||||
|
||||
Reference in new issue
Block a user