add webui for udp tunnels

This commit is contained in:
Jeff Becker 2016-09-03 13:58:34 -04:00
parent 9acbb2203c
commit fa1021df59
No known key found for this signature in database
GPG key ID: AB950234D6EA286B
7 changed files with 181 additions and 3 deletions

View file

@ -337,7 +337,38 @@ namespace http {
s << "<td>" << it->GetWindowSize () << "</td>";
s << "<td>" << (int)it->GetStatus () << "</td>";
s << "</tr><br>\r\n" << std::endl;
}
s << "</table><br>\r\n<table><caption>Forwards</caption><tr>";
s << "<th>Remote Destination</th>";
s << "<th>IBGW</th>";
s << "<th>OBEP</th>";
s << "<th>UDP Converstation</th>";
s << "<th>Idle Time</th>";
s << "</th>";
auto forward = i2p::client::context.GetForwardInfosFor(dest->GetIdentHash());
for (auto & info : forward)
{
s << "<tr>";
s << "<td>" << info.RemoteIdent.ToBase32() << "</td>";
s << "<td>";
if(info.CurrentIBGW)
s << info.CurrentIBGW->ToBase64();
else
s << "(none)";
s << "</td>";
s << "<td>";
if(info.CurrentOBEP)
s << info.CurrentOBEP->ToBase64();
else
s << "(none)";
s << "</td>";
s << "<td>" << info.LocalEndpoint << " &#8644; " << info.RemoteEndpoint << "</td>";
auto sec = std::chrono::duration<float, std::ratio<1000, 1 > >( std::chrono::milliseconds(info.idle) );
s << "<td>" << sec.count() << " seconds </td>";
s << "</tr><br>\r\n";
}
s << "</table>\r\n";
}
}