Show failed policies count in Fleet Desktop (#6379)

This commit is contained in:
Sharvil Shah 2022-06-24 17:10:05 -07:00 committed by GitHub
parent d724d8595c
commit c59d3249ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1 @@
* Updated the dropdown in Fleet Desktop to now show the number of failing policies along with the status

View file

@ -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()
}
}()