fix(dashboard): don't initially load items of hidden api widgets

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
Richard Steinmetz 2025-01-13 10:52:16 +01:00
parent d4b862e513
commit 0bb7be28f0
No known key found for this signature in database
GPG key ID: 27137D9E7D273FB2
3 changed files with 7 additions and 5 deletions

View file

@ -299,7 +299,7 @@ export default {
const apiWidgetIdsToFetch = Object
.values(this.apiWidgets)
.filter(widget => this.isApiWidgetV2(widget.id))
.filter(widget => this.isApiWidgetV2(widget.id) && this.layout.includes(widget.id))
.map(widget => widget.id)
await Promise.all(apiWidgetIdsToFetch.map(id => this.fetchApiWidgetItems([id], true)))
@ -397,9 +397,11 @@ export default {
const index = this.layout.indexOf(panel.id)
if (!currentValue && index > -1) {
this.layout.splice(index, 1)
} else {
this.layout.push(panel.id)
if (this.isApiWidgetV2(panel.id)) {
this.fetchApiWidgetItems([panel.id], true)
}
}
Vue.set(this.panels[panel.id], 'mounted', false)
this.saveLayout()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long