Files
landwelle/web/admin/push.html
T

10 lines
4.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "push-admin.html"}}<!doctype html><html lang="de"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="noindex,nofollow"><title>App-Push – Landwelle Verwaltung</title><link rel="icon" href="/assets/landwelle-logo-trim.png"><link rel="stylesheet" href="/assets/admin-v37.css"><link rel="stylesheet" href="/assets/admin-push-v1.css"><script src="/assets/admin-v11.js" defer></script></head>
<body class="admin-dashboard-page"><div class="admin-layout"><aside class="admin-sidebar"><a class="admin-sidebar-brand" href="/admin"><img src="/assets/landwelle-logo-trim.png" alt="Landwelle"><span>Verwaltung</span></a>{{adminNavigation}}</aside><div class="admin-workspace"><header class="admin-topbar"><button class="admin-mobile-menu" type="button" aria-label="Navigation öffnen" aria-expanded="false">☰</button><div><span>Apps &amp; Veröffentlichung</span><strong>Push-Nachrichten</strong></div><div class="admin-user"><span class="admin-avatar">{{printf "%.1s" .Username}}</span><strong>{{.Username}}</strong></div></header>
<main class="admin-content app-push-page"><div class="admin-page-heading"><div><span class="admin-kicker">Landwelle App</span><h1>Push-Nachrichten</h1><p>Versende redaktionelle Mitteilungen an registrierte App-Installationen und kontrolliere Zustellung und Öffnungen.</p></div></div>
{{if .Error}}<div class="admin-alert is-error">{{.Error}}</div>{{end}}{{if .Success}}<div class="admin-alert is-success">{{.Success}}</div>{{end}}
<section class="push-status-grid"><article class="admin-card"><span>Installationen</span><strong>{{.Stats.Installations}}</strong></article><article class="admin-card"><span>Push aktiviert</span><strong>{{.Stats.PushEnabled}}</strong></article><article class="admin-card"><span>Aktive FCM-Tokens</span><strong>{{.Stats.ActiveTokens}}</strong></article><article class="admin-card"><span>Gesendet</span><strong>{{.Stats.Sent}}</strong></article><article class="admin-card"><span>Fehlgeschlagen</span><strong>{{.Stats.Failed}}</strong></article><article class="admin-card"><span>Geöffnet</span><strong>{{.Stats.Opened}}</strong></article></section>
<div class="push-main-grid"><section class="admin-card"><header><span class="admin-kicker">Sofortversand</span><h2>Push erstellen</h2><p>Nur Geräte mit aktiviertem FCM-Token und dem ausgewählten Thema erhalten die Nachricht.</p></header><form method="post" class="push-form"><input type="hidden" name="csrf_token" value="{{.CSRFToken}}"><label><span>Titel</span><input name="title" maxlength="160" required value="{{.Title}}" placeholder="Landwelle Eilmeldung"></label><label><span>Nachricht</span><textarea name="body" rows="5" maxlength="500" required placeholder="Kurzer Teaser für die App …">{{.Body}}</textarea></label><label><span>Zielthema</span><select name="topic" required>{{range .Topics}}<option value="{{.Slug}}" {{if eq $.Topic .Slug}}selected{{end}}>{{.Name}} · {{.Slug}}</option>{{end}}</select></label><label><span>Deep Link</span><input name="deep_link" value="{{.DeepLink}}" placeholder="landwelle://aktuelles"></label><button class="admin-primary-button" type="submit" {{if or (not .DatabaseReady) (not .FirebaseReady) (not .EncryptionOK)}}disabled{{end}}>Sofort senden</button></form></section>
<aside class="admin-card push-health"><header><span class="admin-kicker">Bereitschaft</span><h2>Push-System</h2></header><dl><div><dt>PostgreSQL</dt><dd>{{if .DatabaseReady}}Bereit{{else}}Fehlt{{end}}</dd></div><div><dt>Firebase</dt><dd>{{.FirebaseState}}</dd></div><div><dt>Tokenverschlüsselung</dt><dd>{{if .EncryptionOK}}Bereit{{else}}LANDWELLE_APP_PUSH_ENCRYPTION_KEY fehlt/ungültig{{end}}</dd></div><div><dt>Kampagnen</dt><dd>{{.Stats.Campaigns}}</dd></div></dl><p>FCM-Tokens werden verschlüsselt gespeichert und niemals im Klartext in dieser Oberfläche angezeigt.</p></aside></div>
<section class="admin-card push-history"><header><span class="admin-kicker">Historie</span><h2>Letzte Push-Kampagnen</h2></header><div class="push-table-wrap"><table><thead><tr><th>Zeit</th><th>Titel</th><th>Thema</th><th>Status</th><th>Erfolgreich</th><th>Fehler</th><th>Geöffnet</th></tr></thead><tbody>{{range .Campaigns}}<tr><td>{{.CreatedAt}}</td><td><strong>{{.Title}}</strong><small>{{.Body}}</small></td><td>{{if .Topic}}{{.Topic}}{{else}}–{{end}}</td><td><span class="push-state push-state-{{.Status}}">{{.Status}}</span></td><td>{{.SentCount}}</td><td>{{.FailedCount}}</td><td>{{.OpenedCount}}</td></tr>{{else}}<tr><td colspan="7">Noch keine Push-Kampagnen vorhanden.</td></tr>{{end}}</tbody></table></div></section>
</main></div></div></body></html>{{end}}