From 34f031a9e429b6bed5656073d7c85e0a463a5da4 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 26 Feb 2022 00:21:33 +0000 Subject: [PATCH] client: setup some scaffolding for displaying tables, but it's nowhere near finished --- .../js/routes/{route_main.mjs => route_dashboard.mjs} | 0 src/static/js/routes/route_table.mjs | 6 ++++++ src/static/js/routes_client.mjs | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) rename src/static/js/routes/{route_main.mjs => route_dashboard.mjs} (100%) create mode 100644 src/static/js/routes/route_table.mjs diff --git a/src/static/js/routes/route_main.mjs b/src/static/js/routes/route_dashboard.mjs similarity index 100% rename from src/static/js/routes/route_main.mjs rename to src/static/js/routes/route_dashboard.mjs diff --git a/src/static/js/routes/route_table.mjs b/src/static/js/routes/route_table.mjs new file mode 100644 index 0000000..eed3e82 --- /dev/null +++ b/src/static/js/routes/route_table.mjs @@ -0,0 +1,6 @@ +"use strict"; + +export default async function(params) { + console.log(`TABLE ${params.table_name}`); + +} diff --git a/src/static/js/routes_client.mjs b/src/static/js/routes_client.mjs index b776235..5eb14bf 100644 --- a/src/static/js/routes_client.mjs +++ b/src/static/js/routes_client.mjs @@ -1,6 +1,7 @@ import ClientRouter from 'powahroot/Client.mjs'; -import route_main from './routes/route_main.mjs'; +import route_dashboard from './routes/route_dashboard.mjs'; +import route_table from './routes/route_table.mjs'; export default function make_routes() { const router = new ClientRouter({ @@ -8,7 +9,10 @@ export default function make_routes() { listen_pushstate: true }); - router.add_page("", route_main); + router.add_404(() => router.navigate("")); + + router.add_page("table/:table_name", route_table); + router.add_page("", route_dashboard); return router; }