feat: custom formatter support
- format.ts: customFormat() uses child_process.execFile
- Template params: {KEY} {VALUE} {HEX_FILE}
- Value written to temp file, path passed via {HEX_FILE}
- 10s timeout, error handling
- StringEditor: 'custom' format option + command input
- Command persisted to localStorage
- i18n keys (zh-CN + en)
This commit is contained in:
Vendored
+1
@@ -111,6 +111,7 @@ export interface ElectronAPI {
|
||||
clearCommandLog: () => Promise<void>
|
||||
decodeValue: (value: string, format: string) => Promise<string>
|
||||
detectFormat: (value: string) => Promise<string>
|
||||
customFormat: (value: string, command: string, key: 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
|
||||
|
||||
@@ -135,6 +135,8 @@ const electronAPI = {
|
||||
ipcRenderer.invoke('redis:decodeValue', value, format),
|
||||
detectFormat: (value: string): Promise<string> =>
|
||||
ipcRenderer.invoke('redis:detectFormat', value),
|
||||
customFormat: (value: string, command: string, key: string): Promise<string> =>
|
||||
ipcRenderer.invoke('redis:customFormat', value, command, key),
|
||||
// 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