From 64cf4d0a3e924dcebdf62d9fc9ac27f4e9357aee Mon Sep 17 00:00:00 2001 From: Block Tester Date: Fri, 17 Jan 2014 05:22:06 +0000 Subject: [PATCH 1/3] Fixes #17 add 'exit' button --- abort.html | 40 ++++++++++++++++++++++++++++++++++++++++ network.html | 5 +++++ twister_network.js | 19 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 abort.html 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 ) } From 5323072be765d0cbb9fc2a79a331c3e1de0999f9 Mon Sep 17 00:00:00 2001 From: Block Tester Date: Fri, 17 Jan 2014 05:32:39 +0000 Subject: [PATCH 2/3] Fixes #17 Added exit daemon button to mobile interface --- tmobile.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tmobile.html b/tmobile.html index ea7327c..12dc101 100644 --- a/tmobile.html +++ b/tmobile.html @@ -478,7 +478,8 @@
     
    - + +

    Detailed information