mavweb: unify UI — shared ui.css + nav partial across all pages

One theme (the PWA's dark palette) for dash/history/trace/notifications/
tools/passkey via static/ui.css; shared nav template with active-page
highlight; tables wrapped in .scroll so they pan on phones; PWA nav no
longer clips the RU/EN toggle; dash 'updated' timestamp fixed (selector
matched nothing). AGENTS.md documents the local preview/screenshot recipe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASstMtsZWLSRcD1Tq8T68Q
This commit is contained in:
kami
2026-07-05 18:36:31 +04:00
parent a158ffd1d2
commit d7c0cf89d3
9 changed files with 215 additions and 158 deletions
+15 -23
View File
@@ -1,31 +1,23 @@
<!doctype html><meta charset=utf-8>
<title>maven dash</title>
<style>
body{font:14px monospace;background:#111;color:#ddd;margin:1rem}
h2{color:#8cf;margin:1.2rem 0 .3rem}
table{border-collapse:collapse;width:100%}
td,th{border-bottom:1px solid #333;padding:.2rem .5rem;text-align:left}
.pending{color:#fc6}.acted{color:#6c6}.ignored{color:#888}.snoozed{color:#c9f}
.pres{color:#6c6}.away{color:#888}
.updated{color:#666;font-size:.85rem;margin-top:-.5rem;margin-bottom:1rem}
nav a{color:#8cf;margin-right:1rem;font-size:.85rem}
</style>
<nav><a href=/history>history</a> <a href=/trace>trace</a> <a href=/notifications>notifications</a></nav>
<meta name=viewport content="width=device-width,initial-scale=1">
<title>maven · dash</title>
<link rel=stylesheet href=/ui.css>
{{template "nav" "dash"}}
<h2>presence</h2>
<p><span class={{.Presence.Bucket}}>{{.Presence.Bucket}}</span> — score {{printf "%.2f" .Presence.Score}} ({{ago .Presence.Updated}})</p>
<div class=updated>обновляется каждые 10с</div>
<div class=updated id=updated>обновляется каждые 10с</div>
<h2>nudges</h2>
<table id=nudges><tr><th>when<th>rule<th>chan<th>outcome<th>message</tr>
{{range .Nudges}}<tr><td>{{ago .Ts}}<td>{{.Rule}}<td>{{.Channel}}<td class={{.Outcome}}>{{.Outcome}}<td>{{.Message}}</tr>{{end}}
</table>
<div class=scroll><table class=mono id=nudges><tr><th>when<th>rule<th>chan<th>outcome<th>message</tr>
{{range .Nudges}}<tr><td>{{ago .Ts}}<td>{{.Rule}}<td><span class=badge>{{.Channel}}</span><td class={{.Outcome}}>{{.Outcome}}<td>{{.Message}}</tr>{{end}}
</table></div>
<h2>facts</h2>
<table id=facts><tr><th>when<th>kind<th>key<th>value<th>source<th>conf</tr>
{{range .Facts}}<tr><td>{{ago .Ts}}<td>{{.Kind}}<td>{{.Key}}<td>{{.Value}}<td>{{.Source}}<td>{{printf "%.2f" .Confidence}}</tr>{{end}}
</table>
<div class=scroll><table class=mono id=facts><tr><th>when<th>kind<th>key<th>value<th>source<th>conf</tr>
{{range .Facts}}<tr><td>{{ago .Ts}}<td>{{.Kind}}<td class=key>{{.Key}}<td>{{.Value}}<td>{{.Source}}<td>{{printf "%.2f" .Confidence}}</tr>{{end}}
</table></div>
<h2>notes</h2>
<table id=notes><tr><th>when<th>source<th>text</tr>
<div class=scroll><table class=mono id=notes><tr><th>when<th>source<th>text</tr>
{{range .Notes}}<tr><td>{{ago .Ts}}<td>{{.Source}}<td>{{.Text}}</tr>{{end}}
</table>
</table></div>
<script>
setInterval(() => fetch('/dash').then(r => r.text()).then(html => {
const p = new DOMParser(), d = p.parseFromString(html, 'text/html');
@@ -33,6 +25,6 @@ setInterval(() => fetch('/dash').then(r => r.text()).then(html => {
const old = document.getElementById(id), nu = d.getElementById(id);
if (old && nu) old.replaceWith(nu);
}
document.querySelector('h2+div').textContent = 'обновлено ' + new Date().toLocaleTimeString();
document.getElementById('updated').textContent = 'обновлено ' + new Date().toLocaleTimeString();
}), 10000);
</script>
</script>