mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Remove useless if in backups.i
This commit is contained in:
parent
bfe6cabd9e
commit
4c6b459b43
@ -513,11 +513,14 @@ class Server:
|
|||||||
|
|
||||||
def list_backups(self):
|
def list_backups(self):
|
||||||
conf = management_helper.get_backup_config(self.server_id)
|
conf = management_helper.get_backup_config(self.server_id)
|
||||||
|
if self.settings['backup_path']:
|
||||||
if helper.check_path_exists(helper.get_os_understandable_path(self.settings['backup_path'])):
|
if helper.check_path_exists(helper.get_os_understandable_path(self.settings['backup_path'])):
|
||||||
files = helper.get_human_readable_files_sizes(helper.list_dir_by_date(helper.get_os_understandable_path(self.settings['backup_path'])))
|
files = helper.get_human_readable_files_sizes(helper.list_dir_by_date(helper.get_os_understandable_path(self.settings['backup_path'])))
|
||||||
return [{"path": os.path.relpath(f['path'], start=helper.get_os_understandable_path(conf['backup_path'])), "size": f["size"]} for f in files]
|
return [{"path": os.path.relpath(f['path'], start=helper.get_os_understandable_path(conf['backup_path'])), "size": f["size"]} for f in files]
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
else:
|
||||||
|
return[]
|
||||||
|
|
||||||
def jar_update(self):
|
def jar_update(self):
|
||||||
servers_helper.set_update(self.server_id, True)
|
servers_helper.set_update(self.server_id, True)
|
||||||
|
@ -649,7 +649,7 @@ class PanelHandler(BaseHandler):
|
|||||||
server_obj = self.controller.servers.get_server_obj(server_id)
|
server_obj = self.controller.servers.get_server_obj(server_id)
|
||||||
server_settings = self.controller.get_server_data(server_id)
|
server_settings = self.controller.get_server_data(server_id)
|
||||||
stale_executable = server_obj.executable
|
stale_executable = server_obj.executable
|
||||||
#Compares old jar name to page data being passed. If they are different we replace the executable name in the execution string.
|
#Compares old jar name to page data being passed. If they are different we replace the executable name in the
|
||||||
if str(stale_executable) != str(executable):
|
if str(stale_executable) != str(executable):
|
||||||
execution_command = execution_command.replace(str(stale_executable), str(executable))
|
execution_command = execution_command.replace(str(stale_executable), str(executable))
|
||||||
|
|
||||||
@ -699,7 +699,6 @@ class PanelHandler(BaseHandler):
|
|||||||
self.redirect("/panel/error?error=Invalid Server ID")
|
self.redirect("/panel/error?error=Invalid Server ID")
|
||||||
return
|
return
|
||||||
|
|
||||||
if backup_path is not None:
|
|
||||||
if enabled == '0':
|
if enabled == '0':
|
||||||
#TODO Use Controller method
|
#TODO Use Controller method
|
||||||
server_obj = self.controller.servers.get_server_obj(server_id)
|
server_obj = self.controller.servers.get_server_obj(server_id)
|
||||||
|
@ -366,7 +366,7 @@ dialog.init(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (webSocket) {
|
if (webSocket) {
|
||||||
webSocket.on('send_start_reload', function (start_error) {
|
webSocket.on('send_start_reload', function () {
|
||||||
location.reload()
|
location.reload()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user