added default ip, regex for version names

This commit is contained in:
FinnHornhoover 2023-11-12 15:38:33 +03:00
parent 0201f11333
commit 1c2cf41e97
2 changed files with 4 additions and 6 deletions

View File

@ -196,8 +196,7 @@ function validateVersionSave(modalName) {
if (
matchingVersions.length > allowedMatches ||
nameInput.value.length < parseInt(nameInput.getAttribute("minlength")) ||
nameInput.value.length > parseInt(nameInput.getAttribute("maxlength"))
!(new RegExp(nameInput.getAttribute("pattern"))).test(nameInput.value)
) {
nameInput.classList.add("invalidinput");
valid = false;

View File

@ -266,6 +266,7 @@
type="text"
id="addserver-ipinput"
placeholder="127.0.0.1:23000"
value="127.0.0.1:23000"
required=""
pattern="^([-a-zA-Z0-9]+\.)+[-a-zA-Z0-9]+:[0-9]+$"
oninput="validateServerSave('add')"
@ -588,8 +589,7 @@
id="addversion-nameinput"
placeholder="custom-build-000"
required=""
minlength="1"
maxlength="70"
pattern="^[-a-zA-Z0-9_]{1,70}$"
oninput="validateVersionSave('add')"
/><label for="addversion-urlinput"
>Version URL</label
@ -655,8 +655,7 @@
id="editversion-nameinput"
placeholder="custom-build-000"
required=""
minlength="1"
maxlength="70"
pattern="^[-a-zA-Z0-9_]{1,70}$"
oninput="validateVersionSave('edit')"
/><label for="editversion-urlinput"
>Version URL</label