diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index 8ed8798cb..119efc930 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -659,8 +659,10 @@ int HTTP_ProcessPacket(http_request_t *request) { if(http_getArg(urlStr,"url",tmpA,sizeof(tmpA))) { CFG_SetWebappRoot(tmpA); + hprintf128(request,"Webapp url set to %s", tmpA); + } else { + poststr(request,"Webapp url not set"); } - poststr(request,"Webapp url set!"); poststr(request,"
"); poststr(request,htmlReturnToCfg); diff --git a/src/httpserver/rest_interface.c b/src/httpserver/rest_interface.c index eebb2ba5e..37ca993cb 100644 --- a/src/httpserver/rest_interface.c +++ b/src/httpserver/rest_interface.c @@ -503,8 +503,8 @@ static int http_rest_get_info(http_request_t *request){ hprintf128(request, "\"ip\":\"%s\",", getMyIp()); hprintf128(request, "\"mac\":\"%s\",", getMACStr(macstr)); hprintf128(request, "\"mqtthost\":\"%s:%d\",", CFG_GetMQTTHost(), CFG_GetMQTTPort()); - hprintf128(request, "\"mqtttopic\":\"%s\"}", CFG_GetShortDeviceName()); - + hprintf128(request, "\"mqtttopic\":\"%s\",", CFG_GetShortDeviceName()); + hprintf128(request, "\"webapp\":\"%s\"}", CFG_GetWebappRoot()); poststr(request, NULL); return 0; diff --git a/src/new_cfg.c b/src/new_cfg.c index dd746e681..71832da0c 100644 --- a/src/new_cfg.c +++ b/src/new_cfg.c @@ -71,8 +71,10 @@ void CFG_SetWebappRoot(const char *s) { int res; CONFIG_INIT_ITEM(CONFIG_TYPE_WEBAPP_ROOT, &item); res = config_get_item(&item); - if (res) - strcpy_safe(g_webappRoot, item.url,sizeof(g_webappRoot)); + strcpy_safe(item.url, s,sizeof(item.url)); + strcpy_safe(g_webappRoot, item.url,sizeof(g_webappRoot)); + + config_save_item(&item); #endif }