feat: CLI SUBSCRIBE/MONITOR streaming mode

- New pubsub.ts: startSubscribe/stopSubscribe/startMonitor/stopMonitor
- IPC: redis:subscribe, redis:unsubscribe, redis:monitor, redis:monitorStop
- Streaming messages pushed via webContents.send
- Preload: onSubscribeMessage/onMonitorMessage callbacks
- CliView: detect SUBSCRIBE/PSUBSCRIBE/MONITOR, switch to streaming mode
- Stop button with pulsing indicator (green=subscribe, yellow=monitor)
- Real-time message display with timestamps
- Auto-cleanup on unmount
- i18n keys (zh-CN + en)
This commit is contained in:
2026-07-07 21:07:57 +08:00
parent 742c62517c
commit c7e47c4d5b
9 changed files with 280 additions and 28 deletions
+6
View File
@@ -104,6 +104,12 @@ export interface ElectronAPI {
isConnected: (id: string) => Promise<boolean>
getCommandLog: () => Promise<any[]>
clearCommandLog: () => Promise<void>
subscribe: (id: string, channels: string[], isPattern: boolean) => Promise<{ success: boolean; error?: string }>
unsubscribe: (id: string) => Promise<void>
onSubscribeMessage: (callback: (msg: any) => void) => void
monitor: (id: string) => Promise<{ success: boolean; error?: string }>
monitorStop: (id: string) => Promise<void>
onMonitorMessage: (callback: (msg: any) => void) => void
}
updater: {
check: () => Promise<{ available: boolean; version?: string }>