From fc0e87835349f57231c90f553fe36c6aadae5c50 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Fri, 24 Mar 2023 22:25:14 +0000 Subject: [PATCH] set default login realm in login page Signed-off-by: Arthur Lu --- scripts/login.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/login.js b/scripts/login.js index aacec0c..50fbed6 100644 --- a/scripts/login.js +++ b/scripts/login.js @@ -10,6 +10,9 @@ async function init (){ let realmSelect = document.querySelector("#realm"); realms.data.forEach((element) => { realmSelect.add(new Option(element.comment, element.realm)); + if("default" in element && element.default === 1){ + realmSelect.value = element.realm; + } }); formSubmitButton.addEventListener("click", async (e) => { status.innerText = "";