*** WIP WIP *** same more changes !
This commit is contained in:
@@ -13,3 +13,7 @@ export const showDate = (sofort) => {
|
|||||||
export const formatJSDate = (d) => {
|
export const formatJSDate = (d) => {
|
||||||
return DateTime.fromJSDate(d).toFormat('yyyy-LL-dd HH:mm:ss')
|
return DateTime.fromJSDate(d).toFormat('yyyy-LL-dd HH:mm:ss')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const formatISODate = (d) => {
|
||||||
|
return DateTime.fromISO(d).toFormat('yyyy-LL-dd HH:mm:ss')
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import * as dt from './datetime.js'
|
|||||||
device: '',
|
device: '',
|
||||||
coordinates: false,
|
coordinates: false,
|
||||||
center: Stuttgart,
|
center: Stuttgart,
|
||||||
zoom: 13,
|
zoom: 10,
|
||||||
refresh: 0,
|
refresh: 0,
|
||||||
starttime: '2023-01-01T00:00:00Z', //date2ISO(defaultStartime),
|
starttime: '2023-01-01T00:00:00Z', //date2ISO(defaultStartime),
|
||||||
endtime: '2023-03-01T00:00:00Z' //date2ISO(emptyTimes.emptyHMtime)
|
endtime: '2023-03-01T00:00:00Z' //date2ISO(emptyTimes.emptyHMtime)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ function getMedian(markers) {
|
|||||||
console.log(markers);
|
console.log(markers);
|
||||||
let i = 0; // now find the 'offlines' (value == -1)
|
let i = 0; // now find the 'offlines' (value == -1)
|
||||||
for (i = 0; i < markers.length; i++) {
|
for (i = 0; i < markers.length; i++) {
|
||||||
if (markers[i].options.value != -1) {
|
if (markers[i].options.value > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ function buildIcon(color, n, indoor) {
|
|||||||
'y="400" font-size="1500%" font-family="Verdana,Lucida Sans Unicode,sans-serif" ' +
|
'y="400" font-size="1500%" font-family="Verdana,Lucida Sans Unicode,sans-serif" ' +
|
||||||
'fill="' + txtColor + '">' + n + '</text>';
|
'fill="' + txtColor + '">' + n + '</text>';
|
||||||
}
|
}
|
||||||
if(indoor !== 0) {
|
if(indoor) {
|
||||||
circIcon += '<line x1="125" y1="475" x2="475" y2="125" stroke="black" stroke-width="20" />'
|
circIcon += '<line x1="125" y1="475" x2="475" y2="125" stroke="black" stroke-width="20" />'
|
||||||
}
|
}
|
||||||
circIcon += '</svg>';
|
circIcon += '</svg>';
|
||||||
@@ -242,7 +242,7 @@ export async function buildMarkers() {
|
|||||||
name: x.id,
|
name: x.id,
|
||||||
value: x.value,
|
value: x.value,
|
||||||
url: '/graph?sid=' + x.id,
|
url: '/graph?sid=' + x.id,
|
||||||
lastseen: dt.formatJSDate(x.lastseen),
|
lastseen: dt.formatISODate(x.lastseen),
|
||||||
indoor: x.indoor
|
indoor: x.indoor
|
||||||
})
|
})
|
||||||
.on('click', e => onMarkerClick(e, true)) // define click- and
|
.on('click', e => onMarkerClick(e, true)) // define click- and
|
||||||
@@ -273,7 +273,7 @@ async function onMarkerClick(e, click) {
|
|||||||
${item.value < 0 ? offlinetext : normaltext}
|
${item.value < 0 ? offlinetext : normaltext}
|
||||||
</table>
|
</table>
|
||||||
<div id="infoBtn">
|
<div id="infoBtn">
|
||||||
<a href="#" class="speciallink">Grafik anzeigen</a>
|
<a href="#" class="speciallink">Show chart</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
@@ -298,3 +298,37 @@ async function setCenter(adr) {
|
|||||||
map.setView([parseFloat(data.lat), parseFloat(data.lon)]);
|
map.setView([parseFloat(data.lat), parseFloat(data.lon)]);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Show the last date below tha map grafics
|
||||||
|
async function showLastDate(dt) {
|
||||||
|
const url = `http://localhost:3004/getproperties?type=noise&box=${bounds.toBBoxString()}`
|
||||||
|
|
||||||
|
let ret = await fetch(url)
|
||||||
|
.catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
});
|
||||||
|
let sensors = await ret.json()
|
||||||
|
|
||||||
|
let url = '/api/getdata';
|
||||||
|
let ld = moment(dt);
|
||||||
|
let last = ld.subtract(1,'h')
|
||||||
|
let erg;
|
||||||
|
let allsens
|
||||||
|
try {
|
||||||
|
erg = await $.getJSON(url + `?data=props&last=1900-01-01`);
|
||||||
|
allsens = erg.count
|
||||||
|
erg = await $.getJSON(url + `?data=props&last=${last.format('YYYY-MM-DD HH:mm')}`);
|
||||||
|
if ((erg != undefined) && (erg.values[0].error != undefined)) {
|
||||||
|
showError(3,erg.values[0].error,aktsensorid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
$('#mapdate').html('Werte von ' + ld.format('YYYY-MM-DD HH:mm'));
|
||||||
|
$('#actsensors').html(`${erg.count} aktive Sensoren (angemeldet ${allsens})`)
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -73,6 +73,15 @@ header #h1datum {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
#map #infoTable table, #map #infoTable tr, #map #infoTable td {
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
#map #infoBtn {
|
||||||
|
margin-top: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
#author {
|
#author {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sourceRoot":"","sources":["style.sass"],"names":[],"mappings":"AAUA;EACE;EACA;EACA;EACA;EACA;EACA;EACA,kBAfW;;;AAiBb;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;AAEA;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AACA;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA,eAzEc;EA0Ed;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA","file":"style.css"}
|
{"version":3,"sourceRoot":"","sources":["style.sass"],"names":[],"mappings":"AAUA;EACE;EACA;EACA;EACA;EACA;EACA;EACA,kBAfW;;;AAiBb;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;AAEA;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AACA;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA,eAzEc;EA0Ed;EACA;EACA;;AAEA;EACE;EACA;EACA;;AACF;EACE;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA","file":"style.css"}
|
||||||
@@ -76,6 +76,15 @@ header
|
|||||||
overflow: hidden
|
overflow: hidden
|
||||||
z-index: 1
|
z-index: 1
|
||||||
|
|
||||||
|
#infoTable table, #infoTable tr, #infoTable td
|
||||||
|
margin: auto
|
||||||
|
text-align: center
|
||||||
|
border: none !important
|
||||||
|
#infoBtn
|
||||||
|
margin-top: 10px
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
|
||||||
#author
|
#author
|
||||||
font-size: 80%
|
font-size: 80%
|
||||||
width: 95%
|
width: 95%
|
||||||
|
|||||||
Reference in New Issue
Block a user