#630 display full oui vendor

This commit is contained in:
Oliver Gorwits
2019-08-18 10:49:57 +01:00
parent c73c3e7569
commit 26dbb714df
4 changed files with 22 additions and 17 deletions

View File

@@ -43,7 +43,7 @@ $(document).ready(function() {
}, {
"data": 'oui.abbrev',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data ||'(Unknown Vendor)') + '</a>';
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(row.oui.abbrev || 'blank') + '">' + he.encode(row.oui.company ||'(Unknown Vendor)') + '</a>';
}
}, {
"data": 'port',
@@ -71,7 +71,7 @@ $(document).ready(function() {
{
"data": 'vendor',
"render": function(data, type, row, meta) {
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data ||'(Unknown Vendor)') + '</a>';
return '<a href="[% uri_for('/report/nodevendor') %]?vendor=' + encodeURIComponent(row.abbrev || 'blank') + '">' + he.encode(row.vendor ||'(Unknown Vendor)') + '</a>';
}
}, {
"data": 'count',

View File

@@ -1,11 +1,11 @@
[% USE CSV -%]
[% IF opt %]
[% CSV.dump(['MAC' 'Vendor' 'Company' 'Device' 'Port']) %]
[% CSV.dump(['MAC' 'Company' 'Device' 'Port']) %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% device = row.device.dns || row.device.name || row.switch %]
[% FOREACH col IN [ row.mac.upper row.oui.abbrev row.oui.company device row.port ] %]
[% FOREACH col IN [ row.mac.upper row.oui.company device row.port ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]