From c271f0b1bb42e1dbc1decea4db94f4caeb9b7fc5 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 30 Jul 2023 17:43:40 +0200 Subject: [PATCH 01/15] Settings page: Move transformations to extra list for optical separation Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 88cade3645..8d2b3ab7cd 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -60,6 +60,8 @@ :footer="objectsSubtitles.pages"> + + Date: Sun, 30 Jul 2023 17:44:15 +0200 Subject: [PATCH 02/15] Settings page: Add add-on settings & Rename system services to settings Signed-off-by: Florian Hotze --- .../web/src/pages/settings/settings-menu.vue | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 8d2b3ab7cd..6d7cb124ec 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -16,7 +16,7 @@ search-in=".item-title" :disable-button="!$theme.aurora" /> - + Configuration @@ -111,7 +111,7 @@ - Add-ons + Add-on Store @@ -127,15 +127,29 @@ - - System Services - - - + +
+ System Settings + + + +
+
+ + Add-on Settings + + + + +
@@ -154,6 +168,7 @@ export default { addonsLoaded: false, servicesLoaded: false, addonStoreTabShortcuts: AddonStoreTabShortcuts, + addonsInstalled: [], systemServices: [], objectsSubtitles: { things: 'Manage the physical layer', @@ -189,13 +204,17 @@ export default { if (!this.apiEndpoints) return const servicesPromise = (this.$store.getters.apiEndpoint('services')) ? this.$oh.api.get('/rest/services') : Promise.resolve([]) - const addonsPromise = (this.$store.getters.apiEndpoint('addons')) ? this.$oh.api.get('/rest/addons/types') : Promise.resolve([]) + const addonsPromise = (this.$store.getters.apiEndpoint('addons')) ? this.$oh.api.get('/rest/addons') : Promise.resolve([]) // can be done in parallel! servicesPromise.then((data) => { this.systemServices = data.filter(s => s.category === 'system') this.servicesLoaded = true }) + addonsPromise.then((data) => { + this.addonsInstalled = data.filter(a => a.installed === true) + this.addonsLoaded = true + }) }, loadCounters () { if (!this.apiEndpoints) return From c71ef8d38911a887b8640b1588647404d32e724e Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 30 Jul 2023 17:44:28 +0200 Subject: [PATCH 03/15] Settings page: Add missing counters Signed-off-by: Florian Hotze --- .../web/src/pages/settings/settings-menu.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 6d7cb124ec..9ecc20c710 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -81,6 +81,7 @@ media-item link="rules/" title="Rules" + :after="rulesCount" badge-color="blue" :footer="objectsSubtitles.rules"> @@ -89,6 +90,7 @@ media-item link="scenes/" title="Scenes" + :after="scenesCount" badge-color="blue" :footer="objectsSubtitles.scenes"> @@ -97,6 +99,7 @@ media-item link="scripts/" title="Scripts" + :after="scriptsCount" badge-color="blue" :footer="objectsSubtitles.scripts"> @@ -185,7 +188,10 @@ export default { thingsCount: '', itemsCount: '', transformationsCount: '', - sitemapsCount: 0 + sitemapsCount: 0, + rulesCount: '', + scenesCount: '', + scriptsCount: '' } }, computed: { @@ -222,7 +228,14 @@ export default { if (this.$store.getters.apiEndpoint('things')) this.$oh.api.get('/rest/things?staticDataOnly=true').then((data) => { this.thingsCount = data.length.toString() }) if (this.$store.getters.apiEndpoint('items')) this.$oh.api.get('/rest/items?staticDataOnly=true').then((data) => { this.itemsCount = data.length.toString() }) if (this.$store.getters.apiEndpoint('ui')) this.$oh.api.get('/rest/ui/components/system:sitemap').then((data) => { this.sitemapsCount = data.length }) - if (this.$store.getters.apiEndpoint('transformations')) this.$oh.api.get('/rest/transformations').then((data) => { this.transformationsCount = data.length }) + if (this.$store.getters.apiEndpoint('transformations')) this.$oh.api.get('/rest/transformations').then((data) => { this.transformationsCount = data.length.toString() }) + if (this.$store.getters.apiEndpoint('rules')) { + this.$oh.api.get('/rest/rules?staticDataOnly=true').then((data) => { + this.rulesCount = data.filter((r) => r.tags.indexOf('Scene') < 0 && r.tags.indexOf('Script') < 0).length.toString() + this.scenesCount = data.filter((r) => r.tags.indexOf('Scene') >= 0).length.toString() + this.scriptsCount = data.filter((r) => r.tags.indexOf('Script') >= 0).length.toString() + }) + } }, navigateToStore (tab) { this.$f7.views.main.router.navigate('addons', { props: { initialTab: tab } }) From 461ade1b24c76ab04ba076b4cdd285dfd7bc6c71 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 6 Aug 2023 16:56:15 +0200 Subject: [PATCH 04/15] Settings page: Update transformations icon & description Signed-off-by: Florian Hotze --- .../org.openhab.ui/web/src/pages/settings/settings-menu.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 9ecc20c710..987521e57d 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -70,7 +70,7 @@ :after="transformationsCount" badge-color="blue" :footer="objectsSubtitles.transform"> - + @@ -178,7 +178,7 @@ export default { model: 'The semantic model of your home', items: 'Manage the functional layer', pages: 'Design displays for user control & monitoring', - transform: 'Manage transformations', + transform: 'Make raw data human-readable', rules: 'Automate with triggers and actions', scenes: 'Store a set of desired states as a scene', scripts: 'Rules dedicated to running code', From 6cdeb69545cbe23cf5d743cd83b247d24c2a91c1 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 6 Aug 2023 17:36:31 +0200 Subject: [PATCH 05/15] Settings page: Hide advanced add-on settings by default Only add-ons which provide configuration via config-descriptions or persistence add-ons are listed by default. All other add-ons are considered advanced. Signed-off-by: Florian Hotze --- .../web/src/pages/settings/settings-menu.vue | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 987521e57d..94817f1703 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -147,10 +147,16 @@ + + Show Advanced + + + Hide Advanced +
@@ -172,6 +178,7 @@ export default { servicesLoaded: false, addonStoreTabShortcuts: AddonStoreTabShortcuts, addonsInstalled: [], + addonsServices: [], systemServices: [], objectsSubtitles: { things: 'Manage the physical layer', @@ -191,12 +198,21 @@ export default { sitemapsCount: 0, rulesCount: '', scenesCount: '', - scriptsCount: '' + scriptsCount: '', + + expandedTypes: {} } }, computed: { apiEndpoints () { return this.$store.state.apiEndpoints + }, + addonsSettings () { + if (this.expandedTypes.addonsInstalled) return this.addonsInstalled + return this.addonsInstalled.filter((a) => + a.type === 'persistence' || + this.addonsServices.findIndex((as) => as.configDescriptionURI === a.uid.replace('-', ':')) > -1 + ) } }, watch: { @@ -215,6 +231,7 @@ export default { // can be done in parallel! servicesPromise.then((data) => { this.systemServices = data.filter(s => s.category === 'system') + this.addonsServices = data.filter(s => s.category !== 'system') this.servicesLoaded = true }) addonsPromise.then((data) => { @@ -237,6 +254,9 @@ export default { }) } }, + showingAll (type) { + return (this.expandedTypes[type] || this[type].length <= 5) + }, navigateToStore (tab) { this.$f7.views.main.router.navigate('addons', { props: { initialTab: tab } }) }, From 7cd4f725dd84e4fc65c0ef182ef8de71a8aaccdc Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 6 Aug 2023 18:30:46 +0200 Subject: [PATCH 06/15] Settings page: Improve add-ons advanced logic Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 94817f1703..708a6b743b 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -211,7 +211,7 @@ export default { if (this.expandedTypes.addonsInstalled) return this.addonsInstalled return this.addonsInstalled.filter((a) => a.type === 'persistence' || - this.addonsServices.findIndex((as) => as.configDescriptionURI === a.uid.replace('-', ':')) > -1 + this.addonsServices.findIndex((as) => as.configDescriptionURI.split(':')[1] === a.id) > -1 ) } }, From 8c38d91506d41090f5d46b89196afe888e0c7e2a Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sun, 6 Aug 2023 18:31:18 +0200 Subject: [PATCH 07/15] Add descriptions to Items, Things & transformations lists Signed-off-by: Florian Hotze --- .../src/pages/settings/items/items-list-vlist.vue | 12 ++++++++++++ .../web/src/pages/settings/things/things-list.vue | 12 ++++++++++++ .../transformations/transformations-list.vue | 11 +++++++++++ 3 files changed, 35 insertions(+) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue index 7178bf926b..1bb9903621 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue @@ -30,6 +30,18 @@ + + + + + In openHAB, Items represent all properties and capabilities of the user's home automation.
While a Thing is quite specific to the device or service, Items provide a unified way to monitor and control functionality provided by Things. + + Learn more about Items. + +
+
+
+ diff --git a/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue b/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue index a46c0f383c..fb52252595 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue @@ -48,6 +48,18 @@ + + + + + Things represent the physical layer of an openHAB system. From a configuration standpoint, Things tell openHAB which physical entities (devices, web services, information sources, etc.) are to be managed by the system. + + Learn more about Things. + + + + + diff --git a/bundles/org.openhab.ui/web/src/pages/settings/transformations/transformations-list.vue b/bundles/org.openhab.ui/web/src/pages/settings/transformations/transformations-list.vue index 31ebab766a..338baf7d9e 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/transformations/transformations-list.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/transformations/transformations-list.vue @@ -42,6 +42,17 @@ + + + + Transformations are used to translate data from a cluttered or technical raw value to a processed human-readable representation. + + Learn more about transformations. + + + + + From 99fc92e6e27e24a0fa8cbac7eeff31b3bde9ad6c Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 14 Aug 2023 19:47:03 +0200 Subject: [PATCH 08/15] Address review: "Show All" instead of "Show/Hide Advanced" Signed-off-by: Florian Hotze --- .../org.openhab.ui/web/src/pages/settings/settings-menu.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue index 708a6b743b..25a3be1ad2 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue @@ -152,10 +152,7 @@ :link="'addons/' + a.uid + '/config'" :title="a.label" /> - Show Advanced - - - Hide Advanced + Show All From 68b1d476a5310260c4ddd62216d762f445a99bb7 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 14 Aug 2023 19:52:45 +0200 Subject: [PATCH 09/15] Address review: Add docs links to "empty state placeholder" and "x Items - Open documentation" Signed-off-by: Florian Hotze --- .../pages/settings/items/items-list-vlist.vue | 27 +++++----- .../pages/settings/things/thing-details.vue | 17 +++--- .../src/pages/settings/things/things-list.vue | 53 ++++++++++--------- .../transformations/transformations-list.vue | 27 +++++----- 4 files changed, 60 insertions(+), 64 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue index 1bb9903621..6c62633849 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue @@ -32,18 +32,7 @@ - - - In openHAB, Items represent all properties and capabilities of the user's home automation.
While a Thing is quite specific to the device or service, Items provide a unified way to monitor and control functionality provided by Things. - - Learn more about Items. - -
-
-
- - - +  Loading... @@ -62,9 +51,11 @@ - + + - {{ items.length }} Items + {{ items.length }} Items - + + + + + + @@ -293,6 +289,9 @@ export default { } }, computed: { + documentationLink () { + return `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org/link/items` + }, searchPlaceholder () { return window.innerWidth >= 1280 ? 'Search (for advanced search, use the developer sidebar (Shift+Alt+D))' : 'Search' } diff --git a/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue b/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue index e38ad29168..da1ae2c93a 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue @@ -768,17 +768,14 @@ export default { } for (const channel of this.thing.channels) { - if (isExtensible(channel, this.thingType)) { - console.debug(`Adding ${channel.uid} to code because it is extensible`) - const editableChannel = { - id: channel.id, - channelTypeUID: channel.channelTypeUID, - label: channel.label, - description: channel.description, - configuration: channel.configuration - } - editableChannels.push(editableChannel) + const editableChannel = { + id: channel.id, + channelTypeUID: channel.channelTypeUID, + label: channel.label, + description: channel.description, + configuration: channel.configuration } + editableChannels.push(editableChannel) } if (editableChannels.length > 0) editableThing.channels = editableChannels diff --git a/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue b/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue index fb52252595..e4f5c0d5e8 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/things/things-list.vue @@ -50,22 +50,29 @@ - - - Things represent the physical layer of an openHAB system. From a configuration standpoint, Things tell openHAB which physical entities (devices, web services, information sources, etc.) are to be managed by the system. - - Learn more about Things. - - + + +  Loading... + + + + + - - - + - {{ things.length }} thingsLoading... + {{ things.length }} Things - + -
+
Alphabetical @@ -75,19 +82,7 @@
- - - - - - + + + + + + @@ -71,11 +60,12 @@ - + - {{ transformations.length }} transformations + {{ transformations.length }} transformations - + -
+
Alphabetical @@ -87,7 +77,6 @@
@@ -113,9 +102,14 @@ + + + + + @@ -140,6 +134,9 @@ export default { } }, computed: { + documentationLink () { + return `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org/link/transformations` + }, indexedTransformations () { if (this.groupBy === 'alphabetical') { return this.transformations.reduce((prev, transformation, i, transformations) => { From c101bfd143761a4cbd7fabc709ff8eee3b3af5a7 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 14 Aug 2023 19:53:52 +0200 Subject: [PATCH 10/15] Add missing i18n texts for no transformations Signed-off-by: Florian Hotze --- .../org.openhab.ui/web/src/assets/i18n/empty-states/en.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.openhab.ui/web/src/assets/i18n/empty-states/en.json b/bundles/org.openhab.ui/web/src/assets/i18n/empty-states/en.json index 10e6258360..aef295efca 100644 --- a/bundles/org.openhab.ui/web/src/assets/i18n/empty-states/en.json +++ b/bundles/org.openhab.ui/web/src/assets/i18n/empty-states/en.json @@ -11,6 +11,9 @@ "things.nobindings.title": "No bindings", "things.nobindings.text": "To add things to your system, you first need to install binding add-ons.", + "transformations.title": "No transformations yet", + "transformations.text": "Transformations are used to translate data from a cluttered or technical raw value to a processed human-readable representation.", + "model.title": "Start modelling your home", "model.text": "Build a model from your items to organize them and relate them to each other semantically.

Begin with a hierarchy of locations: buildings, outside areas, floors and rooms, as needed. Then, insert equipment and points from your things (or manually).", From e987bd21f0d2e74c21d348e620e5801afeb39d6b Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sat, 19 Aug 2023 16:01:22 +0200 Subject: [PATCH 11/15] Consolidate add-on store & settings and rfc to own component Signed-off-by: Florian Hotze --- bundles/org.openhab.ui/web/src/js/routes.js | 2 +- .../pages/settings/menu/add-on-section.vue | 48 +++++++++++++++++++ .../settings/{ => menu}/settings-menu.vue | 42 ++-------------- 3 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 bundles/org.openhab.ui/web/src/pages/settings/menu/add-on-section.vue rename bundles/org.openhab.ui/web/src/pages/settings/{ => menu}/settings-menu.vue (85%) diff --git a/bundles/org.openhab.ui/web/src/js/routes.js b/bundles/org.openhab.ui/web/src/js/routes.js index 6380a56c2e..009ca5231d 100644 --- a/bundles/org.openhab.ui/web/src/js/routes.js +++ b/bundles/org.openhab.ui/web/src/js/routes.js @@ -9,7 +9,7 @@ import AnalyzerPopup from '../pages/analyzer/analyzer-popup.vue' const AboutPage = () => import(/* webpackChunkName: "about-page" */ '../pages/about.vue') const UserProfilePage = () => import(/* webpackChunkName: "profile-page" */ '../pages/profile.vue') -const SettingsMenuPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/settings-menu.vue') +const SettingsMenuPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/menu/settings-menu.vue') const ServiceSettingsPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/services/service-settings.vue') const AddonsListPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/addons/addons-list.vue') const AddonsAddPage = () => import(/* webpackChunkName: "admin-base" */ '../pages/settings/addons/addons-add.vue') diff --git a/bundles/org.openhab.ui/web/src/pages/settings/menu/add-on-section.vue b/bundles/org.openhab.ui/web/src/pages/settings/menu/add-on-section.vue new file mode 100644 index 0000000000..9b5127e365 --- /dev/null +++ b/bundles/org.openhab.ui/web/src/pages/settings/menu/add-on-section.vue @@ -0,0 +1,48 @@ + + + diff --git a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue similarity index 85% rename from bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue rename to bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue index 25a3be1ad2..13fe24b65d 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue @@ -113,22 +113,6 @@ - - Add-on Store - - - - - -
@@ -142,19 +126,7 @@
- - Add-on Settings - - - - - Show All - - +
@@ -166,9 +138,12 @@