Skip to content

Commit

Permalink
Add dialog to inbox that shows thing file template
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Seime <arne.seime@gmail.com>
  • Loading branch information
seime committed Dec 14, 2024
1 parent c2ae0ab commit e681bd0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bundles/org.openhab.ui/web/src/css/app.styl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ html
.sitemap-validation-dialog
--f7-dialog-width 80%

.thing-file-configuration-dialog
--f7-dialog-width 80%

// Align smart-select item with f7-list-input fields
@media (min-width 1024px)
.aligned-smart-select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,28 @@ export default {
entry.thingUID.substring(entry.thingUID.lastIndexOf(':') + 1))
}
},
{
text: 'Show equivalent Thing file configuration (basic properties)',
color: 'blue',
bold: true,
onClick: () => {
let properties = Object.entries(entry.properties).map(([k, v]) => `${k}="${v}"`)
let explanatoryText = 'NOTE: If this is a bridge, substitute <code>Thing</code> with <code>Bridge</code>' +
'<p>All properties are show here, but you may not want to include them all in the file configuraiton. Refer to binding docs for this particular binding for more details.</p>'
let content = `<p><code>Thing ${entry.thingUID} "${entry.label}" [ ${properties} ]</code></p>`
this.$f7.dialog.create({
title: 'Equivalent Thing file configuration',
text: explanatoryText + content,
cssClass: 'thing-file-configuration-dialog',
buttons: [
{
text: 'Close',
color: 'orange'
}
]
}).open()
}
},
{
text: (!ignored) ? 'Ignore' : 'Unignore',
color: (!ignored) ? 'orange' : 'blue',
Expand Down

0 comments on commit e681bd0

Please sign in to comment.