feat: 支持 docker 菜单栏展示监控任务
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user