117 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| [% 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>
 | |
| 
 | |
|     <tfoot>
 | |
|       <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>
 | |
|     </tfoot>    
 | |
|   </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({
 | |
|     "deferRender": true,
 | |
|     "data": [% results %],
 | |
|     "columns": [
 | |
|       [% IF opt %] {
 | |
|       "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 %] {
 | |
|         "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.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
 | |
|         }
 | |
|       }
 | |
|       [% END %]
 | |
|     ]
 | |
|   });
 | |
| });
 | |
| </script>
 |