mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2025-07-19 05:03:49 +02:00
Added list of sessions in GUI as demo
This commit is contained in:
@ -221,6 +221,13 @@
|
||||
<button onclick='ipcRenderer.sendSync("synchronous-message", "SESSION:startSearch");'>
|
||||
Start session search
|
||||
</button>
|
||||
<table id="sessionListTa">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Host</th>
|
||||
<th>Amount of members</th>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
function createNewSession() {
|
||||
val = document.getElementById("sessionName").value
|
||||
@ -229,10 +236,30 @@
|
||||
alert("Your Sessionname may not contain a |");
|
||||
}
|
||||
console.log(val)
|
||||
ipcRenderer.sendSync("synchronous-message", "SESSION:createNew| " + val);
|
||||
ipcRenderer.sendSync("synchronous-message", "SESSION:createNew|" + val);
|
||||
}
|
||||
|
||||
setInterval(function(){console.log(ipcRenderer.sendSync("synchronous-message", "SESSION:getAll" ));}, 5000)
|
||||
setInterval(function(){
|
||||
allSess = ipcRenderer.sendSync("synchronous-message", "SESSION:getAll" )
|
||||
elmList = document.getElementById("sessionListTa")
|
||||
elmList.innerHTML = "<tr><th>Name</th><th>Host</th><th>Amount of members</th></tr>"
|
||||
SesKeys = Object.keys(allSess)
|
||||
var i = 0
|
||||
insBlock = ""
|
||||
while(i < SesKeys.length){
|
||||
console.log(i, SesKeys[i], allSess[SesKeys[i]])
|
||||
insBlock = "<tr>"
|
||||
insBlock += "<td>" + allSess[SesKeys[i]].name + "</td>"
|
||||
insBlock += "<td>" + allSess[SesKeys[i]].host + "</td>"
|
||||
insBlock += "<td>" + allSess[SesKeys[i]].memberCount + "</td>"
|
||||
insBlock += "</tr>"
|
||||
elmList.innerHTML = elmList.innerHTML + insBlock
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
console.log(allSess);
|
||||
}, 5000)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user