diff --git a/app/classes/web/ajax_handler.py b/app/classes/web/ajax_handler.py index 9e5cf819..6074ecf6 100644 --- a/app/classes/web/ajax_handler.py +++ b/app/classes/web/ajax_handler.py @@ -215,8 +215,7 @@ class AjaxHandler(BaseHandler): server_id = self.get_argument('id', None) if file_path.contains('/') or file_path('\\'): - server_info = self.controller.servers.get_server_data_by_id(server_id) - file_path = os.path.abspath(os.path.join(server_info["backup_path"], file_path)) + file_path = file_path.replace('/', "\\") console.warning("delete {} for server {}".format(file_path, server_id)) diff --git a/app/frontend/templates/panel/server_backup.html b/app/frontend/templates/panel/server_backup.html index 4132d3a9..faf98626 100644 --- a/app/frontend/templates/panel/server_backup.html +++ b/app/frontend/templates/panel/server_backup.html @@ -204,7 +204,8 @@ callback: function (result) { console.log(result); if (result == true) { - del_backup(file_to_del, {{ data['server_stats']['server_id']['server_id'] }} ); + var full_path = '{{ data['server_stats']['server_id']['backup_path'] }}' + '/' + file_to_del; + del_backup(full_path, {{ data['server_stats']['server_id']['server_id'] }} ); } } });