From b8994d80a976013648e028c851160ddfa94d42b5 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Sat, 18 Feb 2023 20:37:50 -0700 Subject: [PATCH] UI stuff; save and load username in cookie --- static/admin.js | 9 ++++++++- static/index.html | 16 +++++++--------- static/socket.js | 7 +++++++ static/util.js | 21 ++++++++++++++++++++- 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/static/admin.js b/static/admin.js index f997f1f..fa6002b 100644 --- a/static/admin.js +++ b/static/admin.js @@ -55,7 +55,7 @@ async function getTables() { } async function doLogin() { - const adminUsrInput = document.getElementById("input_admin_usr"); + const adminUsrInput = document.getElementById("name_entry"); const adminPassInput = document.getElementById("input_admin_pass"); if (adminUsrInput && adminPassInput) { @@ -69,6 +69,13 @@ async function doLogin() { } } +function showAdminModal(show) { + const modal = document.getElementById("admin_modal") + if (modal) { + modal.style.display = show ? "block" : "none"; + } +} + async function getAdminToken(user, pass) { const headers = new Headers(); headers.set('Authorization', 'Basic ' + btoa(user + ":" + pass)); diff --git a/static/index.html b/static/index.html index 4206766..2b3b1dc 100644 --- a/static/index.html +++ b/static/index.html @@ -5,24 +5,22 @@ Felt - -
+ - +
-
- + - +