Files
Maven/cmd/mavweb/notifications.html
T
kami 5c34fb14f9 mavweb: add notifications history page at /notifications
RecentNudges IPC method, store adapter, dispatch, and client proxy.
Web UI at /notifications showing recent nudge history with color-coded
outcomes, nav links from /dash and /history.
2026-07-05 13:20:24 +04:00

50 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Notifications — Maven</title>
<style>
body{background:#111;color:#ddd;font-family:system-ui,sans-serif;margin:0;padding:1rem;font-size:.9rem}
a{color:#00aaff;text-decoration:none}
a:hover{text-decoration:underline}
h1{font-size:1.2rem;font-weight:400;color:#888;letter-spacing:.1em;text-transform:uppercase}
nav{margin-bottom:1rem;display:flex;gap:1rem}
nav a{font-size:.85rem;letter-spacing:.05em;text-transform:uppercase;color:#666}
nav a:hover{color:#ddd}
table{width:100%;border-collapse:collapse;margin-top:.5rem}
th,td{padding:.4rem .5rem;text-align:left;border-bottom:1px solid #222;white-space:nowrap}
th{color:#555;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
td{color:#aaa}
.rule{color:#00ff88;font-weight:600}
.chan{font-size:.75rem;color:#555;background:#1a1a2e;padding:.15rem .35rem;border-radius:3px}
.pending{color:#888}
.acted{color:#00ff88}
.snoozed{color:#ffaa00}
.ignored{color:#ff4444}
.msg{color:#666;max-width:300px;overflow:hidden;text-overflow:ellipsis}
.ts{color:#555;font-size:.8rem}
.empty{color:#555;padding:2rem;text-align:center}
</style>
</head>
<body>
<nav>
<a href=/dash>dash</a>
<a href=/trace>trace</a>
<a href=/tools>tools</a>
<a href=/history>history</a>
</nav>
<h1>Notifications</h1>
{{if .Nudges}}<table>
<tr><th>when</th><th>rule</th><th>channel</th><th>outcome</th><th>message</th></tr>
{{range .Nudges}}<tr>
<td class=ts>{{.Ts.Format "15:04"}}</td>
<td class=rule>{{.Rule}}</td>
<td><span class=chan>{{.Channel}}</span></td>
<td class={{.Outcome}}>{{.Outcome}}</td>
<td class=msg>{{.Message}}</td>
</tr>{{end}}</table>
{{else}}<div class=empty>no notifications yet</div>{{end}}
</body>
</html>