api, dns / firewall live log. change output to associative array so we can easily map list of results. https://github.com/opnsense/core/issues/1788

This commit is contained in:
Ad Schellevis 2017-11-08 19:27:32 +01:00
parent 632d887d9a
commit 557effd64a
2 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ class DnsController extends ApiControllerBase
}
$result = array();
foreach ($address as $addr) {
$result[] = gethostbyaddr($addr);
$result[$addr] = gethostbyaddr($addr);
}
return $result;
} else {

View File

@ -122,9 +122,9 @@ POSSIBILITY OF SUCH DAMAGE.
$(this).unbind('click');
$(".act_info_fld_src, .act_info_fld_dst").each(function(){
var target_field = $(this);
ajaxGet(url='/api/diagnostics/dns/reverse_lookup', {'address': $(this).text()}, callback=function(data, status) {
if (Array.isArray(data)) {
var resolv_output = data.join(',');
ajaxGet(url='/api/diagnostics/dns/reverse_lookup', {'address': target_field.text()}, callback=function(data, status) {
if (data[target_field.text()] != undefined) {
var resolv_output = data[target_field.text()];
if (target_field.text() != resolv_output) {
target_field.text(target_field.text() + ' [' + resolv_output + ']');
}