From 7b3bc68f545c21388fdfbf95ffbbbcf8333b8a01 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Wed, 30 Sep 2026 13:28:26 +0200 Subject: [PATCH] Allow params in Report/KPI Aggregator names --- .../js/components/DashboardWidget/Report/Kpi.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/public/js/components/DashboardWidget/Report/Kpi.js b/public/js/components/DashboardWidget/Report/Kpi.js index e1c0ab953..928d59c51 100644 --- a/public/js/components/DashboardWidget/Report/Kpi.js +++ b/public/js/components/DashboardWidget/Report/Kpi.js @@ -21,11 +21,23 @@ export default { }, data() { return { + calledVars: {}, data: undefined, hasErrors: false, }; }, computed: { + activeLabel() { + if (!this.activeAggregator.label) + return ''; + + return this.activeAggregator.label.replace( + /\{\s*([^\}]+)\s*\}/g, + (match, key) => this.calledVars[key] === undefined + ? match + : this.calledVars[key] + ); + }, activeAggregator() { if (this.config.aggregators.length == 1) return this.config.aggregators[0]; @@ -128,6 +140,8 @@ export default { } } + this.calledVars = vars; + try { const result = await this.$api.call( ApiReport.get(this.config.statistik_kurzbz, vars), @@ -177,7 +191,7 @@ export default {