|
|
|
@ -182,7 +182,7 @@ namespace http {
@@ -182,7 +182,7 @@ namespace http {
|
|
|
|
|
" <meta charset=\"UTF-8\">\r\n" |
|
|
|
|
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n" |
|
|
|
|
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n" |
|
|
|
|
" <title>Purple I2P " VERSION " Webconsole</title>\r\n"; |
|
|
|
|
" <title>Purple I2P Webconsole</title>\r\n"; |
|
|
|
|
GetStyles(s); |
|
|
|
|
s << |
|
|
|
|
"</head>\r\n" |
|
|
|
@ -196,8 +196,10 @@ namespace http {
@@ -196,8 +196,10 @@ namespace http {
|
|
|
|
|
if (i2p::context.IsFloodfill ()) |
|
|
|
|
s << " <a href=\"" << webroot << "?page=" << HTTP_PAGE_LEASESETS << "\">" << tr("LeaseSets") << "</a><br>\r\n"; |
|
|
|
|
s << |
|
|
|
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TUNNELS << "\">" << tr("Tunnels") << "</a><br>\r\n" |
|
|
|
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSIT_TUNNELS << "\">" << tr("Transit Tunnels") << "</a><br>\r\n" |
|
|
|
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TUNNELS << "\">" << tr("Tunnels") << "</a><br>\r\n"; |
|
|
|
|
if (i2p::context.AcceptsTunnels () || i2p::tunnel::tunnels.CountTransitTunnels()) |
|
|
|
|
s << " <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSIT_TUNNELS << "\">" << tr("Transit Tunnels") << "</a><br>\r\n"; |
|
|
|
|
s << |
|
|
|
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_TRANSPORTS << "\">" << tr ("Transports") << "</a><br>\r\n" |
|
|
|
|
" <a href=\"" << webroot << "?page=" << HTTP_PAGE_I2P_TUNNELS << "\">" << tr("I2P tunnels") << "</a><br>\r\n"; |
|
|
|
|
if (i2p::client::context.GetSAMBridge ()) |
|
|
|
@ -447,7 +449,17 @@ namespace http {
@@ -447,7 +449,17 @@ namespace http {
|
|
|
|
|
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n"; |
|
|
|
|
for (auto & it : pool->GetInboundTunnels ()) { |
|
|
|
|
s << "<div class=\"listitem\">"; |
|
|
|
|
it->Print(s); |
|
|
|
|
// for each tunnel hop if not zero-hop
|
|
|
|
|
if (it->GetNumHops ()) |
|
|
|
|
{ |
|
|
|
|
it->VisitTunnelHops( |
|
|
|
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent) |
|
|
|
|
{ |
|
|
|
|
s << "⇒ " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " "; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
s << "⇒ " << it->GetTunnelID () << ":me"; |
|
|
|
|
if (it->LatencyIsKnown()) |
|
|
|
|
s << " ( " << it->GetMeanLatency() << tr(/* tr: Milliseconds */ "ms") << " )"; |
|
|
|
|
ShowTunnelDetails(s, it->GetState (), false, it->GetNumReceivedBytes ()); |
|
|
|
@ -457,7 +469,17 @@ namespace http {
@@ -457,7 +469,17 @@ namespace http {
|
|
|
|
|
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n"; |
|
|
|
|
for (auto & it : pool->GetOutboundTunnels ()) { |
|
|
|
|
s << "<div class=\"listitem\">"; |
|
|
|
|
it->Print(s); |
|
|
|
|
s << it->GetTunnelID () << ":me ⇒"; |
|
|
|
|
// for each tunnel hop if not zero-hop
|
|
|
|
|
if (it->GetNumHops ()) |
|
|
|
|
{ |
|
|
|
|
it->VisitTunnelHops( |
|
|
|
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent) |
|
|
|
|
{ |
|
|
|
|
s << " " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ⇒"; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
if (it->LatencyIsKnown()) |
|
|
|
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )"; |
|
|
|
|
ShowTunnelDetails(s, it->GetState (), false, it->GetNumSentBytes ()); |
|
|
|
@ -631,7 +653,16 @@ namespace http {
@@ -631,7 +653,16 @@ namespace http {
|
|
|
|
|
s << "<b>" << tr("Inbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n"; |
|
|
|
|
for (auto & it : i2p::tunnel::tunnels.GetInboundTunnels ()) { |
|
|
|
|
s << "<div class=\"listitem\">"; |
|
|
|
|
it->Print(s); |
|
|
|
|
if (it->GetNumHops ()) |
|
|
|
|
{ |
|
|
|
|
it->VisitTunnelHops( |
|
|
|
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent) |
|
|
|
|
{ |
|
|
|
|
s << "⇒ " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " "; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
s << "⇒ " << it->GetTunnelID () << ":me"; |
|
|
|
|
if (it->LatencyIsKnown()) |
|
|
|
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )"; |
|
|
|
|
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumReceivedBytes ()); |
|
|
|
@ -641,7 +672,17 @@ namespace http {
@@ -641,7 +672,17 @@ namespace http {
|
|
|
|
|
s << "<b>" << tr("Outbound tunnels") << ":</b><br>\r\n<div class=\"list\">\r\n"; |
|
|
|
|
for (auto & it : i2p::tunnel::tunnels.GetOutboundTunnels ()) { |
|
|
|
|
s << "<div class=\"listitem\">"; |
|
|
|
|
it->Print(s); |
|
|
|
|
s << it->GetTunnelID () << ":me ⇒"; |
|
|
|
|
// for each tunnel hop if not zero-hop
|
|
|
|
|
if (it->GetNumHops ()) |
|
|
|
|
{ |
|
|
|
|
it->VisitTunnelHops( |
|
|
|
|
[&s](std::shared_ptr<const i2p::data::IdentityEx> hopIdent) |
|
|
|
|
{ |
|
|
|
|
s << " " << i2p::data::GetIdentHashAbbreviation (hopIdent->GetIdentHash ()) << " ⇒"; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
if (it->LatencyIsKnown()) |
|
|
|
|
s << " ( " << it->GetMeanLatency() << tr("ms") << " )"; |
|
|
|
|
ShowTunnelDetails(s, it->GetState (), (it->GetTunnelPool () == ExplPool), it->GetNumSentBytes ()); |
|
|
|
@ -1065,6 +1106,7 @@ namespace http {
@@ -1065,6 +1106,7 @@ namespace http {
|
|
|
|
|
SendReply(res, content); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool strictheaders; |
|
|
|
|
i2p::config::GetOption("http.strictheaders", strictheaders); |
|
|
|
|
if (strictheaders) |
|
|
|
@ -1087,6 +1129,7 @@ namespace http {
@@ -1087,6 +1129,7 @@ namespace http {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HTML head start
|
|
|
|
|
ShowPageHead (s); |
|
|
|
|
if (req.uri.find("page=") != std::string::npos) { |
|
|
|
|