From 8c62d6be6839358b04c0f7da9fc13934605d1186 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 30 Sep 2024 15:59:24 +0200 Subject: [PATCH] fixed script execution order Signed-off-by: Stephan Richter --- .../src/main/resources/{DE => de}/clients.html | 0 .../src/main/resources/{DE => de}/edit_client.html | 0 .../src/main/resources/{DE => de}/index.html | 0 .../src/main/resources/{DE => de}/login.html | 0 .../src/main/resources/{DE => de}/navigation.html | 0 .../src/main/resources/{DE => de}/new_client.html | 0 .../src/main/resources/{DE => de}/reset.html | 0 .../src/main/resources/{DE => de}/settings.html | 0 .../src/main/resources/{DE => de}/users.html | 0 .../src/main/resources/en/scripts/clients.js | 5 +++-- .../src/main/resources/en/scripts/index.js | 2 +- .../src/main/resources/en/scripts/settings.js | 4 +--- .../src/main/resources/en/scripts/user.js | 1 + .../src/main/resources/en/scripts/users.js | 3 +-- de.srsoftware.oidc.web/src/main/resources/en/todo.html | 9 --------- 15 files changed, 7 insertions(+), 17 deletions(-) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/clients.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/edit_client.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/index.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/login.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/navigation.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/new_client.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/reset.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/settings.html (100%) rename de.srsoftware.oidc.web/src/main/resources/{DE => de}/users.html (100%) diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/clients.html b/de.srsoftware.oidc.web/src/main/resources/de/clients.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/clients.html rename to de.srsoftware.oidc.web/src/main/resources/de/clients.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/edit_client.html b/de.srsoftware.oidc.web/src/main/resources/de/edit_client.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/edit_client.html rename to de.srsoftware.oidc.web/src/main/resources/de/edit_client.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/index.html b/de.srsoftware.oidc.web/src/main/resources/de/index.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/index.html rename to de.srsoftware.oidc.web/src/main/resources/de/index.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/login.html b/de.srsoftware.oidc.web/src/main/resources/de/login.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/login.html rename to de.srsoftware.oidc.web/src/main/resources/de/login.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/navigation.html b/de.srsoftware.oidc.web/src/main/resources/de/navigation.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/navigation.html rename to de.srsoftware.oidc.web/src/main/resources/de/navigation.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/new_client.html b/de.srsoftware.oidc.web/src/main/resources/de/new_client.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/new_client.html rename to de.srsoftware.oidc.web/src/main/resources/de/new_client.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/reset.html b/de.srsoftware.oidc.web/src/main/resources/de/reset.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/reset.html rename to de.srsoftware.oidc.web/src/main/resources/de/reset.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/settings.html b/de.srsoftware.oidc.web/src/main/resources/de/settings.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/settings.html rename to de.srsoftware.oidc.web/src/main/resources/de/settings.html diff --git a/de.srsoftware.oidc.web/src/main/resources/DE/users.html b/de.srsoftware.oidc.web/src/main/resources/de/users.html similarity index 100% rename from de.srsoftware.oidc.web/src/main/resources/DE/users.html rename to de.srsoftware.oidc.web/src/main/resources/de/users.html diff --git a/de.srsoftware.oidc.web/src/main/resources/en/scripts/clients.js b/de.srsoftware.oidc.web/src/main/resources/en/scripts/clients.js index 5699352..23a000a 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/scripts/clients.js +++ b/de.srsoftware.oidc.web/src/main/resources/en/scripts/clients.js @@ -43,5 +43,6 @@ function remove(clientId){ }).then(handleRemove); } } - -fetch(client_controller+"/list").then(handleClients); \ No newline at end of file +document.addEventListener("logged_in", function(event) { // wait until page loaded + fetch(client_controller+"/list").then(handleClients); +}); \ No newline at end of file diff --git a/de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js b/de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js index 69e8cda..f837834 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js +++ b/de.srsoftware.oidc.web/src/main/resources/en/scripts/index.js @@ -24,6 +24,6 @@ function handleDash(response){ }); } -document.addEventListener("DOMContentLoaded", function(event) { // wait until page loaded +document.addEventListener("logged_in", function(event) { // wait until page loaded fetch(client_controller+"/dash").then(handleDash) }); diff --git a/de.srsoftware.oidc.web/src/main/resources/en/scripts/settings.js b/de.srsoftware.oidc.web/src/main/resources/en/scripts/settings.js index e1c439f..0ae5254 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/scripts/settings.js +++ b/de.srsoftware.oidc.web/src/main/resources/en/scripts/settings.js @@ -4,7 +4,6 @@ function fillForm(){ if (user == null){ setTimeout(fillForm,100); } else { - console.log(user); setValue('username',user.username); setValue('email',user.email); setValue('uuid', user.uuid); @@ -158,7 +157,6 @@ function displayDuration(){ function durationUpdate(){ var raw = getValue('session_duration'); - console.log(raw); var mins = 0; var hrs = 0; var days = 0; @@ -178,7 +176,7 @@ function durationUpdate(){ } -document.addEventListener("DOMContentLoaded", function(event) { // wait until page loaded +document.addEventListener("logged_in", function(event) { // wait until page loaded fillForm(); fetch("/api/email/settings",{credentials:'include'}).then(handleMailSettings); }); \ No newline at end of file diff --git a/de.srsoftware.oidc.web/src/main/resources/en/scripts/user.js b/de.srsoftware.oidc.web/src/main/resources/en/scripts/user.js index 2da145b..58ddb6b 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/scripts/user.js +++ b/de.srsoftware.oidc.web/src/main/resources/en/scripts/user.js @@ -9,6 +9,7 @@ function handleUser(response){ response.json().then(u => { user = u; fetch(web+"/navigation.html",{credentials:'include'}).then(handleNavigation); + document.dispatchEvent(new Event('logged_in')); }); } } diff --git a/de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js b/de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js index 0a3e689..08a2670 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js +++ b/de.srsoftware.oidc.web/src/main/resources/en/scripts/users.js @@ -75,7 +75,6 @@ function handleRemove(response){ redirect("users.html"); } else { response.text().then(info => { - console.log(info); show(info); }); } @@ -102,7 +101,7 @@ function reset_password(userid){ fetch(user_controller+"/reset?user="+userid,{credentials:'include'}).then(() => { disable('reset-'+userid); }); } -document.addEventListener("DOMContentLoaded", function(event) { // wait until page loaded +document.addEventListener("logged_in", function(event) { // wait until page loaded fetch(user_controller+"/list",{method:'POST',credentials:'include'}).then(handleUsers); }); diff --git a/de.srsoftware.oidc.web/src/main/resources/en/todo.html b/de.srsoftware.oidc.web/src/main/resources/en/todo.html index a77a232..bd62295 100644 --- a/de.srsoftware.oidc.web/src/main/resources/en/todo.html +++ b/de.srsoftware.oidc.web/src/main/resources/en/todo.html @@ -15,15 +15,6 @@