refactor: 迁移至 electron-vite 官方推荐目录结构
- electron/* -> src/main/* (主进程) - electron/preload.ts -> src/preload/index.ts (预加载) - src/electron-api.d.ts -> src/preload/index.d.ts (类型声明) - src/* -> src/renderer/src/* (渲染进程) - src/index.html -> src/renderer/index.html - electron.vite.config.ts 简化为自动入口检测 (零配置) - tsconfig.app.json -> tsconfig.web.json, 更新 includes/paths - 构建产物 dist-electron/ -> out/ (修复 main/preload 输出覆盖 bug) - 更新 package.json main 字段 + electron-builder files - 更新 .gitignore + eslint ignores - 更新 AGENTS.md 架构文档
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
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 }
|
||||
Reference in New Issue
Block a user