feat(phase7): pattern search, health check, keyboard shortcuts
- KeyList: pattern input for Redis MATCH, local filter, Go button - ConnectionStore: health check interval (5s ping), healthOk state - StatusBar: health indicator (unstable = yellow pulse) - RedisService: ping, isConnected methods - Sidebar: Delete key (Del), deselect (Esc), refresh (F5) - useKeyboard: expanded shortcut map
This commit is contained in:
@@ -207,4 +207,10 @@ export function registerIpcHandlers(): void {
|
||||
ipcMain.handle('redis:existsKey', async (_e, id: string, key: string) => {
|
||||
return redisService.existsKey(id, key)
|
||||
})
|
||||
ipcMain.handle('redis:ping', async (_e, id: string) => {
|
||||
return redisService.ping(id)
|
||||
})
|
||||
ipcMain.handle('redis:isConnected', (_e, id: string) => {
|
||||
return redisService.isConnected(id)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -337,3 +337,14 @@ export async function existsKey(id: string, key: string): Promise<boolean> {
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
return (await client.exists(key)) === 1
|
||||
}
|
||||
|
||||
export async function ping(id: string): Promise<string> {
|
||||
const client = clients.get(id)
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
return client.ping()
|
||||
}
|
||||
|
||||
export function isConnected(id: string): boolean {
|
||||
const client = clients.get(id)
|
||||
return client?.status === 'ready'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user