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,13 +69,17 @@ func (widget *Widget) Refresh() {
|
|||||||
func (widget *Widget) contentFrom(onCalls []pagerduty.OnCall, incidents []pagerduty.Incident) string {
|
func (widget *Widget) contentFrom(onCalls []pagerduty.OnCall, incidents []pagerduty.Incident) string {
|
||||||
var str string
|
var str string
|
||||||
|
|
||||||
if len(incidents) > 0 {
|
if widget.settings.showIncidents {
|
||||||
str += "[yellow]Incidents[white]\n"
|
str += "[yellow] Incidents[white]"
|
||||||
for _, incident := range incidents {
|
if len(incidents) > 0 {
|
||||||
str += fmt.Sprintf("[%s]%s[white]\n", widget.settings.common.Colors.Subheading, incident.Summary)
|
for _, incident := range incidents {
|
||||||
str += fmt.Sprintf("Status: %s\n", incident.Status)
|
str += fmt.Sprintf("\n [%s]%s[white]\n", widget.settings.common.Colors.Subheading, incident.Summary)
|
||||||
str += fmt.Sprintf("Service: %s\n", incident.Service.Summary)
|
str += fmt.Sprintf(" Status: %s\n", incident.Status)
|
||||||
str += fmt.Sprintf("Escalation: %s\n", incident.EscalationPolicy.Summary)
|
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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +106,7 @@ func (widget *Widget) contentFrom(onCalls []pagerduty.OnCall, incidents []pagerd
|
|||||||
sort.Strings(keys)
|
sort.Strings(keys)
|
||||||
|
|
||||||
if len(keys) > 0 {
|
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
|
// Print out policies, and escalation order of users
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user