This commit is contained in:
retoor 2025-05-23 07:00:28 +02:00
parent 3bf09f9083
commit 539fb262b2
2 changed files with 14 additions and 6 deletions

View File

@ -42,8 +42,9 @@ class MessageList extends HTMLElement {
textElement.innerHTML = html; textElement.innerHTML = html;
textElement.style.display = message.text == "" ? "none" : "block"; textElement.style.display = message.text == "" ? "none" : "block";
} }
triggerGlow(uid) { triggerGlow(uid,color) {
let lastElement = null; app.startField.glowColor(color)
let lastElement = null;
this.querySelectorAll(".avatar").forEach((el) => { this.querySelectorAll(".avatar").forEach((el) => {
const div = el.closest("a"); const div = el.closest("a");
if (el.href.indexOf(uid) != -1) { if (el.href.indexOf(uid) != -1) {

View File

@ -28,6 +28,7 @@ class RPCView(BaseView):
self.services = self.app.services self.services = self.app.services
self.ws = ws self.ws = ws
self.user_session = {} self.user_session = {}
self._scheduled = []
async def _session_ensure(self): async def _session_ensure(self):
uid = await self.view.session_get("uid") uid = await self.view.session_get("uid")
@ -339,9 +340,11 @@ class RPCView(BaseView):
async for record in self.services.channel.get_users(channel_uid) async for record in self.services.channel.get_users(channel_uid)
] ]
async def _schedule(self, uid, seconds, call): async def _schedule(self, seconds, call):
self._scheduled.append(call)
await asyncio.sleep(seconds) await asyncio.sleep(seconds)
await self.services.socket.send_to_user(uid, call) await self.services.socket.send_to_user(self.user_uid, call)
self._scheduled.remove(call)
async def ping(self, callId, *args): async def ping(self, callId, *args):
@ -353,11 +356,15 @@ class RPCView(BaseView):
async def get(self): async def get(self):
scheduled = []
async def schedule(uid, seconds, call): async def schedule(uid, seconds, call):
scheduled.append(call)
await asyncio.sleep(seconds) await asyncio.sleep(seconds)
await self.services.socket.send_to_user(uid, call) await self.services.socket.send_to_user(uid, call)
sheduled.remove(call)
ws = web.WebSocketResponse() ws = web.WebSocketResponse()
await ws.prepare(self.request) await ws.prepare(self.request)
@ -371,7 +378,7 @@ class RPCView(BaseView):
await self.services.socket.subscribe( await self.services.socket.subscribe(
ws, subscription["channel_uid"], self.request.session.get("uid") ws, subscription["channel_uid"], self.request.session.get("uid")
) )
if self.request.app.uptime_seconds < 10: if not scheduled and self.request.app.uptime_seconds < 10:
await schedule(self.request.session.get("uid"),1,{"event":"refresh", "data": { await schedule(self.request.session.get("uid"),1,{"event":"refresh", "data": {
"message": "Finishing deployment"} "message": "Finishing deployment"}
} }