- viac senzorov, oprava chyb ked nevracia hodnotu controller

This commit is contained in:
2022-10-29 10:20:24 +02:00
parent 5e521583af
commit ce144bcd58
7 changed files with 4113 additions and 4205 deletions

5
resources/js/app.js vendored
View File

@@ -133,7 +133,7 @@ var app = new Vue({
var that = this;
window.setInterval(function () {
console.log("TIMER");
that.getData();
that.getData(); // ZOPTIALIZOVAT ABY BRAL IBA NOVE DATA
}, 300000);
},
@@ -256,8 +256,7 @@ var app = new Vue({
}
})
.then(function (response) {
console.log("GET DATA");
console.log(response.config.params.type);
console.log("GET DATA = ",response.config.params.type);
let data = response.data.map(x => [moment(x[0]).toDate(), x[1]]);
app.series[response.config.params.type] = data;
app.componentKey += 1;

View File

@@ -6,7 +6,7 @@
<script>
export default {
props: ['fromdate','todate','type','range','host'],
props: ['fromdate','todate','type','range','host','model'],
name: 'Stats',
data() {
return {
@@ -59,7 +59,8 @@ export default {
that.params.height = 400;
}
} else {
that.params.data.push(['Hodnota',response.data[0].min,response.data[0].max,response.data[0].mean.toFixed(2),response.data[0].last]);
if (response.data.length > 0)
that.params.data.push(['Hodnota',response.data[0].min,response.data[0].max,response.data[0].mean.toFixed(2),response.data[0].last]);
};
console.log(that.params.data);
that.redraw += 1;

View File

@@ -85,7 +85,7 @@
<div class="content" id="app">
<div class="title m-b-md">
@{{ sensormap[ti].desc }}
@{{ sensormap[si].desc }}
</div>
<div>