Implemented shutdown through UI and implemented router check

This commit is contained in:
2025-11-28 10:23:57 +01:00
parent 368f60d7b6
commit b2c5d08ff4
29 changed files with 639 additions and 71 deletions

View File

@@ -6,6 +6,7 @@ import { Main } from '../Main';
import { DashboardRouter } from './DashboardRouter';
import { join } from 'path';
import { CalibrationRouter } from './CalibrationRouter';
import { delay } from '../Utils';
const PREFIX = '[WebServer]';
export class WebServer {
@@ -74,6 +75,20 @@ export class WebServer {
callback({ succeed: true });
}
);
socket.on(
'shutdownInstallation',
async (
callback: (response: {
succeed: boolean;
message?: string;
}) => void
) => {
await delay(1000);
callback({ succeed: true });
this._Main.shutdown();
}
);
socket.on('cameraRunner', (command: string, ...args: any[]) =>
this._Main.CameraRunner.handle(command, ...args)
);