mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-02 20:01:51 +08:00
feat(findings): add manual remark and finding edit support
- Persist findings.remark with archive-restore compatibility, full-text search, and Markdown/CSV/JSON export
- Extend PATCH /api/exploration/findings/{id} to update name, vulnclass, severity, status, summary, evidence, report, and remark with atomic upfront validation
- Add dedicated Notes (remark) card and Edit Finding dialog on the finding detail page, plus remark preview/inline editing in the findings list and task findings tab
Fixes #198
This commit is contained in:
1 parent
253a8eeac3
commit
835e289ee2
21 files changed
+975
-43
No files matched your search
+8
-1
@@ -79,6 +79,9 @@ func FindingsMarkdown(fs []*db.DBFinding, generatedAt time.Time) string {
|
||||
if s := strings.TrimSpace(f.Summary); s != "" {
|
||||
fmt.Fprintf(&b, "%s\n\n", s)
|
||||
}
|
||||
if rm := strings.TrimSpace(f.Remark); rm != "" {
|
||||
fmt.Fprintf(&b, "**备注:**\n\n%s\n\n", rm)
|
||||
}
|
||||
if e := strings.TrimSpace(f.Evidence); e != "" {
|
||||
fmt.Fprintf(&b, "**证据:**\n\n```\n%s\n```\n\n", e)
|
||||
}
|
||||
@@ -110,6 +113,9 @@ func SingleFindingMarkdown(f *db.DBFinding, generatedAt time.Time) string {
|
||||
if s := strings.TrimSpace(f.Summary); s != "" {
|
||||
fmt.Fprintf(&b, "## 概述\n\n%s\n\n", s)
|
||||
}
|
||||
if rm := strings.TrimSpace(f.Remark); rm != "" {
|
||||
fmt.Fprintf(&b, "## 备注\n\n%s\n\n", rm)
|
||||
}
|
||||
if e := strings.TrimSpace(f.Evidence); e != "" {
|
||||
fmt.Fprintf(&b, "## 证据\n\n```\n%s\n```\n\n", e)
|
||||
}
|
||||
@@ -155,7 +161,7 @@ func FindingsCSV(fs []*db.DBFinding) []byte {
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString("\xEF\xBB\xBF") // UTF-8 BOM
|
||||
w := csv.NewWriter(&buf)
|
||||
_ = w.Write([]string{"ID", "名称", "类别", "严重等级", "状态", "所属任务", "发现时间", "概述", "流量证据数量", "流量证据ID"})
|
||||
_ = w.Write([]string{"ID", "名称", "类别", "严重等级", "状态", "所属任务", "发现时间", "概述", "备注", "流量证据数量", "流量证据ID"})
|
||||
for _, f := range items {
|
||||
id := fmt.Sprintf("%d", f.ID)
|
||||
if f.ExportCaseID > 0 {
|
||||
@@ -170,6 +176,7 @@ func FindingsCSV(fs []*db.DBFinding) []byte {
|
||||
f.TaskDescription,
|
||||
f.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
strings.TrimSpace(f.Summary),
|
||||
strings.TrimSpace(f.Remark),
|
||||
fmt.Sprint(len(f.TrafficBindings)), findingTrafficIDs(f),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user