aboutsummaryrefslogtreecommitdiff
path: root/overview/public
diff options
context:
space:
mode:
Diffstat (limited to 'overview/public')
-rw-r--r--overview/public/index.html2
-rw-r--r--overview/public/script.js41
2 files changed, 22 insertions, 21 deletions
diff --git a/overview/public/index.html b/overview/public/index.html
index 6f63353..b9c08bb 100644
--- a/overview/public/index.html
+++ b/overview/public/index.html
@@ -47,6 +47,6 @@
</ul>
</div>
- <script src="script.js"></script>
+ <script src="script.js"></script>
</body>
</html>
diff --git a/overview/public/script.js b/overview/public/script.js
index 68b2d5a..d7e5b71 100644
--- a/overview/public/script.js
+++ b/overview/public/script.js
@@ -1,22 +1,23 @@
-fetch("/auth/api/status").then(response => response.json()).then(response => {
- console.log(response);
- const first = document.querySelectorAll("a")[0];
- const second = document.querySelectorAll("a")[1];
- const third = document.querySelectorAll("a")[2];
+fetch("/auth/api/status")
+ .then((response) => response.json())
+ .then((response) => {
+ console.log(response);
+ const first = document.querySelectorAll("a")[0];
+ const second = document.querySelectorAll("a")[1];
+ const third = document.querySelectorAll("a")[2];
- if (!response.admin)
- third.style.display = "none";
+ if (!response.admin) third.style.display = "none";
- if (response.loggedIn) {
- first.href = "/auth/change.html";
- first.innerText = "Passwort ändern";
- second.href = "/auth/api/logout";
- second.innerText = "Logout";
- if (response.admin) {
- third.href = "/admin";
- third.innerText = "Admin";
- }
- } else {
- document.querySelectorAll("div.pure-menu")[0].style.display = "none";
- }
-});
+ if (response.loggedIn) {
+ first.href = "/auth/change.html";
+ first.innerText = "Passwort ändern";
+ second.href = "/auth/api/logout";
+ second.innerText = "Logout";
+ if (response.admin) {
+ third.href = "/admin";
+ third.innerText = "Admin";
+ }
+ } else {
+ document.querySelectorAll("div.pure-menu")[0].style.display = "none";
+ }
+ });