From 7d3ebca20ae8fa8d0808654763eec9c9634e8b52 Mon Sep 17 00:00:00 2001 From: floutchito Date: Fri, 25 Feb 2022 12:07:25 +0100 Subject: [PATCH 01/11] feat(ui): Optional tabs navigation Add a UI section in settings Move dark mode switch to UI Settings section Add UI setting to replace Navigation Drawer with tabs, useful when app is embedded in another one, typically Home Assistant integration --- src/App.vue | 67 +++++++++++++++++++++++-------------- src/components/Settings.vue | 53 ++++++++++++++++++++++++++++- src/store/mutations.js | 33 +++++++++++++++--- 3 files changed, 121 insertions(+), 32 deletions(-) diff --git a/src/App.vue b/src/App.vue index c8486cb1eb0..798180205d4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,10 @@ diff --git a/src/store/mutations.js b/src/store/mutations.js index 6f41e9ec6ea..9f6a2df675f 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -1,4 +1,7 @@ import { $set } from "../lib/utils" +import { Settings } from '@/modules/Settings' + +const settings = new Settings(localStorage); export const state = { auth: undefined, @@ -59,7 +62,11 @@ export const state = { zwaveVersion: '', controllerStatus: 'Unknown', newConfigVersion: undefined - } + }, + ui: { + darkMode: settings.load('dark', false), + navTabs: settings.load('navTabs', false), + } } function getValue(v) { @@ -91,7 +98,9 @@ export const getters = { devices: state => state.devices, gateway: state => state.gateway, appInfo: state => state.appInfo, - scales: state => state.scales + scales: state => state.scales, + darkMode: state => state.ui.darkMode, + navTabs: state => state.ui.navTabs } export const actions = { @@ -132,7 +141,13 @@ export const actions = { }, removeValue(store, data) { store.commit('removeValue', data) - } + }, + setDarkMode(store, darkMode) { + store.commit('setDarkMode', darkMode) + }, + setNavTabs(store, navTabs) { + store.commit('setNavTabs', navTabs) + } } export const mutations = { @@ -249,7 +264,7 @@ export const mutations = { let lastTransmit = node.lastTransmit let errorReceive = false let errorTransmit = false - + if (node.statistics) { if (node.isControllerNode) { const prev = node.statistics @@ -373,5 +388,13 @@ export const mutations = { state.devices.push(d) } } - } + }, + setDarkMode(state, value) { + settings.store('dark', value); + state.ui.darkMode = value + }, + setNavTabs(state, value) { + settings.store('navTabs', value); + state.ui.navTabs = value + } } From 83ad56e81d52d1251d2b43a082264d000f60f94b Mon Sep 17 00:00:00 2001 From: floutchito Date: Fri, 25 Feb 2022 15:42:15 +0100 Subject: [PATCH 02/11] feat(ui): Flatten style and unnest elevation when necessary Remove cards nesting when unnecessary Flatten elevation when unnecessary Use buttons instead of ExpansionPanels for actions and statistics on ControlPanel Refactored StatisticsCard.vue --- src/App.vue | 8 +- src/components/ControlPanel.vue | 207 +- src/components/Mesh.vue | 180 +- src/components/Settings.vue | 1986 ++++++++++---------- src/components/SmartStart.vue | 102 +- src/components/custom/StatisticsCard.vue | 185 +- src/components/dialogs/DialogAddRemove.vue | 12 +- src/components/nodes-table/index.vue | 4 +- 8 files changed, 1323 insertions(+), 1361 deletions(-) diff --git a/src/App.vue b/src/App.vue index 798180205d4..ca1f57d1604 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,7 +64,7 @@ v-for="item in pages" :key="item.title" :to="item.path === '#' ? '' : item.path" - class="px-1" + class="smaller-min-width-tabs" > + + diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 0441209bc58..368f938c0a2 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -1,102 +1,127 @@ + + diff --git a/src/components/SmartStart.vue b/src/components/SmartStart.vue index 1466eb79c57..1ba79c621b3 100644 --- a/src/components/SmartStart.vue +++ b/src/components/SmartStart.vue @@ -1,59 +1,55 @@ diff --git a/src/components/dialogs/DialogAddRemove.vue b/src/components/dialogs/DialogAddRemove.vue index 997c394f109..96ea65c49ea 100644 --- a/src/components/dialogs/DialogAddRemove.vue +++ b/src/components/dialogs/DialogAddRemove.vue @@ -14,8 +14,14 @@ > - - + + + +