mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Show failed policies count in Fleet Desktop (#6379)
This commit is contained in:
parent
d724d8595c
commit
c59d3249ef
2 changed files with 8 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
|||
* Updated the dropdown in Fleet Desktop to now show the number of failing policies along with the status
|
||||
|
|
@ -124,15 +124,18 @@ func main() {
|
|||
continue
|
||||
}
|
||||
|
||||
status := "🟢"
|
||||
failedPolicyCount := 0
|
||||
for _, policy := range policies {
|
||||
if policy.Response != "pass" {
|
||||
status = "🔴"
|
||||
break
|
||||
failedPolicyCount++
|
||||
}
|
||||
}
|
||||
|
||||
myDeviceItem.SetTitle(status + " My device")
|
||||
if failedPolicyCount > 0 {
|
||||
myDeviceItem.SetTitle(fmt.Sprintf("🔴 My device (%d)", failedPolicyCount))
|
||||
} else {
|
||||
myDeviceItem.SetTitle("🟢 My device")
|
||||
}
|
||||
myDeviceItem.Enable()
|
||||
}
|
||||
}()
|
||||
|
|
|
|||
Loading…
Reference in a new issue