返回提交历史
Modified
static/webui/script.js
+3
-3
XFEstudio/XFESpaceNinjaServer
fix(webui): force max value on cheats input (#3677)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3677 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
4badd83f
代码差异
1 个文件
+3
-3
@@ -4068,16 +4068,16 @@ document.querySelectorAll("#account-cheats .input-group").forEach(grp => {
4068
4068
const input = btn.closest(".input-group").querySelector('input[type="number"]');
4069
4069
if (!input) return;
4070
4070
revalidateAuthz().then(() => {
4071
const value = input.value;
4071
const value = Math.min(Number(input.value), Number(input.max));
4072
4072
$.post({
4073
4073
url: "/custom/setAccountCheat?" + window.authz,
4074
4074
contentType: "application/json",
4075
4075
data: JSON.stringify({
4076
4076
key: input.id,
4077
value: parseInt(value)
4077
value: value
4078
4078
})
4079
4079
}).done(() => {
4080
btn.value = value;
4080
input.value = value;
4081
4081
});
4082
4082
});
4083
4083
};