mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 04:37:50 +02:00
Add basic inbound tunnel information to webui.
This commit is contained in:
parent
19557a0908
commit
f04f556b75
5 changed files with 212 additions and 1 deletions
|
@ -7,6 +7,9 @@
|
|||
<li class="menu-item">
|
||||
<a href="netdb.html" class="menu-link">Network Database</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="tunnels.html" class="menu-link">Tunnels</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="config.html" class="menu-link">Configure</a>
|
||||
</li>
|
||||
|
|
66
webui/tunnels.html
Normal file
66
webui/tunnels.html
Normal file
|
@ -0,0 +1,66 @@
|
|||
<!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">
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
<script type="text/javascript" src="javascript/I2PControl.js"></script>
|
||||
<script type="text/javascript">
|
||||
function updateNetDbInfo(result, session) {
|
||||
if(session.error) {
|
||||
alert("Error: " + session.error["message"]);
|
||||
return;
|
||||
}
|
||||
|
||||
var table = document.getElementById("tunnels").getElementsByTagName("tbody")[0];
|
||||
|
||||
for(id in result["i2p.router.net.tunnels.inbound.list"]) {
|
||||
if(!result["i2p.router.net.tunnels.inbound.list"].hasOwnProperty(id))
|
||||
continue;
|
||||
var tunnel = result["i2p.router.net.tunnels.inbound.list"][id];
|
||||
|
||||
var row = table.insertRow(table.rows.length);
|
||||
row.insertCell(0).appendChild(document.createTextNode(id));
|
||||
row.insertCell(1).appendChild(document.createTextNode(tunnel["status"] ? tunnel["status"] : "running"));
|
||||
row.insertCell(2).appendChild(document.createTextNode(tunnel["layout"]));
|
||||
}
|
||||
}
|
||||
|
||||
function requestNetDbInfo(session) {
|
||||
session.request("RouterInfo", {
|
||||
"i2p.router.net.tunnels.inbound.list" : "",
|
||||
}, updateNetDbInfo);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
var session = new I2PControl.Session("itoopie");
|
||||
session.start(function() { requestNetDbInfo(session); });
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>i2pd router console</h1>
|
||||
<h2>Tunnel List</h2>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<table id="tunnels">
|
||||
<thead>
|
||||
<th>Tunnel ID</th>
|
||||
<th>Status</th>
|
||||
<th>Overview</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--#include virtual="menu.html" -->
|
||||
<!--#include virtual="footer.html" -->
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue