Commit 08c80160 authored by alain's avatar alain 🐙
Browse files

adjust for status info refactor

parent 7032dcd6
Pipeline #247 canceled with stages
# gammasense-data-app backend
## to install:
## to start:
......@@ -40,16 +40,17 @@ export default {
coordinates: sensor.coordinates.reverse(),
mean: null,
timestamp: null,
dataAge: null
dataAge: null,
status: null
}
if(sensorData) {
const dataAgeInHours = getDataAge(sensorData.timestamp, "hourly")
if(dataAgeInHours > 48) {
sensorDataReturn.name = sensorDataReturn.name + " (offline)"
sensorDataReturn.status = 0
} else if(dataAgeInHours > 8) {
sensorDataReturn.name = sensorDataReturn.name + " (geen recente data)"
sensorDataReturn.status = 1
} else {
sensorDataReturn.mean = sensorData.cpm_mean
sensorDataReturn.timestamp = sensorData.timestamp
......@@ -57,7 +58,7 @@ export default {
}
} else {
offlineSensors.push(sensor.id)
sensorDataReturn.name = sensorDataReturn.name + " (offline)"
sensorDataReturn.status = 0
}
return sensorDataReturn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment