Puts a temporary fix on deleting backups. Will be fixed in alpha 4

This commit is contained in:
Andrew 2021-11-19 21:09:09 -05:00
parent 5230a7ddc3
commit 4d31ee399a
2 changed files with 9 additions and 4 deletions

View File

@ -216,7 +216,8 @@ class AjaxHandler(BaseHandler):
console.warning("delete {} for server {}".format(file_path, server_id))
if not self.check_server_id(server_id, 'del_file'): return
if not self.check_server_id(server_id, 'del_file'):
return
else: server_id = bleach.clean(server_id)
server_info = self.controller.servers.get_server_data_by_id(server_id)

View File

@ -149,10 +149,13 @@
console.log('Sending Command to delete backup: ' + filename)
$.ajax({
type: "POST",
type: "DELETE",
headers: {'X-XSRFToken': token},
url: '/ajax/del_file?server_id='+id,
data: data_to_send,
data: {
file_path: filename,
id: id
},
success: function(data) {
location.reload();
},
@ -201,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'] }} );
}
}
});