157af4399f
- 恢复 IPC 类型声明 (src/electron-api.d.ts),修复 31 个 TS2339 错误 - 修复构建断裂:vite.config.ts 改回 electron.vite.config.ts - 修复 2 个 verbatimModuleSyntax type-import 报错 - 修正 .gitignore 构建产物路径 (electron-dist/ -> dist-electron/ + release/) - 清理 55+ 处过时路径注释 - 更新 AGENTS.md 架构文档与 IPC 通道表 - 修正 docs/ROADMAP.md 过时引用
61 lines
1.1 KiB
TypeScript
61 lines
1.1 KiB
TypeScript
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
|
|
tlsRejectUnauthorized: boolean
|
|
sshEnabled: boolean
|
|
sshHost: string
|
|
sshPort: number
|
|
sshUsername: string
|
|
sshPassword: string
|
|
sshPrivateKeyPath: string
|
|
sshPassphrase: string
|
|
cluster: boolean
|
|
sentinelEnabled: boolean
|
|
sentinelHost: string
|
|
sentinelPort: number
|
|
sentinelMasterName: string
|
|
sentinelNodePassword: 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 }
|