From 30b20f8e18088e3ef40021e518e1debfa0f84cc6 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 10 Mar 2022 03:26:08 +0000 Subject: [PATCH] client: Add initial on load UI logic. It's still missing static/js/tabledefs/index.mjs though --- src/static/app.mjs | 12 +++----- src/static/index.html | 3 +- src/static/js/SystemQueryClient.mjs | 1 - src/static/js/ui/GlobalUI.mjs | 43 +++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/static/js/ui/GlobalUI.mjs diff --git a/src/static/app.mjs b/src/static/app.mjs index 2372bf2..e2628ce 100644 --- a/src/static/app.mjs +++ b/src/static/app.mjs @@ -3,6 +3,7 @@ import SystemQueryClient from './js/SystemQueryClient.mjs'; import make_router from './js/routes_client.mjs'; +import GlobalUI from './js/ui/GlobalUI.mjs'; import TableView from './js/ui/TableView.mjs'; window.addEventListener("load", async (_event) => { @@ -12,16 +13,11 @@ window.addEventListener("load", async (_event) => { globalThis.sysquery = new SystemQueryClient(); globalThis.sysquery_router = make_router(); globalThis.sysui = { - tableview: new TableView(el_table) + ui: new GlobalUI(), + tableview: new TableView(el_table), } - - - const status = await globalThis.sysquery.status(); - - el_version.replaceChildren( - document.createTextNode(status.version) - ); + await ui.init(); globalThis.sysquery_router.navigate_current_hash(); diff --git a/src/static/index.html b/src/static/index.html index 8e96926..c1d3510 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -13,7 +13,8 @@