diff --git a/main.py b/main.py index 9a891d9..4c089c2 100644 --- a/main.py +++ b/main.py @@ -70,7 +70,7 @@ async def _(request: aiohttp.web.Request): await ws.prepare(request) print(f'[WS] client {client} connected, {ws=}') - model.subscribe(client, ws) + await model.subscribe(client, ws) async for msg in ws: print(f'[WS] incoming message from client {client}, {ws=}, {msg=}') diff --git a/static/renderer.js b/static/renderer.js index edc6e90..b67fe53 100644 --- a/static/renderer.js +++ b/static/renderer.js @@ -7,7 +7,11 @@ ws.onmessage = function(event) { console.log(msg); - if (msg.hasOwnProperty('session')) { - document.getElementById('current_session').innerText = msg.session; + if (msg.hasOwnProperty('currentsession')) { + document.getElementById('current_session').innerText = msg.currentsession; + } + + if (msg.hasOwnProperty('allsessions')) { + document.getElementById('all_sessions').innerText = msg.allsessions.join(', '); } }; \ No newline at end of file diff --git a/ui.html b/ui.html index 2ad2a56..b623d8a 100644 --- a/ui.html +++ b/ui.html @@ -9,8 +9,8 @@
this is the UI