1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2026-01-31 15:40:25 +01:00

Added network session broadcaster

This commit is contained in:
TheGreyDiamond
2020-11-24 22:05:23 +01:00
parent a2f4ab1ce7
commit 7b9f09cf88
7 changed files with 1534 additions and 30 deletions

View File

@@ -2,5 +2,17 @@
<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>
<button onclick='ipcRenderer.sendSync("synchronous-message", "SESSION:createNew");''>
Create new session
</button>
</body>
</html>

View File

@@ -7,7 +7,7 @@
<link href="static/default.css" rel="stylesheet"/>
<link href="static/fontawesome-free-5.15.1-web/css/all.css" rel="stylesheet">
</head>
<body class="fa-spin">
<body class="">
<center>
<img src="static/icon.png" alt="Logo" height="40px"></img>

View File

@@ -205,5 +205,17 @@
<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>
<button onclick='ipcRenderer.sendSync("synchronous-message", "SESSION:createNew");''>
Create new session
</button>
</body>
</html>