feat: 支持 docker 菜单栏展示监控任务

This commit is contained in:
richarjiang
2026-07-16 11:03:32 +08:00
parent 25bca0e859
commit 9adc665ef4
12 changed files with 466 additions and 48 deletions

View File

@@ -35,10 +35,19 @@ const api: TennisBookApi = {
deleteMonitorTask: (taskId: string) =>
ipcRenderer.invoke(IPC_CHANNELS.deleteMonitorTask, taskId),
takeMonitorAlerts: () => ipcRenderer.invoke(IPC_CHANNELS.takeMonitorAlerts),
listUnreadMonitorAlerts: () =>
ipcRenderer.invoke(IPC_CHANNELS.listUnreadMonitorAlerts),
acknowledgeMonitorAlerts: (taskId?: string) =>
ipcRenderer.invoke(IPC_CHANNELS.acknowledgeMonitorAlerts, taskId),
onMonitorAlert: (listener: () => void) => {
const handler = () => listener()
ipcRenderer.on(IPC_CHANNELS.monitorAlert, handler)
return () => ipcRenderer.removeListener(IPC_CHANNELS.monitorAlert, handler)
},
onShowMonitorTask: (listener: (taskId: string) => void) => {
const handler = (_event: Electron.IpcRendererEvent, taskId: string) => listener(taskId)
ipcRenderer.on(IPC_CHANNELS.showMonitorTask, handler)
return () => ipcRenderer.removeListener(IPC_CHANNELS.showMonitorTask, handler)
}
}