mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Puts a temporary fix on deleting backups. Will be fixed in alpha 4
This commit is contained in:
parent
5230a7ddc3
commit
4d31ee399a
@ -216,7 +216,8 @@ class AjaxHandler(BaseHandler):
|
|||||||
|
|
||||||
console.warning("delete {} for server {}".format(file_path, server_id))
|
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)
|
else: server_id = bleach.clean(server_id)
|
||||||
|
|
||||||
server_info = self.controller.servers.get_server_data_by_id(server_id)
|
server_info = self.controller.servers.get_server_data_by_id(server_id)
|
||||||
|
@ -149,10 +149,13 @@
|
|||||||
|
|
||||||
console.log('Sending Command to delete backup: ' + filename)
|
console.log('Sending Command to delete backup: ' + filename)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "DELETE",
|
||||||
headers: {'X-XSRFToken': token},
|
headers: {'X-XSRFToken': token},
|
||||||
url: '/ajax/del_file?server_id='+id,
|
url: '/ajax/del_file?server_id='+id,
|
||||||
data: data_to_send,
|
data: {
|
||||||
|
file_path: filename,
|
||||||
|
id: id
|
||||||
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
@ -201,7 +204,8 @@
|
|||||||
callback: function (result) {
|
callback: function (result) {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result == true) {
|
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'] }} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user