mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Always show incidents if configured
This commit is contained in:
parent
aa5e5e70a9
commit
d3834271e0
@ -69,14 +69,18 @@ func (widget *Widget) Refresh() {
|
||||
func (widget *Widget) contentFrom(onCalls []pagerduty.OnCall, incidents []pagerduty.Incident) string {
|
||||
var str string
|
||||
|
||||
if widget.settings.showIncidents {
|
||||
str += "[yellow] Incidents[white]"
|
||||
if len(incidents) > 0 {
|
||||
str += "[yellow]Incidents[white]\n"
|
||||
for _, incident := range incidents {
|
||||
str += fmt.Sprintf("[%s]%s[white]\n", widget.settings.common.Colors.Subheading, incident.Summary)
|
||||
str += fmt.Sprintf("\n [%s]%s[white]\n", widget.settings.common.Colors.Subheading, incident.Summary)
|
||||
str += fmt.Sprintf(" Status: %s\n", incident.Status)
|
||||
str += fmt.Sprintf(" Service: %s\n", incident.Service.Summary)
|
||||
str += fmt.Sprintf(" Escalation: %s\n", incident.EscalationPolicy.Summary)
|
||||
}
|
||||
} else {
|
||||
str += "\n No unresolved incidents\n"
|
||||
}
|
||||
}
|
||||
|
||||
tree := make(map[string][]pagerduty.OnCall)
|
||||
@ -102,7 +106,7 @@ func (widget *Widget) contentFrom(onCalls []pagerduty.OnCall, incidents []pagerd
|
||||
sort.Strings(keys)
|
||||
|
||||
if len(keys) > 0 {
|
||||
str += fmt.Sprintf("[%s] Schedules[white]\n", widget.settings.common.Colors.Subheading)
|
||||
str += fmt.Sprintf("\n[%s] Schedules[white]\n", widget.settings.common.Colors.Subheading)
|
||||
|
||||
// Print out policies, and escalation order of users
|
||||
for _, key := range keys {
|
||||
|
Loading…
x
Reference in New Issue
Block a user