set default login realm in login page

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-03-24 22:25:14 +00:00
parent fa66459da7
commit 42e8d729d6

View File

@ -10,6 +10,9 @@ async function init (){
let realmSelect = document.querySelector("#realm"); let realmSelect = document.querySelector("#realm");
realms.data.forEach((element) => { realms.data.forEach((element) => {
realmSelect.add(new Option(element.comment, element.realm)); realmSelect.add(new Option(element.comment, element.realm));
if("default" in element && element.default === 1){
realmSelect.value = element.realm;
}
}); });
formSubmitButton.addEventListener("click", async (e) => { formSubmitButton.addEventListener("click", async (e) => {
status.innerText = ""; status.innerText = "";