This commit is contained in:
parent
a83a3efc79
commit
1cf5795aee
@ -1898,34 +1898,36 @@ single.getRoute("/webui/cheats").on("beforeload", function () {
|
|||||||
url: "/custom/getConfig?" + window.authz,
|
url: "/custom/getConfig?" + window.authz,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify(uiConfigs)
|
data: JSON.stringify(uiConfigs)
|
||||||
}).done(json => {
|
})
|
||||||
//window.is_admin = true;
|
.done(json => {
|
||||||
$(".config-admin-hide").addClass("d-none");
|
//window.is_admin = true;
|
||||||
$(".config-admin-show").removeClass("d-none");
|
$(".config-admin-hide").addClass("d-none");
|
||||||
Object.entries(json).forEach(entry => {
|
$(".config-admin-show").removeClass("d-none");
|
||||||
const [key, value] = entry;
|
Object.entries(json).forEach(entry => {
|
||||||
var x = document.getElementById(`${key}`);
|
const [key, value] = entry;
|
||||||
if (x != null) {
|
var x = document.getElementById(`${key}`);
|
||||||
if (x.type == "checkbox") {
|
if (x != null) {
|
||||||
x.checked = value;
|
if (x.type == "checkbox") {
|
||||||
} else if (x.type == "number") {
|
x.checked = value;
|
||||||
x.setAttribute("value", `${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");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
})
|
||||||
//window.is_admin = false;
|
.fail(res => {
|
||||||
$(".config-admin-hide").removeClass("d-none");
|
if (res.responseText == "Log-in expired") {
|
||||||
$(".config-admin-show").addClass("d-none");
|
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);
|
}, 10);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user