diff --git a/abort.html b/abort.html new file mode 100644 index 0000000..a136425 --- /dev/null +++ b/abort.html @@ -0,0 +1,40 @@ + + + + + Aborting... + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+

Daemon exited...

+
+ +
+ + + diff --git a/network.html b/network.html index eafb023..ecde17c 100644 --- a/network.html +++ b/network.html @@ -83,6 +83,11 @@
  • 00.00.00.00 +
  • +
  • + + +
  • Detailed information

    diff --git a/twister_network.js b/twister_network.js index 2974209..75b263d 100644 --- a/twister_network.js +++ b/twister_network.js @@ -223,6 +223,24 @@ function setSpamMsg() { }, {}); } +function exitDaemon() { + $( ".terminate-daemon").text("Exiting..."); + $( ".terminate-daemon").addClass("disabled"); + $.MAL.disableButton( $( ".terminate-daemon") ); + + twisterRpc("stop", undefined, + function(args, ret) { + console.log("daemon exiting"); + + setTimeout(function _reload_after_exit() { + window.location.href = '/abort.html'; + }, 2000); + }, {}, + function(args, ret) { + console.log("error while exiting daemon"); + }, {}); +} + // handlers common to both desktop and mobile function interfaceNetworkHandlers() { $( ".new-peer-addr" ).keyup( peerKeypress ); @@ -231,6 +249,7 @@ function interfaceNetworkHandlers() { $( ".add-dns").bind( "click", addDNSClick ); $( "select.genblock").change( setGenerate ); $( ".update-spam-msg").bind( "click", setSpamMsg ); + $( ".terminate-daemon").bind( "click", exitDaemon ) }