7a95097cc7
- Redesign dash/history/notifications/trace pages with unified CSS framework (ui.css): cards, badges, scrollable tables, responsive grid, PWA shell. - Add /voice page with chat-bubble transcript, listening indicator, and push-to-talk button for voice interaction. - Add mavweb.js: client-side JS for live transcript polling, auto-scroll, push-to-talk, and service-worker registration. - Update PWA manifest, icon, and service-worker for installable web app. - Add WebAuthn credential management (register/list/delete) with modal UI. - Update main.go: /voice route, WebAuthn handlers, new page navigation. - Update handlers_test.go for new voice and WebAuthn routes.
46 lines
1.8 KiB
HTML
46 lines
1.8 KiB
HTML
{{template "shellTop" "history"}}
|
||
<h1>Command History</h1>
|
||
{{if .Facts}}
|
||
<p class=hint>{{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}}<tr class="{{if .VoidsID}}voided{{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=hint>{{.Source}}</td>
|
||
<td>{{printf "%.2f" .Confidence}}</td>
|
||
<td>{{if not .VoidsID}}<button class="btn btn-sm" onclick="revert('{{.Key}}',this)">revert</button>{{end}}</td>
|
||
</tr>{{end}}
|
||
</table></div>
|
||
{{else}}
|
||
<div class=empty>
|
||
<svg class=icon width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
||
<div>no facts recorded yet</div>
|
||
<div class=hint>facts appear here when maven observes or records events</div>
|
||
</div>
|
||
{{end}}
|
||
{{template "shellBottom"}}
|
||
<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';btn.disabled=true;}
|
||
}).catch(e=>{
|
||
msg.className='msg msg-err';
|
||
msg.hidden=false;
|
||
msg.textContent='error: '+e;
|
||
btn.disabled=false;
|
||
});
|
||
}
|
||
</script>
|
||
</html>
|