mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +00:00
hide entry if count is zero on dropdown filters
This commit is contained in:
parent
a567212337
commit
a11d082bcb
3 changed files with 5 additions and 2 deletions
2
httpdocs/js/ntop.min.js
vendored
2
httpdocs/js/ntop.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -110,6 +110,8 @@ class DataTableUtils {
|
|||
if (key == 'all') return;
|
||||
|
||||
const count = DataTableUtils.countEntries(key, tableAPI.columns(columnIndex).data()[0]);
|
||||
// hide the entry if count is zero
|
||||
if (count == 0) $(this).hide();
|
||||
|
||||
// update the counter text
|
||||
$(this).find('.counter').text(`(${count})`);
|
||||
|
|
@ -136,6 +138,7 @@ class DataTableUtils {
|
|||
|
||||
const count = DataTableUtils.countEntries(val, tableAPI.columns(columnIndex).data()[0]);
|
||||
const $counter = $(`<span class='counter'>(${count})</span>`);
|
||||
if (count == 0) $entry.hide();
|
||||
|
||||
$entry.append($counter);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue