i2pd/webui/index.html

102 lines
3.5 KiB
HTML
Raw Normal View History

2015-09-06 18:34:50 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>Purple I2P 0.10.0 Webconsole</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2015-09-07 10:31:57 +00:00
<link rel="stylesheet" href="css/main.css">
<script type="text/javascript" src="javascript/I2PControl.js"></script>
<script type="text/javascript">
function updateRouterInfo(result, session) {
2015-09-12 12:43:30 +00:00
if(session.error) {
alert("Error: " + session.error["message"]);
return;
2015-09-12 12:43:30 +00:00
}
2015-09-07 10:31:57 +00:00
I2PControl.updateDocument({
"version" : result["i2p.router.version"],
"status" : I2PControl.statusToString(result["i2p.router.net.status"]),
2015-09-07 11:41:48 +00:00
"uptime" : I2PControl.msToString(result["i2p.router.uptime"]),
"knownpeers" : result["i2p.router.netdb.knownpeers"],
"activepeers" : result["i2p.router.netdb.activepeers"],
"tunnels-participating" : result["i2p.router.net.tunnels.participating"],
2015-09-17 14:49:55 +00:00
"tunnels-successrate" : result["i2p.router.net.tunnels.creationsuccessrate"] + "&#37",
2015-09-07 11:41:48 +00:00
"bw-in" : result["i2p.router.net.bw.inbound.1s"],
"bw-out" : result["i2p.router.net.bw.outbound.1s"]
2015-09-07 10:31:57 +00:00
});
2015-09-12 12:43:30 +00:00
window.setTimeout(function() { requestRouterInfo(session); }, 5000);
}
2015-09-07 10:31:57 +00:00
2015-09-12 12:43:30 +00:00
function requestRouterInfo(session) {
session.request("RouterInfo", {
"i2p.router.version" : "",
"i2p.router.net.status" : "",
"i2p.router.uptime" : "",
"i2p.router.netdb.knownpeers" : "",
"i2p.router.netdb.activepeers" : "",
"i2p.router.net.tunnels.participating" : "",
2015-09-17 14:49:55 +00:00
"i2p.router.net.tunnels.creationsuccessrate" : "",
2015-09-12 12:43:30 +00:00
"i2p.router.net.bw.inbound.1s" : "",
"i2p.router.net.bw.outbound.1s" : ""
}, updateRouterInfo);
2015-09-07 10:31:57 +00:00
}
2015-09-12 12:43:30 +00:00
2015-09-07 10:31:57 +00:00
window.onload = function() {
var session = new I2PControl.Session("itoopie");
2015-09-12 12:43:30 +00:00
session.start(function() { requestRouterInfo(session); });
document.getElementById("shutdown").onclick = function() {
session.request("RouterManager", {"Shutdown" : ""}, function() {});
this.disabled = true;
};
document.getElementById("shutdown-graceful").onclick = function() {
session.request("RouterManager", {"ShutdownGraceful" : ""}, function() {});
this.disabled = true;
};
document.getElementById("reseed").onclick = function() {
session.request("RouterManager", {"Reseed" : ""}, function() {});
this.disabled = true;
};
2015-09-07 10:31:57 +00:00
};
2015-09-12 12:43:30 +00:00
2015-09-07 10:31:57 +00:00
</script>
2015-09-06 18:34:50 +00:00
</head>
2015-09-07 10:31:57 +00:00
2015-09-06 18:34:50 +00:00
<body>
2015-09-07 10:31:57 +00:00
<div class="header">
<h1>i2pd router console</h1>
<h2>Version: <span id="version"></span>, uptime: <span id="uptime"></span></h2>
<h2>Network status: <span id="status"></span></h2>
<p>
<button id="shutdown-graceful">graceful shutdown</button>
<button id="shutdown">force shutdown</button>
2015-09-07 10:31:57 +00:00
<button id="restart" disabled>restart</button>
<button id="reseed">reseed</button>
</p>
</div>
<div class="content">
2015-09-17 14:49:55 +00:00
<h2 class="content-subhead">
Tunnels participating: <span id="tunnels-participating"></span>
</h2>
<h2 class="content-subhead">
Tunnel create success rate: <span id="tunnels-successrate"></span>
</h2>
<h2 class="content-subhead">
Active peers: <span id="activepeers"></span>
</h2>
<h2 class="content-subhead">
Known peers: <span id="knownpeers"></span>
</h2>
<h2 class="content-subhead">
Bandwidth:
2015-09-07 10:31:57 +00:00
in <span id="bw-in"></span> Bps /
out <span id="bw-out"></span> Bps
</h2>
</div>
2015-09-17 09:47:16 +00:00
<!--#include virtual="menu.html" -->
2015-09-17 14:49:55 +00:00
<!--#include virtual="footer.html" -->
2015-09-07 10:31:57 +00:00
2015-09-06 18:34:50 +00:00
</body>
</html>