|
|
@ -177,7 +177,8 @@ function displayGraph(id, data, width, height, interpolation) { |
|
|
|
oneUrl = `${baseUrl}/id/${id}?limit=150`; |
|
|
|
oneUrl = `${baseUrl}/id/${id}?limit=150`; |
|
|
|
that.off('click'); |
|
|
|
that.off('click'); |
|
|
|
$.getJSON(oneUrl, function(data, textStatus, xhr) { |
|
|
|
$.getJSON(oneUrl, function(data, textStatus, xhr) { |
|
|
|
var extra = (data[0]['info']['sensor'] === "dht11" ? "humidity" : "moisture"); |
|
|
|
var isFlora = data[0]['info']['sensor'].toLowerCase().indexOf("flora") > -1; |
|
|
|
|
|
|
|
var extra = (isFlora ? 'humidity' : 'moisture'); |
|
|
|
var ks = ['temperature', extra]; |
|
|
|
var ks = ['temperature', extra]; |
|
|
|
for (var ik in ks) { |
|
|
|
for (var ik in ks) { |
|
|
|
var key = ks[ik]; |
|
|
|
var key = ks[ik]; |
|
|
@ -196,7 +197,8 @@ function displayGraph(id, data, width, height, interpolation) { |
|
|
|
var x = data[i]; |
|
|
|
var x = data[i]; |
|
|
|
addToList(x); |
|
|
|
addToList(x); |
|
|
|
addEleToDashBoard(x); |
|
|
|
addEleToDashBoard(x); |
|
|
|
var toHide = (x['info']['sensor'] === "dht11" ? 'moisture' : 'humidity'); |
|
|
|
var isFlora = x['info']['sensor'].toLowerCase().indexOf("flora") > -1; |
|
|
|
|
|
|
|
var toHide = (isFlora ? 'humidity' : 'moisture'); |
|
|
|
$('#' + x['device'].replace(/:/g, '_')).find('.'+ toHide).hide(); |
|
|
|
$('#' + x['device'].replace(/:/g, '_')).find('.'+ toHide).hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
reloadListener(); |
|
|
|
reloadListener(); |
|
|
|