feat: added admin password and admin modal

This commit is contained in:
Davide Passoni
2025-03-10 17:16:02 +01:00
parent 9a7af84cd4
commit 386d5298a2
16 changed files with 645 additions and 61 deletions

View File

@@ -475,7 +475,7 @@ class Manager {
}
async onGameMasterPasswordChanged(value) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password']")) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password'].unique")) {
input.placeholder = "";
}
@@ -486,7 +486,7 @@ class Manager {
}
async onBlueCommanderPasswordChanged(value) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password']")) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password'].unique")) {
input.placeholder = "";
}
@@ -497,7 +497,7 @@ class Manager {
}
async onRedCommanderPasswordChanged(value) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password']")) {
for (let input of this.activePage.getElement().querySelectorAll("input[type='password'].unique")) {
input.placeholder = "";
}
@@ -507,6 +507,13 @@ class Manager {
showErrorPopup(`<div class='main-message'>A critical error occurred! </div><div class='sub-message'> Check ${this.getLogLocation()} for more info. </div>`);
}
async onAdminPasswordChanged(value) {
if (this.getActiveInstance())
this.getActiveInstance().setAdminPassword(value);
else
showErrorPopup(`<div class='main-message'>A critical error occurred! </div><div class='sub-message'> Check ${this.getLogLocation()} for more info. </div>`);
}
/* When the frontend port input value is changed */
async onFrontendPortChanged(value) {
this.setPort('frontend', Number(value));