diff --git a/configuration.php b/configuration.php index 3cc19659f..a1f3e9536 100644 --- a/configuration.php +++ b/configuration.php @@ -2042,6 +2042,14 @@ function uploadifive() { +
+
+
+
+

',__("Cabinets"),'

diff --git a/db-20.01-to-20.02-maybe.sql b/db-20.01-to-20.02-maybe.sql index 87e10e67c..1748421e4 100644 --- a/db-20.01-to-20.02-maybe.sql +++ b/db-20.01-to-20.02-maybe.sql @@ -4,6 +4,10 @@ UPDATE fac_Config SET DefaultVal = 'Location' WHERE fac_Config.Parameter = 'AssignCabinetLabels'; + +--- Add preference for resolution of device ip addresses + +INSERT into fac_Config set Parameter='ResolveDeviceIp', Value='Disabled', UnitOfMeasure='string',ValType='string', DefaultVal='disabled'; -- -- Bump up the database version (uncomment below once released) -- diff --git a/devices.php b/devices.php index 5a2dd4d42..99d97a049 100644 --- a/devices.php +++ b/devices.php @@ -1801,7 +1801,7 @@ function setPreferredLayout() {
-
+
diff --git a/search_export.php b/search_export.php index 6daeaea05..e035e1bef 100644 --- a/search_export.php +++ b/search_export.php @@ -2,6 +2,7 @@ require_once('db.inc.php'); require_once('facilities.inc.php'); + $resolve_ip = $config->ParameterArray['ResolveDeviceIp']; $subheader=__("Data Center View/Export"); $datacenter=new DataCenter(); @@ -24,7 +25,7 @@ $cList=$person->GetUserList(true); /* This is a helper function to deal with nested devices aka russian nesting dolls */ - function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ + function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList,$resolve_ip){ // Find all of the children! $childList=$dev->GetDeviceChildren(); @@ -74,8 +75,10 @@ function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ \tDeviceID\" target=\"device\">$child->Label \t$child->SerialNo \t$child->AssetTag - \t$child->PrimaryIP - \tDeviceType&search\" target=\"search\">$child->DeviceType + \t$child->PrimaryIP" . + + (( $_POST['resolve'] == 'true' && $resolve_ip == 'enabled') ? ($child->PrimaryIP != '' ? "\t" .@gethostbyname($child->PrimaryIP) . "" : "\t") : '' ) + . "\tDeviceType&search\" target=\"search\">$child->DeviceType \t$cModel \t$ctags \t$cDepartment @@ -92,7 +95,7 @@ function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ \n\t\t\n"; if($child->DeviceType=="Chassis"){ - $chassis=processChassis($child,$dept,$row,$ca_result,$tpList,$cList); + $chassis=processChassis($child,$dept,$row,$ca_result,$tpList,$cList,$resolve_ip); $body.=$chassis; } } @@ -138,8 +141,9 @@ function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ \t".__("Name")." \t".__("Serial Number")." \t".__("Asset Tag")." - \t".__("Primary IP / Host Name")." - \t".__("Device Type")." + \t".__("Primary IP / Host Name")."". + (( $_POST['resolve'] == 'true' && $resolve_ip == 'enabled') ? "\t" . __("Resolved IP") . "" : '' ) . + "\t".__("Device Type")." \t".__("Template")." \t".__("Tags")." \t".__("Owner")." @@ -205,8 +209,9 @@ function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ \tDeviceID\" target=\"device\">{$row["Label"]} \t{$row["SerialNo"]} \t{$row["AssetTag"]} - \t{$row["PrimaryIP"]} - \t{$row["DeviceType"]} + \t{$row["PrimaryIP"]}" . + ( ( $_POST['resolve'] == 'true' && $resolve_ip == 'enabled' ) ? ($row["PrimaryIP"] != '' ? "\t" .@gethostbyname($row["PrimaryIP"]) . "" : "\t") : '' ) + . "\t{$row["DeviceType"]} \t$Model \t$tags \t$Department @@ -222,7 +227,7 @@ function processChassis($dev,$dept,$row,$ca_result,$tpList,$cList){ {$ca_cells}\t\n\t\t\n"; if($row["DeviceType"]=="Chassis"){ - $chassis=processChassis($dev,$dept,$row,$ca_result,$tpList,$cList); + $chassis=processChassis($dev,$dept,$row,$ca_result,$tpList,$cList,$resolve_ip); $body.=$chassis; } } @@ -287,7 +292,13 @@ function redraw(){ } dt(); $('#datacenterid').change(function(){ - $.post('', {datacenterid: $(this).val(), ajax: ''}, function(data){ + $.post('', {datacenterid: $(this).val(), resolve: $("#resolve").is(":checked"), ajax: ''}, function(data){ + $('#tablecontainer').html(data); + dt(); + }); + }); + $('#resolve').click(function(){ + $.post('', {datacenterid: $('#datacenterid').val(), resolve: $("#resolve").is(":checked"), ajax: ''}, function(data){ $('#tablecontainer').html(data); dt(); }); @@ -307,6 +318,7 @@ function redraw(){ '; foreach($dcList as $dc){print "\t\t\t\t\n";} ?> + Show Resolved IPs (500 IPs aprox 20 seconds)'; }; ?>