From a64e1b2aa62f28fa0d2e399afb9d23be8c3d1071 Mon Sep 17 00:00:00 2001 From: MXPLRS | Kirill Date: Mon, 19 Sep 2016 20:22:15 +0300 Subject: [PATCH] add sliders for LeaseSets --- HTTPServer.cpp | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 2e469f98..8a63658c 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -345,50 +345,32 @@ namespace http { void ShowLeasesSets(std::stringstream& s) { - s << "
LeaseSets:

"; + s << "
LeaseSets (click on to show info):

\r\n"; + int counter = 1; // for each lease set i2p::data::netdb.VisitLeaseSets( - [&s](const i2p::data::IdentHash dest, std::shared_ptr leaseSet) + [&s, &counter](const i2p::data::IdentHash dest, std::shared_ptr leaseSet) { // create copy of lease set so we extract leases i2p::data::LeaseSet ls(leaseSet->GetBuffer(), leaseSet->GetBufferLen()); - // begin lease set entry s << "
"; - // invalid ? + s << "'>\r\n"; if (!ls.IsValid()) - s << "
!! Invalid !!
"; - // ident - s << "
" << dest.ToBase32() << "
"; - // LeaseSet time - s << "
expires: " << ls.GetExpirationTime() << "
"; - // get non expired leases + s << "
!! Invalid !!
\r\n"; + s << "
\r\n"; + s << "\r\n

\r\n"; + s << "Expires: " << ls.GetExpirationTime() << "
\r\n"; auto leases = ls.GetNonExpiredLeases(); - // show non expired leases - s << "

Non Expired Leases: " << leases.size() << "
"; - // for each lease - s << "
"; + s << "Non Expired Leases: " << leases.size() << "
\r\n"; for ( auto & l : leases ) { - // begin lease - s << "
"; - // gateway - s << "
Gateway: " << l->tunnelGateway.ToBase64() << "
"; - // tunnel id - s << "
TunnelID: " << l->tunnelID << "
"; - // end date - s << "
EndDate: " << l->endDate << "
"; - // end lease - s << "
"; + s << "Gateway: " << l->tunnelGateway.ToBase64() << "
\r\n"; + s << "TunnelID: " << l->tunnelID << "
\r\n"; + s << "EndDate: " << l->endDate << "
\r\n"; } - // end for each lease - s << "
"; - // end lease set entry - s << "
"; - // linebreak - s << "
"; + s << "

\r\n
\r\n\r\n"; } ); // end for each lease set