Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thing details: Add "Install Binding" button for HANDLER_MISSING_ERROR #3003

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading