Skip to content

Commit

Permalink
fix(dashboard): don't initially load items of hidden api widgets
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Jan 13, 2025
1 parent 42c021f commit 2205d2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions apps/dashboard/src/DashboardApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions dist/dashboard-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dashboard-main.js.map

Large diffs are not rendered by default.

0 comments on commit 2205d2d

Please sign in to comment.