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",
|
"program": "${workspaceFolder}/bin/www.js",
|
||||||
"env": {
|
"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
|
let cnt = 0
|
||||||
values.forEach((x) => {
|
values.forEach((x) => {
|
||||||
let dat = new Date(x.datetime).getTime()
|
let dat = new Date(x.datetime).getTime()
|
||||||
series1.push([dat, x.values.noise_LAeq])
|
series1.push([dat, x.LAeq])
|
||||||
series2.push([dat, x.values.noise_LA_max])
|
series2.push([dat, x.LA_max])
|
||||||
series3.push([dat, x.values.noise_LA_min]) // put data and value into series array
|
series3.push([dat, x.LA_min]) // put data and value into series array
|
||||||
})
|
})
|
||||||
|
|
||||||
if (values.length != 0) {
|
if (values.length != 0) {
|
||||||
const lastidx = values.length - 1
|
const lastidx = values.length - 1
|
||||||
// Aktuelle Werte speichern
|
// Aktuelle Werte speichern
|
||||||
aktVal['LAeq'] = values[lastidx].values.noise_LAeq
|
aktVal['LAeq'] = values[lastidx].LAeq
|
||||||
aktVal['LAMax'] = values[lastidx].values.noise_LA_max
|
aktVal['LAMax'] = values[lastidx].LA_max
|
||||||
aktVal['LAMin'] = values[lastidx].values.noise_LA_min
|
aktVal['LAMin'] = values[lastidx].LA_min
|
||||||
|
|
||||||
// InfoTafel füllen
|
// InfoTafel füllen
|
||||||
infoTafel =
|
infoTafel =
|
||||||
|
|||||||
@@ -167,8 +167,11 @@ import {setCurrentTab, getCurrentTab, showError, fetchfromserver} from "./chart_
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
params.sid = csid
|
params.sid = csid
|
||||||
let ok = await showChart(params, 'live', 'dlive')
|
let t = triggerTabList[1]
|
||||||
|
let tt = new bootstrap.Tab(t)
|
||||||
|
tt.show()
|
||||||
setCurrentTab('livetab')
|
setCurrentTab('livetab')
|
||||||
|
let ok = await showChart(params, 'live', 'dlive')
|
||||||
if (ok) {
|
if (ok) {
|
||||||
await loadAll(params)
|
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 called as '/api' then directly return the data
|
||||||
if ((calledAs === '/api') || (cmd === 'getoneproperty') || (cmd === 'getaddress')) {
|
if ((calledAs === '/api') || (cmd === 'getoneproperty') || (cmd === 'getaddress')) {
|
||||||
if(pretty) {
|
if(pretty) {
|
||||||
|
res.setHeader('Content-Type', 'text/plain; charset=utf-8');
|
||||||
res.send(JSON.stringify(response.data,null,2))
|
res.send(JSON.stringify(response.data,null,2))
|
||||||
} else {
|
} else {
|
||||||
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
||||||
res.json(response.data)
|
res.json(response.data)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user