2026-07-29 13:47:45 +00:00
|
|
|
// Connection configuration types
|
|
|
|
|
|
2026-07-29 18:27:27 +00:00
|
|
|
export type AuthMode = 'password' | 'token'
|
|
|
|
|
|
2026-07-29 13:47:45 +00:00
|
|
|
export interface ConnectionConfig {
|
|
|
|
|
id: string
|
|
|
|
|
name: string
|
|
|
|
|
primary: EndpointConfig
|
|
|
|
|
fallbacks: EndpointConfig[]
|
|
|
|
|
certFingerprint?: string
|
|
|
|
|
trusted: boolean
|
|
|
|
|
status: ConnectionStatus
|
|
|
|
|
clusterName?: string
|
|
|
|
|
isCluster: boolean
|
2026-07-29 18:27:27 +00:00
|
|
|
authMode: AuthMode
|
|
|
|
|
username?: string
|
2026-07-29 13:47:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface EndpointConfig {
|
|
|
|
|
url: string // e.g., "https://192.168.1.10:8006"
|
|
|
|
|
node?: string // Node name (for display)
|
|
|
|
|
token?: string // API token (stored in keyring, not in config)
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-29 18:27:27 +00:00
|
|
|
export type ConnectionStatus =
|
2026-07-29 13:47:45 +00:00
|
|
|
| 'disconnected'
|
|
|
|
|
| 'connecting'
|
|
|
|
|
| 'connected'
|
|
|
|
|
| 'failed'
|
|
|
|
|
| 'failover'
|
|
|
|
|
|
|
|
|
|
export interface CertificateInfo {
|
|
|
|
|
fingerprint: string
|
|
|
|
|
issuer: string
|
|
|
|
|
subject: string
|
|
|
|
|
validFrom: string
|
|
|
|
|
validTo: string
|
|
|
|
|
selfSigned: boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConnectionCredentials {
|
|
|
|
|
connectionId: string
|
|
|
|
|
apiToken: string
|
|
|
|
|
}
|
2026-07-29 18:27:27 +00:00
|
|
|
|
|
|
|
|
export interface LoginResult {
|
|
|
|
|
connectionId: string
|
|
|
|
|
ticket: string
|
|
|
|
|
csrfToken: string
|
|
|
|
|
}
|