prettier
All checks were successful
Build / build (pull_request) Successful in 49s

This commit is contained in:
Sainan 2025-06-27 00:42:56 +02:00
parent a83a3efc79
commit 1cf5795aee

View File

@ -1898,34 +1898,36 @@ single.getRoute("/webui/cheats").on("beforeload", function () {
url: "/custom/getConfig?" + window.authz,
contentType: "application/json",
data: JSON.stringify(uiConfigs)
}).done(json => {
//window.is_admin = true;
$(".config-admin-hide").addClass("d-none");
$(".config-admin-show").removeClass("d-none");
Object.entries(json).forEach(entry => {
const [key, value] = entry;
var x = document.getElementById(`${key}`);
if (x != null) {
if (x.type == "checkbox") {
x.checked = value;
} else if (x.type == "number") {
x.setAttribute("value", `${value}`);
}
}
});
}).fail(res => {
if (res.responseText == "Log-in expired") {
revalidateAuthz().then(() => {
if (single.getCurrentPath() == "/webui/cheats") {
single.loadRoute("/webui/cheats");
})
.done(json => {
//window.is_admin = true;
$(".config-admin-hide").addClass("d-none");
$(".config-admin-show").removeClass("d-none");
Object.entries(json).forEach(entry => {
const [key, value] = entry;
var x = document.getElementById(`${key}`);
if (x != null) {
if (x.type == "checkbox") {
x.checked = value;
} else if (x.type == "number") {
x.setAttribute("value", `${value}`);
}
}
});
} else {
//window.is_admin = false;
$(".config-admin-hide").removeClass("d-none");
$(".config-admin-show").addClass("d-none");
}
});
})
.fail(res => {
if (res.responseText == "Log-in expired") {
revalidateAuthz().then(() => {
if (single.getCurrentPath() == "/webui/cheats") {
single.loadRoute("/webui/cheats");
}
});
} else {
//window.is_admin = false;
$(".config-admin-hide").removeClass("d-none");
$(".config-admin-show").addClass("d-none");
}
});
}
}, 10);
});