bdcf4fe299
- Move main process to electron/main/ - Move preload to electron/preload/ - Add shared types in electron/shared/ - Split redis-service into modular redis/ directory - Flatten renderer to src/ (remove src/renderer/ nesting) - Update electron.vite.config.ts paths - Update tsconfig paths - Output to electron-dist/
56 lines
994 B
TypeScript
56 lines
994 B
TypeScript
// src/main/store.ts
|
|
import Store from 'electron-store'
|
|
|
|
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
|
|
}
|
|
|
|
interface AppSettings {
|
|
theme: 'system' | 'dark' | 'light'
|
|
locale: string
|
|
fontSize: number
|
|
scanCount: number
|
|
}
|
|
|
|
interface AppStorage {
|
|
connections: ConnectionConfig[]
|
|
settings: AppSettings
|
|
}
|
|
|
|
const store = new Store<AppStorage>({
|
|
name: 'jrdm-config',
|
|
defaults: {
|
|
connections: [],
|
|
settings: {
|
|
theme: 'system',
|
|
locale: 'en',
|
|
fontSize: 13,
|
|
scanCount: 500,
|
|
},
|
|
},
|
|
})
|
|
|
|
export default store
|
|
export type { ConnectionConfig, AppSettings }
|