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

Added vendor_id


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