From eab9215b0b9a2c5c76580802f3b299b1e8cd874b Mon Sep 17 00:00:00 2001 From: Benjamin Webb <40066515+webb-ben@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:41:07 -0500 Subject: [PATCH] Add Cluster Toggle (#73) * Create Settings Menu - Create Settings menu in app header - Move Language and Token widgets inside settings menu - Add icons to menu options - Display active language on language selection * Add Marker cluster toggle requires: https://github.com/wmo-im/wis2box/pull/590 * Update mdi-icon for cluster --- docker/entrypoint.sh | 1 + src/App.vue | 3 +- src/components/app/AppHeader.vue | 9 ++--- src/components/app/AppSettings.vue | 47 +++++++++++++++++++++++++++ src/components/app/SelectLocale.vue | 16 +++++++-- src/components/app/TokenAuth.vue | 6 ++-- src/components/station/WisStation.vue | 31 ++++++++++++++---- src/locales/_template.json | 4 ++- src/locales/en.json | 4 ++- src/locales/es.json | 6 ++-- src/locales/fr.json | 6 ++-- 11 files changed, 108 insertions(+), 25 deletions(-) create mode 100644 src/components/app/AppSettings.vue diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ca1347b..bc8e775 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,5 +7,6 @@ window.VUE_APP_MQTT='${WIS2BOX_MQTT_URL}'\n window.VUE_APP_WAF='${WIS2BOX_URL}/data/'\n window.VUE_APP_BASEMAP_URL='${WIS2BOX_BASEMAP_URL:-https://\{s\}.tile.openstreetmap.org/\{z\}/\{x\}/\{y\}.png}'\n window.VUE_APP_BASEMAP_ATTRIBUTION='${WIS2BOX_BASEMAP_ATTRIBUTION:-© OpenStreetMap contributors}'\n +window.VUE_APP_CLUSTER='${WIS2BOX_UI_CLUSTER}'\n " echo $env >> /usr/share/nginx/html/env.js diff --git a/src/App.vue b/src/App.vue index 6250d80..db14485 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,7 +46,8 @@ export default { url: '', dialog: false, token: '', - interceptor: null + interceptor: null, + cluster: window.VUE_APP_CLUSTER === true || window.VUE_APP_CLUSTER === 'true' }; }, computed: { diff --git a/src/components/app/AppHeader.vue b/src/components/app/AppHeader.vue index 544db54..5b9bedd 100644 --- a/src/components/app/AppHeader.vue +++ b/src/components/app/AppHeader.vue @@ -21,8 +21,7 @@ - - + @@ -32,8 +31,7 @@ + diff --git a/src/components/app/SelectLocale.vue b/src/components/app/SelectLocale.vue index 6f51f37..7cb390e 100644 --- a/src/components/app/SelectLocale.vue +++ b/src/components/app/SelectLocale.vue @@ -1,15 +1,17 @@