Files
netdisco/share/views/ajax/search/vlan.tt
nick n 6a36baa961 add a new tab to device -> vlans (#483)
* first steps for vlan tab

* export sort_vlans, use strict/warnings

* update manifest, get worker closer to functioning

* remove ie 9 script & extra ./th

* make it work

* cleanup

* readd internet explorer code

* start for csv output

* move things to debug logging instead of info

* use message which was discussed

* fix for address table sorting

* link os

* final touches thx to ollyg

* fetch origin/master

* VLAN is the preferred style for user interface usage

* does a missing libexpat-dev make travis builds complain?

* Revert "does a missing libexpat-dev make travis builds complain?"

This reverts commit 0cebc66f42708ff0f946213aab4bcbcc1b1b1379.
2019-01-14 21:57:37 +00:00

54 lines
2.2 KiB
Plaintext

<table id="vs-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>VLAN</th>
<th>Device</th>
<th>Description</th>
<th>Model</th>
<th>OS</th>
<th>Vendor</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#vs-data-table').dataTable({
"deferRender": true,
"data": [% results %],
"columns": [{
"data": 'vlans.vlan',
"render": function(data, type, row, meta) {
return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>';
}
}, {
"data": 'ip',
"render": function(data, type, row, meta) {
return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(row.dns || row.ip) + '</a>';
}
}, {
"data": 'vlans.description',
"render": function(data, type, row, meta) {
return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'model',
"render": function(data, type, row, meta) {
return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'os',
"render": function(data, type, row, meta) {
return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
}
}, {
"data": 'vendor',
"render": function(data, type, row, meta) {
return '<a class="nd_linkcell nd_stealth-link" href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(row.vlans.vlan) + '">' + he.encode(data || '') + '</a>';
}
}
],
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
});
});</script>