Merge pull request #2221 from wipedlifepotato/httpTheme
Some checks are pending
Build Debian packages / bookworm (push) Waiting to run
Build Debian packages / bullseye (push) Waiting to run
Build Debian packages / trixie (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=no (push) Waiting to run
Build on OSX / With USE_UPNP=yes (push) Waiting to run
Build on Windows / clang-x86_64 (push) Waiting to run
Build on Windows / i686 (push) Waiting to run
Build on Windows / ucrt-x86_64 (push) Waiting to run
Build on Windows / x86_64 (push) Waiting to run
Build on Windows / CMake clang-x86_64 (push) Waiting to run
Build on Windows / CMake i686 (push) Waiting to run
Build on Windows / CMake ucrt-x86_64 (push) Waiting to run
Build on Windows / CMake x86_64 (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=no (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=yes (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=OFF (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=ON (push) Waiting to run
Build containers / Building container for linux/amd64 (push) Waiting to run
Build containers / Building container for linux/arm64 (push) Waiting to run
Build containers / Building container for linux/arm/v7 (push) Waiting to run
Build containers / Building container for linux/386 (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions

feat: custom http themes for webconsole
This commit is contained in:
orignal 2025-08-15 08:30:27 -04:00 committed by GitHub
commit 2a4a162941
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 172 additions and 4 deletions

View file

@ -42,10 +42,10 @@
namespace i2p {
namespace http {
static void LoadExtCSS ()
static void LoadExtCSS (std::string fileName = "style.css")
{
std::stringstream s;
std::string styleFile = i2p::fs::DataDirPath ("webconsole/style.css");
std::string styleFile = i2p::fs::DataDirPath ("webconsole/"+fileName+".css");
if (i2p::fs::Exists(styleFile)) {
std::ifstream f(styleFile, std::ifstream::binary);
s << f.rdbuf();
@ -168,7 +168,15 @@ 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";
if(theme != "light" && theme != "black" )
{
if (theme =="white") {
theme = "light";
} else {
LoadExtCSS(theme);
}
}