mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Only show server inits to admins
This commit is contained in:
parent
61c1621cbb
commit
4152e2be69
@ -173,7 +173,7 @@ class ServersController(metaclass=Singleton):
|
|||||||
self.failed_servers = []
|
self.failed_servers = []
|
||||||
|
|
||||||
for server in servers:
|
for server in servers:
|
||||||
self.ws.broadcast(
|
self.ws.broadcast_to_admins(
|
||||||
"update", {"message": f"Initializing {server['server_name']}."}
|
"update", {"message": f"Initializing {server['server_name']}."}
|
||||||
)
|
)
|
||||||
server_id = server.get("server_id")
|
server_id = server.get("server_id")
|
||||||
|
@ -37,7 +37,7 @@ class WebSocketManager(metaclass=Singleton):
|
|||||||
|
|
||||||
def broadcast_to_admins(self, event_type: str, data):
|
def broadcast_to_admins(self, event_type: str, data):
|
||||||
def filter_fn(client):
|
def filter_fn(client):
|
||||||
if client.get_user_id in HelperUsers.get_super_user_list():
|
if str(client.get_user_id()) in str(HelperUsers.get_super_user_list()):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
1
main.py
1
main.py
@ -195,6 +195,7 @@ if __name__ == "__main__":
|
|||||||
# init servers
|
# init servers
|
||||||
logger.info("Initializing all servers defined")
|
logger.info("Initializing all servers defined")
|
||||||
Console.info("Initializing all servers defined")
|
Console.info("Initializing all servers defined")
|
||||||
|
ws.broadcast("update", {"message": "Initializing Servers"})
|
||||||
controller.servers.init_all_servers()
|
controller.servers.init_all_servers()
|
||||||
|
|
||||||
def tasks_starter():
|
def tasks_starter():
|
||||||
|
Loading…
Reference in New Issue
Block a user