From 7188d4e61c5b240728ccd70eade25c34d3e5417f Mon Sep 17 00:00:00 2001 From: maggie0002 <64841595+maggie0002@users.noreply.github.com> Date: Thu, 1 Sep 2022 15:50:26 +0200 Subject: [PATCH] Add ON_DEVICE var for controlling display states --- Dockerfile | 6 +++-- ui/quasar.conf.js | 3 ++- ui/src/App.vue | 10 +++----- ui/src/boot/pinia.ts | 10 +------- ui/src/components/SystemDeviceInfo.vue | 9 ++------ ui/src/stores/system.ts | 32 -------------------------- 6 files changed, 12 insertions(+), 58 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2ff2ed4..852146cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,11 @@ COPY ui ui # Run lint to ensure build fails if there are coding issues RUN yarn lint -# Build ExpressJS and UI +# Build ExpressJS and UI. +# ON_DEVICE=false informs the build that there my not be a backend available, and therefore +# not to perform certain function like communicating with the backend on boot RUN yarn build -RUN yarn build-pwa +RUN ON_DEVICE=false yarn build-pwa # Reduce the node_modules folder down to the essentials required for ExpressJS RUN yarn workspaces focus expressjs --production diff --git a/ui/quasar.conf.js b/ui/quasar.conf.js index de06bb8d..083d2d96 100644 --- a/ui/quasar.conf.js +++ b/ui/quasar.conf.js @@ -63,7 +63,8 @@ module.exports = configure(function (ctx) { build: { env: { DEVICE_HOSTNAME: process.env.DEVICE_HOSTNAME, - BACKEND_PORT: process.env.BACKEND_PORT + BACKEND_PORT: process.env.BACKEND_PORT, + ON_DEVICE: process.env.ON_DEVICE ? process.env.ON_DEVICE : 'true' }, target: { browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'], diff --git a/ui/src/App.vue b/ui/src/App.vue index d7a50bf4..44dbbb97 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -1,10 +1,5 @@