Use channel.get_kind_display() in more places.

This commit is contained in:
Pēteris Caune 2019-11-20 17:31:36 +02:00
parent fbba2b585e
commit e4646205cb
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
2 changed files with 7 additions and 33 deletions

View File

@ -51,14 +51,6 @@
{% endif %}
{% elif ch.kind == "pd" %}
PagerDuty account <span>{{ ch.pd_account }}</span>
{% elif ch.kind == "pagertree" %}
PagerTree
{% elif ch.kind == "pagerteam" %}
Pager Team
{% elif ch.kind == "opsgenie" %}
OpsGenie
{% elif ch.kind == "victorops" %}
VictorOps
{% elif ch.kind == "po" %}
Pushover ({{ ch.po_priority }} priority)
{% elif ch.kind == "slack" %}
@ -67,14 +59,6 @@
team <span>{{ ch.slack_team }}</span>,
channel <span>{{ ch.slack_channel }}</span>
{% endif %}
{% elif ch.kind == "webhook" %}
Webhook
{% elif ch.kind == "apprise" %}
Apprise
{% elif ch.kind == "pushbullet" %}
Pushbullet
{% elif ch.kind == "discord" %}
Discord
{% elif ch.kind == "telegram" %}
Telegram
{% if ch.telegram_type == "group" %}
@ -82,8 +66,6 @@
{% elif ch.telegram_type == "private" %}
user <span>{{ ch.telegram_name }}</span>
{% endif %}
{% elif ch.kind == "hipchat" %}
HipChat
{% elif ch.kind == "sms" %}
SMS to <span>{{ ch.sms_number }}</span>
{% elif ch.kind == "trello" %}
@ -100,10 +82,6 @@
{% if ch.whatsapp_notify_up and not ch.whatsapp_notify_down %}
(up only)
{% endif %}
{% elif ch.kind == "mattermost" %}
Mattermost
{% elif ch.kind == "msteams" %}
Microsoft Teams
{% else %}
{{ ch.get_kind_display }}
{% endif %}

View File

@ -5,18 +5,11 @@
{% if event.channel.slack_channel %}
to {{ event.channel.slack_channel }}
{% endif %}
{% elif event.channel.kind == "pd" %}
Sent alert to PagerDuty
{% elif event.channel.kind == "pagertree" %}
Sent alert to PagerTree
{% elif event.channel.kind == "pagerteam" %}
Sent alert to Pager Team
{% elif event.channel.kind == "opsgenie" %}
Sent alert to OpsGenie
{% elif event.channel.kind == "hipchat" %}
Sent alert to HipChat
{% elif event.channel.kind == "po" %}
Sent a Pushover notification
{% if event.channel.name %}
({{ event.channel.name }})
{% endif %}
{% elif event.channel.kind == "webhook" %}
Called webhook {{ event.channel.url_down }}
{% elif event.channel.kind == "msteams" %}
@ -43,7 +36,10 @@
({{ event.channel.name }})
{% endif %}
{% else %}
Sent alert to {{ event.channel.kind|capfirst }}
Sent alert to {{ event.channel.get_kind_display }}
{% if event.channel.name %}
({{ event.channel.name }})
{% endif %}
{% endif %}
{% if event.error %}
<br />