mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Added modal feedback when deleting hosts (#7591)
This commit is contained in:
parent
68c9dc1f18
commit
bd0e5ed39e
6 changed files with 72 additions and 19 deletions
|
|
@ -31,14 +31,16 @@ if isEmptyString(ifid) or isEmptyString(serial_key) then
|
|||
return
|
||||
end
|
||||
|
||||
local num_hosts_deleted = 0
|
||||
|
||||
if tonumber(serial_key) then
|
||||
local epoch = os.time() - tonumber(serial_key)
|
||||
inactive_hosts_utils.deleteAllEntriesSince(ifid, epoch)
|
||||
num_hosts_deleted = inactive_hosts_utils.deleteAllEntriesSince(ifid, epoch)
|
||||
elseif (serial_key == "all") then
|
||||
inactive_hosts_utils.deleteAllEntries(ifid)
|
||||
num_hosts_deleted = inactive_hosts_utils.deleteAllEntries(ifid)
|
||||
else
|
||||
inactive_hosts_utils.deleteSingleEntry(ifid, serial_key)
|
||||
num_hosts_deleted = inactive_hosts_utils.deleteSingleEntry(ifid, serial_key)
|
||||
end
|
||||
|
||||
rest_utils.answer(rc)
|
||||
rest_utils.answer(rc, {deleted_hosts = num_hosts_deleted})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue