mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-26 22:54:45 +00:00
Merge pull request #54 from BlockTester/exit-button
Fixes #17 add 'exit' button
This commit is contained in:
commit
3a0e983e63
40
abort.html
Normal file
40
abort.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Aborting...</title>
|
||||
<link rel="stylesheet" href="css/style.css" type="text/css"/>
|
||||
<script src="jquery.min.js"></script>
|
||||
<script src="jQueryPlugins.js"></script>
|
||||
<script src="jquery.json-2.4.js"></script>
|
||||
<script src="jquery.jsonrpcclient.js"></script>
|
||||
<script src="jquery.storageapi.js"></script>
|
||||
<script src="mobile_abstract.js"></script>
|
||||
<script src="twister_io.js"></script>
|
||||
<script src="twister_user.js"></script>
|
||||
<script src="twister_formatpost.js"></script>
|
||||
<script src="twister_following.js"></script>
|
||||
<script src="twister_newmsgs.js"></script>
|
||||
<script src="twister_network.js"></script>
|
||||
<script src="interface_common.js"></script>
|
||||
|
||||
<link rel="icon" type="image/png" href="img/twister_mini.png" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- MENU SUPERIOR INIT -->
|
||||
<nav class="userMenu">
|
||||
</nav>
|
||||
<!-- MENU SUPERIOR END -->
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="network singleBlock">
|
||||
<h2 style="text-align: center"> Daemon exited... </h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -83,6 +83,11 @@
|
||||
<li>
|
||||
<label>Client Version: </label>
|
||||
<span class="version">00.00.00.00</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>Terminate Daemon:</label>
|
||||
<button class="terminate-daemon">Exit</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3> Detailed information </h3>
|
||||
|
@ -478,7 +478,8 @@
|
||||
</div>
|
||||
<div> </div>
|
||||
</ul>
|
||||
|
||||
<button class="terminate-daemon">Terminate Daemon</button>
|
||||
|
||||
<h3> Detailed information </h3>
|
||||
<ul>
|
||||
<li class="connections">
|
||||
|
@ -223,6 +223,27 @@ function setSpamMsg() {
|
||||
}, {});
|
||||
}
|
||||
|
||||
function exitDaemon() {
|
||||
if (confirm('Are you sure you want to exit the daemon?\nThe Twister client will stop working.')) {
|
||||
$( ".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 +252,7 @@ function interfaceNetworkHandlers() {
|
||||
$( ".add-dns").bind( "click", addDNSClick );
|
||||
$( "select.genblock").change( setGenerate );
|
||||
$( ".update-spam-msg").bind( "click", setSpamMsg );
|
||||
$( ".terminate-daemon").bind( "click", exitDaemon )
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user