Added basic control panel

This commit is contained in:
2026-03-11 16:46:06 +01:00
parent 7df210aaf2
commit c4eedfff1e
105 changed files with 21923 additions and 958 deletions

View File

@@ -0,0 +1,29 @@
import { MorphComponent } from 'morphux';
import { Main } from './main';
export class OutOfServiceMode {
private _Main: Main;
state: boolean = false;
input: HTMLInputElement = document.querySelector(
'.ntsh-outofservicemode-input',
);
constructor(Main: Main) {
this._Main = Main;
this.registerListeners();
}
private registerListeners() {
this.input.addEventListener('change', async () => {
const valid = await this._Main.executeCommand(
this.state ? 'disableOutOfService' : 'enableOutOfService',
`Are you sure you want to set the installation to "${this.state ? 'Out of Service' : 'Operational'}"?`,
'unityWebSocket',
);
if (!valid) this.input.checked = this.state;
this.state = this.input.checked;
});
}
}