From 4b1ef3b4dc381762ab5757318ef612820b02d02d Mon Sep 17 00:00:00 2001 From: jimtng <2554958+jimtng@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:03:36 +1000 Subject: [PATCH] Thing details: Add "Install Binding" button for HANDLER_MISSING_ERROR (#3003) Signed-off-by: Jimmy Tanagra --- .../web/src/pages/addons/addons-store.vue | 8 ++++++-- .../web/src/pages/settings/things/thing-details.vue | 12 +++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/addons/addons-store.vue b/bundles/org.openhab.ui/web/src/pages/addons/addons-store.vue index 99ae4f339..2d1bfcf89 100644 --- a/bundles/org.openhab.ui/web/src/pages/addons/addons-store.vue +++ b/bundles/org.openhab.ui/web/src/pages/addons/addons-store.vue @@ -253,6 +253,7 @@ import { AddonIcons, AddonTitles, AddonSuggestionLabels, AddonConnectionTypes, A export default { mixins: [AddonStoreMixin], + props: ['searchFor'], components: { AddonsSection }, @@ -326,9 +327,12 @@ export default { }) this.ready = true this.startEventSource() - setTimeout(() => { + this.$nextTick(() => { this.$f7.lazy.create('.page-addon-store') - }, 100) + if (this.searchFor) { + this.$refs.storeSearchbar.search(this.searchFor) + } + }) }) }) }, 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 178cc1535..210fdd5c4 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 @@ -136,7 +136,8 @@ - + + @@ -649,6 +650,15 @@ export default { } ) }, + installBinding () { + this.$f7router.navigate({ + url: '/addons/binding/' + }, { + props: { + searchFor: this.thing.UID.split(':')[0] + } + }) + }, toggleDisabled () { const enable = (this.thing.statusInfo.statusDetail === 'DISABLED') this.$oh.api.putPlain('/rest/things/' + this.thingId + '/enable', enable.toString()).then((data) => {