systemquery/src/static/app.mjs

29 lines
685 B
JavaScript

"use strict";
import SystemQueryClient from './js/SystemQueryClient.mjs';
import make_router from './js/routes_client.mjs';
import TableView from './js/ui/TableView.mjs';
window.addEventListener("load", async (_event) => {
const el_version = document.querySelector(".version");
const el_table = document.querySelector("main");
globalThis.sysquery = new SystemQueryClient();
globalThis.sysquery_router = make_router();
globalThis.sysui = {
tableview: new TableView(el_table)
}
const status = await globalThis.sysquery.status();
el_version.replaceChildren(
document.createTextNode(status.version)
);
globalThis.sysquery_router.navigate_current_hash();
});