feat: audit log / history timeline on instance detail page
Adds an instance_history table that records every field change: - createInstance logs a 'created' event - updateInstance diffs old vs new and logs one row per changed field (name, state, stack, vmid, tailscale_ip, all service flags) - History is stored under the new vmid when vmid changes New endpoint: GET /api/instances/:vmid/history The 'timestamps' section on the detail page is replaced with a grid timeline showing timestamp | field | old → new for each event. State changes are colour-coded (deployed=green, testing=amber, degraded=red). Boolean service flags display as on/off. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
js/db.js
5
js/db.js
@@ -55,3 +55,8 @@ async function updateInstance(vmid, data) {
|
||||
async function deleteInstance(vmid) {
|
||||
await api(`/instances/${vmid}`, { method: 'DELETE' });
|
||||
}
|
||||
|
||||
async function getInstanceHistory(vmid) {
|
||||
const res = await fetch(`${BASE}/instances/${vmid}/history`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user