Admin controller draft

This commit is contained in:
Viktor Kholodov
2021-01-09 02:09:00 +03:00
parent 23f566af51
commit e702bd61b4
13 changed files with 119 additions and 37 deletions
+11 -10
View File
@@ -45,8 +45,8 @@ window.onload = function() {
'</button>';
return memo + '<tr>\n' +
' <td>'+ lobby.user1Info.name +'</td>\n' +
' <td>'+ lobby.user2Info.name +'</td>\n' +
' <td>'+ lobby.user1Info.name.substring(0, 20) +'</td>\n' +
' <td>'+ lobby.user2Info.name.substring(0, 20) +'</td>\n' +
' <td>'+ lobby.status +'</td>\n' +
' <td>' + joinButton + ' ' + observerButton +
' </td>' +
@@ -81,13 +81,6 @@ window.onload = function() {
}));
});
$("#updateDecider").click(function(event) {
event.preventDefault();
ws.send(JSON.stringify({
type: "updateDecider"
}));
});
$("#submitmsg").click(function(event) {
sendMessage();
});
@@ -105,6 +98,7 @@ window.onload = function() {
}));
$("#decider").hide();
$("#lobbies").show();
$(".navbar").show();
});
if($.cookie('user')=== undefined){
@@ -157,9 +151,12 @@ window.onload = function() {
type: "userName",
name: $.cookie('user')
}));
ws.send(JSON.stringify({
type: "getLobbies"
}));
}
let timerId = setInterval(() =>
var timerId = setInterval(() =>
ws.send(JSON.stringify({
type: "getLobbies"
})), 2000);
@@ -168,6 +165,7 @@ window.onload = function() {
function changeNick() {
result = prompt("Введите ник", $.cookie('user'));
if(result == null) return;
result = result.substr(0, 20);
$.cookie('user', result, { expires: 7 });
ws.send(JSON.stringify({
type: "userName",
@@ -195,6 +193,9 @@ function disconnectLobby(error) {
$("#decider").hide();
$(".navbar").show();
$("#lobbies").show();
ws.send(JSON.stringify({
type: "getLobbies"
}));
alert(error);
}