{% extends "content.html" %} {% block inner %} {% import 'partials/components/ui_macros.html' as ui %} {% import 'partials/components/card.html' as card %} {% set event_labels = { "error": "Fehler", "warning": "Warnung", "success": "Erfolg", "info": "Info" } %}
Benachrichtigungen
{# ── Kanäle ────────────────────────────────────────────────────────────── #}
Kanäle
{% if channels %} {% for ch_id, ch in channels.items() %} {% set ch_enabled = ch.get('enabled', True) %} {% set title_html %} {{ ch.label or ch_id }} {{ ch.backend or 'ntfy' }} {% endset %} {% set toggle_html %} {{ ui.toggle_switch(module=key, item=ch_id, container_id="tab-notify-channels", loading_id=loading_id, enabled=ch_enabled, description=ch.label or ch_id) }} {% endset %} {% set footer_left %} {% endset %} {% set footer_right %} {{ ui.edit_button(module=key, item=ch_id, container_id="tab-notify-channels", loading_id=loading_id) }} {{ ui.delete_button(module=key, item=ch_id, container_id="tab-notify-channels", loading_id=loading_id, description=ch.label or ch_id) }} {% endset %} {% call card.render(title_html, enabled=ch_enabled, toggle_html=toggle_html, footer_left=footer_left, footer_right=footer_right) %}
{% if ch.backend == 'ntfy' or not ch.backend %} Server {{ ch.ntfy_url or 'https://ntfy.sh' }} Thema {{ ch.ntfy_topic or '—' }} {% if ch.ntfy_token %} Token ••••••{{ ch.ntfy_token[-4:] if ch.ntfy_token|length > 4 else '••••' }} {% endif %} {% elif ch.backend == 'email' %} Von {{ ch.mail_from or '—' }} An {{ ch.mail_to or '—' }} {% endif %}
{% endcall %} {% endfor %} {% else %}
Keine Kanäle konfiguriert
Lege mit „Neuer Kanal" einen ntfy-Server oder E-Mail-Account an.
{% endif %}
{# ── Notify-Jobs ───────────────────────────────────────────────────────── #}
Notify-Jobs
{% if jobs %} {% for job_id, job in jobs.items() %} {% set job_enabled = job.get('enabled', True) %} {% set ch = channels.get(job.get('channel_id', '')) %} {% set title_html %} {{ job.label or job_id }} {% if ch %} {{ ch.label or job.get('channel_id') }} {% else %} Kein Kanal {% endif %} {% endset %} {% set toggle_html %} {{ ui.toggle_switch(module=key + "/jobs", item=job_id, container_id="tab-notify-jobs", loading_id=loading_id, enabled=job_enabled, description=job.label or job_id) }} {% endset %} {% set footer_left %} {% endset %} {% set footer_right %} {% endset %} {% call card.render(title_html, enabled=job_enabled, toggle_html=toggle_html, footer_left=footer_left, footer_right=footer_right) %}
{% set evts = job.get('events') or [] %} Ereignisse {% if evts %} {% set ns = namespace(labels=[]) %} {% for ev in evts %}{% set ns.labels = ns.labels + [event_labels.get(ev, ev)] %}{% endfor %} {{ ns.labels | join(', ') }} {% else %} keine {% endif %} {% set srcs = job.get('sources') or [] %} {% if srcs %} Quellen {% set ns = namespace(labels=[]) %} {% for s in srcs %}{% set ns.labels = ns.labels + [all_sources.get(s, s)] %}{% endfor %} {{ ns.labels | join(', ') }} {% endif %}
{% endcall %} {% endfor %} {% else %}
Keine Notify-Jobs
Erstelle mit „Neuer Job" eine Benachrichtigungsregel.
{% endif %}
{# /notify-columns #} {% endblock %}