mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add broadcast to non-admin function
This commit is contained in:
parent
fb41bc2443
commit
b60e6933dd
@ -43,6 +43,14 @@ class WebSocketManager(metaclass=Singleton):
|
|||||||
|
|
||||||
self.broadcast_with_fn(filter_fn, event_type, data)
|
self.broadcast_with_fn(filter_fn, event_type, data)
|
||||||
|
|
||||||
|
def broadcast_to_non_admins(self, event_type: str, data):
|
||||||
|
def filter_fn(client):
|
||||||
|
if str(client.get_user_id()) not in str(HelperUsers.get_super_user_list()):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
self.broadcast_with_fn(filter_fn, event_type, data)
|
||||||
|
|
||||||
def broadcast_page(self, page: str, event_type: str, data):
|
def broadcast_page(self, page: str, event_type: str, data):
|
||||||
def filter_fn(client):
|
def filter_fn(client):
|
||||||
return client.page == page
|
return client.page == page
|
||||||
|
Loading…
Reference in New Issue
Block a user