Update foo
This commit is contained in:
9
static/views/session/script.js
Normal file
9
static/views/session/script.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var text = document.getElementById("msg").innerText
|
||||
msg = JSON.parse(text)
|
||||
|
||||
document.getElementById("btn-leave-session").onclick = async (e) => await fetch('api/leave_session', {
|
||||
method: 'POST', body: JSON.stringify({})
|
||||
});
|
||||
var session = msg.session;
|
||||
document.getElementById("session").innerText = session["name"];
|
||||
document.getElementById('label-username').innerText = msg.username;
|
||||
3
static/views/session/template.html
Normal file
3
static/views/session/template.html
Normal file
@@ -0,0 +1,3 @@
|
||||
Welcome to <b id="session"></b>, <span id="label-username"></span>
|
||||
<br><br>
|
||||
<button id="btn-leave-session">Leave Session</button>
|
||||
Reference in New Issue
Block a user