mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-08-26 12:51:54 +00:00
Merge pull request #2220 from wipedlifepotato/httpTheme
feat: http theme for webconsole
This commit is contained in:
commit
1ffcb3d3de
@ -167,6 +167,11 @@ namespace http {
|
|||||||
{
|
{
|
||||||
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
std::string webroot; i2p::config::GetOption("http.webroot", webroot);
|
||||||
|
|
||||||
|
std::string theme; i2p::config::GetOption("http.theme", theme);
|
||||||
|
if(theme != "light" && theme != "black" ) theme = "light";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Page language
|
// Page language
|
||||||
std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage(); // get current used language
|
std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage(); // get current used language
|
||||||
auto it = i2p::i18n::languages.find(currLang);
|
auto it = i2p::i18n::languages.find(currLang);
|
||||||
@ -184,6 +189,17 @@ namespace http {
|
|||||||
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n"
|
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n"
|
||||||
" <title>" << tr(/* tr: Webconsole page title */ "Purple I2P Webconsole") << "</title>\r\n";
|
" <title>" << tr(/* tr: Webconsole page title */ "Purple I2P Webconsole") << "</title>\r\n";
|
||||||
GetStyles(s);
|
GetStyles(s);
|
||||||
|
if (theme == "black")
|
||||||
|
{
|
||||||
|
s <<
|
||||||
|
"<style>:root {\r\n"
|
||||||
|
"--main-bg-color: #242424;\r\n"
|
||||||
|
"--main-text-color: #17ab5c;\r\n"
|
||||||
|
"--main-link-color: #bf64b7;\r\n"
|
||||||
|
"--main-link-hover-color: #000000;\r\n"
|
||||||
|
"}\r\n</style>";
|
||||||
|
|
||||||
|
}
|
||||||
s <<
|
s <<
|
||||||
"</head>\r\n"
|
"</head>\r\n"
|
||||||
"<body>\r\n"
|
"<body>\r\n"
|
||||||
|
@ -97,6 +97,7 @@ namespace config {
|
|||||||
("http.webroot", value<std::string>()->default_value("/"), "WebUI root path (default: / )")
|
("http.webroot", value<std::string>()->default_value("/"), "WebUI root path (default: / )")
|
||||||
("http.lang", value<std::string>()->default_value("english"), "WebUI language (default: english )")
|
("http.lang", value<std::string>()->default_value("english"), "WebUI language (default: english )")
|
||||||
("http.showTotalTCSR", value<bool>()->default_value(false), "Show additional value with total TCSR since router's start (default: false)")
|
("http.showTotalTCSR", value<bool>()->default_value(false), "Show additional value with total TCSR since router's start (default: false)")
|
||||||
|
("http.theme", value<std::string>()->default_value("light"), "Theme for http web console")
|
||||||
;
|
;
|
||||||
|
|
||||||
options_description httpproxy("HTTP Proxy options");
|
options_description httpproxy("HTTP Proxy options");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user