-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.html
110 lines (107 loc) · 3.99 KB
/
admin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<html>
<head>
<title>Kicker Admin</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css"/>
<link rel="stylesheet" href="interface/style.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body center>
<div class="joiner container">
<h1>Joiner</h1>
<input type="text" name="nick" placeholder="nickname"
value=""
onkeypress="(event.key.toLowerCase() === 'enter') ? callPlusOne() : null"/>
<button onclick="callPlusOne()" id="plusone">+1</button>
</div>
<div class="games container">
<h2>Games</h2>
<script>
const tplGame = (game, settings) => {
let showGogogoButtons = false;
if (game.joiner.length === settings.maxjoiner) {
showGogogoButtons = true;
}
return `
<div class="game${game.done ? ' is-done' : ''}">
${game.done ? `<div class="done-layer" label="GOGOGO" date="${HRDate(game.donedate)}"></div>` : ''}
<table>
<thead>
<tr>
<td colspan="5">
#${game.id} / ${HRDate(game.date)}
</td>
<td center>
<i onclick="deleteGame(${game.id})" class="game-delete far fa-trash-alt"></i>
</td>
</tr>
<tr>
<th>ID</th>
<th>CID</th>
<th>Nick</th>
<th center>Date</th>
<th center width="100">State</th>
<th></th>
</tr>
</thead>
<tbody>
${game.joiner.map((joiner) => {
return `
<tr>
<td>${joiner.id}</td>
<td>${joiner.clientid}</td>
<td>${joiner.nick}</td>
<td center>${HRDate(joiner.date)}</td>
<td center>${!joiner.gogogo
? (!showGogogoButtons
? '+1'
: `<button onclick="setGOGOGO(${joiner.id}, ${game.id})">GOGOGO</button>`)
: '<span class="gogogo">GOGOGO</span>'}</td>
<td center>
<i onclick="deleteJoiner(${joiner.id}, ${game.id})" class="far fa-trash-alt"></i>
</td>
</tr>`
}).join('\n')}
</tbody>
</table>
</div>
`;
}
</script>
<div class="templates"></div>
</div>
<div class="clients container">
<h2>Clients</h2>
<div class="mb-sm">
<input type="text" name="clientnick" placeholder="anonymous"
value=""
onkeypress="(event.key.toLowerCase() === 'enter') ? sendClientNick() : null"/>
<button onclick="sendClientNick()">Set your clientname</button>
</div>
<script>
const tplClient = (client) => {
return `
<tr>
<td>${client.id}</td>
<td>${client.nick}${client.isThisYou ? ' (You)' : ''}<br /><span class="ms--1">${client.type}</span></td>
<td>${HRDate(client.lastseendate)}</td>
</tr>`;
}
</script>
<table>
<thead>
<tr>
<th>Id</th>
<th>Nick</th>
<th>Lastseen</th>
</tr>
</thead>
<tbody class="templates">
</tbody>
</table>
</div>
<pre id="error" style="max-height:150px;overflow-y: scroll;"></pre>
<script src="https://cdn.jsdelivr.net/npm/bowser@2.10.0/es5.min.js"></script>
<script src="interface/api.js"></script>
<script src="interface/admin.js"></script>
</body>
</html>