修改获取切换 node 和 linux 源日志

This commit is contained in:
whyour
2023-11-30 23:39:14 +08:00
parent c6a25e5359
commit 5afec03548
6 changed files with 51 additions and 25 deletions
+3 -1
View File
@@ -17,4 +17,6 @@ export type SockMessageType =
| 'updateSystemVersion'
| 'manuallyRunScript'
| 'runSubscriptionEnd'
| 'reloadSystem';
| 'reloadSystem'
| 'updateNodeMirror'
| 'updateLinuxMirror';
+16 -8
View File
@@ -142,15 +142,19 @@ export default class SystemService {
{
onStart: async (cp) => {
res.setHeader('QL-Task-Pid', `${cp.pid}`);
},
onEnd: async () => {
res.end();
},
onEnd: async () => {
this.sockService.sendMessage({
type: 'updateNodeMirror',
message: 'update node mirror end',
});
},
onError: async (message: string) => {
res.write(`\n${message}`);
this.sockService.sendMessage({ type: 'updateNodeMirror', message });
},
onLog: async (message: string) => {
res.write(`\n${message}`);
this.sockService.sendMessage({ type: 'updateNodeMirror', message });
},
},
{
@@ -192,15 +196,19 @@ export default class SystemService {
{
onStart: async (cp) => {
res.setHeader('QL-Task-Pid', `${cp.pid}`);
},
onEnd: async () => {
res.end();
},
onEnd: async () => {
this.sockService.sendMessage({
type: 'updateLinuxMirror',
message: 'update linux mirror end',
});
},
onError: async (message: string) => {
res.write(`\n${message}`);
this.sockService.sendMessage({ type: 'updateLinuxMirror', message });
},
onLog: async (message: string) => {
res.write(`\n${message}`);
this.sockService.sendMessage({ type: 'updateLinuxMirror', message });
},
},
{