diff --git a/backend/src/routes/integrations.ts b/backend/src/routes/integrations.ts index 9b4f50c..a2917ec 100644 --- a/backend/src/routes/integrations.ts +++ b/backend/src/routes/integrations.ts @@ -37,6 +37,9 @@ interface IntegrationRow { } function serialize(row: IntegrationRow) { + const secretKeys = ( + db.prepare('SELECT key FROM secrets WHERE integration_id = ?').all(row.id) as { key: string }[] + ).map((r) => r.key) return { id: row.id, type: row.type, @@ -44,6 +47,7 @@ function serialize(row: IntegrationRow) { enabled: !!row.enabled, status: row.status, config: JSON.parse(row.config_json), + secretKeys, lastCheckedAt: row.last_checked_at, createdAt: row.created_at, } diff --git a/src/lib/api.ts b/src/lib/api.ts index 0fff277..798fdb4 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -185,6 +185,7 @@ export interface Integration { enabled: boolean status: string config: Record + secretKeys: string[] lastCheckedAt: string | null createdAt: string } diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx index 073ee52..7709c1d 100644 --- a/src/pages/Settings.tsx +++ b/src/pages/Settings.tsx @@ -562,15 +562,19 @@ function SshHostsSection() { const value = values[f.key] ?? savedValue if (f.file) { + const isSaved = existing?.secretKeys?.includes(f.key) return (
- +