Bug #3301
closed"Reverse Resolve with DNS" popup poorly formatted
100%
Description
The dialog that is displayed from the firewall log with the results of the reverse DNS lookup is poorly formatted.
It is displayed using the javascript alert function and formatted using tabs and newlines.
Unfortunately the Chrome browser doesn't support tabs so there is no separation between the columns, the fields in each row are joined together. Even on browsers which support tabs there can be a very small separation between fields.
I've rewritten the display_host_results() function in display_dns.php to use spaces instead of tabs. It does a much better job of aligning the fields in each column and works in all the browsers.
It still isn't perfect due to the use of a proportional font.
Here is the new version of the function:
function display_host_results ($address,$hostname,$dns_speeds) { $map_lengths = function($element) { return array(strlen($element[0]), strlen($element[1])); }; $map_column0 = function($element) { return $element[0]; }; echo gettext("IP Address") . ": {$address} \n"; echo gettext("Host Name") . ": {$hostname} \n"; 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'])); } $length_table = array_map($map_lengths, $text_table); $col0_padlength = max(array_map($map_column0, $length_table)); foreach ($text_table as $text_row) { echo str_pad($text_row[0], $col0_padlength + 4) . $text_row[1] . "\n"; } }
Updated by Phillip Davis over 10 years ago
It is easy for the developers if you make changes in GitHub and submit a pull request.
Updated by Robert Nelson over 10 years ago
Thanks for letting me know, I submitted the pull request.
Updated by Robert Nelson over 10 years ago
This can be closed, pull request #847 was merged to master.
Updated by Ermal Luçi over 10 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset e30dd11d164895307bd56fe043e4770517872fd5.
Updated by Chris Buechler over 10 years ago
- Status changed from Feedback to Closed