From 3a0a3a2ddb854cbbc62990ca43ffb1137be967a8 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Tue, 3 Sep 2024 12:57:52 +0200 Subject: [PATCH] html files for pages --- .gitignore | 4 ++- packages/web/build-index.js | 8 ++++++ .../web/{public/index.html => index.html.tpl} | 5 ++++ packages/web/package.json | 5 ++-- packages/web/src/LoginPage.svelte | 6 ++-- packages/web/src/clientAuth.ts | 28 +++++++++---------- packages/web/src/main.ts | 5 +--- packages/web/src/utility/api.ts | 6 ++-- packages/web/src/utility/pageDefs.ts | 10 +------ 9 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 packages/web/build-index.js rename packages/web/{public/index.html => index.html.tpl} (97%) diff --git a/.gitignore b/.gitignore index 686ceb6c6..5ba6aaa45 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,6 @@ yarn-error.log* app/src/nativeModulesContent.js packages/api/src/nativeModulesContent.js packages/api/src/packagedPluginsContent.js -.VSCodeCounter \ No newline at end of file +.VSCodeCounter + +pacgaes/web/public/*.html \ No newline at end of file diff --git a/packages/web/build-index.js b/packages/web/build-index.js new file mode 100644 index 000000000..91650e4c2 --- /dev/null +++ b/packages/web/build-index.js @@ -0,0 +1,8 @@ +const fs = require('fs'); + +const template = fs.readFileSync('./index.html.tpl', 'utf-8'); + +for (const page of ['', 'not-logged', 'error', 'admin-login', 'login', 'admin', 'license']) { + const text = template.replace(/{{page}}/g, page); + fs.writeFileSync(`public/${page || 'index'}.html`, text); +} diff --git a/packages/web/public/index.html b/packages/web/index.html.tpl similarity index 97% rename from packages/web/public/index.html rename to packages/web/index.html.tpl index 2830d44ad..69fb1621c 100644 --- a/packages/web/public/index.html +++ b/packages/web/index.html.tpl @@ -22,6 +22,11 @@ + + +