Commit ec413c8f authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

admin device view fix

parent 2e9e8353
...@@ -362,10 +362,11 @@ def administration_user_application_device_data(name, appkey, devid, var, dest, ...@@ -362,10 +362,11 @@ def administration_user_application_device_data(name, appkey, devid, var, dest,
if dest == 'graph': if dest == 'graph':
last = data.get_last_hours(appkey, devid, MAX_PG_ENTRIES_GRAPH_HOURS, int(page)) last = data.get_last_hours(appkey, devid, MAX_PG_ENTRIES_GRAPH_HOURS, int(page))
if last[0]: if last[0]:
arr = '[["Time", "{}"],'.format(var) arr = '['
last = [ddm.decode_datum(d, dev[3]) for d in last[1]] last = [ddm.decode_datum(d, dev[3]) for d in last[1]]
for d in last: for d in last:
arr += '[new Date('+str(d[0])+'*1000),'+str(d[2][var])+'],' if var in d[2]:
arr += '[new Date('+str(d[0])+'*1000),'+str(d[2][var])+'],'
arr += ']' arr += ']'
return arr return arr
elif dest == 'table': elif dest == 'table':
...@@ -375,7 +376,8 @@ def administration_user_application_device_data(name, appkey, devid, var, dest, ...@@ -375,7 +376,8 @@ def administration_user_application_device_data(name, appkey, devid, var, dest,
if last[0]: if last[0]:
last = [ddm.decode_datum(d, dev[3]) for d in last[1]] last = [ddm.decode_datum(d, dev[3]) for d in last[1]]
for d in last: for d in last:
t += '<tr><th>'+d[1]+'</th><th>'+str(d[2][var])+'</th></tr>' if var in d[2]:
t += '<tr><th>'+d[1]+'</th><th>'+str(d[2][var])+'</th></tr>'
return t return t
......
Supports Markdown
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