From ec6421b62cef84842b39e1bbb404bae467c355df Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 12 Apr 2022 17:37:20 -0400 Subject: [PATCH] Disable Backups when no path --- app/classes/shared/server.py | 2 + .../templates/panel/server_backup.html | 614 ++++++++++-------- 2 files changed, 333 insertions(+), 283 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 3900f822..0971e4e8 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -762,6 +762,8 @@ class Server: return False def backup_server(self): + if self.settings["backup_path"] is "": + return backup_thread = threading.Thread( target=self.a_backup_server, daemon=True, name=f"backup_{self.name}" ) diff --git a/app/frontend/templates/panel/server_backup.html b/app/frontend/templates/panel/server_backup.html index a30fb803..c7654ed3 100644 --- a/app/frontend/templates/panel/server_backup.html +++ b/app/frontend/templates/panel/server_backup.html @@ -9,14 +9,15 @@
- +
@@ -24,155 +25,181 @@
- {% include "parts/details_stats.html %} + {% include "parts/details_stats.html %}
- {% include "parts/server_controls_list.html %} + {% include "parts/server_controls_list.html %} -
-
-
-
-
- {% raw xsrf_form_html() %} - - +
+
+
+
+ + {% raw xsrf_form_html() %} + + - {% if data['backing_up'] %} -
-
{{ data['backup_stats']['percent'] }}%
-
-

Backing up {{data['backup_stats']['total_files']}} Files

- {% end %} - -
- {% if not data['backing_up'] %} -
- -
- {% end %} -
- {% if data['super_user'] %} - - - {% end %} -
- -
- - -
-
- - {% if data['backup_config']['compress'] %} - {{ translate('serverBackups', 'compress', data['lang']) }} - {% else %} - {{ translate('serverBackups', 'compress', data['lang']) }} - {% end %} -
-
- -
- -
- - - - - - + {% if data['backing_up'] %} +
+
{{ + data['backup_stats']['percent'] }}%
- -
-
- - -

{{ translate('serverBackups', 'currentBackups', data['lang']) }}

- - - - - - - - - {% for backup in data['backup_list'] %} - - - - - - {% end %} - - -
{{ translate('serverBackups', 'options', data['lang']) }}{{ translate('serverBackups', 'path', data['lang']) }}{{ translate('serverBackups', 'size', data['lang']) }}
- - - {{ translate('serverBackups', 'download', data['lang']) }} - -
-
- - -
{{ backup['path'] }}{{ backup['size'] }}
- -
-
-
-
-
-
-
-

{{ translate('serverBackups', 'excludedBackups', data['lang']) }}

-
-
-
    - {% for item in data['exclusions'] %} -
  • {{item}}
  • -
    +

    Backing up {{data['backup_stats']['total_files']}} Files

    {% end %} -
+ +
+ {% if not data['backing_up'] %} +
+ +
+ {% end %} +
+ {% if data['super_user'] %} + + + {% end %} +
+ +
+ + +
+
+ + {% if data['backup_config']['compress'] %} + {{ translate('serverBackups', 'compress', data['lang']) }} + {% else %} + {{ + translate('serverBackups', 'compress', data['lang']) }} + {% end %} +
+
+ +
+ +
+ + + + + +
+
+
+ + +

{{ translate('serverBackups', 'currentBackups', data['lang']) }}

+ + + + + + + + + {% for backup in data['backup_list'] %} + + + + + + {% end %} + + +
{{ translate('serverBackups', 'options', data['lang']) }}{{ translate('serverBackups', 'path', data['lang']) }}{{ translate('serverBackups', 'size', data['lang']) }}
+ + + {{ translate('serverBackups', 'download', data['lang']) }} + +
+
+ + +
{{ backup['path'] }}{{ backup['size'] }}
+ +
+
+
+
+
+
+
+

{{ translate('serverBackups', 'excludedBackups', + data['lang']) }}

+
+
+
    + {% for item in data['exclusions'] %} +
  • {{item}}
  • +
    + {% end %} +
+
+
@@ -183,41 +210,44 @@
@@ -226,7 +256,7 @@ {% block js %}