[feature] Add Reset Function

main
Joaquin 3 years ago
parent dedb7e2893
commit 3c5361d5da
Signed by: puly
GPG Key ID: 9E9299CD96C65EC6
  1. 26
      app.js
  2. 4
      webFiles/adminpanel.html

@ -78,6 +78,18 @@ function takeVotingRights(){
}); });
} }
function nullPrezenta(){
Object.keys(credentials).forEach(function(key) {
credentials[key].present = 0;
});
}
function nullLogStatus(){
Object.keys(credentials).forEach(function(key) {
credentials[key].loggedIn = 0;
});
}
app.get('/', (request, response) => { app.get('/', (request, response) => {
@ -393,6 +405,20 @@ app.get('/admindo', (request, response) => {
report("++ PREZENTI: " + prezenti.toString() + " ++"); report("++ PREZENTI: " + prezenti.toString() + " ++");
report("------------PREZENTA------------"); report("------------PREZENTA------------");
} }
if(request.query.do === 'reset'){
takeVotingRights();
nullLogStatus();
nullPrezenta();
activity = 'null';
logString = '';
response.redirect('/logout');
response.end();
return;
}
} }
response.redirect('/admin'); response.redirect('/admin');

@ -36,6 +36,10 @@
<button type="button" class="rounded-xl w-full bg-indigo-900 my-2 py-5 my-2 px-5 text-sm md:text-xl font-bold tracking-wide justify-center items-center font-[manrope]" id="prezent">FA PREZENTA</button> <button type="button" class="rounded-xl w-full bg-indigo-900 my-2 py-5 my-2 px-5 text-sm md:text-xl font-bold tracking-wide justify-center items-center font-[manrope]" id="prezent">FA PREZENTA</button>
<button type="button" class="rounded-xl w-full bg-indigo-900 my-2 py-5 my-2 px-5 text-sm md:text-xl font-bold tracking-wide justify-center items-center font-[manrope]" id="stopprezent">STOP PREZENTA</button> <button type="button" class="rounded-xl w-full bg-indigo-900 my-2 py-5 my-2 px-5 text-sm md:text-xl font-bold tracking-wide justify-center items-center font-[manrope]" id="stopprezent">STOP PREZENTA</button>
<p class="text-3xl pb-10 font-extrabold tracking-wide">RESET</p>
<button type="button" class="rounded-xl w-full bg-indigo-900 my-2 py-5 my-2 px-5 text-sm md:text-xl font-bold tracking-wide justify-center items-center font-[manrope]" onclick="location.href='/admindo?do=reset';">RESET</button>
</div> </div>
</div> </div>

Loading…
Cancel
Save