diff --git a/Kconfig b/Kconfig index ba932ab..2c3f773 100644 --- a/Kconfig +++ b/Kconfig @@ -54,6 +54,14 @@ menu "WebGUIApp" default n help This will reset to default settings on every startup + + menu "Web UI settings" + config WEBGUIAPP_ACCENT_COLOR + string "Accent color code for web ui" + default "#dba617" + help + Set accent color for user web ui + endmenu menu "OTA settings" config WEBGUIAPP_OTA_AUTOUPDATE_ENABLE diff --git a/src/HTTPPrintSystem.c b/src/HTTPPrintSystem.c index 3e0bd4a..99076a5 100644 --- a/src/HTTPPrintSystem.c +++ b/src/HTTPPrintSystem.c @@ -116,6 +116,12 @@ static void PrintCheckbox(char *VarData, void *arg, bool checked) snprintf(VarData, MAX_DYNVAR_LENGTH, " "); } +static void HTTPPrint_actclr(char *VarData, void *arg) +{ + snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", CONFIG_WEBGUIAPP_ACCENT_COLOR); +} + + static void HTTPPrint_name(char *VarData, void *arg) { snprintf(VarData, MAX_DYNVAR_LENGTH, "%s", CONFIG_DEVICE_MODEL_NAME); @@ -713,7 +719,10 @@ static void HTTPPrint_DEF(char *VarData, void *arg) } dyn_var_handler_t HANDLERS_ARRAY[] = { - /*Ststem settings*/ + /*GUI settings*/ + { "actclr", sizeof("actclr") - 1, &HTTPPrint_actclr }, + + /*System settings*/ { "name", sizeof("name") - 1, &HTTPPrint_name }, { "dname", sizeof("dname") - 1, &HTTPPrint_dname }, { "login", sizeof("login") - 1, &HTTPPrint_login }, diff --git a/src/HTTPServer.c b/src/HTTPServer.c index f13d364..b0a4cd3 100644 --- a/src/HTTPServer.c +++ b/src/HTTPServer.c @@ -355,7 +355,10 @@ static esp_err_t GETHandler(httpd_req_t *req) } //check if the file can contains dynamic variables - if (IS_FILE_EXT(filename, ".html") || IS_FILE_EXT(filename, ".json") || IS_FILE_EXT(filename, ".js")) + if (IS_FILE_EXT(filename, ".html") || + IS_FILE_EXT(filename, ".json") || + IS_FILE_EXT(filename, ".css") || + IS_FILE_EXT(filename, ".js")) isDynamicVars = true; do {