diff --git a/static/renderer.js b/static/renderer.js
index b67fe53..9595eb7 100644
--- a/static/renderer.js
+++ b/static/renderer.js
@@ -12,6 +12,17 @@ ws.onmessage = function(event) {
}
if (msg.hasOwnProperty('allsessions')) {
- document.getElementById('all_sessions').innerText = msg.allsessions.join(', ');
+ const all_sessions = document.getElementById('all_sessions');
+
+ while (all_sessions.children.length) all_sessions.lastChild.remove();
+
+ for (let session of msg.allsessions) {
+ const button = document.createElement('button');
+ button.innerText = session;
+ button.onclick = async (e) => await fetch('api/join_session', {
+ method: 'POST', body: JSON.stringify({sessionid: session})
+ });
+ all_sessions.appendChild(button);
+ }
}
};
\ No newline at end of file
diff --git a/ui.html b/ui.html
index b623d8a..4da1b9e 100644
--- a/ui.html
+++ b/ui.html
@@ -10,7 +10,7 @@
this is the UI
You are not in any session.
-
+