mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2025-07-18 20:53:49 +02:00
31 lines
1.2 KiB
HTML
31 lines
1.2 KiB
HTML
|
|
<h1>Sessions</h1>
|
|
yes.
|
|
<button onclick='ipcRenderer.sendSync("synchronous-message", "PAGE:change.index");'>Go back</button>
|
|
<state>Sessionstate: <state id = "sessionStateText">unknown</state></state>
|
|
<script>
|
|
connectionStatesAsText = {"-1": "Unknown", "0": "Not connected to a session", "1": "Connecting...", "2": "Hosting", "3": "Connected", "4": "Connection failed"};
|
|
setInterval(function(){
|
|
connectionState = ipcRenderer.sendSync("synchronous-message", "SESSION:get.state");
|
|
document.getElementById("sessionStateText").innerHTML = connectionStatesAsText[String(connectionState)];
|
|
}, 1000);
|
|
|
|
</script>
|
|
Name: <input type="text" value="Unnamed session" id="sessionName">
|
|
<button onclick='createNewSession()'>
|
|
Create new session
|
|
</button>
|
|
<script>
|
|
function createNewSession() {
|
|
val = document.getElementById("sessionName").value
|
|
if (val.indexOf('|') > -1)
|
|
{
|
|
alert("Your Sessionname may not contain a |");
|
|
}
|
|
console.log(val)
|
|
ipcRenderer.sendSync("synchronous-message", "SESSION:createNew| " + val);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|