From f21b95e358db521895de5926468ad4400a7c4a12 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sat, 18 Mar 2023 16:46:29 -0400 Subject: [PATCH] Start of frontend --- app/classes/web/server_handler.py | 17 + .../templates/server/bedrock_wizard.html | 21 + .../templates/server/steam_wizard.html | 1094 +++++++++++++++++ app/frontend/templates/server/wizard.html | 24 + 4 files changed, 1156 insertions(+) create mode 100644 app/frontend/templates/server/steam_wizard.html diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 8b533bdf..6ef23de2 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -92,6 +92,8 @@ class ServerHandler(BaseHandler): page_data = { "update_available": self.helper.update_available, + "steamCMD": True, + "windows": self.helper.is_os_windows(), "version_data": self.helper.get_version_string(), "user_data": exec_user, "user_role": exec_user_role, @@ -165,6 +167,21 @@ class ServerHandler(BaseHandler): template = "server/bedrock_wizard.html" + if page == "steam_cmd_step1": + if not superuser and not self.controller.crafty_perms.can_create_server( + exec_user["user_id"] + ): + self.redirect( + "/panel/error?error=Unauthorized access: " + "not a server creator or server limit reached" + ) + return + + page_data["servers"] = self.controller.steam_apps.fetch_cache() + if page_data["servers"] is None: + page_data["servers"] = [] + template = "server/steam_wizard.html" + self.render( template, data=page_data, diff --git a/app/frontend/templates/server/bedrock_wizard.html b/app/frontend/templates/server/bedrock_wizard.html index d910eb06..03659510 100644 --- a/app/frontend/templates/server/bedrock_wizard.html +++ b/app/frontend/templates/server/bedrock_wizard.html @@ -14,6 +14,20 @@ Minecraft-Bedrock + {% if data["steamCMD"] %} + + {% else %} + + + {% end %}
@@ -662,6 +676,13 @@ } + +{% end %} + +{% block js %} + + + +{% end %} \ No newline at end of file diff --git a/app/frontend/templates/server/wizard.html b/app/frontend/templates/server/wizard.html index aea48f1c..4aa1562a 100644 --- a/app/frontend/templates/server/wizard.html +++ b/app/frontend/templates/server/wizard.html @@ -14,6 +14,20 @@ Minecraft-Bedrock + {% if data["steamCMD"] %} + + {% else %} + + + {% end %}
@@ -905,6 +919,16 @@