mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Clean the OpsGenie schedule names
This commit is contained in:
parent
0eb45dd748
commit
6a70bbe345
@ -60,7 +60,7 @@ func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string {
|
||||
str := "\n"
|
||||
|
||||
for _, data := range onCallResponse.OnCallData {
|
||||
str = str + fmt.Sprintf(" [green]%s[white]\n", data.Parent.Name)
|
||||
str = str + fmt.Sprintf(" [green]%s[white]\n", widget.cleanScheduleName(data.Parent.Name))
|
||||
str = str + fmt.Sprintf(" %s\n", strings.Join(widget.namesFromEmails(data.Recipients), ", "))
|
||||
str = str + "\n"
|
||||
}
|
||||
@ -68,6 +68,10 @@ func (widget *Widget) contentFrom(onCallResponse *OnCallResponse) string {
|
||||
return str
|
||||
}
|
||||
|
||||
func (widget *Widget) cleanScheduleName(schedule string) string {
|
||||
return strings.Replace(schedule, "_", " ", -1)
|
||||
}
|
||||
|
||||
func (widget *Widget) namesFromEmails(emails []string) []string {
|
||||
names := []string{}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user