Network insight: store hostname into it's own field on reverse lookup so we don't loose the original address. Pass the address to the detail view on click. closes https://github.com/opnsense/core/issues/4609

This commit is contained in:
Ad Schellevis 2021-01-16 15:19:44 +01:00
parent d91e308001
commit c797bfd220

View File

@ -346,7 +346,9 @@ POSSIBILITY OF SUCH DAMAGE.
let chart_data = [];
chart_data_in.map(function(item){
var label = "(other)";
if (item.src_addr != "") {
if (item.hostname !== undefined) {
label = item.hostname;
} else if (item.src_addr != "") {
label = item.src_addr;
}
chart_data.push({'label': label, 'value': item.total});
@ -389,7 +391,8 @@ POSSIBILITY OF SUCH DAMAGE.
ajaxGet('/api/diagnostics/dns/reverse_lookup', {'address': addresses}, function(lookup_data, status) {
data.map(function(item){
if (lookup_data[item.src_addr] != undefined) {
item.src_addr = lookup_data[item.src_addr];
item.src_addr = item.src_addr;
item.hostname = lookup_data[item.src_addr];
}
});
add_src_pie(data);