diff options
author | Ermal Luçi <eri@pfsense.org> | 2013-11-07 10:31:40 -0800 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2013-11-07 10:31:40 -0800 |
commit | e30dd11d164895307bd56fe043e4770517872fd5 (patch) | |
tree | 6c5b5afd44100bbc4a91fb83b13c58167e7ccb8d | |
parent | 90caf54ebf46763f4856d446ab0aa77259282119 (diff) | |
parent | 84eaea96c6d38d11f4ea7531f341122fd34b3906 (diff) | |
download | pfsense-e30dd11d164895307bd56fe043e4770517872fd5.zip pfsense-e30dd11d164895307bd56fe043e4770517872fd5.tar.gz |
Merge pull request #849 from Robert-Nelson/RELENG_2_1
Fix #3301
-rw-r--r-- | usr/local/www/diag_dns.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 6b336a2..98271d1 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -150,15 +150,22 @@ if( ($_POST['host']) && ($_POST['dialog_output']) ) { } function display_host_results ($address,$hostname,$dns_speeds) { + $map_lengths = function($element) { return strlen($element[0]); }; + echo gettext("IP Address") . ": {$address} \n"; echo gettext("Host Name") . ": {$hostname} \n"; echo "\n"; - echo gettext("Server") . "\t" . gettext("Query Time") . "\n"; - if(is_array($dns_speeds)) - foreach($dns_speeds as $qt){ - echo trim($qt['dns_server']) . "\t" . trim($qt['query_time']); - echo "\n"; + $text_table = array(); + $text_table[] = array(gettext("Server"), gettext("Query Time")); + if (is_array($dns_speeds)) { + foreach ($dns_speeds as $qt) { + $text_table[] = array(trim($qt['dns_server']), trim($qt['query_time'])); } + } + $col0_padlength = max(array_map($map_lengths, $text_table)) + 4; + foreach ($text_table as $text_row) { + echo str_pad($text_row[0], $col0_padlength) . $text_row[1] . "\n"; + } } include("head.inc"); ?> |