Reporting / Traffic: cleanup deselected interface rows. from @kulikov-a https://github.com/opnsense/core/pull/4625

This commit is contained in:
Ad Schellevis 2021-01-23 19:59:47 +01:00
parent 4d31db164f
commit c455ebbe6e

View File

@ -244,7 +244,8 @@ POSSIBILITY OF SUCH DAMAGE.
tr = $("<tr/>");
tr.attr("data-address", item.address); // XXX: find matches on tag
tr.data('bps_in', 0).data('bps_out', 0).data('bps_max_in', 0)
.data('bps_max_out', 0).data('total_in', 0).data('total_out', 0);
.data('bps_max_out', 0).data('total_in', 0).data('total_out', 0)
.data('intf', intf);
tr.append($("<td/>").html(intf_label));
tr.append($("<td/>").text(item.address));
tr.append($("<td class='bps_in'/>").text("0b"));
@ -292,6 +293,13 @@ POSSIBILITY OF SUCH DAMAGE.
return b_total - a_total;
}
}).appendTo(target);
// cleanup deselected interface rows
let intsshow = $("#interfaces").val();
$('#rxTopTable > tbody').find('tr').each(function(){
if (!intsshow.includes($(this).data('intf'))) {
$(this).remove();
}
});
}
/**