feat: expose traffic IDs and filter finding statistics

This commit is contained in:
ji ruo committed 2026-11-09 16:11:15 +08:00
1 parent 459a484237
commit 8ee94f2215
14 files changed
+333 -70

No files matched your search

+2 -8
View File
@@ -2337,15 +2337,9 @@ func (s *Server) resolveAssetIDs(ids []int64) map[int64]*db.Asset {
return assets
}
// findingStats serves the whole-table aggregates (stat cards + vuln-class filter)
// for the paginated 发现 page.
// findingStats serves filtered, pagination-independent counts and global options.
func (s *Server) findingStats(w http.ResponseWriter, r *http.Request) {
st, err := s.m.pg.FindingStats()
if err != nil {
writeErr(w, 500, err.Error())
return
}
st.Distinct, err = s.m.pg.DistinctFindingStats("")
st, err := s.m.pg.FilteredFindingStats(findingFilterFromQuery(r.URL.Query()))
if err != nil {
writeErr(w, 500, err.Error())
return