From 1a9dd53ebe8d4111897a7135439df1f5bf21fe6b Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 7 Sep 2022 13:48:18 -0400 Subject: [PATCH 01/72] Remove roles url from href Fixes trace when clicking "roles config" tab while on roles config page. --- app/frontend/templates/panel/panel_edit_role.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/templates/panel/panel_edit_role.html b/app/frontend/templates/panel/panel_edit_role.html index 86ee953a..79751791 100644 --- a/app/frontend/templates/panel/panel_edit_role.html +++ b/app/frontend/templates/panel/panel_edit_role.html @@ -39,7 +39,7 @@
-
+ {% raw xsrf_form_html() %}
-

{{ translate('rolesConfig', 'roleTitle', data['lang']) }}

+

{{ translate('rolesConfig', 'roleTitle', + data['lang']) }}

- - + +

@@ -91,7 +96,9 @@
-

{{ translate('rolesConfig', 'roleServers', data['lang']) }} {{ translate('rolesConfig', 'serversDesc', data['lang']) }}

+

{{ translate('rolesConfig', 'roleServers', + data['lang']) }} {{ translate('rolesConfig', 'serversDesc', + data['lang']) }}

@@ -109,13 +116,14 @@ --table-border-width: 1px; border-collapse: collapse; } + th.rotate-column-header { /* Something you can count on */ height: 140px; white-space: nowrap; } - th.rotate-column-header > div { + th.rotate-column-header>div { transform: /* Magic Numbers */ translate(0px, 51px) @@ -123,15 +131,18 @@ rotate(315deg); width: 30px; } - th.rotate-column-header > div > span { + + th.rotate-column-header>div>span { border-bottom: 1px solid #ccc; padding: 5px 10px; } + th.rotate { white-space: nowrap; position: relative; } - th.rotate > div { + + th.rotate>div { /* place div at bottom left of the th parent */ position: absolute; bottom: 0; @@ -141,24 +152,25 @@ /* Move the top left corner of the span's bottom-border to line up with the top left corner of the td's border-right border so that the border corners are matched * Rotate 315 (-45) degrees about matched border corners */ transform: - translate(calc(100% - var(--table-border-width) / 2), var(--table-border-width)) - rotate(-45deg); + translate(calc(100% - var(--table-border-width) / 2), var(--table-border-width)) rotate(-45deg); transform-origin: 0% calc(100% - var(--table-border-width)); transition: transform 500ms; width: 100%; } - th.rotate > div > span { + + th.rotate>div>span { /* make sure the bottom of the span is matched up with the bottom of the parent div */ position: absolute; bottom: 0; left: 0; - border-bottom: var(--table-border-width) solid #383e5d; + border-bottom: var(--table-border-width) solid var(--outline); transition: border-bottom-color 500ms; padding-bottom: 5px; user-select: none; } - table.rotate-table > tbody td { - border-right: var(--table-border-width) solid #383e5d; + + table.rotate-table>tbody td { + border-right: var(--table-border-width) solid var(--outline); /* make sure this is at least as wide as sqrt(2) * height of the tallest letter in your font or the headers will overlap each other*/ min-width: 30px; padding-top: 2px; @@ -167,53 +179,57 @@ } @media screen and (min-width: 1650px) { - th.rotate > div { + th.rotate>div { transform: translate(15px, 0px) rotate(0deg); } - th.rotate > div > span { + + th.rotate>div>span { border-bottom-color: transparent; } } {{ translate('rolesConfig', 'serverName', data['lang']) }} -
{{ translate('rolesConfig', 'serverAccess', data['lang']) }}
+ +
{{ translate('rolesConfig', 'serverAccess', data['lang']) }}
+ {% for permission in data['permissions_all'] %} -
{{ permission.name }}
+ +
{{ permission.name }}
+ {% end %} - {% for server in data['servers_all'] %} + {% for server in data['servers_all'] %} {{ server['server_name'] }} - + {% for permission in data['permissions_all'] %} {% if server['server_id'] in data['role']['servers'] %} - - + - + {% else %} + id="permission_{{ server['server_id'] }}_{{ permission.name }}" + name="permission_{{ server['server_id'] }}_{{ permission.name }}" autocomplete="off" + value="1" disabled> {% end %} {% end %} - {% end %} + {% end %} @@ -224,18 +240,22 @@
-

{{ translate('panelConfig', 'save', data['lang']) }}

+

{{ translate('panelConfig', 'save', + data['lang']) }}

- - + +
-

{{ translate('rolesConfig', 'roleUsers', data['lang']) }}

+

{{ translate('rolesConfig', 'roleUsers', + data['lang']) }}

@@ -272,20 +292,24 @@

{{ translate('rolesConfig', 'created', data['lang']) }} {{ str(data['role']['created']) }} -
- {{ translate('rolesConfig', 'configUpdate', data['lang']) }} {{ str(data['role']['last_update']) }} -
- {{ translate('userConfig', 'manager', data['lang']) }}: {{ data['role_manager']['username'] }} -
+
+ {{ translate('rolesConfig', 'configUpdate', data['lang']) }} {{ str(data['role']['last_update']) + }} +
+ {{ translate('userConfig', 'manager', data['lang']) }}: {{ data['role_manager']['username'] }} +

{% if data['new_role'] %} - {{ translate('rolesConfig', 'delRole', data['lang']) }}
- {{ translate('rolesConfig', 'doesNotExist', data['lang']) }} + {{ translate('rolesConfig', + 'delRole', data['lang']) }}
+ {{ translate('rolesConfig', 'doesNotExist', data['lang']) }} {% else %} - {{ translate('rolesConfig', 'delRole', data['lang']) }} + {{ translate('rolesConfig', 'delRole', data['lang']) }} {% end %} +
@@ -294,38 +318,37 @@
-
- + -{% end %} + {% end %} -{% block js %} - + -{% end %} + {% end %} \ No newline at end of file diff --git a/app/frontend/templates/panel/server_admin_controls.html b/app/frontend/templates/panel/server_admin_controls.html index 542f2ce7..02e28356 100644 --- a/app/frontend/templates/panel/server_admin_controls.html +++ b/app/frontend/templates/panel/server_admin_controls.html @@ -42,7 +42,6 @@
{{ translate('rolesConfig', 'serverName', data['lang']) }} - -
{{ translate('rolesConfig', 'serverAccess', data['lang']) }}
- +
{{ translate('rolesConfig', 'serverAccess', data['lang']) }}
{% for permission in data['permissions_all'] %} - -
{{ permission.name }}
- +
{{ permission.name }}
{% end %} - {% for server in data['servers_all'] %} + {% for server in data['servers_all'] %} {{ server['server_name'] }} - + {% for permission in data['permissions_all'] %} {% if server['server_id'] in data['role']['servers'] %} - - + - + {% else %} + id="permission_{{ server['server_id'] }}_{{ permission.name }}" + name="permission_{{ server['server_id'] }}_{{ permission.name }}" + autocomplete="off" value="1" disabled> {% end %} {% end %} - {% end %} + {% end %} @@ -240,22 +224,18 @@
-

{{ translate('panelConfig', 'save', - data['lang']) }}

+

{{ translate('panelConfig', 'save', data['lang']) }}

- - + +
-

{{ translate('rolesConfig', 'roleUsers', - data['lang']) }}

+

{{ translate('rolesConfig', 'roleUsers', data['lang']) }}

@@ -267,18 +247,18 @@ - {% for user in data['users'] %} + {% for user in data['users'] %} {% for ruser in data['user-roles'][user.user_id] %} - {% if ruser == data['role']['role_name'] %} - - {{ user.username }} - - - - - {% end %} - {% end %} + {% if ruser == data['role']['role_name'] %} + + {{ user.username }} + + + + + {% end %} {% end %} + {% end %}
@@ -292,24 +272,20 @@

{{ translate('rolesConfig', 'created', data['lang']) }} {{ str(data['role']['created']) }} -
- {{ translate('rolesConfig', 'configUpdate', data['lang']) }} {{ str(data['role']['last_update']) - }} -
- {{ translate('userConfig', 'manager', data['lang']) }}: {{ data['role_manager']['username'] }} -
+
+ {{ translate('rolesConfig', 'configUpdate', data['lang']) }} {{ str(data['role']['last_update']) }} +
+ {{ translate('userConfig', 'manager', data['lang']) }}: {{ data['role_manager']['username'] }} +

{% if data['new_role'] %} - {{ translate('rolesConfig', - 'delRole', data['lang']) }}
- {{ translate('rolesConfig', 'doesNotExist', data['lang']) }} + {{ translate('rolesConfig', 'delRole', data['lang']) }}
+ {{ translate('rolesConfig', 'doesNotExist', data['lang']) }} {% else %} - {{ translate('rolesConfig', 'delRole', data['lang']) }} + {{ translate('rolesConfig', 'delRole', data['lang']) }} {% end %} -
@@ -318,37 +294,38 @@
- + + - {% end %} +{% end %} - {% block js %} - + - {% end %} \ No newline at end of file +{% end %} diff --git a/app/frontend/templates/panel/panel_edit_user.html b/app/frontend/templates/panel/panel_edit_user.html index 6f165f52..de60388e 100644 --- a/app/frontend/templates/panel/panel_edit_user.html +++ b/app/frontend/templates/panel/panel_edit_user.html @@ -121,6 +121,19 @@ data['lang']) }}{% end %} {% end %} +
+ + +
{% if data['superuser'] %}
-
- +
+
+
+ +

{{ translate('serverWizard', 'uploadZip', data['lang']) }}

+
+

+ +

+ {% raw xsrf_form_html() %} + + +
+
+
+
+ + +
+
+ +
+
+
+ + + + +
+
+
+ +
+
+

+
+
- - - - -{% end %} - -{% block js%} - - + + - + -{% end %} \ No newline at end of file + + {% end %} \ No newline at end of file diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index bd21b722..86f4db3f 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -502,6 +502,7 @@ "importServer": "Import an Existing Server", "importServerButton": "Import Server!", "importZip": "Import from a Zip File", + "uploadZip": "Upload Zip File For Server Import", "maxMem": "Maximum Memory", "minMem": "Minimum Memory", "myNewServer": "My New Server", From ab344cbff43cb87f38bbaa3aff93be1c27b8ed55 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 27 Sep 2022 22:49:52 -0400 Subject: [PATCH 61/72] Add zip upload to bedrock servers --- app/classes/web/upload_handler.py | 1 - .../templates/server/bedrock_wizard.html | 234 +++++++++++++++++- 2 files changed, 230 insertions(+), 5 deletions(-) diff --git a/app/classes/web/upload_handler.py b/app/classes/web/upload_handler.py index 26f94a06..e4ba8222 100644 --- a/app/classes/web/upload_handler.py +++ b/app/classes/web/upload_handler.py @@ -35,7 +35,6 @@ class UploadHandler(BaseHandler): # Class & Function Defination api_key, _token_data, exec_user = self.current_user self.upload_type = str(self.request.headers.get("X-Content-Upload-Type")) - print(self.upload_type) if self.upload_type == "server_import": superuser = exec_user["superuser"] diff --git a/app/frontend/templates/server/bedrock_wizard.html b/app/frontend/templates/server/bedrock_wizard.html index a756ae1c..b105ed0c 100644 --- a/app/frontend/templates/server/bedrock_wizard.html +++ b/app/frontend/templates/server/bedrock_wizard.html @@ -321,9 +321,171 @@

-
- +
+
+
+ +

{{ translate('serverWizard', 'uploadZip', data['lang']) }}

+
+

+ +

+ {% raw xsrf_form_html() %} + + +
+
+
+
+ + +
+
+ +
+
+
+ + + + +
+
+
+ +
+
+

+
+
@@ -412,6 +574,65 @@ {% block js%} + - - + - {% end %} \ No newline at end of file + +{% end %} \ No newline at end of file From cd0486fe112da5ae181260f41749a7f34855b118 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 2 Oct 2022 21:10:44 +0100 Subject: [PATCH 70/72] Update changelog !472 --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 537ae25f..488f8be2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,11 @@ ## --- [4.0.15] - 2022/10/02 ### New features - Base Theme Switching (Dark, Light, Default) 🤩🎨 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/471)) +- Upload Zip functionality for server imports 🏗️🎉 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/472)) ### Bug fixes - Fix traceback on basic schedule with "days" interval ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/469)) - Fix bad method call with API stdin ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/470))
*(Thank you ['IWant2Tryhard'](https://github.com/MyNameTsThad) for catching that 🐛)* -### Tweaks -TBD -### Lang -TBD

## --- [4.0.14] - 2022/09/23 From a6b22c0fb8d3be060ca7078696b46875e2623b63 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 2 Oct 2022 21:29:48 +0100 Subject: [PATCH 71/72] Update changelog !473 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 488f8be2..5e7599cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fix traceback on basic schedule with "days" interval ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/469)) - Fix bad method call with API stdin ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/470))
*(Thank you ['IWant2Tryhard'](https://github.com/MyNameTsThad) for catching that 🐛)* +- Fix clients variable as static to prevent crash if client list changed while sending a websocket ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/473))

## --- [4.0.14] - 2022/09/23 From 668808529244480e15d21dfc4895cd0e5455c8c5 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 2 Oct 2022 22:23:59 +0100 Subject: [PATCH 72/72] Prepare 4.0.16 release base --- CHANGELOG.md | 11 +++++++++++ README.md | 2 +- app/config/version.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7599cf..939f950e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ # Changelog +## --- [4.0.16] - 2022/TBD +### New features +TBD +### Bug fixes +TBD +### Tweaks +TBD +### Lang +TBD +

+ ## --- [4.0.15] - 2022/10/02 ### New features - Base Theme Switching (Dark, Light, Default) 🤩🎨 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/471)) diff --git a/README.md b/README.md index 6010290d..f211adf8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Supported Python Versions](https://shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20-blue)](https://www.python.org) -[![Version(temp-hardcoded)](https://img.shields.io/badge/release-v4.0.15--beta-orange)](https://gitlab.com/crafty-controller/crafty-4/-/releases) +[![Version(temp-hardcoded)](https://img.shields.io/badge/release-v4.0.16--beta-orange)](https://gitlab.com/crafty-controller/crafty-4/-/releases) [![Code Quality(temp-hardcoded)](https://img.shields.io/badge/code%20quality-10-brightgreen)](https://gitlab.com/crafty-controller/crafty-4) [![Build Status](https://gitlab.com/crafty-controller/crafty-4/badges/master/pipeline.svg)](https://gitlab.com/crafty-controller/crafty-4/-/commits/master) diff --git a/app/config/version.json b/app/config/version.json index 19d34c97..a3b99705 100644 --- a/app/config/version.json +++ b/app/config/version.json @@ -1,6 +1,6 @@ { "major": 4, "minor": 0, - "sub": 15, + "sub": 16, "meta": "beta" }