Fancy fixs

This commit is contained in:
2021-01-12 21:20:11 +01:00
parent 50c493e20f
commit 0d489ae54a
5 changed files with 126 additions and 67 deletions

70
resources/js/app.js vendored
View File

@@ -34,6 +34,9 @@ Vue.use(VueThermometer);
import VueDygraphs from 'vue-dygraphs';
Vue.use(VueDygraphs);
import VueTableDynamic from 'vue-table-dynamic'
Vue.use(VueTableDynamic);
//(function () {
var app = new Vue({
el: '#app',
@@ -45,31 +48,38 @@ Vue.use(VueDygraphs);
pressure: null,
voltage: null,
time: null,
temp_options: {
legend: 'always',
title: 'Teplotný graf',
xlabel: 'Dátum',
labels: ['Dátum','Teplota'],
ylabel: 'Stupeň',
fillGraph: true
params: {
data: [],
border: true,
stripe: true
},
hum_options: {
color: 'red',
legend: 'always',
title: 'Vlhkosť graf',
xlabel: 'Dátum',
labels: ['Dátum','Vlhkosť'],
ylabel: 'Percent',
fillGraph: true
},
p_options: {
color: 'blue',
legend: 'always',
title: 'Tlak graf',
xlabel: 'Dátum',
labels: ['Dátum','Tlak'],
ylabel: 'Tlak',
fillGraph: true
options: {
temperature: {
legend: 'always',
title: 'Teplotný graf',
xlabel: 'Dátum',
labels: ['Dátum','Teplota'],
ylabel: 'Stupeň',
fillGraph: true
},
humidity: {
color: 'red',
legend: 'always',
title: 'Vlhkosť graf',
xlabel: 'Dátum',
labels: ['Dátum','Vlhkosť'],
ylabel: 'Percent',
fillGraph: true
},
pressure: {
color: 'blue',
legend: 'always',
title: 'Tlak graf',
xlabel: 'Dátum',
labels: ['Dátum','Tlak'],
ylabel: 'Tlak',
fillGraph: true
}
},
series: { "temperature" : [], "humidity" : [], "pressure": [] },
},
@@ -94,11 +104,13 @@ Vue.use(VueDygraphs);
.then(function (response) {
console.log("GET DATA");
console.log(response.data.temperature);
app.temperature = response.data.temperature;
app.humidity = response.data.humidity;
app.pressure = response.data.pressure;
app.voltage = response.data.voltage;
app.time = moment(response.data.time);
let data = app.params.data = [];
data.push(['Teplota',response.data.temperature,'°C']);
data.push(['Vlhkosť',response.data.humidity,'%']);
data.push(['Tlak',response.data.pressure,'kHPa']);
data.push(['Napätie',response.data.voltage,'V']);
moment.locale('sk_SK');
app.time = moment(response.data.time).format('LLL');
})
.catch(function (error) {
console.log(error);