From b10bbe7c529c1162ed8c6b6a9bcf2b2196300119 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 8 Oct 2019 22:25:34 -0500 Subject: [PATCH] added confirm for restart/shutdown ui btns --- TODO.txt | 1 - static-data/www/shared/panel.js | 18 +++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TODO.txt b/TODO.txt index 38bff9f0..82941d66 100644 --- a/TODO.txt +++ b/TODO.txt @@ -7,5 +7,4 @@ * ensure accessibility for Onionr web UI * make forward secrecy compatible with multiple devices * make uptime timer be human meaningful -* add confirm for shutdown/restart * add way to mark key as dead diff --git a/static-data/www/shared/panel.js b/static-data/www/shared/panel.js index 88e02c40..c88cf552 100755 --- a/static-data/www/shared/panel.js +++ b/static-data/www/shared/panel.js @@ -22,18 +22,22 @@ restartBtn = document.getElementById('restartNode') shutdownBtn.onclick = function(){ if (! nowebpass){ - httpGet('shutdownclean') - overlay('shutdownNotice') + if (confirm("Really shutdown Onionr?")){ + httpGet('shutdownclean') + overlay('shutdownNotice') + } } } restartBtn.onclick = function(){ if (! nowebpass){ - fetch('/restartclean', { - headers: { - "token": webpass - }}) - PNotify.notice('Node is restarting') + if (confirm("Really restart Onionr?")){ + fetch('/restartclean', { + headers: { + "token": webpass + }}) + PNotify.notice('Node is restarting') + } } }