diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-03 17:10:44 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-03 17:10:44 +0300 |
commit | 3bce3e1f788debaf7e964655c9727a179fa78e1d (patch) | |
tree | 68ff143b2851a9ba37eb6c27b73ca4ecaec771cf /src/components/_sila/Global/Chart.vue | |
parent | c9923b6fc173fdbb4ec61dbee7285bce24a0c62c (diff) | |
download | webui-vue-3bce3e1f788debaf7e964655c9727a179fa78e1d.tar.xz |
upd serialization for new back api
Diffstat (limited to 'src/components/_sila/Global/Chart.vue')
-rw-r--r-- | src/components/_sila/Global/Chart.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index fa66683a..4da58798 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -76,7 +76,7 @@ export default { computed: { readyData() { let filteredData = this.data.filter((metric) => { - return metric.MetricValue !== 'nan'; + return metric.Value !== 'nan'; }); filteredData.sort((a, b) => { @@ -90,7 +90,7 @@ export default { return { ...metric, Timestamp: time, - MetricValue: Math.round(metric.MetricValue), + Value: Math.round(metric.Value), }; }); @@ -101,7 +101,7 @@ export default { }, metricData() { let group = this.readyData.reduce(function (rv, x) { - (rv[x['MetricProperty']] = rv[x['MetricProperty']] || []).push(x); + (rv[x['Sensor']] = rv[x['Sensor']] || []).push(x); return rv; }, {}); @@ -116,7 +116,7 @@ export default { const { length } = arr; return Math.round( arr.reduce((acc, val) => { - return acc + val.MetricValue / length; + return acc + val.Value / length; }, 0) ); }; |