webpnp/ui.html
Dominic Zimmer ab931a5717 Fix an oops
2020-04-17 02:07:17 +02:00

41 lines
1011 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>leafblade Minecraft Server</title>
<meta charset="UTF-8"/>
</head>
<body>
this is the UI
<!--<button id="test_api">Test API</button>-->
<button id="btn_create_session">Create session</button>
<br><br><br>
<input id="join_session_id" type="text" placeholder="Enter session id" />
<button id="btn_join_session">Join session</button>
<script src="/static/renderer.js"></script>
<script>
document.getElementById("btn_create_session").onclick = async function (e) {
let data = {};
await fetch('api/create_session', {
method: 'POST',
body: JSON.stringify(data),
})
};
document.getElementById("btn_join_session").onclick = async function (e) {
let text = document.getElementById("join_session_id").value
let data = {"sessionid": text};
await fetch('api/join_session', {
method: 'POST',
body: JSON.stringify(data),
})
};
</script>
</body>
</html>