remove 'noise_' from values
Trigger live tab, if sensorid is given
This commit is contained in:
Vendored
+6
-1
@@ -13,7 +13,12 @@
|
||||
],
|
||||
"program": "${workspaceFolder}/bin/www.js",
|
||||
"env": {
|
||||
"APIHOST": "https://sensorapi.fuerst-stuttgart.de"
|
||||
// "APIHOST": "http://reception:3000",
|
||||
// "MONGOHOST": "reception",
|
||||
// "MONGOUSRP": "admin:mongo4noise",
|
||||
// "MONGOAUTH": "true",
|
||||
// "INFLUXHOST": "reception",
|
||||
// "INFLUXTOKEN": "gHGGgjaK0lmM6keMa01JeuDpqOE_vRq8UimsU4QKb2miI5BDh2PfWynEbwKizdJapXy8jVbTat5mVZLQTNmSdw==",
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -24,17 +24,17 @@ export const liveData = (params, values, req) => {
|
||||
let cnt = 0
|
||||
values.forEach((x) => {
|
||||
let dat = new Date(x.datetime).getTime()
|
||||
series1.push([dat, x.values.noise_LAeq])
|
||||
series2.push([dat, x.values.noise_LA_max])
|
||||
series3.push([dat, x.values.noise_LA_min]) // put data and value into series array
|
||||
series1.push([dat, x.LAeq])
|
||||
series2.push([dat, x.LA_max])
|
||||
series3.push([dat, x.LA_min]) // put data and value into series array
|
||||
})
|
||||
|
||||
if (values.length != 0) {
|
||||
const lastidx = values.length - 1
|
||||
// Aktuelle Werte speichern
|
||||
aktVal['LAeq'] = values[lastidx].values.noise_LAeq
|
||||
aktVal['LAMax'] = values[lastidx].values.noise_LA_max
|
||||
aktVal['LAMin'] = values[lastidx].values.noise_LA_min
|
||||
aktVal['LAeq'] = values[lastidx].LAeq
|
||||
aktVal['LAMax'] = values[lastidx].LA_max
|
||||
aktVal['LAMin'] = values[lastidx].LA_min
|
||||
|
||||
// InfoTafel füllen
|
||||
infoTafel =
|
||||
|
||||
@@ -167,8 +167,11 @@ import {setCurrentTab, getCurrentTab, showError, fetchfromserver} from "./chart_
|
||||
return
|
||||
}
|
||||
params.sid = csid
|
||||
let ok = await showChart(params, 'live', 'dlive')
|
||||
let t = triggerTabList[1]
|
||||
let tt = new bootstrap.Tab(t)
|
||||
tt.show()
|
||||
setCurrentTab('livetab')
|
||||
let ok = await showChart(params, 'live', 'dlive')
|
||||
if (ok) {
|
||||
await loadAll(params)
|
||||
}
|
||||
|
||||
@@ -38,8 +38,10 @@ router.get('/:cmd', async function(req, res, next) {
|
||||
// if called as '/api' then directly return the data
|
||||
if ((calledAs === '/api') || (cmd === 'getoneproperty') || (cmd === 'getaddress')) {
|
||||
if(pretty) {
|
||||
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
|
||||
res.send(JSON.stringify(response.data,null,2))
|
||||
} else {
|
||||
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
||||
res.json(response.data)
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user