311c5cb1cd
- 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
42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<!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>
|