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

View File

@@ -26,6 +26,7 @@
"dependencies": {
"moment": "^2.29.1",
"vue-dygraphs": "^0.1.2",
"vue-table-dynamic": "^0.4.1",
"vuejs-thermometer": "^0.1.3"
}
}

84
public/js/app.js vendored

File diff suppressed because one or more lines are too long

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);

View File

@@ -92,19 +92,15 @@
<div class="row">
<vue-thermometer class="justify-content-center col-sm-3" :value="temperature" :min="tmin" :max="tmax"></vue-thermometer>
<div class="col-sm-9" id="values">
<vue-table-dynamic :params="params"></vue-table-dynamic>
<ul>
<li>Teplota: @{{temperature}} °C</li>
<li>Vlhkosť: @{{humidity}} %</li>
<li>Tlak: @{{pressure}} khPa</li>
<li>Napätie: @{{voltage}} V</li>
<li>Čas: @{{time}}</li>
</ul>
</div>
</div>
<dygraphs ref="dgt" :graph-data="series['temperature']" :graph-options="temp_options"></dygraphs>
<dygraphs ref="dgh" :graph-data="series['humidity']" :graph-options="hum_options"></dygraphs>
<dygraphs ref="dgp" :graph-data="series['pressure']" :graph-options="p_options"></dygraphs>
<dygraphs ref="dgt" :graph-data="series['temperature']" :graph-options="options['temperature']"></dygraphs>
<dygraphs ref="dgh" :graph-data="series['humidity']" :graph-options="options['humidity']"></dygraphs>
<dygraphs ref="dgp" :graph-data="series['pressure']" :graph-options="options['pressure']"></dygraphs>
</div>

View File

@@ -4210,6 +4210,16 @@ lodash.restparam@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
lodash.trim@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/lodash.trim/-/lodash.trim-4.5.1.tgz#36425e7ee90be4aa5e27bcebb85b7d11ea47aa57"
integrity sha1-NkJefukL5KpeJ7zruFt9EepHqlc=
lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@@ -6761,6 +6771,13 @@ vue-loader@^15.4.2:
vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0"
vue-scrollbar-simple@0.0.9:
version "0.0.9"
resolved "https://registry.yarnpkg.com/vue-scrollbar-simple/-/vue-scrollbar-simple-0.0.9.tgz#15536023f3213907eeb491f50e0c6871d58d4fd8"
integrity sha512-1KVBu9+GVxgCLtEOTz2lsSBdNBH5VZT/hCv/li+KwF/RtCpK2I2SxyvOKNPNKPGWM3p+PM8A2HStilTZ0c5QXA==
dependencies:
lodash.throttle "^4.1.1"
vue-style-loader@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"
@@ -6769,6 +6786,15 @@ vue-style-loader@^4.1.0:
hash-sum "^1.0.2"
loader-utils "^1.0.2"
vue-table-dynamic@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/vue-table-dynamic/-/vue-table-dynamic-0.4.1.tgz#3e67a07cfc4ab1bcd29bf3f105ebf7dc22877bed"
integrity sha512-SvfgoVN/zewwd7IRNd9rlwW/DGy8LClwBxGAlvAV0idyOUfGc4yO/l31mux+OpqgqA7/0cvT/b3OcL0yEprEvQ==
dependencies:
lodash.throttle "^4.1.1"
lodash.trim "^4.5.1"
vue-scrollbar-simple "0.0.9"
vue-template-compiler@^2.6.10:
version "2.6.12"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz#947ed7196744c8a5285ebe1233fe960437fcc57e"