fix: exclude watch from patrol status summary
Since watch/info findings are filtered from the UI and never shown to users, don't include them in the patrol run status summary. This makes the summary consistent with what users actually see.
This commit is contained in:
parent
f054012c44
commit
50c029c044
1 changed files with 2 additions and 4 deletions
|
|
@ -872,7 +872,8 @@ func (p *PatrolService) runPatrol(ctx context.Context) {
|
|||
summary := p.findings.GetSummary()
|
||||
var findingsSummaryStr string
|
||||
var status string
|
||||
totalActive := summary.Critical + summary.Warning + summary.Watch
|
||||
// Only count critical and warning as active issues (watch/info are filtered from UI)
|
||||
totalActive := summary.Critical + summary.Warning
|
||||
if totalActive == 0 {
|
||||
findingsSummaryStr = "All healthy"
|
||||
status = "healthy"
|
||||
|
|
@ -884,9 +885,6 @@ func (p *PatrolService) runPatrol(ctx context.Context) {
|
|||
if summary.Warning > 0 {
|
||||
parts = append(parts, fmt.Sprintf("%d warning", summary.Warning))
|
||||
}
|
||||
if summary.Watch > 0 {
|
||||
parts = append(parts, fmt.Sprintf("%d watch", summary.Watch))
|
||||
}
|
||||
findingsSummaryStr = fmt.Sprintf("%s", joinParts(parts))
|
||||
if summary.Critical > 0 {
|
||||
status = "critical"
|
||||
|
|
|
|||
Loading…
Reference in a new issue