First running version

This commit is contained in:
rxf
2023-03-24 13:49:54 +01:00
parent be8d364116
commit d10b274fe0
18 changed files with 1377 additions and 645 deletions
+27 -8
View File
@@ -5,6 +5,10 @@ import * as map from './map.js'
import * as dt from './datetime.js'
import {logit} from './logit.js'
import * as chart_live from './chart_live.js'
import * as chart_houravg from './chart_houravg.js'
import * as chart_dayavg from './chart_dayavg.js'
import * as chart_daynight from './chart_daynight.js'
import * as chart_lden from './chart_lden.js'
(async () => {
@@ -28,14 +32,21 @@ import * as chart_live from './chart_live.js'
}
// END global variables
const tabtable = [
{id: 'kartentab', func: map.showMap},
{id: 'livetab', func: chart_live.showLive},
// {id: 'houravgtab', func: chart_houravg.showHouravg},
// {id: 'dayavgtab', func: chart_dayavg.showDayavg},
// {id: 'daynighttab', func: chart_daynight.showDaynight},
// {id: 'ldentab', func: chart_lden.showLden},
]
const tabtable = [
{id: 'kartentab', func: map.showMap},
{id: 'livetab', func: chart_live.showLive},
{id: 'houravgtab', func: chart_houravg.showHouravg},
{id: 'dayavgtab', func: chart_dayavg.showDayavg},
{id: 'daynighttab', func: chart_daynight.showDaynight},
{id: 'ldentab', func: chart_lden.showLden},
]
const removeTabs = () => {
document.querySelector('#navi').style.display = 'none'
}
const showTabs = () => {
document.querySelector('#navi').style.display = 'block'
}
async function main() {
// initialise tabs
@@ -78,7 +89,15 @@ const tabtable = [
// show version and version-date
document.querySelector('#versn').setHTML(`Version: ${sysparams.version} vom ${sysparams.date.slice(0,10)}`)
const csid = parseInt(sysparams.csid)
if(csid !== -1) {
let triggerEl = document.querySelector('#livetab')
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
params.sid = csid
await chart_live.showLive(params)
}
// show the map
removeTabs()
map.showMap(params)
}
main().catch(console.error)