relocate repo files so ND2 is the only code
This commit is contained in:
59
share/views/ajax/admintask/jobqueue.tt
Normal file
59
share/views/ajax/admintask/jobqueue.tt
Normal file
@@ -0,0 +1,59 @@
|
||||
[% IF NOT results.size %]
|
||||
<div class="span2 alert alert-info">The job queue is empty.</div>
|
||||
[% ELSE %]
|
||||
<table class="table table-bordered table-condensed table-hover nd_floatinghead">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Entered</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
<th class="nd_center-cell">Status</th>
|
||||
<th class="nd_center-cell">Device</th>
|
||||
<th class="nd_center-cell">Port</th>
|
||||
<th class="nd_center-cell">Param</th>
|
||||
<th class="nd_center-cell">User</th>
|
||||
<th class="nd_center-cell">Started</th>
|
||||
<th class="nd_center-cell">Finished</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr
|
||||
[% ' class="nd_jobqueueitem success"' IF row.status == 'done' %]
|
||||
[% ' class="nd_jobqueueitem error"' IF row.status == 'error' %]
|
||||
[% ' class="nd_jobqueueitem info"' IF row.status.search('^queued-') %]
|
||||
data-content="<pre>[% row.log | html_entity %]</pre>"
|
||||
>
|
||||
<td class="nd_center-cell">[% row.entered_stamp | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
[% FOREACH word IN row.action.split('_') %]
|
||||
[% word.ucfirst | html_entity %]
|
||||
[% END %]
|
||||
</td>
|
||||
[% IF row.status.search('^queued-') %]
|
||||
<td class="nd_center-cell">Running on "[% row.status.remove('^queued-') | html_entity %]"</td>
|
||||
[% ELSE %]
|
||||
<td class="nd_center-cell">[% row.status.ucfirst | html_entity %]</td>
|
||||
[% END %]
|
||||
<td class="nd_center-cell">
|
||||
[% IF row.action == 'discover' AND row.status == 'error' %]
|
||||
<a href="[% uri_for('/') %]?device=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
||||
[% ELSE %]
|
||||
<a href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a>
|
||||
[% END %]
|
||||
</td>
|
||||
<td class="nd_center-cell">[% row.port | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.subaction | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.username | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.started_stamp | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.finished_stamp | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="del" name="job" type="hidden" value="[% row.job | html_entity %]">
|
||||
<button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
88
share/views/ajax/admintask/nodemonitor.tt
Normal file
88
share/views/ajax/admintask/nodemonitor.tt
Normal file
@@ -0,0 +1,88 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Date Added</th>
|
||||
<th class="nd_center-cell">MAC Address</th>
|
||||
<th class="nd_center-cell">Enabled</th>
|
||||
<th class="nd_center-cell">Reason</th>
|
||||
<th class="nd_center-cell">Email</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="nd_center-cell"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="mac" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="active" type="checkbox" checked></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="why" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="cc" type="email"></td>
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
[% SET count = 0 %]
|
||||
[% WHILE (row = results.next) %]
|
||||
[% SET count = count + 1 %]
|
||||
<tr>
|
||||
<td class="nd_center-cell">[% row.date | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="mac" type="text" value="[% row.mac | html_entity %]">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="active" type="checkbox" [% 'checked="checked"' IF row.active %]>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="why" type="text" value="[% row.why | html_entity %]">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="cc" type="email" value="[% row.cc | html_entity %]">
|
||||
</td>
|
||||
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
|
||||
|
||||
<button class="btn" data-toggle="modal"
|
||||
data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
|
||||
|
||||
<div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
|
||||
<h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<p class="text-info">Monitor for "[% row.mac | html_entity %]" will be removed.</p>
|
||||
</blockquote>
|
||||
<input data-form="del" name="mac" type="hidden" value="[% row.mac | html_entity %]">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": [ 0, 2, 5 ],
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [ 0, 2, 5 ],
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
105
share/views/ajax/admintask/orphaned.tt
Normal file
105
share/views/ajax/admintask/orphaned.tt
Normal file
@@ -0,0 +1,105 @@
|
||||
[% IF orphans.size > 0 %]
|
||||
<div class="accordion" id="accordion-orphans">
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse-orphan" href="#collapse-orphan">
|
||||
<i class="icon-chevron-up"></i>
|
||||
Orphaned Devices
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-orphan" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Location</th>
|
||||
<th>Contact</th>
|
||||
<th>Vendor</th>
|
||||
<th>Model</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH row IN orphans %]
|
||||
<tr>
|
||||
<td><a href="[% uri_for('/device') %]?q=[% row.ip | uri %]">
|
||||
[% row.dns || row.name || row.ip | html_entity %]</a></td>
|
||||
<td>
|
||||
[% IF row.location %]
|
||||
<a href="[% search_device %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
|
||||
[% row.location | html_entity %]</a>
|
||||
[% ELSE %]
|
||||
[Not Set]
|
||||
[% END %]
|
||||
</td>
|
||||
<td>[% row.contact | html_entity %]</td>
|
||||
<td>[% row.vendor | html_entity %]</td>
|
||||
<td>[% row.model | html_entity %]</td>
|
||||
</tr>
|
||||
[%END%]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
[% END %]
|
||||
[%# The largest graph is considered the main network, all others are
|
||||
considered orphaned, so we need two to generate div %]
|
||||
[% IF graphs.size > 1 %]
|
||||
<div class="accordion" id="accordion-networks">
|
||||
[% count = 0 %]
|
||||
[% FOREACH network IN graphs %]
|
||||
[% count = count + 1 %]
|
||||
[%# The largest is not an orphan, so skip %]
|
||||
[% NEXT IF count == 1 %]
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-target="#collapse-[% count %]" href="#collapse-[% count %]">
|
||||
<i class="icon-chevron-up"></i>
|
||||
Orphaned Network: [% count - 1 | html_entity %] Size: [% network.size | html_entity %] Devices
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapse-[% count %]" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Location</th>
|
||||
<th>Contact</th>
|
||||
<th>Vendor</th>
|
||||
<th>Model</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH row IN network %]
|
||||
<tr>
|
||||
<td><a href="[% uri_for('/device') %]?tab=netmap&q=[% row.ip | uri %]">
|
||||
[% row.dns || row.name || row.ip | html_entity %]</a></td>
|
||||
<td>
|
||||
[% IF row.location %]
|
||||
<a href="[% search_device %]&q=[% row.location | uri %]&location=[% row.location | uri %]">
|
||||
[% row.location | html_entity %]</a>
|
||||
[% ELSE %]
|
||||
[Not Set]
|
||||
[% END %]
|
||||
</td>
|
||||
<td>[% row.contact | html_entity %]</td>
|
||||
<td>[% row.vendor | html_entity %]</td>
|
||||
<td>[% row.model | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
<script>
|
||||
$('.accordion').on('show hide', function (n) {
|
||||
$(n.target).siblings('.accordion-heading').find('.accordion-toggle i').toggleClass('icon-chevron-up icon-chevron-down');
|
||||
});
|
||||
</script>
|
||||
51
share/views/ajax/admintask/orphaned_csv.tt
Normal file
51
share/views/ajax/admintask/orphaned_csv.tt
Normal file
@@ -0,0 +1,51 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump(['Orphaned Devices']) %]
|
||||
|
||||
[% CSV.dump([ 'Device' 'IP' 'Device Location' 'Contact' ' Vendor'
|
||||
'Model' ]) %]
|
||||
|
||||
[% FOREACH row IN orphans %]
|
||||
[% mydlist = [] %]
|
||||
[% mydevice = row.dns || row.name %]
|
||||
[% mydlist.push(mydevice) %]
|
||||
[% mydlist.push(row.ip) %]
|
||||
[% mydlist.push(row.location) %]
|
||||
[% mydlist.push(row.contact) %]
|
||||
[% mydlist.push(row.vendor) %]
|
||||
[% mydlist.push(row.model) %]
|
||||
[% CSV.dump(mydlist) %]
|
||||
|
||||
[% END %]
|
||||
|
||||
[% IF graphs.size > 1 %]
|
||||
[% count = 0 %]
|
||||
[% FOREACH network IN graphs %]
|
||||
[% count = count + 1 %]
|
||||
[%# The largest is not an orphan, so skip %]
|
||||
[% NEXT IF count == 1 %]
|
||||
|
||||
[% CSV.dump([' ']) %]
|
||||
|
||||
[% ntwk_header = [] %]
|
||||
[% ntwk_header.push('Orphaned Network') %]
|
||||
[% ntwk_header.push(count - 1) %]
|
||||
|
||||
[% CSV.dump(ntwk_header) %]
|
||||
|
||||
[% CSV.dump([ 'Device' 'IP' 'Device Location' 'Contact' ' Vendor'
|
||||
'Model' ]) %]
|
||||
|
||||
[% FOREACH row IN network %]
|
||||
[% mydlist = [] %]
|
||||
[% mydevice = row.dns || row.name %]
|
||||
[% mydlist.push(mydevice) %]
|
||||
[% mydlist.push(row.ip) %]
|
||||
[% mydlist.push(row.location) %]
|
||||
[% mydlist.push(row.contact) %]
|
||||
[% mydlist.push(row.vendor) %]
|
||||
[% mydlist.push(row.model) %]
|
||||
[% CSV.dump(mydlist) %]
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
55
share/views/ajax/admintask/performance.tt
Normal file
55
share/views/ajax/admintask/performance.tt
Normal file
@@ -0,0 +1,55 @@
|
||||
[% IF results.count == 0 %]
|
||||
<div class="span3 alert alert-info">The aren't enough jobs to report.</div>
|
||||
[% ELSE %]
|
||||
<table id="app-data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
<th class="nd_center-cell">Number of Devices</th>
|
||||
<th class="nd_center-cell">Queued At</th>
|
||||
<th class="nd_center-cell">Started</th>
|
||||
<th class="nd_center-cell">Finished</th>
|
||||
<th class="nd_center-cell">Time Elapsed</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr
|
||||
[% IF NOT mac AND row.action == 'macsuck' %]
|
||||
class="info"
|
||||
[% SET mac = 1 %]
|
||||
[% ELSIF NOT arp AND row.action == 'arpnip' %]
|
||||
class="info"
|
||||
[% SET arp = 1 %]
|
||||
[% ELSIF NOT dis AND row.action == 'discover' %]
|
||||
class="info"
|
||||
[% SET dis = 1 %]
|
||||
[% ELSIF NOT nbt AND row.action == 'nbtstat' %]
|
||||
class="info"
|
||||
[% SET nbt = 1 %]
|
||||
[% END %]
|
||||
>
|
||||
<td class="nd_center-cell">[% row.action.ucfirst | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.number | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.entered_stamp | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.start | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.end | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.elapsed | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#app-data-table').dataTable({
|
||||
"paging": false,
|
||||
"searching": false,
|
||||
"info": false,
|
||||
"order": [[ 2, 'desc' ], [ 5, 'desc' ]],
|
||||
"pageLength": 50
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
75
share/views/ajax/admintask/pseudodevice.tt
Normal file
75
share/views/ajax/admintask/pseudodevice.tt
Normal file
@@ -0,0 +1,75 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Device Name</th>
|
||||
<th class="nd_center-cell">Device IP</th>
|
||||
<th class="nd_center-cell">Number of Ports</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="nd_center-cell"><input data-form="add" name="dns" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="ip" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="ports" type="number"></td>
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
[% SET count = 0 %]
|
||||
[% WHILE (row = results.next) %]
|
||||
[% SET count = count + 1 %]
|
||||
<tr>
|
||||
<td class="nd_center-cell"><a class="nd_linkcell"
|
||||
href="[% uri_for('/device') %]?q=[% row.ip | uri %]">[% row.dns | html_entity %]</a></td>
|
||||
<td class="nd_center-cell">[% row.ip | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="ports" type="number" value="[% row.port_count | html_entity %]">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="dns" type="hidden" value="[% row.dns | html_entity %]">
|
||||
<input data-form="update" name="ip" type="hidden" value="[% row.ip | html_entity %]">
|
||||
<button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
|
||||
|
||||
<button class="btn" data-toggle="modal"
|
||||
data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
|
||||
|
||||
<div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
|
||||
<h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<p class="text-info">
|
||||
Pseudo-device "[% row.dns | html_entity %] / [% row.ip | html_entity %]" will be deleted.</p>
|
||||
</blockquote>
|
||||
<input data-form="del" name="dns" type="hidden" value="[% row.dns | html_entity %]">
|
||||
<input data-form="del" name="ip" type="hidden" value="[% row.ip | html_entity %]">
|
||||
<input data-form="del" name="ports" type="hidden" value="[% row.port_count | html_entity %]">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"columnDefs": [ {
|
||||
"targets": [ 2, 3 ],
|
||||
"orderable": false,
|
||||
"searchable": false
|
||||
} ],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
39
share/views/ajax/admintask/slowdevices.tt
Normal file
39
share/views/ajax/admintask/slowdevices.tt
Normal file
@@ -0,0 +1,39 @@
|
||||
[% IF results.count == 0 %]
|
||||
<div class="span3 alert alert-info">The aren't enough jobs to report.</div>
|
||||
[% ELSE %]
|
||||
<table id="asd-data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
<th class="nd_center-cell">Device</th>
|
||||
<th class="nd_center-cell">Started</th>
|
||||
<th class="nd_center-cell">Finished</th>
|
||||
<th class="nd_center-cell">Time Elapsed</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr>
|
||||
<td class="nd_center-cell">[% row.action.ucfirst | html_entity %]</td>
|
||||
<td class="nd_center-cell"><a class="nd_linkcell"
|
||||
href="[% uri_for('/device') %]?q=[% row.device | uri %]">[% row.device | html_entity %]</a></td>
|
||||
<td class="nd_center-cell">[% row.started | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.finished | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.elapsed | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#asd-data-table').dataTable({
|
||||
"paging": false,
|
||||
"searching": false,
|
||||
"info": false,
|
||||
"order": [[ 4, 'desc' ], [ 0, 'asc' ], [ 1, 'asc' ] ],
|
||||
"pageLength": 12
|
||||
});
|
||||
} );
|
||||
</script>
|
||||
101
share/views/ajax/admintask/topology.tt
Normal file
101
share/views/ajax/admintask/topology.tt
Normal file
@@ -0,0 +1,101 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Left Device</th>
|
||||
<th class="nd_center-cell">Left Port</th>
|
||||
<th class="nd_center-cell">Right Device</th>
|
||||
<th class="nd_center-cell">Right Port</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="nd_center-cell">
|
||||
<div class="input-append">
|
||||
<input data-form="add" class="nd_topo_dev nd_topo_dev1" name="dev1" type="text">
|
||||
<span class="add-on nd_topo_dev_caret"><i class="icon-caret-down icon-large"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<div class="input-append">
|
||||
<input data-form="add" class="nd_topo_port nd_topo_dev1" name="port1" type="text">
|
||||
<span class="add-on nd_topo_port_caret"><i class="icon-caret-down icon-large"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<div class="input-append">
|
||||
<input data-form="add" class="nd_topo_dev nd_topo_dev2" name="dev2" type="text">
|
||||
<span class="add-on nd_topo_dev_caret"><i class="icon-caret-down icon-large"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<div class="input-append">
|
||||
<input data-form="add" class="nd_topo_port nd_topo_dev2" name="port2" type="text">
|
||||
<span class="add-on nd_topo_port_caret"><i class="icon-caret-down icon-large"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
[% SET count = 0 %]
|
||||
[% WHILE (row = results.next) %]
|
||||
[% SET count = count + 1 %]
|
||||
<tr>
|
||||
<td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') %]?q=[% row.device1.ip | uri %]">
|
||||
[% (row.device1.dns || row.device1.name || row.device1.ip) | html_entity %]</a>
|
||||
</td>
|
||||
<td class="nd_center-cell">[% row.port1 | html_entity %]</td>
|
||||
<td class="nd_center-cell"><a class="nd_linkcell" href="[% uri_for('/device') %]?q=[% row.device2.ip | uri %]">
|
||||
[% (row.device2.dns || row.device2.name || row.device2.ip) | html_entity %]</a></td>
|
||||
<td class="nd_center-cell">[% row.port2 | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn" data-toggle="modal"
|
||||
data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
|
||||
|
||||
<div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
|
||||
<h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<p class="text-info">The link between these two ports will be removed:</p>
|
||||
<p> </p>
|
||||
<ul>
|
||||
<li><p class="text-info">[% (row.device1.dns || row.device1.name || row.device1.ip) | html_entity %],
|
||||
[% row.port1 | html_entity %]</p></li>
|
||||
<li><p class="text-info">[% (row.device2.dns || row.device2.name || row.device2.ip) | html_entity %],
|
||||
[% row.port2 | html_entity %]</p></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<input data-form="del" name="dev1" type="hidden" value="[% row.dev1 | html_entity %]">
|
||||
<input data-form="del" name="port1" type="hidden" value="[% row.port1 | html_entity %]">
|
||||
<input data-form="del" name="dev2" type="hidden" value="[% row.dev2 | html_entity %]">
|
||||
<input data-form="del" name="port2" type="hidden" value="[% row.port2 | html_entity %]">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"columnDefs": [ {
|
||||
"targets": [ 4 ],
|
||||
"orderable": false,
|
||||
"searchable": false
|
||||
} ],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
42
share/views/ajax/admintask/undiscoveredneighbors.tt
Normal file
42
share/views/ajax/admintask/undiscoveredneighbors.tt
Normal file
@@ -0,0 +1,42 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Observing Device</th>
|
||||
<th>Undiscovered Neighbor</th>
|
||||
<th class="nd_center-cell">Last Discovery Attempt</th>
|
||||
<th class="nd_center-cell">Last Discovery Log</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td><a href="[% device_ports %]&q=[% row.ip | uri %]&f=[% row.port | uri %]">
|
||||
[% row.dns || row.name || row.ip | html_entity %] ( [% row.port | html_entity %] ) </a></td>
|
||||
<td>
|
||||
[% IF row.remote_ip %]
|
||||
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
|
||||
[% row.remote_ip | html_entity %]
|
||||
</a> ([% row.remote_port | html_entity %])
|
||||
[% '<br />' IF row.remote_id or row.remote_type %]
|
||||
[% ' id: '_ row.remote_id IF row.remote_id %]
|
||||
[% ' type: '_ row.remote_type IF row.remote_type %]
|
||||
[% ELSE %]
|
||||
Known Device's MAC Address seen on this Port during Macsuck
|
||||
[% END %]
|
||||
</td>
|
||||
<td class="nd_center-cell">[% row.finished | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.log | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"order": [[ 2, 'desc' ], [ 1, 'asc' ] ],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
18
share/views/ajax/admintask/undiscoveredneighbors_csv.tt
Normal file
18
share/views/ajax/admintask/undiscoveredneighbors_csv.tt
Normal file
@@ -0,0 +1,18 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Observing Device' 'Device Port'
|
||||
'Remote IP' 'Remote Port' 'Remote ID' 'Remote Type'
|
||||
'Last Discovery Attempt' 'Discovery Log']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.remote_ip) %]
|
||||
[% mylist.push(row.remote_port) %]
|
||||
[% mylist.push(row.remote_id) %]
|
||||
[% mylist.push(row.remote_type) %]
|
||||
[% mylist.push(row.finished) %]
|
||||
[% mylist.push(row.log) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
61
share/views/ajax/admintask/userlog.tt
Normal file
61
share/views/ajax/admintask/userlog.tt
Normal file
@@ -0,0 +1,61 @@
|
||||
[% IF results.count == 0 %]
|
||||
<div class="span2 alert alert-info">The user activity log is empty.</div>
|
||||
[% ELSE %]
|
||||
<table id="aul-data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Creation</th>
|
||||
<th class="nd_center-cell">User</th>
|
||||
<th class="nd_center-cell">User IP</th>
|
||||
<th class="nd_center-cell">Event</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#aul-data-table').dataTable( {
|
||||
"serverSide": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/control/admin/userlog/data') %]",
|
||||
"columns": [{
|
||||
"data": 'creation',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return moment(data).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
}, {
|
||||
"data": 'username',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'userip',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'event',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'entry',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<input data-form="del" name="entry" type="hidden" value="' + encodeURIComponent(data) +
|
||||
'"><button class="btn nd_adminbutton" name="del" type="submit"><i class="icon-trash text-error"></i></button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
106
share/views/ajax/admintask/users.tt
Normal file
106
share/views/ajax/admintask/users.tt
Normal file
@@ -0,0 +1,106 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Full Name</th>
|
||||
<th class="nd_center-cell">Username</th>
|
||||
<th class="nd_center-cell">Password</th>
|
||||
<th class="nd_center-cell">LDAP Auth</th>
|
||||
<th class="nd_center-cell">Port Control</th>
|
||||
<th class="nd_center-cell">Administrator</th>
|
||||
<th class="nd_center-cell">Created</th>
|
||||
<th class="nd_center-cell">Last Login</th>
|
||||
<th class="nd_center-cell">Note</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="nd_center-cell"><input data-form="add" name="fullname" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="username" type="text"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="password" type="password"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" type="checkbox" name="ldap"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" type="checkbox" name="port_control"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" type="checkbox" name="admin"></td>
|
||||
<td class="nd_center-cell"></td>
|
||||
<td class="nd_center-cell"></td>
|
||||
<td class="nd_center-cell"><input data-form="add" name="note" type="text"></td>
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
[% SET count = 0 %]
|
||||
[% FOREACH row IN results %]
|
||||
[% SET count = count + 1 %]
|
||||
<tr>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="fullname" type="text" value="[% row.fullname | html_entity %]">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="username" type="text" value="[% row.username | html_entity %]">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="password" type="password" value="********">
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="ldap" type="checkbox" [% 'checked="checked"' IF row.ldap %]>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="port_control" type="checkbox" [% 'checked="checked"' IF row.port_control %]>
|
||||
</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="admin" type="checkbox" [% 'checked="checked"' IF row.admin %]>
|
||||
</td>
|
||||
<td class="nd_center-cell">[% row.created | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.last_seen | html_entity %]</td>
|
||||
<td class="nd_center-cell">
|
||||
<input data-form="update" name="note" type="text" value="[% row.note | html_entity %]">
|
||||
</td>
|
||||
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn nd_adminbutton" name="update" type="submit"><i class="icon-save text-warning"></i></button>
|
||||
|
||||
<button class="btn" data-toggle="modal"
|
||||
data-target="#nd_devdel-[% count %]" type="button"><i class="icon-trash text-error"></i></button>
|
||||
|
||||
<div id="nd_devdel-[% count %]" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-labelledby="nd_devdel-label-[% count %]" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
|
||||
<h3 id="nd_devdel-label-[% count %]">Are you sure?</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<p class="text-info">User "[% row.username | html_entity %]" will be deleted.</p>
|
||||
</blockquote>
|
||||
<input data-form="del" name="username" type="hidden" value="[% row.username | html_entity %]">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn btn-danger nd_adminbutton" name="del" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": [ 2, 3, 4, 5, 6, 7, 8, 9 ],
|
||||
"searchable": false
|
||||
},
|
||||
{
|
||||
"targets": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
18
share/views/ajax/admintask/users_csv.tt
Normal file
18
share/views/ajax/admintask/users_csv.tt
Normal file
@@ -0,0 +1,18 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Full Name' 'Username'
|
||||
'LDAP Auth' 'Port Control' 'Administrator' 'Created'
|
||||
'Last Login' 'Note']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.fullname) %]
|
||||
[% mylist.push(row.username) %]
|
||||
[% mylist.push(row.ldap) %]
|
||||
[% mylist.push(row.port_control) %]
|
||||
[% mylist.push(row.admin) %]
|
||||
[% mylist.push(row.created) %]
|
||||
[% mylist.push(row.last_seen) %]
|
||||
[% mylist.push(row.note) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
24
share/views/ajax/datatabledefaults.tt
Normal file
24
share/views/ajax/datatabledefaults.tt
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
"processing": true
|
||||
,"stateSave": true
|
||||
,"pageLength": [% settings.table_pagesize %]
|
||||
,"lengthMenu": [% table_showrecordsmenu %]
|
||||
,"dom": '<"top"l<"nd_datatables-pager"p>f>rit<"bottom"><"clear">'
|
||||
,"language": {
|
||||
"search": '_INPUT_'
|
||||
,"searchPlaceholder": 'Filter records...'
|
||||
,"lengthMenu": "Show _MENU_ records."
|
||||
,"info": " Showing _START_ to _END_ of _TOTAL_"
|
||||
,"infoFiltered": "(filtered from _MAX_ total)"
|
||||
,"infoEmpty": " No matching entries"
|
||||
}
|
||||
,"stateSaveParams": function (settings, data) {
|
||||
// make sure filter is never saved
|
||||
data.search.search = "";
|
||||
// make sure paging position is not saved
|
||||
data.start = 0;
|
||||
[% IF is_custom_report %]
|
||||
// disable sorting for custom reports
|
||||
data.order = "";
|
||||
[% END %]
|
||||
}
|
||||
52
share/views/ajax/device/addresses.tt
Normal file
52
share/views/ajax/device/addresses.tt
Normal file
@@ -0,0 +1,52 @@
|
||||
<table id="da-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Address</th>
|
||||
<th>DNS</th>
|
||||
<th class="nd_center-cell">Interface</th>
|
||||
<th>Description</th>
|
||||
<th>Prefix</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#da-data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'alias',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'dns',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'subnet',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
11
share/views/ajax/device/addresses_csv.tt
Normal file
11
share/views/ajax/device/addresses_csv.tt
Normal file
@@ -0,0 +1,11 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Address' 'DNS' 'Interface' 'Description' 'Prefix' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% FOREACH col IN [ row.alias row.dns row.port row.device_port.name row.subnet ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
199
share/views/ajax/device/details.tt
Normal file
199
share/views/ajax/device/details.tt
Normal file
@@ -0,0 +1,199 @@
|
||||
[% SET user_can_port_control = user_has_role('port_control') %]
|
||||
<table class="table table-condensed table-striped">
|
||||
</tbody>
|
||||
<tr>
|
||||
<td>System Name</td>
|
||||
<td>[% d.name %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location
|
||||
[% IF user_can_port_control %]
|
||||
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
|
||||
[% END %]
|
||||
</td>
|
||||
[% IF user_can_port_control %]
|
||||
<td class="nd_editable-cell" contenteditable="true"
|
||||
data-field="location" data-for-device="[% d.ip %]">
|
||||
[% d.location | html_entity %]
|
||||
</td>
|
||||
[% ELSE %]
|
||||
<td>
|
||||
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
|
||||
href="[% search_device %]&q=[% d.location | uri %]&location=[% d.location | uri %]">[% d.location | html_entity %]</a>
|
||||
</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contact
|
||||
[% IF user_can_port_control %]
|
||||
<i class="icon-edit nd_edit-icon nd_device-details-edit"></i>
|
||||
[% END %]
|
||||
</td>
|
||||
[% IF user_can_port_control %]
|
||||
<td class="nd_editable-cell" contenteditable="true"
|
||||
data-field="contact" data-for-device="[% d.ip | html_entity %]">
|
||||
[% d.contact | html_entity %]
|
||||
</td>
|
||||
[% ELSE %]
|
||||
<td>[% d.contact | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vendor / Model</td>
|
||||
<td>
|
||||
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
|
||||
href="[% search_device %]&q=[% d.vendor | uri %]&vendor=[% d.vendor | uri %]">[% d.vendor | html_entity %]</a>
|
||||
/
|
||||
<a rel="tooltip" data-placement="top" data-offset="5" data-title="Find Similar Devices"
|
||||
href="[% search_device %]&q=[% d.model | uri %]&model=[% d.model | uri %]">[% d.model | html_entity %]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>OS / Version</td>
|
||||
<td>[% d.os | html_entity %] /
|
||||
<a rel="tooltip" data-placement="top" data-offset="5"
|
||||
data-title="Find Similar Devices"
|
||||
href="[% search_device %]&q=[% d.os_ver | uri %]&os_ver=[% d.os_ver | uri %]">[% d.os_ver | html_entity %]</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serial Number</td>
|
||||
<td>[% d.serial | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>[% d.description | html_entity | html_line_break %]</td>
|
||||
</tr>
|
||||
[% IF settings._extra_device_details.size %]
|
||||
[% FOREACH config IN settings._extra_device_details %]
|
||||
<tr>
|
||||
<td>
|
||||
[% config.label %]
|
||||
</td>
|
||||
<td>
|
||||
[% TRY %]
|
||||
[% INCLUDE "plugin/${config.name}/device_details.tt" %]
|
||||
[% CATCH %]
|
||||
<!-- dummy content required by Template Toolkit TRY -->
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
[% END %]
|
||||
<tr>
|
||||
<td>Administration</td>
|
||||
<td>
|
||||
<a href="ssh://[% d.ip | uri %]" target="_blank">
|
||||
<span class="label label-info"><i class="icon-keyboard"></i> SSH</span></a>
|
||||
<a href="telnet://[% d.ip | uri %]" target="_blank">
|
||||
<span class="label label-info"><i class="icon-keyboard"></i> Telnet</span></a>
|
||||
<a href="https://[% d.ip | uri %]/" target="_blank">
|
||||
<span class="label label-info"><i class="icon-external-link"></i> Web</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SNMP Class</td>
|
||||
<td><a target="_blank" href="https://metacpan.org/pod/[% d.snmp_class | uri %]">[% d.snmp_class | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Uptime</td>
|
||||
<td>[% d.uptime_age | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Layers</td>
|
||||
<td>
|
||||
[% d.layers.substr(7,1) ? '<span class="badge badge-success">1</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(6,1) ? '<span class="badge badge-success">2</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(5,1) ? '<span class="badge badge-success">3</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(4,1) ? '<span class="badge badge-success">4</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(3,1) ? '<span class="badge badge-success">5</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(2,1) ? '<span class="badge badge-success">6</span>' : '<span class="badge"> </span>' %]
|
||||
[% d.layers.substr(1,1) ? '<span class="badge badge-success">7</span>' : '<span class="badge"> </span>' %]
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Discover</td>
|
||||
<td>[% d.last_discover_stamp | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Arpnip</td>
|
||||
<td>[% d.last_arpnip_stamp | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last Macsuck</td>
|
||||
<td>[% d.last_macsuck_stamp | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hardware Status</td>
|
||||
<td>Fan: [% d.fan | html_entity %]
|
||||
<br/>PS1 [[% d.ps1_type | html_entity %]]: [% d.ps1_status | html_entity %]
|
||||
<br/>PS2 [[% d.ps2_type | html_entity %]]: [% d.ps2_status | html_entity %]</td>
|
||||
</tr>
|
||||
[% IF p.size %]
|
||||
<tr>
|
||||
<td>PoE Status</td>
|
||||
<td>
|
||||
[% FOREACH m IN p %]
|
||||
[% UNLESS m.module == 1 %]
|
||||
<br/>
|
||||
[% END %]
|
||||
Module [% m.module %]: [% m.status | html_entity %], [% m.poe_capable_ports %] power-capable ports, [% m.poe_powered_ports %] powered ([% m.poe_disabled_ports %] admin disabled, [% m.poe_errored_ports %] errors), [% m.poe_power_committed %]/[% m.power %] watts committed.
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
<tr>
|
||||
<td>MAC Address</td>
|
||||
<td>[% d.mac | html_entity %]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VTP Domain</td>
|
||||
<td>[% d.vtp_domain | html_entity %]</td>
|
||||
</tr>
|
||||
[% IF user_has_role('admin') %]
|
||||
<tr data-for-device="[% d.ip %]">
|
||||
<td>Admin Tasks</td>
|
||||
<td>
|
||||
<input type="hidden" data-form="discover" value="[% d.ip %]" name="device"/>
|
||||
<button class="btn btn-info btn-small nd_adminbutton" name="discover">Discover</button>
|
||||
<input type="hidden" data-form="arpnip" value="[% d.ip %]" name="device"/>
|
||||
<button class="btn btn-info btn-small nd_adminbutton" name="arpnip">Arpnip</button>
|
||||
<input type="hidden" data-form="macsuck" value="[% d.ip %]" name="device"/>
|
||||
<button class="btn btn-info btn-small nd_adminbutton" name="macsuck">Macsuck</button>
|
||||
<input type="hidden" data-form="nbtstat" value="[% d.ip %]" name="device"/>
|
||||
<button class="btn btn-info btn-small nd_adminbutton" name="nbtstat">NBTstat</button>
|
||||
|
||||
<button class="btn btn-danger btn-small pull-right"
|
||||
data-toggle="modal" data-target="#nd_devdel" type="button">Delete</button>
|
||||
|
||||
<div id="nd_devdel" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-labelledby="nd_devdel-label" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
|
||||
<h3 id="nd_devdel-label">Confirm Delete: [% d.dns || d.ip | html_entity %]</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li><p>This action is immediate and not reversible</p></li>
|
||||
<li><p>All associated Nodes may be removed from the database</p></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
<textarea id="nd_devdel-log" class="input-block-level" rows="2" data-form="delete"
|
||||
placeholder="Enter a log message" name="log"></textarea>
|
||||
<label class="checkbox">
|
||||
<input id="nd_devdel-archive" type="checkbox" data-form="delete" name="archive">
|
||||
<h4 class="nd_unbolden">Archive Nodes</h4>
|
||||
</label>
|
||||
<input type="hidden" data-form="delete" value="[% d.ip %]" name="device"/>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button class="btn btn-danger nd_adminbutton" name="delete" data-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
60
share/views/ajax/device/modules.tt
Normal file
60
share/views/ajax/device/modules.tt
Normal file
@@ -0,0 +1,60 @@
|
||||
[% BLOCK recurse -%]
|
||||
[% INCLUDE print_line item=item %]
|
||||
[% IF nodes.$item.children.defined -%]
|
||||
<ul>
|
||||
[% FOREACH kidtype IN nodes.$item.children.keys -%]
|
||||
[%- FOREACH kid IN nodes.$item.children.$kidtype -%]
|
||||
[%- IF kid -%]
|
||||
[% INCLUDE recurse item=kid %]
|
||||
[%- END -%]
|
||||
[%- END -%]
|
||||
[%- END -%]
|
||||
</ul>
|
||||
[% END -%]
|
||||
</li>
|
||||
[%- END -%]
|
||||
[% BLOCK print_line -%]
|
||||
<li>
|
||||
[% IF nodes.$item.children.defined -%]
|
||||
<span><i class="icon-minus-sign text-info"></i>
|
||||
[%- ELSE -%]
|
||||
<span><i class="icon-leaf"></i>
|
||||
[%- END -%]
|
||||
<a href="[% uri_for('/report/moduleinventory') %]?description=[% nodes.$item.module.description | uri %]">[% nodes.$item.module.description -%]</a>
|
||||
[%- IF nodes.$item.module.name -%]
|
||||
<a href="[% uri_for('/report/moduleinventory') %]?name=[% nodes.$item.module.name | uri %]">([% nodes.$item.module.name %])</a>
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.fw_ver -%]
|
||||
fw: [% nodes.$item.module.fw_ver %]
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.hw_ver -%]
|
||||
hw: [% nodes.$item.module.hw_ver %]
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.sw_ver -%]
|
||||
sw: [% nodes.$item.module.sw_ver %]
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.serial -%]
|
||||
<a href="[% uri_for('/report/moduleinventory') %]?serial=[% nodes.$item.module.serial | uri %]">[serial: [% nodes.$item.module.serial %]]</a>
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.type -%]
|
||||
/ <a href="[% uri_for('/report/moduleinventory') %]?type=[% nodes.$item.module.type | uri %]">[% nodes.$item.module.type %]</a>
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.model -%]
|
||||
/ <a href="[% uri_for('/report/moduleinventory') %]?model=[% nodes.$item.module.model | uri %]">[% nodes.$item.module.model %]</a>
|
||||
[%- END -%]
|
||||
[%- IF nodes.$item.module.fru -%]
|
||||
<b>[FRU]</b>
|
||||
[%- END -%]
|
||||
</span>
|
||||
[%- END -%]
|
||||
<div class="tree">
|
||||
<ul>
|
||||
[% FOREACH module IN nodes.root %]
|
||||
[% INCLUDE recurse item=module %]
|
||||
[%- END -%]
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
[%+ INCLUDE 'js/bootstrap-tree.js' -%]
|
||||
</script>
|
||||
187
share/views/ajax/device/netmap.tt
Normal file
187
share/views/ajax/device/netmap.tt
Normal file
@@ -0,0 +1,187 @@
|
||||
<script>
|
||||
|
||||
var winHeight = window.innerHeight;
|
||||
var winWidth = window.innerWidth;
|
||||
|
||||
// links in the initial tree drawing use this generator
|
||||
var treeLink = d3.svg.diagonal.radial()
|
||||
.projection(function(d) { return [d.y, d.x / 180 * Math.PI]; });
|
||||
|
||||
// actual device neighbor links use this generator
|
||||
var neighLink = d3.svg.diagonal.radial();
|
||||
|
||||
// store x,y for all circles on the map
|
||||
var loc = {};
|
||||
// store actual links between all nodes
|
||||
var neighbors_data = {};
|
||||
|
||||
// main SVG background, with support for pan/zoom
|
||||
var svg = d3.select("#netmap_pane").append("svg")
|
||||
.attr("width", winWidth - 50)
|
||||
.attr("height", winHeight - 100)
|
||||
.attr("pointer-events", "all")
|
||||
.append('g')
|
||||
.call(d3.behavior.zoom().on("zoom", redraw))
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + winHeight / 2 + "," + winHeight / 2 + ")");
|
||||
|
||||
// this is the image background
|
||||
// XXX there must be a way to discover the radial tree's size?
|
||||
svg.append('rect')
|
||||
.attr("x", (0 - (winHeight * 2)))
|
||||
.attr('width', "400%")
|
||||
.attr("y", (0 - (winHeight * 2)))
|
||||
.attr('height', "400%")
|
||||
.attr('fill', 'white');
|
||||
|
||||
// handle pan and zoom
|
||||
function redraw() {
|
||||
svg.attr("transform",
|
||||
"translate(" + d3.event.translate + ")"
|
||||
+ "scale(" + d3.event.scale + ")"
|
||||
+ "translate(" + (winHeight / 2) + "," + (winHeight / 2) + ")");
|
||||
}
|
||||
|
||||
// save the x,y of an element into the loc dictionary
|
||||
function recordLocation(d,i) {
|
||||
var rect = this.getBoundingClientRect();
|
||||
loc[d.name] = {
|
||||
'x': (rect.left + ((rect.right - rect.left) / 2))
|
||||
,'y': (rect.top + ((rect.bottom - rect.top) / 2))
|
||||
};
|
||||
}
|
||||
|
||||
// convert a device name to a valid CSS class name
|
||||
function to_class(name) { return 'nd_' + name.replace(/\./g, "_") }
|
||||
|
||||
// handler for clicking on a circle - redirect to that device's netmap
|
||||
function circleClick(d) {
|
||||
window.location = '[% uri_for('/device') %]?tab=netmap'
|
||||
+ '&q=' + d.fullname
|
||||
+ '&depth=[% params.depth | uri %]'
|
||||
+ '&vlan=[% params.vlan | uri %]';
|
||||
}
|
||||
|
||||
// handler for mouseover on a circle - show that device's real neighbors
|
||||
function circleOver(d) {
|
||||
$('.link').hide();
|
||||
$('path.' + to_class(d.name)).show();
|
||||
$(this).css('cursor', 'pointer');
|
||||
|
||||
$.each(neighbors_data[d.name], function(idx, target) {
|
||||
if (! (target in loc)) { return true }
|
||||
$('circle.' + to_class(target)).css('fill', '#e96cfa');
|
||||
});
|
||||
}
|
||||
|
||||
// handler for mouseout on a circle - hide real neighbours and show treeLinks
|
||||
function circleOut(d) {
|
||||
$.each(neighbors_data[d.name], function(idx, target) {
|
||||
if (! (target in loc)) { return true }
|
||||
$('circle.' + to_class(target)).css('fill', '#fff');
|
||||
});
|
||||
|
||||
$(this).css('cursor', 'auto');
|
||||
$('path.' + to_class(d.name)).hide();
|
||||
$('.link').show();
|
||||
}
|
||||
|
||||
// load all device connections into neighbors_data dictionary
|
||||
$.getJSON('[% uri_for('/ajax/data/device/alldevicelinks') %]', function(data) {
|
||||
neighbors_data = data;
|
||||
|
||||
// draw the tree
|
||||
d3.json("[% uri_for('/ajax/data/device/netmap') %]?"
|
||||
+ '&q=[% params.q | uri %]'
|
||||
+ '&depth=[% params.depth | uri %]'
|
||||
+ '&vlan=[% params.vlan | uri %]', function(error, root) {
|
||||
var tree = d3.layout.tree()
|
||||
// magic number "8" for scaling (network depth). seems to make things look right for me.
|
||||
.size([360, (winHeight / 8 * (root['scale'] || 0))])
|
||||
.separation(function(a, b) { return (a.parent == b.parent ? 1 : 2) / a.depth; });
|
||||
|
||||
var nodes = tree.nodes(root),
|
||||
links = tree.links(nodes);
|
||||
|
||||
var link = svg.selectAll(".link")
|
||||
.data(links)
|
||||
.enter().append("path")
|
||||
.attr("class", "link")
|
||||
.attr("d", treeLink);
|
||||
|
||||
var node = svg.selectAll(".node")
|
||||
.data(nodes)
|
||||
.enter().append("g")
|
||||
.attr("class", "node")
|
||||
.attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; });
|
||||
|
||||
// begin to draw...
|
||||
d3.select("#nd_waiting").remove();
|
||||
|
||||
node.append("circle")
|
||||
.attr("r", 4.5)
|
||||
// circle has class name of its device, so we can show/hide it
|
||||
.attr("class", function(d) { return to_class(d.name) })
|
||||
// store the x,y of every circle we've just drawn
|
||||
.each(recordLocation)
|
||||
// handlers for mouse interaction with the circles
|
||||
.on("click", circleClick)
|
||||
.on("mouseover", circleOver)
|
||||
.on("mouseout", circleOut);
|
||||
|
||||
node.append("text")
|
||||
.attr("dy", ".31em")
|
||||
.attr("text-anchor", function(d) { return d.x < 180 ? "start" : "end"; })
|
||||
.attr("transform", function(d) { return d.x < 180 ? "translate(8)" : "rotate(180)translate(-8)"; })
|
||||
.text(function(d) { return d.name; });
|
||||
|
||||
// reorient text on the root node
|
||||
svg.select(".node")
|
||||
.attr("transform", function(d) {
|
||||
return d.x < 180 ? "rotate(0)translate(0)" : "rotate(180)translate(0)"; });
|
||||
|
||||
// key (name) of the root node in our locations store
|
||||
var rootname = svg.select(".node").data()[0].name;
|
||||
// reformatted neighbors_data for the real neighbor links
|
||||
var neighbors = [];
|
||||
|
||||
// need to build neighbors array only after we have built loc dictionary,
|
||||
// after drawing the circles and storing their x,y
|
||||
$.each(neighbors_data, function(key, val) {
|
||||
if (! (key in loc)) { return true }
|
||||
|
||||
$.each(val, function(idx, name) {
|
||||
if (! (name in loc)) { return true }
|
||||
|
||||
neighbors.push({
|
||||
'source': {
|
||||
'name': key
|
||||
,'x': loc[key]['x']
|
||||
,'y': loc[key]['y']
|
||||
}
|
||||
,'target': {
|
||||
'name': name
|
||||
,'x': loc[name]['x']
|
||||
,'y': loc[name]['y']
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// insert Netdisco neighbor links below circles but above tree links
|
||||
svg.selectAll(".neighbor")
|
||||
.data(neighbors)
|
||||
.enter().insert("path", ".node")
|
||||
// add class name of source device, so we can show/hide the link
|
||||
// (also "neighbor" class)
|
||||
.attr("class", function(d) { return ("neighbor " + to_class( d.source.name )) })
|
||||
.attr("d", neighLink)
|
||||
.attr("transform", "translate(-" + loc[rootname]['x'] + ",-" + loc[rootname]['y'] + ")");
|
||||
});
|
||||
|
||||
}); // jquery getJSON for all connections
|
||||
|
||||
// vim: ft=javascript
|
||||
</script>
|
||||
|
||||
<div id="nd_waiting" class="span2 alert"><i class="icon-spinner icon-spin"></i> Waiting for results...</div>
|
||||
427
share/views/ajax/device/ports.tt
Normal file
427
share/views/ajax/device/ports.tt
Normal file
@@ -0,0 +1,427 @@
|
||||
[% SET user_can_port_control = user_has_role('port_control') %]
|
||||
<table id="dp-data-table" class="table table-bordered table-striped" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
[% FOREACH item IN vars.port_columns %]
|
||||
[% NEXT IF item.name == 'c_admin' %]
|
||||
[% NEXT IF item.name == 'c_nodes' AND params.c_nodes AND params.c_neighbors %]
|
||||
[% NEXT UNLESS params.${item.name} %]
|
||||
[% SET th_class = '' %]
|
||||
[% IF (item.name == 'c_port' OR item.name == 'c_descr' OR item.name == 'c_name') %]
|
||||
[% th_class = ' class="portsort"' %]
|
||||
[% END %]
|
||||
<th[% th_class %]>
|
||||
[% item.label | html_entity %]
|
||||
</th>
|
||||
[% END %]
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td class="nd_center-cell nd_devport-icon">
|
||||
[% IF row.up_admin != 'up' %]
|
||||
<i class="icon-remove"></i>
|
||||
[% ELSIF row.up == 'up' AND row.stp == 'blocking' AND row.vlan_count < 2 %]
|
||||
<i class="icon-fullscreen text-info"></i>
|
||||
[% ELSIF row.has_column_loaded('is_free') AND row.is_free %]
|
||||
<i class="icon-arrow-down text-success"></i>
|
||||
[% ELSIF row.up_admin == 'up' AND (row.up != 'up' AND row.up != 'dormant') %]
|
||||
<i class="icon-arrow-down text-error"></i>
|
||||
[% ELSE %]
|
||||
<i class="icon-angle-up text-success"></i>
|
||||
[% END %]
|
||||
[% IF row.slave_of %]<br/>
|
||||
[% IF row.get_column('agg_master_up_admin') != 'up' %]
|
||||
<small><i class="icon-group muted"></i></small>
|
||||
[% ELSIF row.get_column('agg_master_up') == 'up' %]
|
||||
<small><i class="icon-group text-success"></i></small>
|
||||
[% ELSE %]
|
||||
<small><i class="icon-group text-error"></i></small>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</td>
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
|
||||
<td>
|
||||
[% TRY %]
|
||||
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
||||
[% CATCH %]
|
||||
<!-- dummy content required by Template Toolkit TRY -->
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_port %]
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
[% IF row.up_admin == 'up' %]
|
||||
<td nowrap class="nd_editable-cell" data-action="down"
|
||||
data-order="[% row.port | html_entity %]" data-filter="[% row.port | html_entity %]"
|
||||
data-field="c_port" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||
[% ELSE %]
|
||||
<td nowrap class="nd_editable-cell" data-action="up"
|
||||
data-order="[% row.port | html_entity %]" data-filter="[% row.port | html_entity %]"
|
||||
data-field="c_port" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
<td nowrap data-order="[% row.port | html_entity %]" data-filter="[% row.port | html_entity %]">
|
||||
[% END %]
|
||||
<a class="nd_log-icon"
|
||||
href="[% uri_for('/report/portlog') %]?q=[% device.ip | uri %]&f=[% row.port | uri %]">
|
||||
<i class="icon-file-text-alt"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="View Port Log"></i>
|
||||
</a>
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
[% IF row.up_admin == 'up' %]
|
||||
<span class="nd_hand-icon">
|
||||
<i class="icon-bullseye" data-action="bounce"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Bounce Port"></i>
|
||||
<i class="icon-hand-down"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Disable Port"></i>
|
||||
</span>
|
||||
[% ELSE %]
|
||||
<span class="nd_hand-icon">
|
||||
<i class="icon-bullseye" data-action="bounce" style="display: none"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Bounce Port"></i>
|
||||
<i class="icon-hand-up"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Enable Port"></i>
|
||||
</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
<a class="nd_this-port-only nd_port-only-first" href="[% uri_for('/device',
|
||||
self_options) %]&q=[% params.q | uri %]&f=[% row.port | uri %]&prefer=port">
|
||||
[% IF row.is_master %]
|
||||
<small><i class="icon-group muted"></i></small>
|
||||
[% END %]
|
||||
[% row.port | html_entity %]</a>
|
||||
[% IF row.slave_of %]<br/>
|
||||
<a class="nd_this-port-only" href="[% uri_for('/device',
|
||||
self_options) %]&q=[% params.q | uri %]&f=[% row.slave_of | uri %]&prefer=port">
|
||||
[% row.slave_of | html_entity %]</a>
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
|
||||
<td>
|
||||
[% TRY %]
|
||||
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
||||
[% CATCH %]
|
||||
<!-- dummy content required by Template Toolkit TRY -->
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_descr %]
|
||||
<td nowrap>[% row.descr | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_comment %]
|
||||
<td nowrap>[% row.last_comment | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_type %]
|
||||
<td>[% row.type | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_duplex %]
|
||||
<td>
|
||||
[% IF row.up == 'up' AND row.duplex %]
|
||||
[% (row.duplex_admin.ucfirst || 'Auto') | html_entity %] / [% row.duplex.ucfirst | html_entity %]
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_lastchange %]
|
||||
<td>[% row.lastchange_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_name %]
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
<td nowrap class="nd_editable-cell" contenteditable="true"
|
||||
data-field="c_name" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||
<i class="icon-edit nd_edit-icon"></i>
|
||||
[% ELSE %]
|
||||
<td nowrap class="nd_editable-cell">
|
||||
[% END %]
|
||||
<div class="nd_editable-cell-content">
|
||||
[% row.name | html_entity %]
|
||||
</div>
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_speed %]
|
||||
<td>[% row.speed | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_mac %]
|
||||
<td>[% row.mac | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_mtu %]
|
||||
<td>[% row.mtu | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_pvid %]
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
<td class="nd_editable-cell" contenteditable="true" data-default="[% row.vlan | html_entity %]"
|
||||
data-field="c_pvid" data-for-device="[% device.ip | html_entity %]" data-for-port="[% row.port | html_entity %]">
|
||||
<i class="icon-edit nd_edit-icon"></i>
|
||||
<div class="nd_editable-cell-content">
|
||||
[% IF row.vlan %][% row.vlan | html_entity %][% END %]
|
||||
</div>
|
||||
</td>
|
||||
[% ELSE %]
|
||||
<td>
|
||||
<a class="nd_linkcell"
|
||||
href="[% uri_for('/search') %]?tab=vlan&q=[% row.vlan | uri %]">
|
||||
[% row.vlan | html_entity %]</a>
|
||||
</td>
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_vmember %]
|
||||
<td>
|
||||
[% IF vmember_ok %]
|
||||
[% IF row.vlan_count %]
|
||||
[% SET output = '' %]
|
||||
[% SET vlanlist = [] %]
|
||||
[% FOREACH vlan IN row.all_port_vlans %][% vlanlist.push(vlan.get_column('vlan')) %][% END %]
|
||||
[% FOREACH vlan IN vlanlist.nsort %]
|
||||
[% SET output = output _
|
||||
'<a href="' _ uri_for('/search') _ '?tab=vlan&q=' _ vlan _ '">' _ vlan _ '</a>' %]
|
||||
[% SET output = output _ ', ' IF NOT loop.last %]
|
||||
[% END %]
|
||||
[% IF row.vlan_count > 10 %] [%# TODO make this a settable variable %]
|
||||
[% SET output = '<div class="nd_vlan-total">(' _ row.vlan_count
|
||||
_ ')</div><span class="nd_linkcell nd_collapse-vlans">
|
||||
<div class="nd_arrow-up-down-left icon-chevron-up icon-large"></div>Show VLANs</span>
|
||||
<div class="nd_collapsing nd_collapse-pre-hidden">' _ output %]
|
||||
[% SET output = output _ '</div>' %]
|
||||
[% END %]
|
||||
[% output %]
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
<i class="icon-asterisk"></i> (too many to list)
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_power %]
|
||||
[% IF row.power %]
|
||||
[% IF row.power.admin == 'true' %]
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
<td nowrap data-action="false"
|
||||
data-field="c_power" data-for-device="[% device.ip | html_entity %]"
|
||||
data-for-port="[% row.port | html_entity %]">
|
||||
|
||||
<i class="icon-off nd_power-icon nd_power-on"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Disable Power"></i>
|
||||
[% ELSE %]
|
||||
<td nowrap>
|
||||
<i class="icon-off nd_power-on"></i>
|
||||
[% END %]
|
||||
<span>
|
||||
[% IF row.power.power > 0 %]
|
||||
[% row.power.power | html_entity %] mW
|
||||
[% ELSE %]
|
||||
([% row.power.status | html_entity %])
|
||||
[% END %]
|
||||
</span>
|
||||
[% ELSE %]
|
||||
[% IF user_can_port_control AND params.c_admin %]
|
||||
<td nowrap data-action="true"
|
||||
data-field="c_power" data-for-device="[% device.ip | html_entity %]"
|
||||
data-for-port="[% row.port | html_entity %]">
|
||||
|
||||
<i class="icon-off nd_power-icon"
|
||||
rel="tooltip" data-placement="top" data-offset="3"
|
||||
data-animation="" data-title="Enable Power"></i>
|
||||
[% ELSE %]
|
||||
<td>
|
||||
<i class="icon-off"></i>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</td>
|
||||
[% ELSE %]
|
||||
<td></td>
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_ssid %]
|
||||
<td>[% row.ssid.ssid | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_nodes OR params.c_neighbors %]
|
||||
<td>
|
||||
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
|
||||
[% IF row.neighbor %]
|
||||
<i class="icon-link[% ' text-warning' IF row.manual_topo %]"></i>
|
||||
[% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %]
|
||||
<i class="icon-phone"></i>
|
||||
[% ELSIF row.remote_type AND row.remote_type.match('^AP:\s') %]
|
||||
<i class="icon-signal"></i>
|
||||
[% END %]
|
||||
<a href="[% uri_for('/device', self_options) %]&q=[% row.neighbor.ip | uri %]">
|
||||
[% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip | html_entity %]</a>
|
||||
[% IF row.remote_port %]
|
||||
-
|
||||
<a href="[% uri_for('/device', self_options) %]&q=[% row.neighbor.ip | uri %]&f=[% row.remote_port | uri %]&prefer=port">
|
||||
[% row.remote_port | html_entity %]</a>
|
||||
[% END %]
|
||||
<br/>
|
||||
[% IF params.neigh_id and (row.remote_id or row.remote_type) %]
|
||||
([% 'id: '_ row.remote_id IF row.remote_id %]
|
||||
[% ' type: '_ row.remote_type IF row.remote_type %])<br/>
|
||||
[% END %]
|
||||
[% ELSIF row.remote_ip %]
|
||||
<i class="icon-unlink text-error"></i>
|
||||
[% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %]
|
||||
<i class="icon-phone"></i>
|
||||
[% ELSIF row.remote_type AND row.remote_type.match('^AP:\s') %]
|
||||
<i class="icon-signal"></i>
|
||||
[% END %]
|
||||
<a href="[% search_node %]&q=[% row.remote_ip | uri %]">
|
||||
[% row.remote_ip | html_entity %]
|
||||
[% ' - ' IF row.remote_port %][% row.remote_port | html_entity %]</a><br/>
|
||||
[% IF params.neigh_id and (row.remote_id or row.remote_type) %]
|
||||
([% 'id: '_ row.remote_id IF row.remote_id %]
|
||||
[% ' type: '_ row.remote_type IF row.remote_type %])<br/>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
<i class="icon-unlink text-error"></i> (possible uplink)
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF params.c_nodes %]
|
||||
[% FOREACH node IN row.$nodes %]
|
||||
[% '<br/>' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %]
|
||||
[% '<i class="icon-book"></i> ' IF NOT node.active %]
|
||||
[% IF row.remote_type AND row.remote_type.match('(?i)ip.phone') %]
|
||||
<i class="icon-phone"></i>
|
||||
[% ELSIF node.wireless.defined
|
||||
OR (row.remote_type AND row.remote_type.match('^AP:\s')) %]
|
||||
<i class="icon-signal"></i>
|
||||
[% END %]
|
||||
<a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
|
||||
[% node.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF (node.vlan > 0) && (node.vlan != row.vlan) %]
|
||||
(on vlan [% node.vlan | html_entity %])
|
||||
[% END %]
|
||||
[% IF params.n_ssid AND node.wireless.defined %]
|
||||
(SSID:
|
||||
[% FOREACH wlan IN node.wireless %]
|
||||
<a href="[%+ uri_for('/report/portssid') %]?ssid=[% wlan.ssid | uri %]">[% wlan.ssid | html_entity %]</a>
|
||||
[% END %]
|
||||
)
|
||||
[% END %]
|
||||
[% IF params.n_vendor AND node.oui.defined %]
|
||||
(Vendor:
|
||||
[% FOREACH oui IN node.oui %]
|
||||
<a href="[%+ uri_for('/report/nodevendor') %]?vendor=[% oui.abbrev | uri %]">[% oui.abbrev | html_entity %]</a>
|
||||
[% END %]
|
||||
)
|
||||
[% END %]
|
||||
[% ' (' _ node.time_last_age _ ')' IF params.n_age %]
|
||||
[% IF params.n_ip4 %]
|
||||
[% FOREACH ip IN node.ip4s %]
|
||||
<br/> [% '<i class="icon-book"></i> ' IF NOT ip.active %]
|
||||
[% SET dns = ip.dns %]
|
||||
[% IF dns %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>
|
||||
[% ELSE %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF params.n_ip6 %]
|
||||
[% FOREACH ip IN node.ip6s %]
|
||||
<br/> [% '<i class="icon-book"></i> ' IF NOT ip.active %]
|
||||
[% SET dns = ip.dns %]
|
||||
[% IF dns %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>
|
||||
[% ELSE %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF params.n_netbios %]
|
||||
[% FOREACH nbt IN node.netbios %]
|
||||
<br/> \\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Nodes in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
|
||||
<br/> [% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_stp %]
|
||||
<td>[% row.stp | html_entity %]</td>
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_up %]
|
||||
<td>
|
||||
[% row.up_admin.ucfirst | html_entity %] / [% row.up.ucfirst | html_entity %]
|
||||
</td>
|
||||
[% END %]
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'right' AND params.${config.name} %]
|
||||
<td>
|
||||
[% TRY %]
|
||||
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
|
||||
[% CATCH %]
|
||||
<!-- dummy content required by Template Toolkit TRY -->
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
[% IF user_can_port_control %]
|
||||
<div id="nd_portlog" class="nd_modal nd_deep-horizon modal hide fade" tabindex="-1"
|
||||
role="dialog" aria-hidden="true">
|
||||
<div class="modal-body">
|
||||
<blockquote>
|
||||
<ul><li><p>Please provide a reason for changing the Port Configuration</p></li></ul>
|
||||
</blockquote>
|
||||
<select id="nd_portlog-reason" class="input-block-level" name="reason">
|
||||
[% FOREACH pair IN settings.port_control_reasons.pairs %]
|
||||
<option[% ' selected="selected"' IF pair.key == 'other' %] value="[% pair.key | html_entity %]">
|
||||
[% pair.value | html_entity %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
<textarea id="nd_portlog-log" class="input-block-level" rows="2" name="log"
|
||||
placeholder="Enter a log message"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button id="nd_portlog-submit" class="btn btn-info" data-dismiss="modal">Continue</button>
|
||||
</div>
|
||||
</div>
|
||||
[% END %]
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dp-data-table').dataTable({
|
||||
"columnDefs": [
|
||||
{ "sortable": false, "targets": 0 },
|
||||
{ "searchable": false, "targets": 0 },
|
||||
{ "type": 'portsort', "targets": [ 'portsort' ] }
|
||||
],
|
||||
"order": [[ 1, 'asc' ]],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
228
share/views/ajax/device/ports_csv.tt
Normal file
228
share/views/ajax/device/ports_csv.tt
Normal file
@@ -0,0 +1,228 @@
|
||||
[% USE CSV -%]
|
||||
|
||||
[% SET headers = [] %]
|
||||
[% SET c_nodes_pos = -1 %]
|
||||
[% FOREACH item IN vars.port_columns %]
|
||||
[% NEXT IF item.name == 'c_admin' %]
|
||||
[% NEXT UNLESS params.${item.name} %]
|
||||
|
||||
[% IF item.name == 'c_nodes' %]
|
||||
[% SET c_nodes_pos = headers.size %]
|
||||
[% headers.push('Node MAC') %]
|
||||
[% headers.push('Archived Node') %]
|
||||
[% headers.push('Age Stamp') IF params.n_age %]
|
||||
[% headers.push('Node IP') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% headers.push('Node DNS') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% headers.push('Archived IP') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% ELSIF item.name == 'c_duplex' %]
|
||||
[% headers.push('Duplex Setting') %]
|
||||
[% headers.push('Duplex') %]
|
||||
[% ELSIF item.name == 'c_power' %]
|
||||
[% headers.push('PoE Status') %]
|
||||
[% headers.push('PoE Power (mW)') %]
|
||||
[% ELSIF item.name == 'c_neighbors' %]
|
||||
[% headers.push('Neighbor IP') %]
|
||||
[% headers.push('Neighbor DNS') %]
|
||||
[% ELSIF item.name == 'c_up' %]
|
||||
[% headers.push('Port Setting') %]
|
||||
[% headers.push('Port Status') %]
|
||||
[% ELSE %]
|
||||
[% headers.push(item.label) %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% CSV.dump(headers) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% SET myport = [] %]
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
|
||||
[% TRY %]
|
||||
[% PROCESS "plugin/${config.name}/device_port_column_csv.tt" %]
|
||||
[% CATCH %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_port %]
|
||||
[% myport.push(row.port) %]
|
||||
[% END %]
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
|
||||
[% TRY %]
|
||||
[% PROCESS "plugin/${config.name}/device_port_column_csv.tt" %]
|
||||
[% CATCH %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_descr %]
|
||||
[% myport.push(row.descr) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_comment %]
|
||||
[% myport.push(row.last_comment) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_type %]
|
||||
[% myport.push(row.type) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_duplex %]
|
||||
[% IF row.up == 'up' AND row.duplex %]
|
||||
[% myport.push( row.duplex_admin.ucfirst || 'Auto' ) %]
|
||||
[% myport.push( row.duplex.ucfirst ) %]
|
||||
[% ELSE %]
|
||||
[% myport.push('') %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_lastchange %]
|
||||
[% myport.push(row.lastchange_stamp) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_name %]
|
||||
[% myport.push(row.name) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_speed %]
|
||||
[% myport.push(row.speed) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_mac %]
|
||||
[% myport.push(row.mac) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_mtu %]
|
||||
[% myport.push(row.mtu) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_pvid %]
|
||||
[% myport.push(row.vlan) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_vmember %]
|
||||
[% IF row.vlan_count %]
|
||||
[% SET output = '' %]
|
||||
[% SET vlanlist = [] %]
|
||||
[% FOREACH vlan IN row.all_port_vlans %][% vlanlist.push(vlan.get_column('vlan')) %][% END %]
|
||||
[% FOREACH vlan IN vlanlist.nsort %]
|
||||
[% SET output = output _ ',' IF NOT loop.first %]
|
||||
[% SET output = output _ vlan %]
|
||||
[% END %]
|
||||
[% myport.push(output) %]
|
||||
[% ELSE %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_power %]
|
||||
[% IF row.power AND row.power.admin == 'true' %]
|
||||
[% myport.push( row.power.status ) %]
|
||||
[% myport.push( row.power.power || '0' ) %]
|
||||
[% ELSE %]
|
||||
[% myport.push('') %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_nodes %]
|
||||
[% myport.push('') %]
|
||||
[% myport.push('') %]
|
||||
[% myport.push('') IF params.n_age %]
|
||||
[% myport.push('') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% myport.push('') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% myport.push('') IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_neighbors %]
|
||||
[% IF (row.remote_ip OR row.is_uplink) %]
|
||||
[% IF row.neighbor %]
|
||||
[% myport.push( row.neighbor.ip ) %]
|
||||
[% myport.push( row.neighbor.dns.remove(settings.domain_suffix) ) %]
|
||||
[% ELSIF row.remote_ip AND row.remote_port %]
|
||||
[% myport.push( row.remote_ip ) %]
|
||||
[% myport.push('') %]
|
||||
[% ELSE %]
|
||||
[% myport.push('(possible uplink)') %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% myport.push('') %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_stp %]
|
||||
[% myport.push(row.stp) %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.c_up %]
|
||||
[% myport.push( row.up_admin.ucfirst ) %]
|
||||
[% myport.push( row.up.ucfirst ) %]
|
||||
[% END %]
|
||||
|
||||
[% FOREACH config IN settings._extra_device_port_cols %]
|
||||
[% NEXT UNLESS config.position == 'right' AND params.${config.name} %]
|
||||
[% TRY %]
|
||||
[% PROCESS "plugin/${config.name}/device_port_column_csv.tt" %]
|
||||
[% CATCH %]
|
||||
[% myport.push('') %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% SET has_nodes = 0 %]
|
||||
[% IF params.c_nodes %]
|
||||
[% FOREACH node IN row.$nodes %]
|
||||
[% SET has_nodes = 1 %]
|
||||
[% SET mynode = [] %]
|
||||
|
||||
[% CALL mynode.push(node.net_mac.$mac_format_call) %]
|
||||
[% CALL mynode.push((node.active ? 'No' : 'Yes')) %]
|
||||
|
||||
[% CALL mynode.push(node.time_last_age) IF params.n_age %]
|
||||
|
||||
[% IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% mynode.push('') %]
|
||||
[% mynode.push('') %]
|
||||
[% mynode.push('') %]
|
||||
[% SET has_ips = 0 %]
|
||||
|
||||
[% IF params.n_ip4 %]
|
||||
[% FOREACH ip IN node.ip4s %]
|
||||
[% SET has_ips = 1 %]
|
||||
|
||||
[% CALL mynode.splice(-3, 1, ip.ip) %]
|
||||
[% CALL mynode.splice(-2, 1, ip.dns) %]
|
||||
[% CALL mynode.splice(-1, 1, (ip.active ? 'No' : 'Yes')) %]
|
||||
|
||||
[% CALL myport.splice(c_nodes_pos, mynode.size, mynode) %]
|
||||
[% CSV.dump(myport) %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF params.n_ip6 %]
|
||||
[% FOREACH ip IN node.ip6s %]
|
||||
[% SET has_ips = 1 %]
|
||||
|
||||
[% CALL mynode.splice(-3, 1, ip.ip) %]
|
||||
[% CALL mynode.splice(-2, 1, ip.dns) %]
|
||||
[% CALL mynode.splice(-1, 1, (ip.active ? 'No' : 'Yes')) %]
|
||||
|
||||
[% CALL myport.splice(c_nodes_pos, mynode.size, mynode) %]
|
||||
[% CSV.dump(myport) %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% CSV.dump(myport) IF NOT has_ips %]
|
||||
[% ELSE %]
|
||||
[% CALL myport.splice(c_nodes_pos, mynode.size, mynode) %]
|
||||
[% CSV.dump(myport) %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% CSV.dump(myport) IF NOT has_nodes %]
|
||||
[% END %]
|
||||
30
share/views/ajax/report/apchanneldist.tt
Normal file
30
share/views/ajax/report/apchanneldist.tt
Normal file
@@ -0,0 +1,30 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Channel</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 1, "desc" ]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'channel'
|
||||
}, {
|
||||
"data": 'ch_count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
10
share/views/ajax/report/apchanneldist_csv.tt
Normal file
10
share/views/ajax/report/apchanneldist_csv.tt
Normal file
@@ -0,0 +1,10 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Channel' 'Count' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.channel) %]
|
||||
[% mylist.push(row.ch_count) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
63
share/views/ajax/report/apclients.tt
Normal file
63
share/views/ajax/report/apclients.tt
Normal file
@@ -0,0 +1,63 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Model</th>
|
||||
<th>Location</th>
|
||||
<th>Port</th>
|
||||
<th>SSID</th>
|
||||
<th>Node Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 5, "desc" ]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(row.ip) + '">'
|
||||
+ he.encode(row.dns || row.name || row.ip) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'location',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'ssid',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'mac_count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
14
share/views/ajax/report/apclients_csv.tt
Normal file
14
share/views/ajax/report/apclients_csv.tt
Normal file
@@ -0,0 +1,14 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Model' 'Location' 'Port' 'SSID' 'Node Count' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.model) %]
|
||||
[% mylist.push(row.location) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.ssid) %]
|
||||
[% mylist.push(row.mac_count) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
115
share/views/ajax/report/apradiochannelpower.tt
Normal file
115
share/views/ajax/report/apradiochannelpower.tt
Normal file
@@ -0,0 +1,115 @@
|
||||
<table id="data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>DNS</th>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th class="nd_center-cell">Channel</th>
|
||||
<th class="nd_center-cell">Tx Power (mW/dBm)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
tr.group,
|
||||
tr.group:hover {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function groupString(d) {
|
||||
"use strict";
|
||||
var s = '';
|
||||
s = s + 'Device: ';
|
||||
s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
|
||||
s = s + he.encode(d.dns || d.device_name || d.ip);
|
||||
if (d.dns || d.device_name) {
|
||||
s = s + ' (' + he.encode(d.ip) + ') ';
|
||||
}
|
||||
s = s + '</a> Model: ' + he.encode(d.model || '');
|
||||
s = s + he.encode(d.location ? ' Location: ' + d.location : '');
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').DataTable({
|
||||
"serverSide": true,
|
||||
"ajax": "[% uri_for('/ajax/content/report/apradiochannelpower/data') %]",
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"columns": [
|
||||
{
|
||||
// Grouping column
|
||||
"data": 'ip',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'dns',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'device_name',
|
||||
"visible": false
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'port_name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'descr',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'channel',
|
||||
"className": "nd_center-cell"
|
||||
}, {
|
||||
"data": 'power',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return (row.power2 ? data + ' / ' + row.power2 : '');
|
||||
}
|
||||
}
|
||||
],
|
||||
"drawCallback": function ( settings ) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
var row_data = api.row( i ).data();
|
||||
$(rows).eq( i ).before(
|
||||
'<tr class="group"><td colspan="5">' + groupString(row_data) + '</td></tr>'
|
||||
);
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
},
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
|
||||
// Order by the grouping
|
||||
$('#data-table tbody').on( 'click', 'tr.group', function () {
|
||||
var currentOrder = table.order()[0];
|
||||
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
|
||||
table.order( [ 0, 'desc' ] ).draw();
|
||||
}
|
||||
else {
|
||||
table.order( [ 0, 'asc' ] ).draw();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
15
share/views/ajax/report/apradiochannelpower_csv.tt
Normal file
15
share/views/ajax/report/apradiochannelpower_csv.tt
Normal file
@@ -0,0 +1,15 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Model' 'Device Location' 'Port' ' Port Name'
|
||||
'Port Description' 'Channel' 'Tx Power mW' 'Tx Power dBm' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mydlist = [] %]
|
||||
[% mydevice = row.dns || row.device_name || row.ip %]
|
||||
[% mydlist.push(mydevice) %]
|
||||
[% FOREACH col IN [ row.model row.location row.port row.name row.descr
|
||||
row.channel row.power row.power2 ] %]
|
||||
[% mydlist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mydlist) %]
|
||||
|
||||
[%END%]
|
||||
41
share/views/ajax/report/deviceaddrnodns.tt
Normal file
41
share/views/ajax/report/deviceaddrnodns.tt
Normal file
@@ -0,0 +1,41 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Device</th>
|
||||
<th class="nd_center-cell">Address</th>
|
||||
<th class="nd_center-cell">Contact</th>
|
||||
<th class="nd_center-cell">Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'alias',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'contact',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'location',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});</script>
|
||||
12
share/views/ajax/report/deviceaddrnodns_csv.tt
Normal file
12
share/views/ajax/report/deviceaddrnodns_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Address' 'Contact' 'Location' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.alias) %]
|
||||
[% mylist.push(row.contact) %]
|
||||
[% mylist.push(row.location) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
56
share/views/ajax/report/devicebylocation.tt
Normal file
56
share/views/ajax/report/devicebylocation.tt
Normal file
@@ -0,0 +1,56 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Location</th>
|
||||
<th class="nd_center-cell">Device</th>
|
||||
<th class="nd_center-cell">System Name</th>
|
||||
<th class="nd_center-cell">Vendor</th>
|
||||
<th class="nd_center-cell">Model</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 0, "asc" ], [2, "asc"], [ 3, "asc" ], [4, "asc"]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'location',
|
||||
"render": function(data, type, row, meta) {
|
||||
if (data) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
|
||||
} else {
|
||||
return '[Not Set]';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'vendor',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/devicebylocation_csv.tt
Normal file
12
share/views/ajax/report/devicebylocation_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Location' 'Device' 'System Name' 'Vendor' 'Model' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.dns || row.ip %]
|
||||
[% FOREACH col IN [ row.location device row.name row.vendor row.model ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
49
share/views/ajax/report/devicednsmismatch.tt
Normal file
49
share/views/ajax/report/devicednsmismatch.tt
Normal file
@@ -0,0 +1,49 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>DNS</th>
|
||||
<th>IP Address</th>
|
||||
<th>Contact</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'dns',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'contact',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'location',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
13
share/views/ajax/report/devicednsmismatch_csv.tt
Normal file
13
share/views/ajax/report/devicednsmismatch_csv.tt
Normal file
@@ -0,0 +1,13 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Name' 'DNS' 'IP Address' 'Contact' 'Location' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.name) %]
|
||||
[% mylist.push(row.dns) %]
|
||||
[% mylist.push(row.ip) %]
|
||||
[% mylist.push(row.contact) %]
|
||||
[% mylist.push(row.location) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
180
share/views/ajax/report/devicepoestatus.tt
Normal file
180
share/views/ajax/report/devicepoestatus.tt
Normal file
@@ -0,0 +1,180 @@
|
||||
<table id="data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>DNS</th>
|
||||
<th>Name</th>
|
||||
<th>Model</th>
|
||||
<th>Location</th>
|
||||
<th>PoE<br>Module</th>
|
||||
<th class="nd_center-cell">Supply</th>
|
||||
<th class="nd_center-cell">Power<br>(W)</th>
|
||||
<th class="nd_center-cell">Capable<br>Ports</th>
|
||||
<th class="nd_center-cell">Powered<br>Ports</th>
|
||||
<th class="nd_center-cell">Disabled<br>Ports</th>
|
||||
<th class="nd_center-cell">Errored<br>Ports</th>
|
||||
<th class="nd_center-cell">Committed<br>(W)</th>
|
||||
<th class="nd_center-cell">Delivering<br>(W)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td>[% row.ip %]</td>
|
||||
<td>[% row.dns %]</td>
|
||||
<td>[% row.name %]</td>
|
||||
<td>[% row.model %]</td>
|
||||
<td>[% row.location %]</td>
|
||||
<td>[% row.module %]</td>
|
||||
<td class="nd_center-cell">[% row.power %]</td>
|
||||
<td class="nd_center-cell">[% row.status %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_capable_ports %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_powered_ports %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_disabled_ports %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_errored_ports %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_power_committed %]</td>
|
||||
<td class="nd_center-cell">[% row.poe_power_delivering %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
tr.group,
|
||||
tr.group:hover {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function groupString(d) {
|
||||
"use strict";
|
||||
var s = '';
|
||||
s = s + 'Device: ';
|
||||
s = s + '<a href="[% uri_for('/device') %]?tab=details&q=' + encodeURIComponent(d.ip) + '">';
|
||||
s = s + he.encode(d.dns || d.name || d.ip);
|
||||
if (d.dns || d.name) {
|
||||
s = s + ' (' + he.encode(d.ip) + ') ';
|
||||
}
|
||||
s = s + '</a> Model: ' + he.encode(d.model || '');
|
||||
s = s + he.encode(d.location ? ' Location: ' + d.location : '');
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').DataTable({
|
||||
"serverSide": true,
|
||||
"ajax": "[% uri_for('/ajax/content/report/devicepoestatus/data') %]",
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"columns": [
|
||||
{
|
||||
// Grouping column
|
||||
"data": 'ip',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'dns',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'name',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'model',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'location',
|
||||
"visible": false
|
||||
}, {
|
||||
"data": 'module',
|
||||
"searchable": false
|
||||
}, {
|
||||
"data": 'status',
|
||||
"className": "nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'power',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_capable_ports',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_powered_ports',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_disabled_ports',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_errored_ports',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_power_committed',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'poe_power_delivering',
|
||||
"className": "nd_center-cell",
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
"drawCallback": function ( settings ) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
var row_data = api.row( i ).data();
|
||||
$(rows).eq( i ).before(
|
||||
'<tr class="group"><td colspan="9">' + groupString(row_data) + '</td></tr>'
|
||||
);
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
},
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
|
||||
// Order by the grouping
|
||||
$('#data-table tbody').on( 'click', 'tr.group', function () {
|
||||
var currentOrder = table.order()[0];
|
||||
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
|
||||
table.order( [ 0, 'desc' ] ).draw();
|
||||
}
|
||||
else {
|
||||
table.order( [ 0, 'asc' ] ).draw();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
19
share/views/ajax/report/devicepoestatus_csv.tt
Normal file
19
share/views/ajax/report/devicepoestatus_csv.tt
Normal file
@@ -0,0 +1,19 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Model' 'Device Location' 'PoE Module' 'Power (W)'
|
||||
'Supply' 'Capable Ports' 'Powered Ports' 'Disabled Ports'
|
||||
'Errored Ports' 'Committed (W)' 'Delivering (W)' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mydlist = [] %]
|
||||
[% mydevice = row.dns || row.name || row.ip %]
|
||||
[% mydlist.push(mydevice) %]
|
||||
[% FOREACH col IN [ row.model row.location row.module row.power row.status
|
||||
row.poe_capable_ports row.poe_powered_ports
|
||||
row.poe_disabled_ports row.poe_errored_ports
|
||||
row.poe_power_committed row.poe_power_delivering
|
||||
] %]
|
||||
[% mydlist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mydlist) %]
|
||||
|
||||
[%END%]
|
||||
61
share/views/ajax/report/duplexmismatch.tt
Normal file
61
share/views/ajax/report/duplexmismatch.tt
Normal file
@@ -0,0 +1,61 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Left Device</th>
|
||||
<th>Port</th>
|
||||
<th>Duplex</th>
|
||||
<th>Right Device</th>
|
||||
<th>Port</th>
|
||||
<th>Duplex</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'left_ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.left_dns || row.left_ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'left_port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.left_dns || row.left_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'left_duplex',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(capitalizeFirstLetter(data || ''));
|
||||
}
|
||||
}, {
|
||||
"data": 'right_ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.right_dns || row.right_ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'right_port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.right_dns || row.right_ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'right_duplex',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(capitalizeFirstLetter(data || ''));
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
13
share/views/ajax/report/duplexmismatch_csv.tt
Normal file
13
share/views/ajax/report/duplexmismatch_csv.tt
Normal file
@@ -0,0 +1,13 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Left Device' 'Port' 'Duplex' 'Right Device' 'Port' 'Duplex' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device_left = row.left_dns || row.left_ip %]
|
||||
[% device_right = row.right_dns || row.right_ip %]
|
||||
[% FOREACH col IN [ device_left row.left_port row.left_duplex.ucfirst device_right row.right_port row.right_duplex.ucfirst ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
27
share/views/ajax/report/generic_report.tt
Normal file
27
share/views/ajax/report/generic_report.tt
Normal file
@@ -0,0 +1,27 @@
|
||||
<table id="rg-data-table" class="table table-bordered table-condensed table-striped" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
[% FOREACH hdr IN headings %]
|
||||
<th>[% hdr | html_entity %]</th>
|
||||
[% END %]
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
[% FOREACH col IN columns %]
|
||||
<td>[% row.item(col) | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#rg-data-table').dataTable({
|
||||
"order": [],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
11
share/views/ajax/report/generic_report_csv.tt
Normal file
11
share/views/ajax/report/generic_report_csv.tt
Normal file
@@ -0,0 +1,11 @@
|
||||
[% USE CSV %]
|
||||
[% CSV.dump(headings) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% FOREACH col IN columns %]
|
||||
[% mylist.push(row.item(col)) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
48
share/views/ajax/report/halfduplex.tt
Normal file
48
share/views/ajax/report/halfduplex.tt
Normal file
@@ -0,0 +1,48 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Description</th>
|
||||
<th>Duplex</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.device.dns || row.device.name || row.ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_duplex=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'duplex',
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(capitalizeFirstLetter(data));
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/halfduplex_csv.tt
Normal file
12
share/views/ajax/report/halfduplex_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Port' 'Description' 'Duplex' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = rrow.device.dns || row.device.name || row.ip %]
|
||||
[% FOREACH col IN [ device row.port row.name row.duplex.ucfirst ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
71
share/views/ajax/report/inventorybymodelbyos.tt
Normal file
71
share/views/ajax/report/inventorybymodelbyos.tt
Normal file
@@ -0,0 +1,71 @@
|
||||
<table id="nsbi-data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<th>Operating System Version</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td>
|
||||
<a href="[% search_device %]&q=[% row.model | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]">
|
||||
[% row.vendor.ucfirst | html_entity %] [% row.model | html_entity %]</a>
|
||||
[% IF row.os %] running "[% row.os | html_entity %]"[% END %]
|
||||
</td>
|
||||
<td>
|
||||
<a class="nd_linkcell"
|
||||
href="[% search_device %]&q=[% row.os_ver | uri %]&vendor=[% row.vendor | uri %]&model=[% row.model | uri %]&os=[% row.os | uri %]&os_ver=[% row.os_ver | uri %]&matchall=on">
|
||||
[% row.os_ver | html_entity %]</a>
|
||||
</td>
|
||||
<td>[% row.os_ver_count | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
tr.group,
|
||||
tr.group:hover {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var table = $('#nsbi-data-table').DataTable({
|
||||
"columnDefs": [
|
||||
{ "visible": false, "targets": 0 }
|
||||
],
|
||||
sort: false,
|
||||
"drawCallback": function ( settings ) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
$(rows).eq( i ).before(
|
||||
'<tr class="group"><td colspan="2">'+group+'</td></tr>'
|
||||
);
|
||||
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
},
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
|
||||
// Order by the grouping
|
||||
$('#nsbi-data-table tbody').on( 'click', 'tr.group', function () {
|
||||
var currentOrder = table.order()[0];
|
||||
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
|
||||
table.order( [ 0, 'desc' ] ).draw();
|
||||
}
|
||||
else {
|
||||
table.order( [ 0, 'asc' ] ).draw();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
67
share/views/ajax/report/ipinventory.tt
Normal file
67
share/views/ajax/report/ipinventory.tt
Normal file
@@ -0,0 +1,67 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Node</th>
|
||||
<th>MAC Address</th>
|
||||
<th class="nd_center-cell">DNS</th>
|
||||
<th>Last Used</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
var cell_str = he.encode(data);
|
||||
if (type == 'display') {
|
||||
if (row.time_last && row.node) {
|
||||
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
else if (row.time_last) {
|
||||
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
}
|
||||
}
|
||||
return cell_str;
|
||||
}
|
||||
}, {
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
var cell_str = he.encode(data || '');
|
||||
if (type == 'display' && data && row.time_last) {
|
||||
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
|
||||
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
|
||||
+ (row.active ? '' : ' <i class="icon-book text-warning"></i> ') + '</a>';
|
||||
}
|
||||
return cell_str;
|
||||
}
|
||||
}, {
|
||||
"data": 'dns',
|
||||
"className": "nd_nowrap nd_center-cell",
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'age',
|
||||
"render": function(data, type, row, meta) {
|
||||
if (type == 'display') {
|
||||
return he.encode(data || 'Never');
|
||||
}
|
||||
else {
|
||||
// so that sorting works correctly on this column
|
||||
return row.time_last;
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/ipinventory_csv.tt
Normal file
12
share/views/ajax/report/ipinventory_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV %]
|
||||
[% CSV.dump([ 'Node' 'MAC Address' 'DNS' 'Last Used' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.ip) %]
|
||||
[% mylist.push(row.mac) %]
|
||||
[% mylist.push(row.dns) %]
|
||||
[% mylist.push(row.time_last) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
111
share/views/ajax/report/moduleinventory.tt
Normal file
111
share/views/ajax/report/moduleinventory.tt
Normal file
@@ -0,0 +1,111 @@
|
||||
[% USE url %]
|
||||
[% IF opt %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Description</th>
|
||||
<th>Name</th>
|
||||
<th>Class</th>
|
||||
<th>Type</th>
|
||||
<th>Model</th>
|
||||
<th>Serial</th>
|
||||
<th>HW Version</th>
|
||||
<th>SW Version</th>
|
||||
<th>FW Version</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% ELSE %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Class</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
[% IF opt %]
|
||||
"serverSide": true,
|
||||
"searching": false,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/moduleinventory/data') %]?[% url(params('query').hash) %]",
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/device') %]?tab=modules&q=' + encodeURIComponent(data) + '">' + he.encode(row.device.dns || row.device.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'description',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?description=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?name=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'class',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'type',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?type=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'serial',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?serial=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'hw_ver',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'sw_ver',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'fw_ver',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'class',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% END %]
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
25
share/views/ajax/report/moduleinventory_csv.tt
Normal file
25
share/views/ajax/report/moduleinventory_csv.tt
Normal file
@@ -0,0 +1,25 @@
|
||||
[% USE CSV -%]
|
||||
[% IF opt %]
|
||||
[% CSV.dump(['Device' 'Description' 'Name' 'Class' 'Type' 'Model' 'Serial' 'HW Version' 'SW Version' 'FW Version']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.device.dns || row.device.name || row.ip %]
|
||||
[% FOREACH col IN [ device row.description row.name row.class.ucfirst row.type row.model row.serial row.hw_ver row.sw_ver row.fw_ver ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% CSV.dump(['Class' 'Count']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% FOREACH col IN [ row.class.ucfirst row.count ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
93
share/views/ajax/report/netbios.tt
Normal file
93
share/views/ajax/report/netbios.tt
Normal file
@@ -0,0 +1,93 @@
|
||||
[% USE url %]
|
||||
[% IF opt %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Domain</th>
|
||||
<th>Node</th>
|
||||
<th>Name</th>
|
||||
<th>User</th>
|
||||
<th>First Seen</th>
|
||||
<th>Last Seen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% ELSE %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Domain</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
[% IF opt %]
|
||||
"serverSide": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/netbios/data') %]?[% url(params('query').hash) %]",
|
||||
"columns": [
|
||||
{
|
||||
"data": 'domain',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '(Blank Domain)');
|
||||
}
|
||||
}, {
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'nbname',
|
||||
"render": function(data, type, row, meta) {
|
||||
var prefix = '';
|
||||
if (row.domain) {
|
||||
prefix = '\\\\' + row.domain + '\\';
|
||||
}
|
||||
return he.encode(prefix) + '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'nbuser',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.nbuser || '[No User]');
|
||||
}
|
||||
}, {
|
||||
"data": 'time_first',
|
||||
"render": function(data, type, row, meta) {
|
||||
return moment(data).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
}, {
|
||||
"data": 'time_last',
|
||||
"render": function(data, type, row, meta) {
|
||||
return moment(data).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
}
|
||||
],
|
||||
"order": [[0, "asc"], [5, "desc"]],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'domain',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/netbios') %]?domain=' + encodeURIComponent(data || 'blank') + '">' + he.encode(data || '(Blank Domain)') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
"order": [[1, "desc"]],
|
||||
[% END %]
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
27
share/views/ajax/report/netbios_csv.tt
Normal file
27
share/views/ajax/report/netbios_csv.tt
Normal file
@@ -0,0 +1,27 @@
|
||||
[% USE CSV -%]
|
||||
[% USE date(format = '%Y-%m-%d %H:%M') %]
|
||||
[% IF opt %]
|
||||
[% CSV.dump(['Domain' 'Node' 'Name' 'User' 'First Seen' 'Last Seen']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.device.dns || row.device.name || row.device.ip %]
|
||||
[% FOREACH col IN [ row.domain row.mac.upper row.nbname row.nbuser date.format(row.time_first) date.format(row.time_last) ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% CSV.dump(['Domain' 'Count']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% domain = row.domain || '(Blank Domain)' %]
|
||||
[% FOREACH col IN [ domain row.count ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
47
share/views/ajax/report/nodemultiips.tt
Normal file
47
share/views/ajax/report/nodemultiips.tt
Normal file
@@ -0,0 +1,47 @@
|
||||
[% USE Number.Format %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>MAC</th>
|
||||
<th>Vendor</th>
|
||||
<th>Location</th>
|
||||
<th>IPs</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 3, "desc" ]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'vendor',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(row.dns || row.name || row.switch) + '(' + he.encode(data) + ')</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'ip_count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
13
share/views/ajax/report/nodemultiips_csv.tt
Normal file
13
share/views/ajax/report/nodemultiips_csv.tt
Normal file
@@ -0,0 +1,13 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'MAC' 'Vendor' 'Switch' 'Port' 'IPs' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.mac.upper) %]
|
||||
[% mylist.push(row.vendor) %]
|
||||
[% mylist.push(row.dns || row.name || row.switch) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.ip_count) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
58
share/views/ajax/report/nodesdiscovered.tt
Normal file
58
share/views/ajax/report/nodesdiscovered.tt
Normal file
@@ -0,0 +1,58 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Remote ID</th>
|
||||
<th>Remote IP</th>
|
||||
<th>Remote Port</th>
|
||||
<th>Remote Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.dns || row.name || data);
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&c_nodes=on&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'remote_id',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'remote_ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data || '') + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'remote_port',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'remote_type',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/nodesdiscovered_csv.tt
Normal file
12
share/views/ajax/report/nodesdiscovered_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Port' 'Remote ID' 'Remote IP' 'Remote Port' 'Remote Type']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.dns || row.name || row.ip %]
|
||||
[% FOREACH col IN [ device row.port row.remote_id row.remote_ip row.remote_port row.remote_type ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
88
share/views/ajax/report/nodevendor.tt
Normal file
88
share/views/ajax/report/nodevendor.tt
Normal file
@@ -0,0 +1,88 @@
|
||||
[% USE url %]
|
||||
[% IF opt %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>MAC</th>
|
||||
<th>Vendor</th>
|
||||
<th>Device (Port)</th>
|
||||
<th>Device DNS</th>
|
||||
<th>Device Name</th>
|
||||
<th>Device IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% ELSE %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Vendor</th>
|
||||
<th class="nd_center-cell">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
[% IF opt %]
|
||||
"serverSide": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"ajax": "[% uri_for('/ajax/content/report/nodevendor/data') %]?[% url(params('query').hash) %]",
|
||||
"columns": [
|
||||
{
|
||||
"data": 'mac',
|
||||
"render": function(data, type, row, meta) {
|
||||
var icon = ' <i class="icon-book text-warning"></i> ';
|
||||
if (row.active) {
|
||||
icon = '';
|
||||
}
|
||||
return '<a href="[% search_node %]&q=' + encodeURIComponent(data) + '">' + he.encode(data.toUpperCase()) + icon + '</a>';
|
||||
}
|
||||
}, {
|
||||
"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>';
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(row.switch) + '&f=' + encodeURIComponent(data) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.switch) + '(' + he.encode(data) + ')</a>';
|
||||
}
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'device.dns',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'device.name',
|
||||
"visible": false
|
||||
}, {
|
||||
// Included for filtering
|
||||
"data": 'switch',
|
||||
"visible": false
|
||||
}
|
||||
],
|
||||
[% ELSE %]
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"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>';
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
"order": [[1, "desc"]],
|
||||
[% END %]
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
26
share/views/ajax/report/nodevendor_csv.tt
Normal file
26
share/views/ajax/report/nodevendor_csv.tt
Normal file
@@ -0,0 +1,26 @@
|
||||
[% USE CSV -%]
|
||||
[% IF opt %]
|
||||
[% CSV.dump(['MAC' 'Vendor' '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 ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% CSV.dump(['Vendor' 'Count']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% vendor = row.vendor || '(Unknown Vendor)' %]
|
||||
[% FOREACH col IN [ vendor row.count ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
49
share/views/ajax/report/portadmindown.tt
Normal file
49
share/views/ajax/report/portadmindown.tt
Normal file
@@ -0,0 +1,49 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Port Description</th>
|
||||
<th>Admin Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 0, "asc" ], [1, "asc"]],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.dns || row.name || row.ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'description',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'up_admin',
|
||||
"orderable": false,
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
"data": [% results %],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/portadmindown_csv.tt
Normal file
12
share/views/ajax/report/portadmindown_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Admin Status' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.description) %]
|
||||
[% mylist.push(row.up_admin) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
50
share/views/ajax/report/portblocking.tt
Normal file
50
share/views/ajax/report/portblocking.tt
Normal file
@@ -0,0 +1,50 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Port Description</th>
|
||||
<th>STP Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 0, "asc" ], [1, "asc"]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.dns || row.name || row.ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'description',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'stp',
|
||||
"orderable": false,
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
12
share/views/ajax/report/portblocking_csv.tt
Normal file
12
share/views/ajax/report/portblocking_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'STP Status' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.description) %]
|
||||
[% mylist.push(row.stp) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
49
share/views/ajax/report/portlog.tt
Normal file
49
share/views/ajax/report/portlog.tt
Normal file
@@ -0,0 +1,49 @@
|
||||
<table id="data-table" class="table table-bordered table-condensed table-striped" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Creation</th>
|
||||
<th class="nd_center-cell">User</th>
|
||||
<th class="nd_center-cell">User IP</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
<th class="nd_center-cell">Reason</th>
|
||||
<th class="nd_center-cell">Log</th>
|
||||
<th class="nd_center-cell">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="nd_center-cell">-</td>
|
||||
<td class="nd_center-cell">[% session.logged_in_user | html_entity %]</td>
|
||||
<td class="nd_center-cell">-</td>
|
||||
<td class="nd_center-cell">comment</td>
|
||||
<td class="nd_center-cell">Other</td>
|
||||
<td class="nd_center-cell"><input data-form="add" class="span4" name="log" type="text" placeholder="Add comment..."></td>
|
||||
<input data-form="add" name="ip" type="hidden" value="[% params.q | html_entity %]">
|
||||
<input data-form="add" name="port" type="hidden" value="[% params.f | html_entity %]">
|
||||
<td class="nd_center-cell">
|
||||
<button class="btn btn-small nd_adminbutton" name="add" type="submit"><i class="icon-plus-sign"></i> Add</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
[% WHILE (row = results.next) %]
|
||||
<tr>
|
||||
<td class="nd_center-cell">[% row.creation_stamp | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.username | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.userip | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.action | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% settings.port_control_reasons.item(row.reason) || row.reason | html_entity %]</td>
|
||||
<td class="nd_center-cell">[% row.log || '-' | html_entity %]</td>
|
||||
<td class="nd_center-cell"></td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
sort: false,
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
48
share/views/ajax/report/portmultinodes.tt
Normal file
48
share/views/ajax/report/portmultinodes.tt
Normal file
@@ -0,0 +1,48 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Port</th>
|
||||
<th>Port Description</th>
|
||||
<th>Node Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"order": [[ 3, "desc" ]],
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(row.dns || row.name || row.ip);
|
||||
}
|
||||
}, {
|
||||
"data": 'port',
|
||||
"type": 'portsort',
|
||||
"render": function(data, type, row, meta) {
|
||||
return type === 'display' ?
|
||||
'<a href="[% device_ports %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data) + '</a>' :
|
||||
data;
|
||||
}
|
||||
}, {
|
||||
"data": 'description',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'mac_count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/portmultinodes_csv.tt
Normal file
12
share/views/ajax/report/portmultinodes_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Port' 'Port Description' 'Node Count' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.dns || row.name || row.ip) %]
|
||||
[% mylist.push(row.port) %]
|
||||
[% mylist.push(row.description) %]
|
||||
[% mylist.push(row.mac_count) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
87
share/views/ajax/report/portssid.tt
Normal file
87
share/views/ajax/report/portssid.tt
Normal file
@@ -0,0 +1,87 @@
|
||||
[% USE Number.Format %]
|
||||
[% IF opt %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device (Port)</th>
|
||||
<th>Broadcast</th>
|
||||
<th>Model</th>
|
||||
<th>SSID</th>
|
||||
<th>Vendor</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% ELSE %]
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">SSID</th>
|
||||
<th class="nd_center-cell">Broadcast</th>
|
||||
<th class="nd_center-cell">Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
[% END %]
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
[% IF opt %]
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '&f=' + encodeURIComponent(row.port.port) + '&c_nodes=on&n_ssid=on">' + he.encode(row.device.dns || row.device.name || row.ip) + '(' + he.encode(row.port.port) + ')</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'broadcast',
|
||||
"render": function(data, type, row, meta) {
|
||||
return (data ? 'Yes' : 'No');
|
||||
}
|
||||
}, {
|
||||
"data": 'device.model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'ssid',
|
||||
"searchable": false,
|
||||
"orderable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'device.vendor',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% ELSE %]
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ssid',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/report/portssid') %]?ssid=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'broadcast',
|
||||
"render": function(data, type, row, meta) {
|
||||
return (data ? 'Yes' : 'No');
|
||||
}
|
||||
}, {
|
||||
"data": 'count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
},
|
||||
],
|
||||
"order": [[ 2, "desc" ]],
|
||||
[% END %]
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
26
share/views/ajax/report/portssid_csv.tt
Normal file
26
share/views/ajax/report/portssid_csv.tt
Normal file
@@ -0,0 +1,26 @@
|
||||
[% USE CSV -%]
|
||||
[% IF opt %]
|
||||
[% CSV.dump(['Device' 'Port' 'Name' 'Broadcast' 'Model' 'SSID' 'Vendor']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.device.dns || row.device.name || row.device.ip %]
|
||||
[% broadcast = row.broadcast ? 'Yes' : 'No' %]
|
||||
[% FOREACH col IN [ device row.port.port row.device.name broadcast row.device.model row.ssid row.device.vendor ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
[% CSV.dump(['SSID' 'Count']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% FOREACH col IN [ row.ssid row.count ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
[% END %]
|
||||
54
share/views/ajax/report/portutilization.tt
Normal file
54
share/views/ajax/report/portutilization.tt
Normal file
@@ -0,0 +1,54 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th class="nd_center-cell">Total Ports</th>
|
||||
<th class="nd_center-cell">In Use</th>
|
||||
<th class="nd_center-cell">Shutdown</th>
|
||||
<th class="nd_center-cell">Free</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'port_count',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'ports_in_use',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'ports_shutdown',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'ports_free',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/portutilization_csv.tt
Normal file
12
share/views/ajax/report/portutilization_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Device' 'Total Ports' 'In Use' 'Shutdown' 'Free' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.dns || row.ip %]
|
||||
[% FOREACH col IN [ device row.port_count row.ports_in_use row.ports_shutdown row.ports_free ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
32
share/views/ajax/report/subnets.tt
Normal file
32
share/views/ajax/report/subnets.tt
Normal file
@@ -0,0 +1,32 @@
|
||||
[% USE Number.Format %]
|
||||
<table id="data-table" class="table table-bordered table-condensed table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="nd_center-cell">Subnet</th>
|
||||
<th class="nd_center-cell">Size</th>
|
||||
<th class="nd_center-cell">Number of Active Nodes</th>
|
||||
<th class="nd_center-cell">Percent Utilization</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% FOREACH row IN results %]
|
||||
<tr>
|
||||
<td class="nd_center-cell"><a href="[% uri_for('/report/ipinventory') %]?subnet=[% row.subnet | uri %]&daterange=[% params.daterange | uri %]&age_invert=[% params.age_invert | uri %]&limit=[% row.subnet_size | uri %]">
|
||||
[% row.subnet | html_entity %]</a></td>
|
||||
<td class="nd_center-cell">[% row.subnet_size | format_number %]</td>
|
||||
<td class="nd_center-cell">[% row.active | format_number %]</td>
|
||||
<td class="nd_center-cell">[% row.percent | html_entity %]</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#data-table').dataTable({
|
||||
"order": [[ 3, 'desc' ]],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
|
||||
14
share/views/ajax/report/subnets_csv.tt
Normal file
14
share/views/ajax/report/subnets_csv.tt
Normal file
@@ -0,0 +1,14 @@
|
||||
[% USE CSV %]
|
||||
[% CSV.dump([ 'Subnet' 'Size' 'Number of Active Nodes' 'Percent Utilization' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.subnet) %]
|
||||
[% mylist.push(row.subnet_size) %]
|
||||
[% mylist.push(row.active) %]
|
||||
[% mylist.push(row.percent) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
|
||||
|
||||
45
share/views/ajax/report/vlaninventory.tt
Normal file
45
share/views/ajax/report/vlaninventory.tt
Normal file
@@ -0,0 +1,45 @@
|
||||
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>VLAN ID</th>
|
||||
<th>VLAN Name</th>
|
||||
<th>Device Count</th>
|
||||
<th>Port Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [
|
||||
{
|
||||
"data": 'vlan',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + data + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'description',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/search') %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'dcount',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}, {
|
||||
"data": 'pcount',
|
||||
"searchable": false,
|
||||
"render": function(data, type, row, meta) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
12
share/views/ajax/report/vlaninventory_csv.tt
Normal file
12
share/views/ajax/report/vlaninventory_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'VLAN ID' 'VLAN Name' 'Device Count' 'Port Count' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% mylist.push(row.vlan) %]
|
||||
[% mylist.push(row.description) %]
|
||||
[% mylist.push(row.dcount) %]
|
||||
[% mylist.push(row.pcount) %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
71
share/views/ajax/search/device.tt
Normal file
71
share/views/ajax/search/device.tt
Normal file
@@ -0,0 +1,71 @@
|
||||
<table id="ds-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Device</th>
|
||||
<th>Contact</th>
|
||||
<th>Location</th>
|
||||
<th>System Name</th>
|
||||
<th>Model</th>
|
||||
<th>OS Version</th>
|
||||
<th>Management IP</th>
|
||||
<th>Serial</th>
|
||||
<th>Last Discovered</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#ds-data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [{
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>';
|
||||
}
|
||||
}, {
|
||||
"data": 'contact',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'location',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'model',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'os_ver',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'serial',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'last_discover_stamp',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});</script>
|
||||
12
share/views/ajax/search/device_csv.tt
Normal file
12
share/views/ajax/search/device_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump(['Device','Contact','Location','System Name','Model','OS Version','Management IP','Serial']) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.dns || row.ip %]
|
||||
[% FOREACH col IN [ device row.contact row.location row.name row.model row.os_ver row.ip row.serial] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
216
share/views/ajax/search/node_by_ip.tt
Normal file
216
share/views/ajax/search/node_by_ip.tt
Normal file
@@ -0,0 +1,216 @@
|
||||
[% USE date(format = '%Y-%m-%d %H:%M') %]
|
||||
[% USE Number.Format %]
|
||||
<table id="nsbi-data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>MAC</th>
|
||||
<th>Match</th>
|
||||
<th class="nd_center-cell">Device or Node</th>
|
||||
[% IF params.stamps %]
|
||||
<th>First Seen</th>
|
||||
<th>Last Seen</th>
|
||||
[% END %]
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = macs.next) %]
|
||||
[% IF row.nbname %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
|
||||
[% row.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
|
||||
[% row.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>NetBIOS</td>
|
||||
<td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% row.domain | uri %]" title="Devices in this Domain">[% row.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% row.nbname | uri %]">[% row.nbname | html_entity %]</a>
|
||||
<br>[% row.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% row.time_first_stamp | html_entity %]</td>
|
||||
<td>[% row.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% ELSE %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
|
||||
[% row.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
|
||||
[% row.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>IP → MAC</td>
|
||||
<td class="nd_center-cell">
|
||||
<a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
|
||||
[% ' <i class="icon-book text-warning"></i> ' IF NOT row.active %]
|
||||
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% row.time_first_stamp | html_entity %]</td>
|
||||
<td>[% row.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% FOREACH nbt IN row.netbios %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% nbt.net_mac.$mac_format_call | uri %]">
|
||||
[% nbt.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nbt.oui.abbrev | uri %]">
|
||||
[% nbt.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>NetBIOS</td>
|
||||
<td class="nd_linkcell nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
|
||||
<br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% date.format(nbt.time_first) | html_entity %]</td>
|
||||
<td>[% date.format(nbt.time_last) | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% FOREACH ni IN row.nodeips %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% ni.net_mac.$mac_format_call | uri %]">
|
||||
[% ni.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% ni.oui.abbrev | uri %]">
|
||||
[% ni.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>IP → MAC</td>
|
||||
<td class="nd_center-cell">
|
||||
<a href="[% search_node %]&q=[% ni.ip | uri %]">[% ni.ip | html_entity %]</a>
|
||||
[% ' <i class="icon-book text-warning"></i> ' IF NOT ni.active %]
|
||||
[% ' (' _ ni.dns.remove(settings.domain_suffix) _ ')' IF ni.dns %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% date.format(ni.time_first) | html_entity %]</td>
|
||||
<td>[% date.format(ni.time_last) | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% FOREACH node IN row.node_sightings(archive_filter) %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
|
||||
[% node.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% node.oui.abbrev | uri %]">
|
||||
[% node.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>Switch Port</td>
|
||||
<td class="nd_center-cell">
|
||||
<a class="nd_linkcell"
|
||||
href="[% device_ports %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
|
||||
[% node.switch | html_entity %] - [% node.port | html_entity %]
|
||||
[% ' <i class="icon-book text-warning"></i>' IF NOT node.active %]</a>
|
||||
[% IF node.device.dns AND node.device_port AND node.device_port.name %]
|
||||
([% node.device.dns | html_entity %] - [% node.device_port.name | html_entity %])
|
||||
[% END %]
|
||||
on vlan [% node.vlan %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% node.time_first_stamp | html_entity %]</td>
|
||||
<td>[% node.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% FOREACH wlan IN node.wireless %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% wlan.net_mac.$mac_format_call | uri %]">
|
||||
[% wlan.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% wlan.oui.abbrev | uri %]">
|
||||
[% wlan.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>Wireless Info</td>
|
||||
<td class="nd_center-cell">SSID: [% wlan.ssid | html_entity %]<br>
|
||||
MaxRate: [% wlan.maxrate | html_entity %]Mbps TxRate: [% wlan.txrate | html_entity %]Mbps<br>
|
||||
SigStr: [% wlan.sigstrength | html_entity %] SigQual: [% wlan.sigqual | html_entity %]<br>
|
||||
Rx: [% wlan.rxpkt | format_number %] pkts, [% wlan.rxbyte | format_number %] bytes<br>
|
||||
Tx: [% wlan.txpkt | format_number %] pkts, [% wlan.txbyte | format_number %] bytes<br>
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td> </td>
|
||||
<td>[% date.format(wlan.time_last) | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% FOREACH nodeip IN row.ip_aliases(archive_filter) %]
|
||||
<tr>
|
||||
<td>MAC: <a href="[% search_node %]&q=[% nodeip.net_mac.$mac_format_call | uri %]">
|
||||
[% nodeip.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nodeip.oui.abbrev | uri %]">
|
||||
[% nodeip.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>MAC → IP</td>
|
||||
<td class="nd_center-cell">
|
||||
<a href="[% search_node %]&q=[% nodeip.ip | uri %]">[% nodeip.ip | html_entity %]</a>
|
||||
[% ' <i class="icon-book text-warning"></i> ' IF NOT nodeip.active %]
|
||||
[% ' (' _ nodeip.dns.remove(settings.domain_suffix) _ ')' IF nodeip.dns %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% nodeip.time_first_stamp | html_entity %]</td>
|
||||
<td>[% nodeip.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
tr.group,
|
||||
tr.group:hover {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var table = $('#nsbi-data-table').DataTable({
|
||||
"columnDefs": [
|
||||
{ "visible": false, "targets": 0 }
|
||||
],
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"drawCallback": function ( settings ) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
$(rows).eq( i ).before(
|
||||
[% IF params.stamps %]
|
||||
'<tr class="group"><td colspan="4">'+group+'</td></tr>'
|
||||
[% ELSE %]
|
||||
'<tr class="group"><td colspan="2">'+group+'</td></tr>'
|
||||
[% END %]
|
||||
);
|
||||
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
},
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
|
||||
// Order by the grouping
|
||||
$('#nsbi-data-table tbody').on( 'click', 'tr.group', function () {
|
||||
var currentOrder = table.order()[0];
|
||||
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
|
||||
table.order( [ 0, 'desc' ] ).draw();
|
||||
}
|
||||
else {
|
||||
table.order( [ 0, 'asc' ] ).draw();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
176
share/views/ajax/search/node_by_mac.tt
Normal file
176
share/views/ajax/search/node_by_mac.tt
Normal file
@@ -0,0 +1,176 @@
|
||||
[% USE Number.Format %]
|
||||
<table id="nsbm-data-table" class="table table-bordered table-hover" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>MAC</th>
|
||||
<th>Match</th>
|
||||
<th class="nd_center-cell">Device or Node</th>
|
||||
[% IF params.stamps %]
|
||||
<th>First Seen</th>
|
||||
<th>Last Seen</th>
|
||||
[% END %]
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
[% WHILE (row = ips.next) %]
|
||||
<tr>
|
||||
<td>
|
||||
MAC: <a href="[% search_node %]&q=[% row.net_mac.$mac_format_call | uri %]">
|
||||
[% row.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% row.oui.abbrev | uri %]">
|
||||
[% row.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>MAC → IP</td>
|
||||
<td class="nd_center-cell"><a href="[% search_node %]&q=[% row.ip | uri %]">[% row.ip | html_entity %]</a>
|
||||
[% ' <i class="icon-book text-warning"></i> ' IF NOT row.active %]
|
||||
[% ' (' _ row.dns.remove(settings.domain_suffix) _ ')' IF row.dns %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% row.time_first_stamp | html_entity %]</td>
|
||||
<td>[% row.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% WHILE (node = sightings.next) %]
|
||||
<tr>
|
||||
<td>
|
||||
MAC: <a href="[% search_node %]&q=[% node.net_mac.$mac_format_call | uri %]">
|
||||
[% node.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% node.oui.abbrev | uri %]">
|
||||
[% node.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>Switch Port</td>
|
||||
<td class="nd_center-cell">
|
||||
<a href="[% device_ports %]&q=[% node.switch | uri %]&f=[% node.port | uri %]&c_nodes=on&c_neighbors=on&prefer=port">
|
||||
[% node.switch | html_entity %] - [% node.port | html_entity %]</a>
|
||||
[% ' <i class="icon-book text-warning"></i> ' IF NOT node.active %]
|
||||
[% IF node.device.dns AND node.device_port AND node.device_port.name %]
|
||||
([% node.device.dns | html_entity %] - [% node.device_port.name | html_entity %])
|
||||
[% END %]
|
||||
on vlan [% node.vlan %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% node.time_first_stamp | html_entity %]</td>
|
||||
<td>[% node.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% WHILE (port = ports.next) %]
|
||||
<tr>
|
||||
<td>
|
||||
MAC: <a href="[% search_node %]&q=[% port.net_mac.$mac_format_call | uri %]">[% port.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% port.oui.abbrev | uri %]">
|
||||
[% port.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>Switch Port</td>
|
||||
<td class="nd_center-cell">
|
||||
<a href="[% device_ports %]&q=[% port.ip | uri %]&f=[% port.port | uri %]&c_mac=on&c_nodes=on&c_neighbors=on">
|
||||
[% port.ip | html_entity %] - [% port.descr | html_entity %]</a>
|
||||
[% IF port.device.dns AND port.name %]
|
||||
([% port.device.dns | html_entity %] - [% port.name | html_entity %])
|
||||
[% END %]
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% port.creation | html_entity %]</td>
|
||||
<td>[% port.creation | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% WHILE (nbt = netbios.next) %]
|
||||
<tr>
|
||||
<td>
|
||||
MAC: <a href="[% search_node %]&q=[% nbt.net_mac.$mac_format_call | uri %]">[% nbt.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% nbt.oui.abbrev | uri %]">
|
||||
[% nbt.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>NetBIOS</td>
|
||||
<td class="nd_center-cell">\\<a href="[% uri_for('/report/netbios') %]?domain=[% nbt.domain | uri %]" title="Devices in this Domain">[% nbt.domain | html_entity %]</a>\<a href="[% search_node %]&q=[% nbt.nbname | uri %]">[% nbt.nbname | html_entity %]</a>
|
||||
<br>[% nbt.nbuser || '[No User]' | html_entity %]@<a href="[% search_node %]&q=[% nbt.ip | uri %]">[% nbt.ip | html_entity %]</a>
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td>[% nbt.time_first_stamp | html_entity %]</td>
|
||||
<td>[% nbt.time_last_stamp | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
[% WHILE (wlan = wireless.next) %]
|
||||
<tr>
|
||||
<td>
|
||||
MAC: <a href="[% search_node %]&q=[% wlan.net_mac.$mac_format_call | uri %]">[% wlan.net_mac.$mac_format_call | html_entity %]</a>
|
||||
[% IF params.show_vendor %]
|
||||
( <a href="[% uri_for('/report/nodevendor') %]?vendor=[% wlan.oui.abbrev | uri %]">
|
||||
[% wlan.oui.company | html_entity %]</a> )
|
||||
[% END %]
|
||||
</td>
|
||||
<td>Wireless Info</td>
|
||||
<td class="nd_center-cell">SSID: [% wlan.ssid | html_entity %]<br>
|
||||
MaxRate: [% wlan.maxrate | html_entity %]Mbps TxRate: [% wlan.txrate | html_entity %]Mbps<br>
|
||||
SigStr: [% wlan.sigstrength | html_entity %] SigQual: [% wlan.sigqual | html_entity %]<br>
|
||||
Rx: [% wlan.rxpkt | format_number %] pkts, [% wlan.rxbyte | format_number %] bytes<br>
|
||||
Tx: [% wlan.txpkt | format_number %] pkts, [% wlan.txbyte | format_number %] bytes<br>
|
||||
</td>
|
||||
[% IF params.stamps %]
|
||||
<td> </td>
|
||||
<td>[% wlan.get_column('time_last_stamp') | html_entity %]</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
[% END %]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
tr.group,
|
||||
tr.group:hover {
|
||||
background-color: #ddd !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var table = $('#nsbm-data-table').DataTable({
|
||||
"columnDefs": [
|
||||
{ "visible": false, "targets": 0 }
|
||||
],
|
||||
"order": [[ 0, 'asc' ]],
|
||||
"drawCallback": function ( settings ) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(0, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
$(rows).eq( i ).before(
|
||||
[% IF params.stamps %]
|
||||
'<tr class="group"><td colspan="4">'+group+'</td></tr>'
|
||||
[% ELSE %]
|
||||
'<tr class="group"><td colspan="2">'+group+'</td></tr>'
|
||||
[% END %]
|
||||
);
|
||||
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
},
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
} );
|
||||
|
||||
// Order by the grouping
|
||||
$('#nsbm-data-table tbody').on( 'click', 'tr.group', function () {
|
||||
var currentOrder = table.order()[0];
|
||||
if ( currentOrder[0] === 0 && currentOrder[1] === 'asc' ) {
|
||||
table.order( [ 0, 'desc' ] ).draw();
|
||||
}
|
||||
else {
|
||||
table.order( [ 0, 'asc' ] ).draw();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
48
share/views/ajax/search/port.tt
Normal file
48
share/views/ajax/search/port.tt
Normal file
@@ -0,0 +1,48 @@
|
||||
<table id="ps-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Port</th>
|
||||
<th>Description</th>
|
||||
<th>Vlan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var table = $('#ps-data-table').dataTable({
|
||||
"deferRender": true,
|
||||
"data": [% results %],
|
||||
"columns": [{
|
||||
"data": 'name',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'ip',
|
||||
"render": function(data, type, row, meta) {
|
||||
var ddns = '';
|
||||
if (row.device.dns || row.device.name) {
|
||||
ddns = ' (' + he.encode(row.device.dns || row.device.name) + ')';
|
||||
}
|
||||
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data)
|
||||
+ '&f=' + encodeURIComponent(row.port) + '">' + he.encode(data)
|
||||
+ ' [' + he.encode(row.port) + ']</a>' + ddns;
|
||||
}
|
||||
}, {
|
||||
"data": 'descr',
|
||||
"render": function(data, type, row, meta) {
|
||||
return he.encode(data || '');
|
||||
}
|
||||
}, {
|
||||
"data": 'port_vlans.vlan',
|
||||
"render": function(data, type, row, meta) {
|
||||
return data || '';
|
||||
}
|
||||
}
|
||||
],
|
||||
[% INCLUDE 'ajax/datatabledefaults.tt' -%]
|
||||
});
|
||||
});</script>
|
||||
|
||||
12
share/views/ajax/search/port_csv.tt
Normal file
12
share/views/ajax/search/port_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Name' 'Port' 'Description' 'Vlan' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% myport = "$row.ip [ $row.port ] (" _ (row.device.dns || row.device.name) _ ")" IF (row.device.dns || row.device.name) %]
|
||||
[% FOREACH col IN [ row.name myport row.descr row.port_vlans.vlan ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
53
share/views/ajax/search/vlan.tt
Normal file
53
share/views/ajax/search/vlan.tt
Normal file
@@ -0,0 +1,53 @@
|
||||
<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>
|
||||
12
share/views/ajax/search/vlan_csv.tt
Normal file
12
share/views/ajax/search/vlan_csv.tt
Normal file
@@ -0,0 +1,12 @@
|
||||
[% USE CSV -%]
|
||||
[% CSV.dump([ 'Vlan' 'Device' 'Description' 'Model' 'OS' 'Vendor' ]) %]
|
||||
|
||||
[% FOREACH row IN results %]
|
||||
[% mylist = [] %]
|
||||
[% device = row.dns || row.ip %]
|
||||
[% FOREACH col IN [ row.vlans.vlan device row.vlans.description row.model row.os row.vendor ] %]
|
||||
[% mylist.push(col) %]
|
||||
[% END %]
|
||||
[% CSV.dump(mylist) %]
|
||||
|
||||
[% END %]
|
||||
77
share/views/ajax/statistics.tt
Normal file
77
share/views/ajax/statistics.tt
Normal file
@@ -0,0 +1,77 @@
|
||||
[% USE Number.Format %]
|
||||
<div class="row">
|
||||
<div class="span5 offset1">
|
||||
<h4>Built using Open Source</h4>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Software</th>
|
||||
<th>Version</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><b><a href="http://netdisco.org">App::Netdisco</a></b></th>
|
||||
<th>[% disco_ver | html_entity %]</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://metacpan.org/module/netdisco-db-deploy">DB Schema</a></th>
|
||||
<th>v[% schema_ver | html_entity %]</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="http://perldancer.org/">Dancer</a></th>
|
||||
<th>[% dancer_version | html_entity %]</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="http://getbootstrap.com">Bootstrap</a></th>
|
||||
<th>[%# Can't determine magically %] 2.3.1</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="http://www.postgresql.org">PostgreSQL</a></th>
|
||||
<th>
|
||||
[% db_version| html_entity %].<br />
|
||||
DBI [% dbi_ver | html_entity %],
|
||||
DBD::Pg [% dbdpg_ver | html_entity %]
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://github.com/netdisco/snmp-info">SNMP::Info</a></th>
|
||||
<th>[% snmpinfo_ver | html_entity %]</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="http://www.perl.org">Perl</a></th>
|
||||
<th>[% perl_version | html_entity %]</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="span4 offset1">
|
||||
<h4>Statistics for this installation</h4>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>[% device_count | format_number %] devices with [% device_port_count | format_number %] interfaces
|
||||
using [% device_count + device_ip_count | format_number %] IPs</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>[% device_links | format_number %] layer 2 links between devices</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>[% node_count | format_number %] nodes in [% node_table_count | format_number %] entries</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>[% ip_count | format_number %] IPs in [% ip_table_count | format_number %] entries</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Statistics took [% process_time %] seconds to process.</th>
|
||||
</tr>
|
||||
<tr><th></th></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user