Autorefresh
public/javascripts/datetiume.js - added parameter 'params' - refresh all graphics aftter refreshrate public/javascripts/global.js - call showDate with params
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
// all date and time functions
|
||||
import { DateTime } from './luxon.min.js'
|
||||
import {loadAll, showChart, setNoUTC} from './showcharts.js'
|
||||
import {getCurrentTab} from "./chart_utilities.js";
|
||||
|
||||
|
||||
// Show date and time (every minute)
|
||||
export const showDate = (sofort) => {
|
||||
// Will be called every second
|
||||
export const showDate = (sofort, params) => {
|
||||
let d = DateTime.now()
|
||||
if(sofort || d.second === 0) {
|
||||
document.querySelector('#h1datum').innerHTML = d.toFormat('yyyy-MM-dd HH:mm')
|
||||
}
|
||||
|
||||
if (((d.minute % params.refreshRate) == 0) && (d.second == 15)) { // alle ganzen refreshRate Minuten, 15sec danach
|
||||
let start = 1
|
||||
console.log(params.refreshRate, 'Minuten um, Grafik wird erneuert');
|
||||
let ct = getCurrentTab()
|
||||
if (ct === 'maptab') {
|
||||
start = 0
|
||||
}
|
||||
loadAll(params, start)
|
||||
}
|
||||
}
|
||||
|
||||
/* ToDo:
|
||||
|
||||
Reference in New Issue
Block a user