Item details: Display persistence status - #3765
Conversation
#4819 Bundle Size — 12.86MiB (+0.02%).55145cb(current) vs b43437e main#4818(baseline) Warning Bundle contains 2 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch mherwege:item_persistence_status Project dashboard Generated by RelativeCI Documentation Report issue |
87b6002 to
12d9579
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a persistence status section to the item detail screen, showing which persistence services are configured for an item, the strategies being used, and whether the item is actually persisted with a count of stored values.
Changes:
- Added a new Persistence section to the item details page showing persistence service configurations
- Created a new component to display persistence service details including configuration status, strategies, and persisted item counts
- Integrated the component with links to persistence service configurations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| bundles/org.openhab.ui/web/src/pages/settings/items/item-details.vue | Adds the persistence section to the item details page with conditional rendering for non-Group items or Groups with a groupType |
| bundles/org.openhab.ui/web/src/components/persistence/item-persistence-details.vue | New component that fetches and displays persistence service information, including matching strategies and persisted status with badges |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5eb197f to
bea9622
Compare
e96e4b7 to
668282b
Compare
668282b to
6277261
Compare
|
During testing, I discovered that persistence services such as InMemory return an array of |
florian-h05
left a comment
There was a problem hiding this comment.
LGTM, thanks!
A very useful addition!
I've refactored it to the TypeScript Composition API and added a minor fix (see my previous comment). I'll wait with testing so you can have a look at my changes.
I am surprised by this. InMemory does return information about the persisted items and does return an empty set if there are no items peristed. From the InMemory addon code, I don't see how it returns a null value in that set: |
|
With openhab/openhab-core#5336 and openhab/openhab-addons#20200 there would indeed be much better information available for this.
This would change the API as it would return a 404 (not found) if nothing was found, and a 405 (not allowed) if the method was not implemented for the service, making a clear distinction. So this code would have to be updated accordingly as well. The core and addon PR's where a consequence of what I tried to achieve here, which I found limiting. This should work without these other PR's. But if the other PR's are accepted and merged, this should be revisited to see if adjustments are needed to improve it. |
I neither, but it definitely does for me. I'll debug this further. |
|
Ready for merging? |
Not quite. I think your refactoring still changes the logic. The end result will be the same, but only because the new REST API hasn't been fully implemented yet (and this code adapted to that). I prefer keeping the difference between null and {} so the changes will be easier afterwards. Minimal changes would all be covered in the TODO. |
|
openhab/openhab-core#5387 fixes the issue with InMemory persistence and potentially also other services. |
Great. Note I already had a very similar fix for this included in openhab/openhab-core#5336. |
|
@mherwege Please have a look at my latest changes, these should fully restore the previous logic. |
|
@florian-h05 What is your view on this? Do we wait for the core and addons PR's to be merged to finalize this? The remaining remarks for me all have to do with the changes as done in the core PR, that will make this more consistent and give better information. In our code base, there is one more call to This can never have worked, as RRD4J never implemented this and always returned an empty Set. But I don't know if it will still compile whitout adjusting it for the exception that can be thrown. |
Let's wait a few days and hope the core PR gets merged soon. |
We'll see. If compilation breaks, either you or me can fix it quickly ;-) |
|
Your core PR has been merged. Do you want to adjust this PR or should I do it (though I‘ll be away from keyboard for a few days)? |
|
I can adjust it, but it may take me a few days as well. It is a bit busy at the moment. |
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
Signed-off-by: Florian Hotze <dev@florianhotze.com>
bb4684a to
55145cb
Compare
|
@florian-h05 I didn't do further testing, but the code looks good to me. Thanks. |
This PR adds a section on persistence in item detail screen. It will:
Here is a screenshot:
