From 10f36cf3f592075771990df3f88448bc976a0be4 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 24 Feb 2022 03:08:21 +0000 Subject: [PATCH] client-side: go! There's still a *ton* of work left, but we're (slowly) getting there --- src/static/app.css | 7 +++++++ src/static/app.mjs | 14 +++++++++++++- src/static/index.html | 2 +- src/static/js/SystemQueryClient.mjs | 14 ++++++++++++++ src/static/js/routes_client.mjs | 7 +++++-- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/static/app.css b/src/static/app.css index bd34054..9a994fc 100644 --- a/src/static/app.css +++ b/src/static/app.css @@ -51,6 +51,13 @@ h1 { margin: 0; } +.version-label { + font-weight: bolder; + font-size: 110%; +} +.version { + font-family: "Ubuntu Mono", "Source Code Pro", monospace; +} /* ███ ██ █████ ██ ██ diff --git a/src/static/app.mjs b/src/static/app.mjs index c53b2b2..358a66e 100644 --- a/src/static/app.mjs +++ b/src/static/app.mjs @@ -1,7 +1,19 @@ +import SystemQueryClient from './js/SystemQueryClient.mjs'; import make_router from './js/routes_client.mjs'; -window.addEventListener("load", (_event) => { +window.addEventListener("load", async (_event) => { + globalThis.sysquery = new SystemQueryClient(); globalThis.sysquery_router = make_router(); + const el_version = document.querySelector(".version"); + + + const status = await globalThis.sysquery.status(); + + el_version.replaceChildren( + document.createTextNode(status.version) + ); + + globalThis.sysquery_router.navigate_current_hash(); }); diff --git a/src/static/index.html b/src/static/index.html index 36494a2..d5bb0a9 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -7,7 +7,7 @@

systemquery

-

Version ???

+

Version ???