diff --git a/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue b/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue index d010d7dc62..719d64c34d 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/menu/settings-menu.vue @@ -18,9 +18,9 @@ search-in=".item-title" :disable-button="!$theme.aurora" /> - + - + Configuration - -
+ +
System Settings
-
- + +
+ System Settings + + + +
+
+
+ +
+ +
+ Add-on Settings + + + +
- + + + + Add-on Settings + + + + @@ -224,24 +259,25 @@ export default { loadMenu () { 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?serviceId=all') : Promise.resolve([]) - // can be done in parallel! - servicesPromise.then((data) => { - this.systemServices = data - .filter(s => (s.category === 'system') && (s.id !== 'org.openhab.persistence')) - .sort((s1, s2) => this.sortByLabel(s1, s2)) - this.addonsServices = data.filter(s => s.category !== 'system').sort((s1, s2) => this.sortByLabel(s1, s2)) - this.servicesLoaded = true - }) - addonsPromise.then((data) => { - this.addonsInstalled = data - .filter(a => a.installed && !['application/vnd.openhab.ruletemplate', 'application/vnd.openhab.uicomponent;type=widget', 'application/vnd.openhab.uicomponent;type=blocks'].includes(a.contentType)) - .sort((s1, s2) => this.sortByLabel(s1, s2)) - this.persistenceAddonsInstalled = this.addonsInstalled.filter(a => a.installed && a.type === 'persistence') - this.addonsLoaded = true - }) + if (this.$store.getters.apiEndpoint('services')) { + this.$oh.api.get('/rest/services').then((data) => { + this.systemServices = data + .filter(s => (s.category === 'system') && (s.id !== 'org.openhab.persistence')) + .sort((s1, s2) => this.sortByLabel(s1, s2)) + this.addonsServices = data.filter(s => s.category !== 'system').sort((s1, s2) => this.sortByLabel(s1, s2)) + this.servicesLoaded = true + }) + } + if (this.$store.getters.apiEndpoint('addons')) { + this.$oh.api.get('/rest/addons?serviceId=all').then((data) => { + this.addonsInstalled = data + .filter(a => a.installed && !['application/vnd.openhab.ruletemplate', 'application/vnd.openhab.uicomponent;type=widget', 'application/vnd.openhab.uicomponent;type=blocks'].includes(a.contentType)) + .sort((s1, s2) => this.sortByLabel(s1, s2)) + this.persistenceAddonsInstalled = this.addonsInstalled.filter(a => a.installed && a.type === 'persistence') + this.addonsLoaded = true + }) + } }, sortByLabel (s1, s2) { return s1.label.toLowerCase() > s2.label.toLowerCase() ? 1 : -1