Skip to content
Snippets Groups Projects
Commit cf6a39b7 authored by jkerdreu's avatar jkerdreu
Browse files

Added infos..

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2320 b32b6428-25c9-4566-ad07-03861ab6144f
parent c3e5199a
Branches
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ def list_devices():
""" Return the list of devices in JSON"""
l = []
for dev in monitor.devices:
h = {'address':dev.address,'devtype':dev.devtype}
h = {'address':dev.address,'devtype':dev.devtype,'info':dev.description.get('info',None)}
l.append(h)
response.headers['Content-Type'] = 'application/json'
return json_encode(l)
......
......@@ -30,13 +30,14 @@ $("#hostname").html(window.location.hostname);
function update() {
$.getJSON(url, function(result){
$("#devices").html("<tr><th>DevType</th><th>Address</th></tr>");
$("#devices").html("<tr><th>DevType</th><th>Address</th><th>Info</th></tr>");
$.each(result, function(i, field){
var devtype= field['devtype'];
var addr= field['address'];
var json= "./device.html?addr="+addr;
var link= "<a href="+json+">"+addr+"</a>";
$("#devices").append("<tr><td>"+devtype+"</td><td>" +link+ "</td></tr>");
var info=field['info'];
$("#devices").append("<tr><td>"+devtype+"</td><td>" +link+ "</td><td>"+info+"</td></tr>");
});
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment