Pridanie statistik v grafe po 1 dni a zvacsenie ikon

This commit is contained in:
2021-01-16 15:17:37 +01:00
parent 70e7fbcc3a
commit 90699640c4
3 changed files with 20 additions and 6 deletions

View File

@@ -44,7 +44,11 @@ export default {
if (that.range) {
for (var i = 0; i < response.data.length; i++) {
var row = response.data[i];
let time = moment(row.time).format('LLL');
if (response.config.params.range == '1d')
var fmt = 'LL';
else
var fmt = 'LLL';
let time = moment(row.time).format(fmt);
let mean = null;
if (row.mean != null) {
mean = row.mean.toFixed(2);

View File

@@ -121,12 +121,13 @@
</div>
</div>
<b-card no-body>
<b-tabs v-model="ti" small card lazy>
<b-tabs v-model="ti" card lazy>
<b-tab title="Teplota" @click="resizeGraph(0)">
<dygraphs ref="dg[0]" :graph-data="series['temperature']" :graph-options="options['temperature']"></dygraphs>
<br/>
<!-- Tabs with card integration -->
<b-card no-body>
<b-tabs small card>
<b-tabs card>
<b-tab title="Celá doba">
<div>Štatistika za celú dobu v grafe</div>
<stats-table :fromdate="startdate" :todate="enddate" :type="'temperature'" :key="componentKey"></stats-table>
@@ -134,13 +135,16 @@
<b-tab title="Hodina">
<stats-table :fromdate="startdate" :todate="enddate" :type="'temperature'" :range="'1h'" :key="componentKey"></stats-table>
</b-tab>
<b-tab title="Deň" v-if="startdate">
<stats-table :fromdate="startdate" :todate="enddate" :type="'temperature'" :range="'1d'" :key="componentKey"></stats-table>
</b-tab>
</b-tabs>
</b-card>
</b-tab>
<b-tab title="Vlhkosť" @click="resizeGraph(1)">
<dygraphs ref="dg[1]" :graph-data="series['humidity']" :graph-options="options['humidity']"></dygraphs>
<b-card no-body>
<b-tabs small card>
<b-tabs card>
<b-tab title="Celá doba">
<div>Štatistika za celú dobu v grafe</div>
<stats-table :fromdate="startdate" :todate="enddate" :type="'humidity'" :key="componentKey"></stats-table>
@@ -148,13 +152,16 @@
<b-tab title="Hodina">
<stats-table :fromdate="startdate" :todate="enddate" :type="'humidity'" :range="'1h'" :key="componentKey"></stats-table>
</b-tab>
<b-tab title="Deň" v-if="startdate">
<stats-table :fromdate="startdate" :todate="enddate" :type="'humidity'" :range="'1d'" :key="componentKey"></stats-table>
</b-tab>
</b-tabs>
</b-card>
</b-tab>
<b-tab title="Tlak" @click="resizeGraph(2)">
<dygraphs ref="dg[2]" :graph-data="series['pressure']" :graph-options="options['pressure']"></dygraphs>
<b-card no-body>
<b-tabs small card>
<b-tabs card>
<b-tab title="Celá doba">
<div>Štatistika za celú dobu v grafe</div>
<stats-table :fromdate="startdate" :todate="enddate" :type="'pressure'" :key="componentKey"></stats-table>
@@ -162,6 +169,9 @@
<b-tab title="Hodina">
<stats-table :fromdate="startdate" :todate="enddate" :type="'pressure'" :range="'1h'" :key="componentKey"></stats-table>
</b-tab>
<b-tab title="Deň" v-if="startdate">
<stats-table :fromdate="startdate" :todate="enddate" :type="'pressure'" :range="'1d'" :key="componentKey"></stats-table>
</b-tab>
</b-tabs>
</b-card>
</b-tab>