feat(07-01): add config history API client and timeline component

- Add ConfigChangeEntry interface and configHistoryApi.list() to api.ts
- Create ConfigHistorySection with timeline, loading skeleton, and empty state
- Poll every 60s via TanStack Query refetchInterval

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-12 23:11:46 -05:00
parent e8bf994e7d
commit 6bd24517ba
2 changed files with 120 additions and 0 deletions

View File

@@ -968,6 +968,29 @@ export const remoteAccessApi = {
.then((r) => r.data),
}
// ─── Config History ─────────────────────────────────────────────────────────
export interface ConfigChangeEntry {
id: string
component: string
summary: string
created_at: string
diff_id: string
lines_added: number
lines_removed: number
snapshot_id: string
}
export const configHistoryApi = {
list: (tenantId: string, deviceId: string, limit = 50, offset = 0) =>
api
.get<ConfigChangeEntry[]>(
`/api/tenants/${tenantId}/devices/${deviceId}/config-history`,
{ params: { limit, offset } },
)
.then((r) => r.data),
}
// ─── VPN (WireGuard) ────────────────────────────────────────────────────────
export interface VpnConfigResponse {