修改系统内更新系统逻辑

This commit is contained in:
whyour
2023-07-13 22:09:45 +08:00
parent 936b565fb1
commit 8affff96f3
6 changed files with 125 additions and 31 deletions
+28 -1
View File
@@ -154,7 +154,7 @@ export default class SystemService {
}
public async updateSystem() {
const cp = spawn('ql -l update', { shell: '/bin/bash' });
const cp = spawn('ql -l update false', { shell: '/bin/bash' });
cp.stdout.on('data', (data) => {
this.sockService.sendMessage({
@@ -180,6 +180,33 @@ export default class SystemService {
return { code: 200 };
}
public async reloadSystem() {
const cp = spawn('ql -l reload', { shell: '/bin/bash' });
cp.stdout.on('data', (data) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: data.toString(),
});
});
cp.stderr.on('data', (data) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: data.toString(),
});
});
cp.on('error', (err) => {
this.sockService.sendMessage({
type: 'reloadSystem',
message: JSON.stringify(err),
});
});
return { code: 200 };
}
public async notify({ title, content }: { title: string; content: string }) {
const isSuccess = await this.notificationService.notify(title, content);
if (isSuccess) {