diff --git a/app/classes/controllers/servers_controller.py b/app/classes/controllers/servers_controller.py index c0bae7b0..95c54bdb 100644 --- a/app/classes/controllers/servers_controller.py +++ b/app/classes/controllers/servers_controller.py @@ -22,6 +22,7 @@ from app.classes.models.server_permissions import ( PermissionsServers, EnumPermissionsServer, ) +from app.classes.shared.websocket_manager import WebSocketManager logger = logging.getLogger(__name__) @@ -36,6 +37,7 @@ class ServersController(metaclass=Singleton): self.management_helper = management_helper self.servers_list = [] self.stats = Stats(self.helper, self) + self.ws = WebSocketManager() # ********************************************************************************** # Generic Servers Methods @@ -171,6 +173,9 @@ class ServersController(metaclass=Singleton): self.failed_servers = [] for server in servers: + self.ws.broadcast( + "update", {"message": f"Initializing {server['server_name']}."} + ) server_id = server.get("server_id") # if we have already initialized this server, let's skip it. diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 62ce8819..7524cf90 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -80,6 +80,7 @@ class Helpers: self.translation = Translation(self) self.update_available = False self.ignored_names = ["crafty_managed.txt", "db_stats"] + self.crafty_starting = False @staticmethod def auto_installer_fix(ex): diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index e1d21f03..f12505eb 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -1609,7 +1609,8 @@ class PanelHandler(BaseHandler): logs_thread.start() self.redirect("/panel/dashboard") return - + if self.helper.crafty_starting: + template = "panel/loading.html" self.render( template, data=page_data, diff --git a/app/frontend/templates/panel/loading.html b/app/frontend/templates/panel/loading.html new file mode 100644 index 00000000..1caeca5f --- /dev/null +++ b/app/frontend/templates/panel/loading.html @@ -0,0 +1,64 @@ +{% extends ../base.html %} + +{% block meta %} +{% end %} + +{% block title %}Crafty Controller Starting{% end %} + +{% block content %} +