@ -198,7 +198,10 @@ namespace http {
@@ -198,7 +198,10 @@ namespace http {
s < < " <b>ERROR:</b> " < < string < < " <br> \r \n " ;
}
void ShowStatus ( std : : stringstream & s , bool includeHiddenContent )
void ShowStatus (
std : : stringstream & s ,
bool includeHiddenContent ,
i2p : : http : : OutputFormatEnum outputFormat )
{
s < < " <b>Uptime:</b> " ;
ShowUptime ( s , i2p : : context . GetUptime ( ) ) ;
@ -245,9 +248,12 @@ namespace http {
@@ -245,9 +248,12 @@ namespace http {
ShowTraffic ( s , i2p : : transport : : transports . GetTotalTransitTransmittedBytes ( ) ) ;
s < < " ( " < < ( double ) i2p : : transport : : transports . GetTransitBandwidth ( ) / 1024 < < " KiB/s)<br> \r \n " ;
s < < " <b>Data path:</b> " < < i2p : : fs : : GetDataDir ( ) < < " <br> \r \n " ;
s < < " <div class='slide'><label for='slide-info'>Hidden content. Press on text to see.</label> \r \n <input type='checkbox' id='slide-info'/> \r \n <p class='content'> \r \n " ;
if ( includeHiddenContent ) {
s < < " <b>Router Ident:</b> " < < i2p : : context . GetRouterInfo ( ) . GetIdentHashBase64 ( ) < < " <br> \r \n " ;
s < < " <div class='slide'> " ;
if ( ( outputFormat = = OutputFormatEnum : : forWebConsole ) | | ! includeHiddenContent ) {
s < < " <label for='slide-info'>Hidden content. Press on text to see.</label> \r \n <input type='checkbox' id='slide-info'/> \r \n <p class='content'> \r \n " ;
}
if ( includeHiddenContent ) {
s < < " <b>Router Ident:</b> " < < i2p : : context . GetRouterInfo ( ) . GetIdentHashBase64 ( ) < < " <br> \r \n " ;
s < < " <b>Router Family:</b> " < < i2p : : context . GetRouterInfo ( ) . GetProperty ( " family " ) < < " <br> \r \n " ;
s < < " <b>Router Caps:</b> " < < i2p : : context . GetRouterInfo ( ) . GetProperty ( " caps " ) < < " <br> \r \n " ;
s < < " <b>Our external address:</b> " < < " <br> \r \n " ;
@ -272,9 +278,12 @@ namespace http {
@@ -272,9 +278,12 @@ namespace http {
}
s < < address - > host . to_string ( ) < < " : " < < address - > port < < " <br> \r \n " ;
}
}
}
s < < " </p> \r \n </div> \r \n " ;
s < < " <b>Routers:</b> " < < i2p : : data : : netdb . GetNumRouters ( ) < < " " ;
if ( outputFormat = = OutputFormatEnum : : forQtUi ) {
s < < " <br> " ;
}
s < < " <b>Routers:</b> " < < i2p : : data : : netdb . GetNumRouters ( ) < < " " ;
s < < " <b>Floodfills:</b> " < < i2p : : data : : netdb . GetNumFloodfills ( ) < < " " ;
s < < " <b>LeaseSets:</b> " < < i2p : : data : : netdb . GetNumLeaseSets ( ) < < " <br> \r \n " ;
@ -285,15 +294,17 @@ namespace http {
@@ -285,15 +294,17 @@ namespace http {
s < < " <b>Client Tunnels:</b> " < < std : : to_string ( clientTunnelCount ) < < " " ;
s < < " <b>Transit Tunnels:</b> " < < std : : to_string ( transitTunnelCount ) < < " <br> \r \n <br> \r \n " ;
s < < " <table><caption>Services</caption><tr><th>Service</th><th>State</th></tr> \r \n " ;
s < < " <tr><td> " < < " HTTP Proxy " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetHttpProxy ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " SOCKS Proxy " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetSocksProxy ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " BOB " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetBOBCommandChannel ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " SAM " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetSAMBridge ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " I2CP " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetI2CPServer ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
bool i2pcontrol ; i2p : : config : : GetOption ( " i2pcontrol.enabled " , i2pcontrol ) ;
s < < " <tr><td> " < < " I2PControl " < < " </td><td><div class=' " < < ( ( i2pcontrol ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " </table> \r \n " ;
if ( outputFormat = = OutputFormatEnum : : forWebConsole ) {
s < < " <table><caption>Services</caption><tr><th>Service</th><th>State</th></tr> \r \n " ;
s < < " <tr><td> " < < " HTTP Proxy " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetHttpProxy ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " SOCKS Proxy " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetSocksProxy ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " BOB " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetBOBCommandChannel ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " SAM " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetSAMBridge ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " <tr><td> " < < " I2CP " < < " </td><td><div class=' " < < ( ( i2p : : client : : context . GetI2CPServer ( ) ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
bool i2pcontrol ; i2p : : config : : GetOption ( " i2pcontrol.enabled " , i2pcontrol ) ;
s < < " <tr><td> " < < " I2PControl " < < " </td><td><div class=' " < < ( ( i2pcontrol ) ? " enabled " : " disabled " ) < < " '></div></td></tr> \r \n " ;
s < < " </table> \r \n " ;
}
}
void ShowLocalDestinations ( std : : stringstream & s )
@ -863,7 +874,7 @@ namespace http {
@@ -863,7 +874,7 @@ namespace http {
} else if ( req . uri . find ( " cmd= " ) ! = std : : string : : npos ) {
HandleCommand ( req , res , s ) ;
} else {
ShowStatus ( s , true ) ;
ShowStatus ( s , true , i2p : : http : : OutputFormatEnum : : forWebConsol e ) ;
res . add_header ( " Refresh " , " 10 " ) ;
}
ShowPageTail ( s ) ;