d60a51c9e7
The table was write-only. Rows were recorded and nothing could show them, so the tests for #368 and #370 had to reach past the store into store.DB — if a test can only see it that way, so can nobody else. A durable record nobody reads answers no question, and why Maven went quiet is supposed to be a query. ListDeliveryAttempts returns recent rows newest first, filtered by status. Status is the filter worth having because the two real questions are "what got dropped" and "what is still pending", and neither is answerable by reading the whole list on a busy day. It reaches mavweb over IPC as DeliveryAttempts. The section goes on /notifications, which already answers "what did she send", rather than on a page of its own. Shared ui.css, the nav partial, the table in div.scroll. A failed outbox read leaves a log line and still renders the nudge list, because half the page beats none of it.
41 lines
1.6 KiB
HTML
41 lines
1.6 KiB
HTML
{{template "shellTop" "notifications"}}
|
|
<h1>Notifications</h1>
|
|
{{if .Nudges}}<div class=scroll><table>
|
|
<tr><th>when</th><th>rule</th><th>channel</th><th>outcome</th><th>message</th></tr>
|
|
{{range .Nudges}}<tr>
|
|
<td class=hint>{{.Ts.Format "15:04"}}</td>
|
|
<td class=key>{{.Rule}}</td>
|
|
<td><span class=badge>{{.Channel}}</span></td>
|
|
<td class={{.Outcome}}>{{.Outcome}}</td>
|
|
<td class=text-max>{{.Message}}</td>
|
|
</tr>{{end}}</table></div>
|
|
{{else}}<div class=empty>
|
|
<svg class=icon width="24" height="24"><use href="/ethos-icons.svg#i-bell"/></svg>
|
|
<div>no notifications yet</div>
|
|
<div class=hint>check back later or ask maven a question</div>
|
|
</div>{{end}}
|
|
<h2>Delivery outbox</h2>
|
|
<p class=hint>
|
|
every send is recorded before it leaves, so a failure is visible rather than silent.
|
|
<a href="/notifications">all</a> ·
|
|
<a href="/notifications?status=dropped">dropped</a> ·
|
|
<a href="/notifications?status=failed">failed</a> ·
|
|
<a href="/notifications?status=pending">pending</a> ·
|
|
<a href="/notifications?status=unknown">unknown</a>
|
|
</p>
|
|
{{if .Attempts}}<div class=scroll><table>
|
|
<tr><th>started</th><th>kind</th><th>rule</th><th>channel</th><th>status</th><th>finished</th></tr>
|
|
{{range .Attempts}}<tr>
|
|
<td class=hint>{{.Created}}</td>
|
|
<td>{{.Kind}}</td>
|
|
<td class=key>{{.Target}}</td>
|
|
<td><span class=badge>{{.Channel}}</span></td>
|
|
<td class={{.Status}}>{{.Status}}</td>
|
|
<td class=hint>{{.Completed}}</td>
|
|
</tr>{{end}}</table></div>
|
|
{{else}}<div class=empty>
|
|
<div>no delivery attempts{{if .Status}} with status {{.Status}}{{end}}</div>
|
|
</div>{{end}}
|
|
{{template "shellBottom"}}
|
|
</html>
|