feat(phase3): key browser MVP
- useKeyStore (Pinia): scan, tree view, key data cache, db switching - KeyBrowser: split pane with KeyList + KeyDetail - KeyList: SCAN pagination, filter, tree toggle, load more - KeyDetail: type badge, TTL display, delete, type-based editor dispatch - StringEditor: view/edit with JSON auto-format - HashEditor: field table, add/edit/delete fields - StatusView: INFO dashboard with stat cards + section grid - MainArea: tab host (Status / Keys) - RedisService: selectDb, dbSize - Preload: selectDb, dbSize IPC channels - App.vue updated with MainArea layout
This commit is contained in:
@@ -115,4 +115,10 @@ export function registerIpcHandlers(): void {
|
||||
ipcMain.handle('redis:setTTL', async (_e, id: string, key: string, ttl: number) => {
|
||||
await redisService.setKeyTTL(id, key, ttl)
|
||||
})
|
||||
ipcMain.handle('redis:selectDb', async (_e, id: string, db: number) => {
|
||||
await redisService.selectDb(id, db)
|
||||
})
|
||||
ipcMain.handle('redis:dbSize', async (_e, id: string) => {
|
||||
return redisService.dbSize(id)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -164,3 +164,15 @@ export async function setKeyTTL(id: string, key: string, ttl: number): Promise<v
|
||||
await client.expire(key, ttl)
|
||||
}
|
||||
}
|
||||
|
||||
export async function selectDb(id: string, db: number): Promise<void> {
|
||||
const client = clients.get(id)
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
await client.select(db)
|
||||
}
|
||||
|
||||
export async function dbSize(id: string): Promise<number> {
|
||||
const client = clients.get(id)
|
||||
if (!client) throw new Error(`Client ${id} not found`)
|
||||
return client.dbsize() as Promise<number>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user