feat: Sentinel mode support

- NewConnectionDialog: sentinel toggle + host/port/masterName/nodePassword form
- connection.ts: use ioredis sentinels config when sentinelEnabled
- Add sentinelEnabled/sentinelHost/sentinelPort/sentinelNodePassword to all types
- i18n keys for all sentinel fields (zh-CN + en)
This commit is contained in:
2026-07-05 16:43:52 +08:00
parent 1686af1a79
commit e46d6a80be
8 changed files with 133 additions and 2 deletions
+17 -1
View File
@@ -22,7 +22,11 @@ export interface ConnectionConfig {
sshPrivateKeyPath: string
sshPassphrase: string
cluster: boolean
sentinelEnabled: boolean
sentinelHost: string
sentinelPort: number
sentinelMasterName: string
sentinelNodePassword: string
separator: string
order: number
createdAt: number
@@ -88,6 +92,11 @@ export const useConnectionStore = defineStore('connection', () => {
tlsCertPath: conn.tlsCertPath,
tlsKeyPath: conn.tlsKeyPath,
tlsRejectUnauthorized: conn.tlsRejectUnauthorized,
sentinelEnabled: conn.sentinelEnabled,
sentinelHost: conn.sentinelHost,
sentinelPort: conn.sentinelPort,
sentinelMasterName: conn.sentinelMasterName,
sentinelNodePassword: conn.sentinelNodePassword,
sshEnabled: conn.sshEnabled,
sshHost: conn.sshHost,
sshPort: conn.sshPort,
@@ -156,7 +165,9 @@ export const useConnectionStore = defineStore('connection', () => {
async function testConnection(opts: {
host: string; port: number; auth?: string; username?: string; tls?: boolean
tlsCaPath?: string; tlsCertPath?: string; tlsKeyPath?: string
tlsCaPath?: string; tlsCertPath?: string; tlsKeyPath?: string; tlsRejectUnauthorized?: boolean
sentinelEnabled?: boolean; sentinelHost?: string; sentinelPort?: number
sentinelMasterName?: string; sentinelNodePassword?: string
sshEnabled?: boolean; sshHost?: string; sshPort?: number; sshUsername?: string
sshPassword?: string; sshPrivateKeyPath?: string; sshPassphrase?: string
}): Promise<{ success: boolean; error?: string }> {
@@ -175,6 +186,11 @@ export const useConnectionStore = defineStore('connection', () => {
tlsCertPath: opts.tlsCertPath,
tlsKeyPath: opts.tlsKeyPath,
tlsRejectUnauthorized: (opts as any).tlsRejectUnauthorized,
sentinelEnabled: opts.sentinelEnabled,
sentinelHost: opts.sentinelHost,
sentinelPort: opts.sentinelPort,
sentinelMasterName: opts.sentinelMasterName,
sentinelNodePassword: opts.sentinelNodePassword,
sshEnabled: opts.sshEnabled,
sshHost: opts.sshHost,
sshPort: opts.sshPort,