-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item edit: Dynamically load UoM dimensions (#2120)
Fixes #1926. Awaiting openhab/openhab-core#3838. Load the UoM dimensions for UoM Item types from the REST API instead of hard-coding them into the UI. --------- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
- Loading branch information
1 parent
1409da9
commit e987624
Showing
6 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
bundles/org.openhab.ui/web/src/components/item/uom-mixin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
data () { | ||
return { | ||
dimensions: [] | ||
} | ||
}, | ||
created () { | ||
this.$oh.api.get('/rest/systeminfo/uom').then((data) => { | ||
data.uomInfo.dimensions.forEach((d) => { | ||
this.dimensions.push({ | ||
name: d.dimension, | ||
label: d.dimension + ' (' + d.systemUnit + ')' | ||
}) | ||
}) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters