Added start/stop control to Unity process

This commit is contained in:
2025-12-01 09:42:20 +01:00
parent b2c5d08ff4
commit 7df210aaf2
13 changed files with 203 additions and 103 deletions

View File

@@ -45,6 +45,8 @@ var DashboardUnity = /** @class */ (function () {
this.processStatus = document.querySelector('.ntsh_dashboard-unity-processstatus');
this.processInfo = document.querySelector('.ntsh_dashboard-unity-processinfo');
this.restartButton = document.querySelector('.ntsh_dashboard-unity-restart');
this.startButton = document.querySelector('.ntsh_dashboard-unity-start');
this.stopButton = document.querySelector('.ntsh_dashboard-unity-stop');
this.uptimeInfo = document.querySelector('.ntsh_dashboard-unity-uptime');
this.webSocketStatus = document.querySelector('.ntsh_dashboard-unity-websocketstatus');
this.webSocketInfo = document.querySelector('.ntsh_dashboard-unity-websocketinfo');
@@ -73,10 +75,14 @@ var DashboardUnity = /** @class */ (function () {
if (state.state != 'RUNNING') {
state.startTime = -1;
this.restartButton.style.display = 'none';
this.stopButton.style.display = 'none';
}
else {
this.restartButton.style.display = 'flex';
this.stopButton.style.display = 'flex';
}
this.startButton.style.display =
state.state == 'STOPPED' ? 'flex' : 'none';
(0, utils_1.setStatusState)(this.processStatus, {
RUNNING: 'green',
STOPPED: 'gray',
@@ -356,6 +362,18 @@ var DashboardUnity = /** @class */ (function () {
return [2 /*return*/];
});
}); });
this.startButton.addEventListener('click', function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.executeCommand('start', 'Are you sure you want to start the Unity Runner process?');
return [2 /*return*/];
});
}); });
this.stopButton.addEventListener('click', function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.executeCommand('stop', 'Are you sure you want to stop the Unity Runner process?');
return [2 /*return*/];
});
}); });
this.enableOutOfServiceButton.addEventListener('click', function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.executeCommand('enableOutOfService', 'Are you sure you want to set the installation to "Out of Service"?', 'unityWebSocket');

File diff suppressed because one or more lines are too long

View File

@@ -73,21 +73,18 @@ var MenuBar = /** @class */ (function () {
});
}); },
},
{
type: 'icon',
text: 'Shutdown',
materialIcon: 'power_settings_new',
uniqueIdentifier: 'shutdown_installation',
click: function () { return __awaiter(_this, void 0, void 0, function () {
var mobileMenu;
return __generator(this, function (_a) {
mobileMenu = document.querySelector('.mux_mobilemenu');
mobileMenu === null || mobileMenu === void 0 ? void 0 : mobileMenu.click();
this.shutdownInstallation();
return [2 /*return*/];
});
}); },
},
// {
// type: 'icon',
// text: 'Shutdown',
// materialIcon: 'power_settings_new',
// uniqueIdentifier: 'shutdown_installation',
// click: async () => {
// const mobileMenu: HTMLDivElement =
// document.querySelector('.mux_mobilemenu');
// mobileMenu?.click();
// this.shutdownInstallation();
// },
// },
],
right: [
{
@@ -115,21 +112,18 @@ var MenuBar = /** @class */ (function () {
});
}); },
},
{
type: 'normal',
text: 'Shutdown',
materialIcon: 'power_settings_new',
uniqueIdentifier: 'shutdown_installation',
click: function () { return __awaiter(_this, void 0, void 0, function () {
var mobileMenu;
return __generator(this, function (_a) {
mobileMenu = document.querySelector('.mux_mobilemenu');
mobileMenu === null || mobileMenu === void 0 ? void 0 : mobileMenu.click();
this.shutdownInstallation();
return [2 /*return*/];
});
}); },
},
// {
// type: 'normal',
// text: 'Shutdown',
// materialIcon: 'power_settings_new',
// uniqueIdentifier: 'shutdown_installation',
// click: async () => {
// const mobileMenu: HTMLDivElement =
// document.querySelector('.mux_mobilemenu');
// mobileMenu?.click();
// this.shutdownInstallation();
// },
// },
{
type: 'normal',
text: 'Dashboard',

File diff suppressed because one or more lines are too long