This commit is contained in:
Nicolo Maio 2023-05-02 08:53:00 +00:00
parent 56d507a708
commit f453601e86
4 changed files with 14 additions and 5 deletions

View file

@ -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