add csv download to duplex mismatch, half duplex, and port utilization reports
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| [% INCLUDE "download_as.tt" %] | ||||
| <table class="table table-bordered table-condensed table-striped nd_floatinghead"> | ||||
|   <thead> | ||||
|     <tr> | ||||
|   | ||||
							
								
								
									
										13
									
								
								Netdisco/share/views/ajax/report/duplexmismatch_csv.tt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Netdisco/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' ]) %] | ||||
|  | ||||
| [% WHILE (row = results.next) %] | ||||
|   [% 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 %] | ||||
| @@ -1,3 +1,4 @@ | ||||
| [% INCLUDE "download_as.tt" %] | ||||
| <table class="table table-bordered table-condensed table-striped nd_floatinghead"> | ||||
|   <thead> | ||||
|     <tr> | ||||
|   | ||||
							
								
								
									
										12
									
								
								Netdisco/share/views/ajax/report/halfduplex_csv.tt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Netdisco/share/views/ajax/report/halfduplex_csv.tt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| [% USE CSV -%] | ||||
| [% CSV.dump([ 'Device' 'Port' 'Description' 'Duplex' ]) %] | ||||
|  | ||||
| [% WHILE (row = results.next) %] | ||||
|   [% mylist = [] %] | ||||
|   [% device = row.device.dns || row.device.ip %] | ||||
|   [% FOREACH col IN [ device row.port row.name row.duplex.ucfirst ] %] | ||||
|     [% mylist.push(col) %] | ||||
|   [% END %] | ||||
|   [% CSV.dump(mylist) %] | ||||
|  | ||||
| [% END %] | ||||
| @@ -1,3 +1,4 @@ | ||||
| [% INCLUDE "download_as.tt" %] | ||||
| <table class="table table-bordered table-condensed table-hover nd_floatinghead"> | ||||
|   <thead> | ||||
|     <tr> | ||||
|   | ||||
							
								
								
									
										12
									
								
								Netdisco/share/views/ajax/report/portutilization_csv.tt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Netdisco/share/views/ajax/report/portutilization_csv.tt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| [% USE CSV -%] | ||||
| [% CSV.dump([ 'Device' 'Total Ports' 'In Use' 'Shutdown' 'Free' ]) %] | ||||
|  | ||||
| [% WHILE (row = results.next) %] | ||||
|   [% 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 %] | ||||
		Reference in New Issue
	
	Block a user