X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lmno.js;h=86306516878b1f68fd6d980ad9ea4e912692d053;hb=808f638d7b86b8befcd9a5d3cd75b7e620d98206;hp=74687361a59fe485a9c42e44c470aea7510fb190;hpb=e9ffd1857fa03d06f8887f15c831c6cfea1044c7;p=lmno-server diff --git a/lmno.js b/lmno.js index 7468736..8630651 100644 --- a/lmno.js +++ b/lmno.js @@ -213,17 +213,16 @@ app.post('/login', async (request, response) => { /* An admin page (only available to admin users, of course) */ app.get('/admin/', auth_admin, (request, response) => { - let active = 0; - let idle = 0; + let active = []; + let idle = []; for (let id in lmno.ids) { if (lmno.ids[id].game.clients.length) - active++; - else - idle++; + active.push(lmno.ids[id]); + else + idle.push(lmno.ids[id]); } - response.send(`Active games: ${active}.
-Idle games: ${idle}`); + response.render('admin.html', { test: "foobar", games: { active: active, idle: idle}}); });