mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
Fixed backup download
Renamed silly REST names to more meaningful ones Fixed download icon to make it consistent with the rest of ntopng
This commit is contained in:
parent
94d4f5c350
commit
c856dd3b6f
4 changed files with 13 additions and 15 deletions
|
|
@ -1,31 +0,0 @@
|
|||
--
|
||||
-- (C) 2013-23 - ntop.org
|
||||
--
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/system_config/?.lua;" .. package.path
|
||||
|
||||
-- ##############################################
|
||||
|
||||
local rest_utils = require("rest_utils")
|
||||
local backup_config = require("backup_config")
|
||||
|
||||
-- ##############################################
|
||||
|
||||
local download = _GET["download"]
|
||||
local epoch = _GET["epoch"]
|
||||
|
||||
local succ, rsp = backup_config.export_backup(epoch)
|
||||
|
||||
if (not succ) then
|
||||
rest_utils.answer(rest_utils.consts.err.bad_content)
|
||||
end
|
||||
|
||||
-- Download the file
|
||||
if download then
|
||||
sendHTTPContentTypeHeader('application/json', 'attachment; filename="configuration.json"')
|
||||
print(rsp)
|
||||
else
|
||||
rest_utils.answer(rest_utils.consts.success.ok, rsp)
|
||||
end
|
||||
-- ##############################################
|
||||
Loading…
Add table
Add a link
Reference in a new issue