Files
Maven/cmd/mavweb/history.html
T
kami 311c5cb1cd mavweb: ui design system refresh — shared nav, cards, component classes
- Rewrote ui.css with design tokens, card/btn/badge/dot components
- All pages wrapped in <main class=page> with max-width container
- Replaced inline <style> blocks with ui.css classes
- passkey page now uses shared nav.site template
- PWA voice page unified under shared nav.site (no more separate tab nav)
- Inline lang toggle moved from nav to voice page body
2026-07-06 00:41:16 +04:00

42 lines
1.5 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.
<!doctype html><meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<title>maven · history</title>
<link rel=stylesheet href=/ui.css>
{{template "nav" "history"}}
<main class=page>
<h1>command history</h1>
<p class=muted>{{len .Facts}} facts shown (newest first)</p>
<div id=msg class=msg hidden></div>
<div class=scroll><table class=mono>
<tr><th>when<th>kind<th>key<th>value<th>source<th>conf<th></tr>
{{range .Facts}}{{if .VoidsID}}<tr class=voided>{{else}}<tr>{{end}}
<td>{{if .VoidsID}}<span class=void-badge> voided</span>{{end}}{{.Ts.Format "2006-01-02 15:04"}}</td>
<td>{{.Kind}}</td>
<td class=key>{{.Key}}</td>
<td class=val>{{.Value}}</td>
<td class=muted>{{.Source}}</td>
<td>{{printf "%.2f" .Confidence}}</td>
<td>{{if not .VoidsID}}<button class=btn onclick="revert('{{.Key}}',this)">revert</button>{{end}}</td>
</tr>{{end}}
</table></div>
</main>
<script>
const msg=document.getElementById('msg');
function revert(key,btn){
btn.disabled=true;
fetch('/api/revert',{method:'POST',headers:{'content-type':'application/x-www-form-urlencoded'},body:'key='+encodeURIComponent(key)})
.then(r=>r.json().then(d=>({ok:r.ok,data:d})))
.then(({ok,data})=>{
msg.className=ok?'msg msg-ok':'msg msg-err';
msg.hidden=false;
msg.textContent=ok?'reverted ✓':(data.error||'revert failed');
if(ok) btn.closest('tr').className='voided';
}).catch(e=>{
msg.className='msg msg-err';
msg.hidden=false;
msg.textContent='error: '+e;
btn.disabled=false;
});
}
</script>