WIP WIP WIP *** Now with tabs

This commit is contained in:
rxf
2023-03-15 16:08:33 +01:00
parent b270370105
commit 0a89e05329
9 changed files with 88 additions and 10 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import { DateTime } from './luxon.min.js'
export const showDate = (sofort) => {
let d = DateTime.now()
if(sofort || d.second === 0) {
$('#h1datum').text(d.toFormat('yyyy-MM-dd HH:mm'))
document.querySelector('#h1datum').setHTML(d.toFormat('yyyy-MM-dd HH:mm'))
}
}
+14 -3
View File
@@ -4,7 +4,7 @@
import * as map from './map.js'
import * as dt from './datetime.js'
$(async() => {
(async function () {
// global constants
const Stuttgart = [48.779, 9.16]
const MAXROWS_IN_TABLE = 1000
@@ -28,13 +28,24 @@ $(async() => {
async function main() {
// initialise tabs
let triggerTabList = [].slice.call(document.querySelectorAll('#myTab a'))
triggerTabList.forEach(function (triggerEl) {
let tabTrigger = new bootstrap.Tab(triggerEl)
triggerEl.addEventListener('click', function (event) {
event.preventDefault()
tabTrigger.show()
})
})
// show dat/time at start
dt.showDate(true)
// and show date/time every minute
setInterval(() => dt.showDate(false), 1000)
// show version and version-date
$('#versn').text(`Version: ${sysparams.version} vom ${sysparams.date.slice(0,10)}`)
document.querySelector('#versn').setHTML(`Version: ${sysparams.version} vom ${sysparams.date.slice(0,10)}`)
// show the map
map.showMap(params)
@@ -42,4 +53,4 @@ $(async() => {
}
main().catch(console.error)
})
})()
+1 -1
View File
@@ -250,7 +250,7 @@ export async function buildMarkers() {
markers.addLayer(marker);
}
map.addLayer(markers);
showLastDate(sensors.lastDate);
// ToDo showLastDate(sensors.lastDate);
}