Skip to content

Commit

Permalink
serialize current dashboard only
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Sep 7, 2023
1 parent 63eb989 commit 2e1fce8
Show file tree
Hide file tree
Showing 6 changed files with 4,739 additions and 6,194 deletions.
2 changes: 1 addition & 1 deletion fava_dashboards/FavaDashboards.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fava_dashboards/templates/FavaDashboards.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set dashboard_id = request.args.get('dashboard', '0') | int %}
{% set bootstrap = extension.bootstrap(dashboard_id) %}
<script id="favaDashboardsBootstrap" type="application/json">
{{ bootstrap|tojson }}
{{ {"ledger": bootstrap["ledger"], "dashboard": bootstrap["dashboards"][dashboard_id]}|tojson }}
</script>

<div class="headerline">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {

const bootstrap = JSON.parse(boostrapJSON);
const ledger = bootstrap.ledger;
const dashboard = bootstrap.dashboards[bootstrap.dashboardId];
const dashboard = bootstrap.dashboard;

renderDashboard(ledger, dashboard);
},
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export interface Dashboard {

export interface Bootstrap {
ledger: Ledger;
dashboards: Dashboard[];
dashboardId: number;
dashboard: Dashboard;
}
Loading

0 comments on commit 2e1fce8

Please sign in to comment.