diff --git a/packages/pm/daemon.js b/packages/pm/daemon.js index 0f8aab8..2278bd7 100644 --- a/packages/pm/daemon.js +++ b/packages/pm/daemon.js @@ -162,10 +162,10 @@ function handleMessage(socket, message) { timestamp: Date.now() }); - // 如果是心跳,更新最后心跳时间 - if (message.type === 'worker-heartbeat') { - workerInfo.lastHeartbeat = Date.now(); - } + // // 如果是心跳,更新最后心跳时间 + // if (message.type === 'worker-heartbeat') { + // workerInfo.lastHeartbeat = Date.now(); + // } } else { sendResponse(socket, _callbackUuid, { error: '未注册的工具进程连接' }); } @@ -328,9 +328,10 @@ function startWorker({ workerId, command, args, env }, restartCount = 0) { status: 'running', startTime: Date.now(), restartCount, // 使用传入的重启次数 - socket: null, // 工具进程的TCP连接,稍后由工具进程注册 - lastHeartbeat: null, + // socket: null, // 工具进程的TCP连接,稍后由工具进程注册 + // lastHeartbeat: null, command, + args, env, workerId, } @@ -388,8 +389,11 @@ function getWorkersStatus() { status: workerInfo.status, uptime: Date.now() - workerInfo.startTime, restartCount: workerInfo.restartCount || 0, - connected: workerInfo.socket !== null && !workerInfo.socket.destroyed, - lastHeartbeat: workerInfo.lastHeartbeat + // connected: workerInfo.socket !== null && !workerInfo.socket.destroyed, + // lastHeartbeat: workerInfo.lastHeartbeat, + command: workerInfo.command, + args: workerInfo.args, + pid: workerInfo.process?.pid }); } return status; diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/connect-to-daemon.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/connect-to-daemon.ts index c62e076..7fbdc79 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/connect-to-daemon.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/connect-to-daemon.ts @@ -129,16 +129,6 @@ export function sendToDaemon(message, { // sendToDaemon({ type: 'start-worker', workerId, command, args, env }); // }); -// // IPC处理:停止工具进程 -// ipcMain.on('stop-worker', (event, workerId) => { -// sendToDaemon({ type: 'stop-worker', workerId }); -// }); - -// // IPC处理:获取所有工具进程状态 -// ipcMain.on('get-workers-status', () => { -// sendToDaemon({ type: 'get-status' }); -// }); - app.on('window-all-closed', () => { if (daemonClient) { daemonClient.destroy(); @@ -149,4 +139,4 @@ app.on('before-quit', () => { if (daemonClient) { daemonClient.destroy(); } -}); \ No newline at end of file +}); diff --git a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts index 0b150f0..1c85fb2 100644 --- a/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts +++ b/packages/ui/src/main/flow/OPEN_SETTING_WINDOW/ipc/index.ts @@ -423,6 +423,31 @@ export default function initIpc() { mainWindow?.webContents.send('read-no-reply-auto-reminder-stopped') }) + ipcMain.handle('get-task-manager-list', async () => { + const result = await sendToDaemon( + { + type: 'get-status' + }, + { + needCallback: true + } + ) + return result + }) + + // IPC处理:停止工具进程 + ipcMain.handle('stop-task', async (_, workerId) => { + await sendToDaemon( + { + type: 'stop-worker', + workerId + }, + { + needCallback: true + } + ) + }) + let subProcessOfBossZhipinLoginPageWithPreloadExtension: ChildProcess | null = null ipcMain.on('launch-bosszhipin-login-page-with-preload-extension', async () => { try { diff --git a/packages/ui/src/renderer/src/features/TaskManager/Item.vue b/packages/ui/src/renderer/src/features/TaskManager/Item.vue new file mode 100644 index 0000000..9f0650e --- /dev/null +++ b/packages/ui/src/renderer/src/features/TaskManager/Item.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/packages/ui/src/renderer/src/features/TaskManager/List.vue b/packages/ui/src/renderer/src/features/TaskManager/List.vue new file mode 100644 index 0000000..349596a --- /dev/null +++ b/packages/ui/src/renderer/src/features/TaskManager/List.vue @@ -0,0 +1,18 @@ + + + diff --git a/packages/ui/src/renderer/src/page/GeekAutoStartChatWithBoss/index.vue b/packages/ui/src/renderer/src/page/GeekAutoStartChatWithBoss/index.vue index 180089d..1e855bb 100644 --- a/packages/ui/src/renderer/src/page/GeekAutoStartChatWithBoss/index.vue +++ b/packages/ui/src/renderer/src/page/GeekAutoStartChatWithBoss/index.vue @@ -1,53 +1,29 @@ diff --git a/packages/ui/src/renderer/src/page/MainLayout/GeekAutoStartChatWithBoss/index.vue b/packages/ui/src/renderer/src/page/MainLayout/GeekAutoStartChatWithBoss/index.vue index 60e5f8e..b305cbe 100644 --- a/packages/ui/src/renderer/src/page/MainLayout/GeekAutoStartChatWithBoss/index.vue +++ b/packages/ui/src/renderer/src/page/MainLayout/GeekAutoStartChatWithBoss/index.vue @@ -1049,12 +1049,15 @@ 仅保存配置 保存配置,并开始求职! +
+ 结束任务 +