From 819e84ec4cdba27f3a9016359aa54a3aa01132a8 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Mon, 30 Jan 2023 23:27:40 -0500 Subject: [PATCH 1/6] Translate additions to backups page --- app/frontend/templates/panel/server_backup.html | 16 ++++++++-------- app/translations/en_EN.json | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/frontend/templates/panel/server_backup.html b/app/frontend/templates/panel/server_backup.html index 4af0ba1a..ab9b4f2e 100644 --- a/app/frontend/templates/panel/server_backup.html +++ b/app/frontend/templates/panel/server_backup.html @@ -110,15 +110,15 @@
{% if data['backup_config']['before'] %} - Run - Command Before Backup + {{ + translate('serverBackups', 'before', data['lang']) }}
{% else %} - Run Command - Before Backup + {{ + translate('serverBackups', 'before', data['lang']) }}
@@ -127,15 +127,15 @@
{% if data['backup_config']['after'] %} - Run - Command After Backup + {{ + translate('serverBackups', 'after', data['lang']) }}
{% else %} - Run Command - Before Backup + {{ + translate('serverBackups', 'after', data['lang']) }}
diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index 15a8ed27..7c5c99d4 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -297,7 +297,9 @@ "shutdown": "Shutdown server for duration of backup", "size": "Size", "storageLocation": "Storage Location", - "storageLocationDesc": "Where do you want to store backups?" + "storageLocationDesc": "Where do you want to store backups?", + "before": "Run command before backup", + "after": "Run command after backup" }, "serverConfig": { "bePatientDelete": "Please be patient while we remove your server from the Crafty panel. This screen will close in a few moments.", From 683c9cecbaf2efc052c8ed11489012a31cd6e1fd Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 31 Jan 2023 13:11:03 -0500 Subject: [PATCH 2/6] Add background key to server_handler page_data --- app/classes/web/server_handler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 1c0d5962..7e01d73a 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -183,6 +183,7 @@ class ServerHandler(BaseHandler): "version_data": "version_data_here", # TODO "user_data": exec_user, "show_contribute": self.helper.get_setting("show_contribute_link", True), + # "background": self.controller.cached_login, "lang": self.controller.users.get_user_lang_by_id(exec_user["user_id"]), "lang_page": Helpers.get_lang_page( self.controller.users.get_user_lang_by_id(exec_user["user_id"]) From ed30cbd4cb12750ba9cf3ab77a1588472e2579bd Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 31 Jan 2023 13:11:28 -0500 Subject: [PATCH 3/6] Refactor public handler keys --- app/classes/web/status_handler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/classes/web/status_handler.py b/app/classes/web/status_handler.py index 410e3a36..ff4eb290 100644 --- a/app/classes/web/status_handler.py +++ b/app/classes/web/status_handler.py @@ -7,12 +7,12 @@ logger = logging.getLogger(__name__) class StatusHandler(BaseHandler): def get(self): - page_data = {"background": self.controller.cached_login} - page_data["lang"] = self.helper.get_setting("language") - page_data["lang_page"] = self.helper.get_lang_page( - self.helper.get_setting("language") - ) - page_data["servers"] = self.controller.servers.get_all_servers_stats() + page_data = { + "background": self.controller.cached_login, + "lang": self.helper.get_setting("language"), + "lang_page": self.helper.get_lang_page(self.helper.get_setting("language")), + "servers": self.controller.servers.get_all_servers_stats(), + } running = 0 for srv in page_data["servers"]: if srv["stats"]["running"]: From 6e0805a8a1c1f9541338e2f897f68cb61416f3ef Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 31 Jan 2023 13:14:01 -0500 Subject: [PATCH 4/6] Lol uncomment the fix --- app/classes/web/server_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 7e01d73a..da854cc5 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -183,7 +183,7 @@ class ServerHandler(BaseHandler): "version_data": "version_data_here", # TODO "user_data": exec_user, "show_contribute": self.helper.get_setting("show_contribute_link", True), - # "background": self.controller.cached_login, + "background": self.controller.cached_login, "lang": self.controller.users.get_user_lang_by_id(exec_user["user_id"]), "lang_page": Helpers.get_lang_page( self.controller.users.get_user_lang_by_id(exec_user["user_id"]) From 4ad96d0970d14e8dfa76adcc1afe01027e5c3a20 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 11 Feb 2023 17:37:56 +0000 Subject: [PATCH 5/6] Update changelog !543 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec750a2d..ff661d80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ TBD ### Tweaks TBD ### Lang -TBD +- Add additional translations to backups page strings ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/543))

## --- [4.0.20] - 2023/01/29 From 3e3d9b68721fb0f34f75fdb9fc256a3d035957f7 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 11 Feb 2023 17:48:08 +0000 Subject: [PATCH 6/6] Update changelog !544 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff661d80..035e3dcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ### New features TBD ### Bug fixes -TBD +- Fix exception related to page data on server start ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/544)) ### Tweaks TBD ### Lang