added confirm for restart/shutdown ui btns

This commit is contained in:
Kevin Froman 2019-10-08 22:25:34 -05:00
parent 7f60560cbe
commit b10bbe7c52
2 changed files with 11 additions and 8 deletions

View File

@ -7,5 +7,4 @@
* ensure accessibility for Onionr web UI * ensure accessibility for Onionr web UI
* make forward secrecy compatible with multiple devices * make forward secrecy compatible with multiple devices
* make uptime timer be human meaningful * make uptime timer be human meaningful
* add confirm for shutdown/restart
* add way to mark key as dead * add way to mark key as dead

View File

@ -22,18 +22,22 @@ restartBtn = document.getElementById('restartNode')
shutdownBtn.onclick = function(){ shutdownBtn.onclick = function(){
if (! nowebpass){ if (! nowebpass){
httpGet('shutdownclean') if (confirm("Really shutdown Onionr?")){
overlay('shutdownNotice') httpGet('shutdownclean')
overlay('shutdownNotice')
}
} }
} }
restartBtn.onclick = function(){ restartBtn.onclick = function(){
if (! nowebpass){ if (! nowebpass){
fetch('/restartclean', { if (confirm("Really restart Onionr?")){
headers: { fetch('/restartclean', {
"token": webpass headers: {
}}) "token": webpass
PNotify.notice('Node is restarting') }})
PNotify.notice('Node is restarting')
}
} }
} }