Skip to content

Commit

Permalink
Thing details: Add "Install Binding" button for HANDLER_MISSING_ERROR (
Browse files Browse the repository at this point in the history
…#3003)

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
  • Loading branch information
jimtng authored Jan 12, 2025
1 parent bd3f1c4 commit 4b1ef3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bundles/org.openhab.ui/web/src/pages/addons/addons-store.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ import { AddonIcons, AddonTitles, AddonSuggestionLabels, AddonConnectionTypes, A
export default {
mixins: [AddonStoreMixin],
props: ['searchFor'],
components: {
AddonsSection
},
Expand Down Expand Up @@ -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)
}
})
})
})
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
<f7-block class="block-narrow" v-if="ready">
<f7-col>
<f7-list>
<f7-list-button color="blue" title="Copy Thing" @click="copyThing" />
<f7-list-button v-if="thing.statusInfo.statusDetail === 'HANDLER_MISSING_ERROR'" color="blue" title="Install Binding" @click="installBinding" />
<f7-list-button v-if="!error" color="blue" title="Copy Thing" @click="copyThing" />
<f7-list-button v-if="editable" color="red" title="Delete Thing" @click="deleteThing" />
</f7-list>
</f7-col>
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 4b1ef3b

Please sign in to comment.