mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix sort. (#7423)
This commit is contained in:
parent
56d507a708
commit
f453601e86
4 changed files with 14 additions and 5 deletions
|
|
@ -96,7 +96,7 @@ end
|
|||
-- ##############################################
|
||||
|
||||
-- @brief List all configurations backup.
|
||||
function backup_config.list_backup(user)
|
||||
function backup_config.list_backup(user, order)
|
||||
local saved_backups_keys = ntop.getHashKeysCache(backup_hash_key) or {}
|
||||
local epoch_list = {}
|
||||
|
||||
|
|
@ -109,6 +109,13 @@ function backup_config.list_backup(user)
|
|||
}
|
||||
end
|
||||
|
||||
if order == "desc" then
|
||||
table.sort(epoch_list, function(x,y) return x.epoch > y.epoch end)
|
||||
else
|
||||
table.sort(epoch_list, function(x,y) return x.epoch < y.epoch end)
|
||||
|
||||
end
|
||||
|
||||
return epoch_list
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue