feat: multi-format viewer (Text/Hex/JSON/Binary/Gzip/Deflate/Brotli)
- New format.ts: decodeValue + detectFormat using Node.js zlib - IPC: redis:decodeValue, redis:detectFormat - StringEditor: format selector dropdown with auto-detect - Monaco editor shows decoded value, read-only for compressed formats - Auto-detect: JSON, Gzip (1f 8b), Deflate (78 xx), non-printable → Hex - i18n keys for all formats (zh-CN + en)
This commit is contained in:
Vendored
+2
@@ -109,6 +109,8 @@ export interface ElectronAPI {
|
||||
isConnected: (id: string) => Promise<boolean>
|
||||
getCommandLog: () => Promise<any[]>
|
||||
clearCommandLog: () => Promise<void>
|
||||
decodeValue: (value: string, format: string) => Promise<string>
|
||||
detectFormat: (value: string) => Promise<string>
|
||||
subscribe: (id: string, channels: string[], isPattern: boolean) => Promise<{ success: boolean; error?: string }>
|
||||
unsubscribe: (id: string) => Promise<void>
|
||||
onSubscribeMessage: (callback: (msg: any) => void) => void
|
||||
|
||||
@@ -130,6 +130,11 @@ const electronAPI = {
|
||||
ipcRenderer.invoke('redis:getCommandLog'),
|
||||
clearCommandLog: (): Promise<void> =>
|
||||
ipcRenderer.invoke('redis:clearCommandLog'),
|
||||
// Format
|
||||
decodeValue: (value: string, format: string): Promise<string> =>
|
||||
ipcRenderer.invoke('redis:decodeValue', value, format),
|
||||
detectFormat: (value: string): Promise<string> =>
|
||||
ipcRenderer.invoke('redis:detectFormat', value),
|
||||
// Pub/Sub
|
||||
subscribe: (id: string, channels: string[], isPattern: boolean): Promise<any> =>
|
||||
ipcRenderer.invoke('redis:subscribe', id, channels, isPattern),
|
||||
|
||||
Reference in New Issue
Block a user