feat(08-02): add snapshot download button to config history timeline
- Add SnapshotResponse interface and getSnapshot API method - Add deviceName prop to ConfigHistorySection - Add download handler that fetches snapshot and triggers .rsc file download - Add Download icon button on each timeline entry with stopPropagation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -991,6 +991,13 @@ export interface DiffResponse {
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export interface SnapshotResponse {
|
||||
id: string
|
||||
config_text: string
|
||||
sha256_hash: string
|
||||
collected_at: string
|
||||
}
|
||||
|
||||
export const configHistoryApi = {
|
||||
list: (tenantId: string, deviceId: string, limit = 50, offset = 0) =>
|
||||
api
|
||||
@@ -1006,6 +1013,13 @@ export const configHistoryApi = {
|
||||
`/api/tenants/${tenantId}/devices/${deviceId}/config/${snapshotId}/diff`,
|
||||
)
|
||||
.then((r) => r.data),
|
||||
|
||||
getSnapshot: (tenantId: string, deviceId: string, snapshotId: string) =>
|
||||
api
|
||||
.get<SnapshotResponse>(
|
||||
`/api/tenants/${tenantId}/devices/${deviceId}/config/${snapshotId}`,
|
||||
)
|
||||
.then((r) => r.data),
|
||||
}
|
||||
|
||||
// ─── VPN (WireGuard) ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user