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

@@ -14479,21 +14479,18 @@
});
}); },
},
{
type: 'icon',
text: 'Shutdown',
materialIcon: 'power_settings_new',
uniqueIdentifier: 'shutdown_installation',
click: function () { return __awaiter$4(_this, void 0, void 0, function () {
var mobileMenu;
return __generator$4(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: [
{
@@ -14521,21 +14518,18 @@
});
}); },
},
{
type: 'normal',
text: 'Shutdown',
materialIcon: 'power_settings_new',
uniqueIdentifier: 'shutdown_installation',
click: function () { return __awaiter$4(_this, void 0, void 0, function () {
var mobileMenu;
return __generator$4(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',
@@ -15732,6 +15726,8 @@
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');
@@ -15760,10 +15756,14 @@
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',
@@ -16043,6 +16043,18 @@
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');