modifications
This commit is contained in:
1 parent
f42d5bca64
commit
41592fba38
7 files changed
+7473
-4
No files matched your search
Executable
+1
@@ -0,0 +1 @@
|
||||
cat /home/beieli/mini-beieli-web/static/js/fontawesome-5.11.2/all.js |~/minify-fa-js.py home,address-card,balance-scale,sign-out-alt,sign-in-alt,calendar,balance-scale,thermometer-half,tint,cloud,battery-three-quarters,envelope,check,lock,exclamation-triangle,cog,plus,shopping-cart,minus,arrow-right,caret-down >/home/beieli/mini-beieli-web/static/js/fontawesome-5.11.2/all-minified.js
|
||||
+2
-3
@@ -9,14 +9,13 @@
|
||||
<link href="static/bulma-calendar/css/bulma-calendar.min.css" rel="stylesheet">
|
||||
<script src="static/bulma-calendar/js/bulma-calendar.min.js"></script>
|
||||
|
||||
<div>
|
||||
<div class="column is-half is-gapless">
|
||||
<div id="reportrange" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
@@ -144,7 +143,7 @@ if (sPageURL.search("property=t") > -1) {
|
||||
maxfunc = function(max) { return 100 }
|
||||
} else if (sPageURL.search("property=w") > -1) {
|
||||
label = 'Gewicht';
|
||||
minfunc = function(min) { if (min < 5000000) { return min - 2000 } else { return min - 1000 } }
|
||||
minfunc = function(min) { if (min > 40000) { return min - 2000 } else { return 0 } }
|
||||
maxfunc = function(max) { return max + 2000 }
|
||||
} else if (sPageURL.search("property=h") > -1) {
|
||||
label = 'Luftfeuchtigkeit';
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
{{define "body_content"}}
|
||||
{{ if ne .UserName "" }}
|
||||
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
|
||||
|
||||
<link href="static/bulma-calendar/css/bulma-calendar.min.css" rel="stylesheet">
|
||||
<script src="static/bulma-calendar/js/bulma-calendar.min.js"></script>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<div id="reportrange" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-half">
|
||||
<a class="button is-success">
|
||||
<span class="icon">
|
||||
<i class="fa fa-balance-scale"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button">
|
||||
<span class="icon">
|
||||
<i class="fa fa-thermometer-half"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button">
|
||||
<span class="icon">
|
||||
<i class="fa fa-tint"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button">
|
||||
<span class="icon">
|
||||
<i class="fa fa-cloud"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button">
|
||||
<span class="icon">
|
||||
<i class="fa fa-battery-three-quarters"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
var start = moment({hour: 0});
|
||||
var end = moment();
|
||||
|
||||
console.log("XXX: "+start.format());
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('D. MMMM YYYY') + ' - ' + end.format('D. MMMM YYYY'));
|
||||
console.log("A new date selection was made: " + start.format() + ' to ' + end.format());
|
||||
s_start = start.utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
|
||||
s_end = end.utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
|
||||
console.log("Start: " + s_start + ' End: ' + s_end);
|
||||
reloadGraph(s_start,s_end);
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
regional: [ "de" ],
|
||||
"locale": {
|
||||
format: 'DD.MM.YYYY',
|
||||
"separator": " - ",
|
||||
"applyLabel": "Anwenden",
|
||||
"cancelLabel": "Abbrechen",
|
||||
"fromLabel": "Von",
|
||||
"toLabel": "Bis",
|
||||
customRangeLabel: 'Benutzerdefiniert',
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": [
|
||||
"So",
|
||||
"Mo",
|
||||
"Di",
|
||||
"Mi",
|
||||
"Do",
|
||||
"Fr",
|
||||
"Sa"
|
||||
],
|
||||
"monthNames": [
|
||||
"Januar",
|
||||
"Februar",
|
||||
"März",
|
||||
"April",
|
||||
"Mai",
|
||||
"Juni",
|
||||
"Juli",
|
||||
"August",
|
||||
"September",
|
||||
"Oktober",
|
||||
"November",
|
||||
"Dezember"
|
||||
],
|
||||
"firstDay": 1
|
||||
},
|
||||
ranges: {
|
||||
'Heute': [moment(), moment()],
|
||||
'Gestern': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Letzte 7 Tage': [moment().subtract(6, 'days'), moment()],
|
||||
'Letzte 30 Tage': [moment().subtract(29, 'days'), moment()],
|
||||
'Diesen Monat': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Letzten Monat': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
//cb(start, end);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<section id="chart">
|
||||
<!-- Content ... -->
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
||||
|
||||
<script>
|
||||
var chart;
|
||||
|
||||
function reloadGraph(start, stop) {
|
||||
range = ""
|
||||
range = range + "&start=" + start;
|
||||
range = range + "&stop=" + stop;
|
||||
$.getJSON('https://mini-beieli.ch/metrics?' + sPageURL + range, function(mydata) {
|
||||
chart.updateSeries([{
|
||||
data: mydata
|
||||
}])
|
||||
});
|
||||
}
|
||||
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
var deveui = urlParams.get('deveui');
|
||||
var start = urlParams.get('start');
|
||||
var stop = urlParams.get('stop');
|
||||
|
||||
range="";
|
||||
if (start == null) {
|
||||
var dstart = moment({hour: 0});
|
||||
var start = dstart.utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
|
||||
range = range + "&start=" + start;
|
||||
}
|
||||
|
||||
if (stop == null) {
|
||||
var dstop = moment();
|
||||
var stop = dstop.utc().format('YYYY-MM-DDTHH:mm:ss[Z]');
|
||||
range = range + "&stop=" + stop;
|
||||
}
|
||||
|
||||
console.log("Start: "+start);
|
||||
console.log("Stop: "+stop);
|
||||
$('#reportrange span').html(moment(start).format('D. MMMM YYYY') + ' - ' + moment(stop).format('D. MMMM YYYY'));
|
||||
|
||||
var sPageURL = window.location.search.substring(1);
|
||||
var label;
|
||||
if (sPageURL.search("property=t") > -1) {
|
||||
label = 'Temperatur';
|
||||
minfunc = function(min) { if (min > 0) { return 0 } else { return min } }
|
||||
maxfunc = function(max) { return max + 5 }
|
||||
} else if (sPageURL.search("property=vp") > -1) {
|
||||
label = 'Akkuladung';
|
||||
minfunc = function(min) { return 0 }
|
||||
maxfunc = function(max) { return 100 }
|
||||
} else if (sPageURL.search("property=w") > -1) {
|
||||
label = 'Gewicht';
|
||||
minfunc = function(min) { if (min < 5000000) { return min - 2000 } else { return min - 1000 } }
|
||||
maxfunc = function(max) { return max + 2000 }
|
||||
} else if (sPageURL.search("property=h") > -1) {
|
||||
label = 'Luftfeuchtigkeit';
|
||||
minfunc = function(min) { return 0 }
|
||||
maxfunc = function(max) { return 100 }
|
||||
} else if (sPageURL.search("property=p") > -1) {
|
||||
label = 'Luftdruck';
|
||||
minfunc = function(min) { return 900 }
|
||||
maxfunc = function(max) { return 1060 }
|
||||
} else {
|
||||
label = 'Unknown';
|
||||
}
|
||||
|
||||
$.getJSON('https://mini-beieli.ch/metrics?' + sPageURL + range, function(mydata) {
|
||||
var options = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
animations: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
xaxis: {
|
||||
type: "datetime",
|
||||
labels: {
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
min: minfunc,
|
||||
max: maxfunc
|
||||
},
|
||||
tooltip: {
|
||||
x: {
|
||||
format: 'dd.MM.yyyy HH:mm'
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: label,
|
||||
data: mydata
|
||||
}]
|
||||
}
|
||||
|
||||
chart = new ApexCharts(document.querySelector("#chart"), options);
|
||||
|
||||
chart.render();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{{ else }}
|
||||
<h4>Bitte zuerst <a href="login.html">einloggen</a></h4>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,5 @@
|
||||
/*!
|
||||
* Font Awesome Free 5.1.0 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
*/
|
||||
!function(){"use strict";var c={};try{"undefined"!=typeof window&&(c=window)}catch(c){}var l=(c.navigator||{}).userAgent,h=void 0===l?"":l,z=c,v=(~h.indexOf("MSIE")||h.indexOf("Trident/"),"___FONT_AWESOME___"),m=function(){try{return!0}catch(c){return!1}}(),s=[1,2,3,4,5,6,7,8,9,10],e=s.concat([11,12,13,14,15,16,17,18,19,20]);["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(s.map(function(c){return c+"x"})).concat(e.map(function(c){return"w-"+c}));var a=z||{};a[v]||(a[v]={}),a[v].styles||(a[v].styles={}),a[v].hooks||(a[v].hooks={}),a[v].shims||(a[v].shims=[]);var t=a[v],M=Object.assign||function(c){for(var l=1;l<arguments.length;l++){var h=arguments[l];for(var z in h)Object.prototype.hasOwnProperty.call(h,z)&&(c[z]=h[z])}return c};var f={"500px":[448,512,[],"f26e","M103.3 344.3c-6.5-14.2-6.9-18.3 7.4-23.1 25.6-8 8 9.2 43.2 49.2h.3v-93.9c1.2-50.2 44-92.2 97.7-92.2 53.9 0 97.7 43.5 97.7 96.8 0 63.4-60.8 113.2-128.5 93.3-10.5-4.2-2.1-31.7 8.5-28.6 53 0 89.4-10.1 89.4-64.4 0-61-77.1-89.6-116.9-44.6-23.5 26.4-17.6 42.1-17.6 157.6 50.7 31 118.3 22 160.4-20.1 24.8-24.8 38.5-58 38.5-93 0-35.2-13.8-68.2-38.8-93.3-24.8-24.8-57.8-38.5-93.3-38.5s-68.8 13.8-93.5 38.5c-.3.3-16 16.5-21.2 23.9l-.5.6c-3.3 4.7-6.3 9.1-20.1 6.1-6.9-1.7-14.3-5.8-14.3-11.8V20c0-5 3.9-10.5 10.5-10.5h241.3c8.3 0 8.3 11.6 8.3 15.1 0 3.9 0 15.1-8.3 15.1H130.3v132.9h.3c104.2-109.8 282.8-36 282.8 108.9 0 178.1-244.8 220.3-310.1 62.8zm63.3-260.8c-.5 4.2 4.6 24.5 14.6 20.6C306 56.6 384 144.5 390.6 144.5c4.8 0 22.8-15.3 14.3-22.8-93.2-89-234.5-57-238.3-38.2zM393 414.7C283 524.6 94 475.5 61 310.5c0-12.2-30.4-7.4-28.9 3.3 24 173.4 246 256.9 381.6 121.3 6.9-7.8-12.6-28.4-20.7-20.4zM213.6 306.6c0 4 4.3 7.3 5.5 8.5 3 3 6.1 4.4 8.5 4.4 3.8 0 2.6.2 22.3-19.5 19.6 19.3 19.1 19.5 22.3 19.5 5.4 0 18.5-10.4 10.7-18.2L265.6 284l18.2-18.2c6.3-6.8-10.1-21.8-16.2-15.7L249.7 268c-18.6-18.8-18.4-19.5-21.5-19.5-5 0-18 11.7-12.4 17.3L234 284c-18.1 17.9-20.4 19.2-20.4 22.6z"],"accessible-icon":[448,512,[],"f368","M423.9 255.8L411 413.1c-3.3 40.7-63.9 35.1-60.6-4.9l10-122.5-41.1 2.3c10.1 20.7 15.8 43.9 15.8 68.5 0 41.2-16.1 78.7-42.3 106.5l-39.3-39.3c57.9-63.7 13.1-167.2-74-167.2-25.9 0-49.5 9.9-67.2 26L73 243.2c22-20.7 50.1-35.1 81.4-40.2l75.3-85.7-42.6-24.8-51.6 46c-30 26.8-70.6-18.5-40.5-45.4l68-60.7c9.8-8.8 24.1-10.2 35.5-3.6 0 0 139.3 80.9 139.5 81.1 16.2 10.1 20.7 36 6.1 52.6L285.7 229l106.1-5.9c18.5-1.1 33.6 14.4 32.1 32.7zm-64.9-154c28.1 0 50.9-22.8 50.9-50.9C409.9 22.8 387.1 0 359 0c-28.1 0-50.9 22.8-50.9 50.9 0 28.1 22.8 50.9 50.9 50.9zM179.6 456.5c-80.6 0-127.4-90.6-82.7-156.1l-39.7-39.7C36.4 287 24 320.3 24 356.4c0 130.7 150.7 201.4 251.4 122.5l-39.7-39.7c-16 10.9-35.3 17.3-56.1 17.3z"],accusoft:[640,512,[],"f369","M482.2 372.1C476.5 365.2 250 75 242.3 65.5c-13.7-17.2 0-16.8 19.2-16.9 9.7-.1 106.3-.6 116.5-.6 24.1-.1 28.7.6 38.4 12.8 2.1 2.7 205.1 245.8 207.2 248.3 5.5 6.7 15.2 19.1 7.2 23.4-2.4 1.3-114.6 47.7-117.8 48.9-10.1 4-17.5 6.8-30.8-9.3m114.7-5.6s-115 50.4-117.5 51.6c-16 7.3-26.9-3.2-36.7-14.6l-57.1-74c-5.4-.9-60.4-9.6-65.3-9.3-3.1.2-9.6.8-14.4 2.9-4.9 2.1-145.2 52.8-150.2 54.7-5.1 2-11.4 3.6-11.1 7.6.2 2.5 2 2.6 4.6 3.5 2.7.8 300.9 67.6 308 69.1 15.6 3.3 38.5 10.5 53.6 1.7 2.1-1.2 123.8-76.4 125.8-77.8 5.4-4 4.3-6.8-1.7-8.2-2.3-.3-24.6-4.7-38-7.2m-326-181.3s-12 1.6-25 15.1c-9 9.3-242.1 239.1-243.4 240.9-7 10 1.6 6.8 15.7 1.7.8 0 114.5-36.6 114.5-36.6.5-.6-.1-.1.6-.6-.4-5.1-.8-26.2-1-27.7-.6-5.2 2.2-6.9 7-8.9l92.6-33.8c.6-.8 88.5-81.7 90.2-83.3v-1l-51.2-65.8"],adn:[496,512,[],"f170","M248 167.5l64.9 98.8H183.1l64.9-98.8zM496 256c0 136.9-111.1 248-248 248S0 392.9 0 256 111.1 8 248 8s248 111.1 248 248zm-99.8 82.7L248 115.5 99.8 338.7h30.4l33.6-51.7h168.6l33.6 51.7h30.2z"],adversal:[512,512,[],"f36a","M482.1 32H28.7C5.8 32 0 37.9 0 60.9v390.2C0 474.4 5.8 480 28.7 480h453.4c24.4 0 29.9-5.2 29.9-29.7V62.2c0-24.6-5.4-30.2-29.9-30.2zM178.4 220.3c-27.5-20.2-72.1-8.7-84.2 23.4-4.3 11.1-9.3 9.5-17.5 8.3-9.7-1.5-17.2-3.2-22.5-5.5-28.8-11.4 8.6-55.3 24.9-64.3 41.1-21.4 83.4-22.2 125.3-4.8 40.9 16.8 34.5 59.2 34.5 128.5 2.7 25.8-4.3 58.3 9.3 88.8 1.9 4.4.4 7.9-2.7 10.7-8.4 6.7-39.3 2.2-46.6-7.4-1.9-2.2-1.8-3.6-3.9-6.2-3.6-3.9-7.3-2.2-11.9 1-57.4 36.4-140.3 21.4-147-43.3-3.1-29.3 12.4-57.1 39.6-71 38.2-19.5 112.2-11.8 114-30.9 1.1-10.2-1.9-20.1-11.3-27.3zm286.7 222c0 15.1-11.1 9.9-17.8 9.9H52.4c-7.4 0-18.2 4.8-17.8-10.7.4-13.9 10.5-9.1 17.1-9.1 132.3-.4 264.5-.4 396.8 0 6.8 0 16.6-4.4 16.6 9.9zm3.8-340.5v291c0 5.7-.7 13.9-8.1 13.9-12.4-.4-27.5 7.1-36.1-5.6-5.8-8.7-7.8-4-12.4-1.2-53.4 29.7-128.1 7.1-144.4-85.2-6.1-33.4-.7-67.1 15.7-100 11.8-23.9 56.9-76.1 136.1-30.5v-71c0-26.2-.1-26.2 26-26.2 3.1 0 6.6.4 9.7 0 10.1-.8 13.6 4.4 13.6 14.3-.1.2-.1.3-.1.5zm-51.5 232.3c-19.5 47.6-72.9 43.3-90 5.2-15.1-33.3-15.5-68.2.4-101.5 16.3-34.1 59.7-35.7 81.5-4.8 20.6 28.8 14.9 84.6 8.1 101.1zm-2Line truncated
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -9,7 +9,7 @@
|
||||
<link rel="stylesheet" href="/static/css/bulma-0.7.4/bulma.min.css">
|
||||
<link rel="stylesheet" href="static/css/mini-beieli-web.css">
|
||||
|
||||
<script defer src="/static/js/fontawesome-5.1.0/all.js"></script>
|
||||
<script src="/static/js/fontawesome-5.11.2/all-minified.js"></script>
|
||||
<script src="/static/js/jquery-3.3.1/jquery.min.js"></script>
|
||||
{{template "header_additions" . }}
|
||||
</head>
|
||||
|
||||
Reference in new issue
Block a user