mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-08-26 10:10:24 +01:00
Merge pull request #2220 from wipedlifepotato/httpTheme
feat: http theme for webconsole
This commit is contained in:
commit
1ffcb3d3de
2 changed files with 17 additions and 0 deletions
|
@ -167,6 +167,11 @@ namespace http {
|
|||
{
|
||||
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
|
||||
std::string currLang = i2p::client::context.GetLanguage ()->GetLanguage(); // get current used language
|
||||
auto it = i2p::i18n::languages.find(currLang);
|
||||
|
@ -184,6 +189,17 @@ namespace http {
|
|||
" <link rel=\"shortcut icon\" href=\"" << itoopieFavicon << "\">\r\n"
|
||||
" <title>" << tr(/* tr: Webconsole page title */ "Purple I2P Webconsole") << "</title>\r\n";
|
||||
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 <<
|
||||
"</head>\r\n"
|
||||
"<body>\r\n"
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace config {
|
|||
("http.webroot", value<std::string>()->default_value("/"), "WebUI root path (default: / )")
|
||||
("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.theme", value<std::string>()->default_value("light"), "Theme for http web console")
|
||||
;
|
||||
|
||||
options_description httpproxy("HTTP Proxy options");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue