Show failed policies count in Fleet Desktop (#6379)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user