diff --git a/libi2pd_webconsole/HTTPServer.cpp b/libi2pd_webconsole/HTTPServer.cpp index 574634cc..1ec0db67 100644 --- a/libi2pd_webconsole/HTTPServer.cpp +++ b/libi2pd_webconsole/HTTPServer.cpp @@ -58,7 +58,7 @@ namespace http { static void GetStyles (std::stringstream& s) { if (externalCSS.length() != 0) - s << "\r\n"; + s << externalCSS; else s << internalCSS; } @@ -182,9 +182,11 @@ namespace http { " \r\n" " \r\n" " \r\n" - " Purple I2P Webconsole\r\n"; + " Purple I2P Webconsole\r\n" + " \r\n" "\r\n" "\r\n" "
" << tr("i2pd webconsole") << "
\r\n" @@ -282,9 +284,6 @@ namespace http { s << "
\r\n"; } #endif - auto family = i2p::context.GetFamily (); - if (family.length () > 0) - s << ""<< tr("Family") << ": " << family << "
\r\n"; s << "" << tr("Tunnel creation success rate") << ": " << i2p::tunnel::tunnels.GetTunnelCreationSuccessRate () << "%
\r\n"; s << "" << tr("Received") << ": "; ShowTraffic (s, i2p::transport::transports.GetTotalReceivedBytes ()); diff --git a/libi2pd_webconsole/HTTPServerResources.h b/libi2pd_webconsole/HTTPServerResources.h index 0acbe8d1..d2df1d32 100644 --- a/libi2pd_webconsole/HTTPServerResources.h +++ b/libi2pd_webconsole/HTTPServerResources.h @@ -33,7 +33,6 @@ namespace http // bundled style sheet const std::string internalCSS = - "\r\n"; // for external style sheet std::string externalCSS; + const std::string pageBase = +" \ + \ + \ + {% block head %} \ + \ + \ + \ + {% block title %}{% endblock %} - Purple I2P Webconsole \ + \ + {% endblock %} \ + \ + \ +
{% tr(\"i2pd webconsole\") %}
\ +
\ +
\ + {% tr(\"Main page\") %}

\ + {% tr(\"Router commands\") %}
\ + {% tr(\"Local Destinations\") %}
\ + {% if isFloodfill %} \ + {% tr(\"LeaseSets\") %}
\ + {% endif %} \ + {% tr(\"Tunnels\") %}
\ + {% if (acceptingTunnels || transitTunnels) %} \ + {% tr(\"Transit Tunnels\") %}
\ + {% endif %} \ + {% tr(\"Transports\") %}
\ + {% tr(\"I2P tunnels\") %}
\ + {% if samEnabled %} \ + {% tr(\"SAM sessions\") %}
\ + {% endif %} \ +
\ +
{% block content %}{% endblock %}
\ +
\ + \ +" + + const std::string pageMain = +"{% extends \"base.html\" %} \ +{% block title %}Main{% endblock %} \ +{% block content %} \ + {% tr(\"Uptime\") %}: {% getUptime() %}
\ + {% tr(\"Network status\") %}: {% getNetworkStatus(false) %}
\ + {% if supportsV6 %} \ + {% tr(\"Network status v6\") %}: {% getNetworkStatus(true) %}
\ + {% endif %} \ + {% if gracefulShutdown %} \ + {% tr(\"Stopping in\") %}: {% getShutdownTimer() %}
\ + {% endif %} \ + {% tr(\"Tunnel creation success rate\") %}: {% getSuccessRate() %}%
\ + {% tr(\"Received\") %}: {% getInBytes() %} ({% getInBW() %} {% tr(/* tr: Kibibit/s */ \"KiB/s\") %})
\ + {% tr(\"Sent\") %}: {% getOutBytes() %} ({% getOutBW() %} {% tr(/* tr: Kibibit/s */ \"KiB/s\") %})
\ + {% tr(\"Transit\") %}: {% getTransitBytes() %} ({% getTransitBW() %} {% tr(/* tr: Kibibit/s */ \"KiB/s\") %})
\ + {% tr(\"Data path\") %}: {% getDataPath() %}
\ + {% if notQt || withHiddenContent %} \ +
\ + \ + \ +
\ + {% tr(\"Router Ident\") %}: {% getRI() %}
\ + {% if lenght(family) %} \ + {% tr(\"Family\") %}: {{ family }}
\ + {% endif %} \ + {% tr(\"Router Caps\") %}: {% getCaps() %}
\ + {% tr(\"Version\") %}: {{ version }}
\ + {% tr(\"Our external address\") %}:
\ + \ + \ + {% for type, address in addresses %} \ + \ + {% endfor %} \ + \ +
{{ type }}{{ address }}
\ +
\ +
\ + {% else %} \ +
\ + {% endif %} \ + {% tr(\"Routers\") %}: {% getNumRouter() %} \ + {% tr(\"Floodfills\") %}: {% getNumFloodfills() %} \ + {% tr(\"LeaseSets\") %}: {% getNumLeaseSets() %}
\ + {% tr(\"Client Tunnels\") %}: {% getClientTunnelsCount() %} \ + {% tr(\"Transit Tunnels\") %}: {% getTransitTunnelsCount() %}
\ +
\ + {% if notQt == false %} \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
{% tr(\"Services\") %}
HTTP {% tr(\"Proxy\") %}{% if httpproxy %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
SOCKS {% tr(\"Proxy\") %}{% if socksproxy %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
BOB{% if bob %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
SAM{% if sam %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
I2CP{% if i2cp %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
I2PControl{% if i2pcontrol %}{% tr(\"Enabled\") %}{% else %}{% tr(\"Disabled\") %}{% endif %}
\ +{% endblock %}" + } // http } // i2p