272eb6b3af
- useKeyStore (Pinia): scan, tree view, key data cache, db switching - KeyBrowser: split pane with KeyList + KeyDetail - KeyList: SCAN pagination, filter, tree toggle, load more - KeyDetail: type badge, TTL display, delete, type-based editor dispatch - StringEditor: view/edit with JSON auto-format - HashEditor: field table, add/edit/delete fields - StatusView: INFO dashboard with stat cards + section grid - MainArea: tab host (Status / Keys) - RedisService: selectDb, dbSize - Preload: selectDb, dbSize IPC channels - App.vue updated with MainArea layout
81 lines
2.6 KiB
TypeScript
81 lines
2.6 KiB
TypeScript
// src/preload/index.d.ts
|
|
export interface ConnectionConfig {
|
|
id: string
|
|
name: string
|
|
host: string
|
|
port: number
|
|
auth: string
|
|
username: string
|
|
tls: boolean
|
|
tlsCaPath: string
|
|
tlsCertPath: string
|
|
tlsKeyPath: string
|
|
sshEnabled: boolean
|
|
sshHost: string
|
|
sshPort: number
|
|
sshUsername: string
|
|
sshPassword: string
|
|
sshPrivateKeyPath: string
|
|
cluster: boolean
|
|
sentinelMasterName: string
|
|
separator: string
|
|
order: number
|
|
createdAt: number
|
|
color?: string
|
|
}
|
|
|
|
export interface ElectronAPI {
|
|
window: {
|
|
minimize: () => void
|
|
maximize: () => void
|
|
close: () => void
|
|
}
|
|
theme: {
|
|
get: () => Promise<boolean>
|
|
set: (theme: 'system' | 'dark' | 'light') => void
|
|
onOsUpdated: (callback: (isDark: boolean) => void) => void
|
|
}
|
|
dialog: {
|
|
openFile: (options: { title?: string; filters?: { name: string; extensions: string[] }[] }) =>
|
|
Promise<{ path: string; content: string } | null>
|
|
}
|
|
credential: {
|
|
encrypt: (text: string) => Promise<string>
|
|
decrypt: (encoded: string) => Promise<string>
|
|
}
|
|
storage: {
|
|
getConnections: () => Promise<ConnectionConfig[]>
|
|
saveConnection: (conn: ConnectionConfig) => Promise<ConnectionConfig[]>
|
|
deleteConnection: (id: string) => Promise<ConnectionConfig[]>
|
|
reorderConnections: (ids: string[]) => Promise<ConnectionConfig[]>
|
|
getSettings: () => Promise<any>
|
|
saveSettings: (settings: any) => Promise<void>
|
|
}
|
|
redis: {
|
|
connect: (id: string, opts: any) => Promise<{ success: boolean; error?: string }>
|
|
disconnect: (id: string) => Promise<void>
|
|
execute: (id: string, command: string, args: string[]) => Promise<any>
|
|
getInfo: (id: string) => Promise<string>
|
|
scanKeys: (id: string, cursor: string, pattern: string, count: number) =>
|
|
Promise<{ cursor: string; keys: string[] }>
|
|
getKeyType: (id: string, key: string) => Promise<string>
|
|
getKeyTTL: (id: string, key: string) => Promise<number>
|
|
getString: (id: string, key: string) => Promise<string | null>
|
|
setString: (id: string, key: string, value: string) => Promise<void>
|
|
deleteKey: (id: string, key: string) => Promise<void>
|
|
hashScan: (id: string, key: string, cursor: string, count: number) =>
|
|
Promise<{ cursor: string; fields: [string, string][] }>
|
|
hashSet: (id: string, key: string, field: string, value: string) => Promise<void>
|
|
hashDel: (id: string, key: string, field: string) => Promise<void>
|
|
setTTL: (id: string, key: string, ttl: number) => Promise<void>
|
|
selectDb: (id: string, db: number) => Promise<void>
|
|
dbSize: (id: string) => Promise<number>
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
electronAPI: ElectronAPI
|
|
}
|
|
}
|