From c94119e17332954ca8fe390f1f9221db5561756b Mon Sep 17 00:00:00 2001 From: catvayor Date: Tue, 13 Jun 2023 18:14:49 +0200 Subject: [PATCH] cleaner admin --- static/admin.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/static/admin.html b/static/admin.html index 9bcfa8f..e3cee5a 100644 --- a/static/admin.html +++ b/static/admin.html @@ -31,11 +31,15 @@ top: 1%; right: 0.5%; } + + .vieux { color: DarkOrchid; } + .tableFixHead { overflow: auto; height: 40%; } .tableFixHead thead th { position: sticky; top: 0; z-index: 1; } table { border-collapse: collapse; width: 100%; } th, td { padding: 8px 16px; } - th { background:#eee; } + th { background: Grey; } + tr:nth-child(even) { background-color: Silver; } @@ -106,7 +110,7 @@ socket.on('update', function(data){ var id = data.id; if(!(id in equipes)){ - var row = `${id}`; + var row = `${id}`; row += `` @@ -120,9 +124,16 @@ id="${id}.npc" onchange="sendUpdate('${id}')" />` row += `` - info_table.innerHTML = info_table.innerHTML + `${row}` + info_table.innerHTML += `${row}` + for(i in equipes){ + var equipe = equipes[i]; + document.getElementById(`${i}.shown`).checked = equipe.state.shown; + document.getElementById(`${i}.blurred`).checked = equipe.state.blurred; + document.getElementById(`${i}.tracker`).checked = equipe.state.tracker; + document.getElementById(`${i}.npc`).value = equipe.state.npc; + } } - equipes[id] = data.state; + equipes[id] = data; document.getElementById(`${id}.shown`).checked = data.state.shown; document.getElementById(`${id}.blurred`).checked = data.state.blurred; document.getElementById(`${id}.tracker`).checked = data.state.tracker;