");
for(i = 0; i < CHANNEL_MAX; i++) {
@@ -204,8 +214,9 @@ int http_fn_index(http_request_t *request) {
int iValue;
iValue = CHANNEL_Get(i);
-
+ poststr(request, "");
hprintf128(request,"Temperature Channel %i value %i C ",i, iValue);
+ poststr(request, " ");
} else if(channelType == ChType_Temperature_div10) {
int iValue;
@@ -214,14 +225,18 @@ int http_fn_index(http_request_t *request) {
iValue = CHANNEL_Get(i);
fValue = iValue * 0.1f;
+ poststr(request, "");
hprintf128(request,"Temperature Channel %i value %f C ",i, fValue);
+ poststr(request, " ");
} else if(channelType == ChType_Humidity) {
int iValue;
iValue = CHANNEL_Get(i);
+ poststr(request, "");
hprintf128(request,"Humidity Channel %i value %i Percent ",i, iValue);
+ poststr(request, " ");
} else if(channelType == ChType_Humidity_div10) {
int iValue;
@@ -230,12 +245,16 @@ int http_fn_index(http_request_t *request) {
iValue = CHANNEL_Get(i);
fValue = iValue * 0.1f;
+ poststr(request, "");
hprintf128(request,"Humidity Channel %i value %f Percent ",i, fValue);
+ poststr(request, " ");
+
} else if(channelType == ChType_LowMidHigh) {
const char *types[]={"Low","Mid","High"};
int iValue;
iValue = CHANNEL_Get(i);
+ poststr(request, "");
hprintf128(request,"Select speed:
");
- hprintf128(request," ");
+ poststr(request, " ");
+
} else if(channelType == ChType_OffLowMidHigh || channelType == ChType_OffLowestLowMidHighHighest || channelType == ChType_LowestLowMidHighHighest) {
const char **types;
const char *types4[] = {"Off","Low","Mid","High"};
@@ -269,6 +289,7 @@ int http_fn_index(http_request_t *request) {
iValue = CHANNEL_Get(i);
+ poststr(request, "");
hprintf128(request,"Select speed:
");
- hprintf128(request," ");
+ poststr(request, " ");
+
} else if(channelType == ChType_TextField) {
int iValue;
iValue = CHANNEL_Get(i);
+ poststr(request, "");
hprintf128(request,"Change channel %i value:
");
hprintf128(request,"");
- hprintf128(request," ");
+ poststr(request, " ");
+
} else if(channelType == ChType_ReadOnly) {
int iValue;
iValue = CHANNEL_Get(i);
+ poststr(request, "");
hprintf128(request,"Channel %i = %i",i,iValue);
- hprintf128(request," ");
+ poststr(request, " ");
}
else if (h_isChannelRelay(i) || channelType == ChType_Toggle) {
if (i <= 1) {
- hprintf128(request, "", CHANNEL_MAX);
+ hprintf128(request, " ");
}
const char *c;
if(CHANNEL_Check(i)) {
@@ -323,20 +348,15 @@ int http_fn_index(http_request_t *request) {
int pwmValue;
pwmValue = CHANNEL_Get(i);
+ poststr(request, " ");
hprintf128(request,"",i);
-
-
- poststr(request,"");
+ hprintf128(request," ",i);
+ poststr(request, " ");
}
}
+
if(bRawPWMs == 0 || forceShowRGBCW) {
int c_pwms;
int lm;
@@ -355,11 +375,11 @@ int http_fn_index(http_request_t *request) {
} else {
c = "bred";
}
- poststr(request, "");
- poststr(request,"",c);
+ poststr(request, " ");
}
if(c_pwms > 0) {
@@ -370,21 +390,13 @@ int http_fn_index(http_request_t *request) {
pwmValue = LED_GetDimmer();
- poststr(request, "");
+ poststr(request, " ");
hprintf128(request," LED Dimmer/Brightness ");
hprintf128(request,"",SPECIAL_CHANNEL_BRIGHTNESS);
- hprintf128(request," ",inputName,SPECIAL_CHANNEL_BRIGHTNESS,pwmValue);
+ hprintf128(request," ",inputName,SPECIAL_CHANNEL_BRIGHTNESS,pwmValue);
hprintf128(request," ",inputName,SPECIAL_CHANNEL_BRIGHTNESS);
hprintf128(request," ",SPECIAL_CHANNEL_BRIGHTNESS);
-
-
- poststr(request,"");
- poststr(request, " ");
+ poststr(request, "");
}
if(c_pwms >= 3) {
char colorValue[16];
@@ -395,21 +407,13 @@ int http_fn_index(http_request_t *request) {
}
LED_GetBaseColorString(colorValue);
-
+ poststr(request, "");
hprintf128(request," LED RGB Color %s ",activeStr);
hprintf128(request,"",SPECIAL_CHANNEL_BASECOLOR);
- hprintf128(request," ",inputName,SPECIAL_CHANNEL_BASECOLOR,colorValue);
+ hprintf128(request," ",inputName,SPECIAL_CHANNEL_BASECOLOR,colorValue);
hprintf128(request," ",inputName,SPECIAL_CHANNEL_BASECOLOR);
hprintf128(request," ");
-
-
- poststr(request,"");
-
+ poststr(request, " ");
}
if(c_pwms == 2 || c_pwms == 5) {
// TODO: temperature slider
@@ -424,24 +428,14 @@ int http_fn_index(http_request_t *request) {
pwmValue = LED_GetTemperature();
- poststr(request, "");
+ poststr(request, " ");
hprintf128(request," LED Temperature Slider %s (cur=%i, min=%i, max=%i) (Cold <--- ---> Warm) ",activeStr,pwmValue,HASS_TEMPERATURE_MIN,HASS_TEMPERATURE_MAX);
hprintf128(request,"",SPECIAL_CHANNEL_TEMPERATURE);
hprintf128(request," ",inputName,SPECIAL_CHANNEL_TEMPERATURE,pwmValue);
+ hprintf128(request,"name=\"%s\" id=\"slider%i\" value=\"%i\" onchange=\"this.form.submit()\">",inputName,SPECIAL_CHANNEL_TEMPERATURE,pwmValue);
hprintf128(request," ",inputName,SPECIAL_CHANNEL_TEMPERATURE);
hprintf128(request," ",SPECIAL_CHANNEL_TEMPERATURE);
-
-
- poststr(request,"");
- poststr(request, " ");
-
-
+ poststr(request, "");
}
}
@@ -450,21 +444,6 @@ int http_fn_index(http_request_t *request) {
DRV_AppendInformationToHTTPIndexPage(request);
#endif
- if(http_getArg(request->url,"restart",tmpA,sizeof(tmpA))) {
- poststr(request," Module will restart soon ");
- RESET_ScheduleModuleReset(3);
- }
-
- poststr(request," ");
-
- poststr(request,"\
- \
- \
- ");
-
- poststr(request," ");
- poststr(request," ");
-
if(1) {
int bFirst = true;
hprintf128(request,"");
@@ -486,10 +465,56 @@ int http_fn_index(http_request_t *request) {
hprintf128(request,"Ping watchdog - %i lost, %i ok! ",
PingWatchDog_GetTotalLost(),PingWatchDog_GetTotalReceived());
+ // for normal page loads, show the rest of the HTML
+ if(!http_getArg(request->url,"state",tmpA,sizeof(tmpA))) {
+ poststr(request, ""); // end div#state
- poststr(request,htmlRefresh);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ // Shared UI elements
+ poststr(request, " ");
+
+ poststr(request, ""
+ " "
+ " "
+ " ");
+
+ poststr(request, " ");
+ poststr(request, " ");
+
+ poststr(request, htmlFooterRefreshLink);
+ http_html_end(request);
+
+ // refresh status section every 3 seconds
+ poststr(
+ request,
+ ""
+ );
+ }
poststr(request, NULL);
return 0;
@@ -497,12 +522,10 @@ int http_fn_index(http_request_t *request) {
int http_fn_about(http_request_t *request){
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "About");
poststr(request,"Open source firmware for BK7231N, BK7231T, XR809 and BL602 by OpenSHWProjects ");
- poststr(request,htmlReturnToMenu);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToMenu);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -513,8 +536,7 @@ int http_fn_about(http_request_t *request){
int http_fn_cfg_mqtt(http_request_t *request) {
int i;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "MQTT");
poststr(request," Use this to connect to your MQTT ");
poststr(request,"\
Host: \
@@ -542,9 +564,8 @@ int http_fn_cfg_mqtt(http_request_t *request) {
poststr(request,"\"> \
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -552,8 +573,7 @@ int http_fn_cfg_mqtt(http_request_t *request) {
int http_fn_cfg_mqtt_set(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Saving MQTT");
if(http_getArg(request->url,"host",tmpA,sizeof(tmpA))) {
CFG_SetMQTTHost(tmpA);
@@ -578,21 +598,15 @@ int http_fn_cfg_mqtt_set(http_request_t *request) {
poststr(request," ");
poststr(request,"Return to MQTT settings ");
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
-
-
-
int http_fn_cfg_webapp(http_request_t *request) {
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set Webapp");
poststr(request," Use this to set the URL of the Webapp ");
poststr(request,"\
Url: \
@@ -601,9 +615,8 @@ int http_fn_cfg_webapp(http_request_t *request) {
poststr(request,"\"> \
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -611,8 +624,7 @@ int http_fn_cfg_webapp(http_request_t *request) {
int http_fn_cfg_webapp_set(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Saving Webapp");
if(http_getArg(request->url,"url",tmpA,sizeof(tmpA))) {
if(CFG_SetWebappRoot(tmpA)) {
@@ -625,9 +637,8 @@ int http_fn_cfg_webapp_set(http_request_t *request) {
}
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -643,8 +654,7 @@ int http_fn_cfg_ping(http_request_t *request) {
int bChanged;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set Watchdog");
bChanged = 0;
poststr(request," Ping watchdog (backup reconnect mechanism) ");
poststr(request," By default, all OpenBeken devices automatically tries to reconnect to WiFi when a connection is lost.");
@@ -704,10 +714,8 @@ int http_fn_cfg_ping(http_request_t *request) {
poststr(request,"\"> \
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -717,8 +725,7 @@ int http_fn_cfg_wifi(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set Wifi");
/*bChanged = 0;
if(http_getArg(recvbuf,"ssid",tmpA,sizeof(tmpA))) {
CFG_SetWiFiSSID(tmpA);
@@ -801,10 +808,8 @@ int http_fn_cfg_wifi(http_request_t *request) {
poststr(request,"\"> \
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -815,8 +820,7 @@ int http_fn_cfg_name(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set name");
poststr(request,"
Change device names for display. ");
if(http_getArg(request->url,"shortName",tmpA,sizeof(tmpA))) {
@@ -844,20 +848,21 @@ int http_fn_cfg_name(http_request_t *request) {
"Short name might be used by Home Assistant, "
"so you will have to reconfig some stuff.')\">");
poststr(request, "");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ //poststr(request,htmlReturnToCfg);
+ //HTTP_AddBuildFooter(request);
+ //poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
+
int http_fn_cfg_wifi_set(http_request_t *request) {
char tmpA[128];
addLogAdv(LOG_INFO, LOG_FEATURE_HTTP,"HTTP_ProcessPacket: generating cfg_wifi_set \r\n");
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Saving Wifi");
if(http_getArg(request->url,"open",tmpA,sizeof(tmpA))) {
CFG_SetWiFiSSID("");
CFG_SetWiFiPass("");
@@ -879,24 +884,18 @@ int http_fn_cfg_wifi_set(http_request_t *request) {
poststr(request," ");
poststr(request,"Return to WiFi settings ");
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
-
-
-
int http_fn_cfg_loglevel_set(http_request_t *request) {
char tmpA[128];
addLogAdv(LOG_INFO, LOG_FEATURE_HTTP,"HTTP_ProcessPacket: generating cfg_loglevel_set \r\n");
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set log level");
if(http_getArg(request->url,"loglevel",tmpA,sizeof(tmpA))) {
#if WINDOWS
#else
@@ -919,9 +918,8 @@ int http_fn_cfg_loglevel_set(http_request_t *request) {
poststr(request," ");
poststr(request,"Return to config settings ");
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -934,8 +932,7 @@ int http_fn_cfg_mac(http_request_t *request) {
int i;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set MAC address");
if(http_getArg(request->url,"mac",tmpA,sizeof(tmpA))) {
for( i = 0; i < 6; i++ )
@@ -953,7 +950,6 @@ int http_fn_cfg_mac(http_request_t *request) {
WiFI_GetMacAddress((char *)mac);
-
poststr(request," Here you can change MAC address. ");
poststr(request,"\
MAC: \
@@ -962,10 +958,8 @@ int http_fn_cfg_mac(http_request_t *request) {
poststr(request,"\"> \
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -983,8 +977,7 @@ int http_fn_flash_read_tool(http_request_t *request) {
char tmpB[64];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Flash read");
poststr(request,"Flash Read Tool ");
if( http_getArg(request->url,"hex",tmpA,sizeof(tmpA))){
hex = atoi(tmpA);
@@ -1058,11 +1051,8 @@ int http_fn_flash_read_tool(http_request_t *request) {
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1078,8 +1068,7 @@ int http_fn_cmd_tool(http_request_t *request) {
//char tmpB[64];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Command tool");
poststr(request,"Command Tool ");
if( http_getArg(request->url,"cmd",tmpA,sizeof(tmpA))) {
@@ -1100,11 +1089,8 @@ int http_fn_cmd_tool(http_request_t *request) {
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1113,8 +1099,7 @@ int http_fn_startup_command(http_request_t *request) {
char tmpA[512];
const char *cmd;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Set startup command");
poststr(request,"Set/Change/Clear startup command line ");
poststr(request,"Startup command is a shorter, smaller alternative to LittleFS autoexec.bat."
"The startup commands are ran at device startup."
@@ -1143,11 +1128,8 @@ int http_fn_startup_command(http_request_t *request) {
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1155,12 +1137,9 @@ int http_fn_uart_tool(http_request_t *request) {
char tmpA[256];
int resultLen = 0;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "UART tool");
poststr(request,"UART Tool ");
-
-
if(http_getArg(request->url,"data",tmpA,sizeof(tmpA))) {
#ifndef OBK_DISABLE_ALL_DRIVERS
byte results[128];
@@ -1196,25 +1175,19 @@ int http_fn_uart_tool(http_request_t *request) {
\
");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
int http_fn_config_dump_table(http_request_t *request) {
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
-
+ http_html_start(request, "Dump config");
poststr(request,"Not implemented ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1226,8 +1199,7 @@ int http_fn_cfg_quick(http_request_t *request) {
char tmpA[128];
int j;
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Quick Config");
poststr(request,"Quick Config ");
if(http_getArg(request->url,"dev",tmpA,sizeof(tmpA))) {
@@ -1243,10 +1215,8 @@ int http_fn_cfg_quick(http_request_t *request) {
poststr(request,"");
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1278,8 +1248,7 @@ int http_fn_cfg_ha(http_request_t *request) {
clientId = CFG_GetMQTTClientId();
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Home Assistant Setup");
poststr(request,"Home Assistant Cfg ");
hprintf128(request,"Note that your short device name is: %s ",shortDeviceName);
poststr(request,"Paste this to configuration yaml ");
@@ -1362,10 +1331,8 @@ int http_fn_cfg_ha(http_request_t *request) {
poststr(request,"");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1503,8 +1470,7 @@ int http_fn_cm(http_request_t *request) {
int http_fn_cfg(http_request_t *request) {
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Config");
poststr(request," ");
poststr(request," ");
poststr(request," ");
@@ -1536,9 +1502,8 @@ int http_fn_cfg(http_request_t *request) {
}
#endif
#endif
- poststr(request,htmlReturnToMenu);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
+ poststr(request,htmlFooterReturnToMenu);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1551,8 +1516,7 @@ int http_fn_cfg_pins(http_request_t *request) {
char tmpB[64];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Pin config");
poststr(request," First textfield is used to enter channel index (relay index), used to support multiple relays and buttons ");
poststr(request," (so, first button and first relay should have channel 1, second button and second relay have channel 2, etc) ");
poststr(request," Second textfield (only for buttons) is used to enter channel to toggle when doing double click ");
@@ -1608,7 +1572,11 @@ int http_fn_cfg_pins(http_request_t *request) {
}
}
if(iChangedRequested>0) {
- CFG_Save_SetupTimer();
+ // Anecdotally, if pins are configured badly, the
+ // second-timer breaks. To reconfigure, force
+ // saving the configuration instead of waiting.
+ //CFG_Save_SetupTimer();
+ CFG_Save_IfThereArePendingChanges();
hprintf128(request, "Pins update - %i reqs, %i changed! ",iChangedRequested,iChanged);
}
// strcat(outbuf,"Click Me! ");
@@ -1663,10 +1631,8 @@ int http_fn_cfg_pins(http_request_t *request) {
}
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1694,8 +1660,7 @@ int http_fn_cfg_generic(http_request_t *request) {
char tmpB[64];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Generic config");
if( http_getArg(request->url,"boot_ok_delay",tmpA,sizeof(tmpA))) {
i = atoi(tmpA);
@@ -1751,10 +1716,8 @@ int http_fn_cfg_generic(http_request_t *request) {
poststr(request,"\"> ");
poststr(request," ");
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1765,9 +1728,7 @@ int http_fn_cfg_startup(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
-
+ http_html_start(request, "Config startup");
hprintf128(request,"Here you can set pin start values");
hprintf128(request,"For relays, simply use 1 or 0 ");
hprintf128(request,"For 'remember last power state', use -1 as a special value ");
@@ -1811,10 +1772,8 @@ int http_fn_cfg_startup(http_request_t *request) {
}
}
- poststr(request,htmlReturnToCfg);
- HTTP_AddBuildFooter(request);
- poststr(request,htmlEnd);
-
+ poststr(request,htmlFooterReturnToCfgLink);
+ http_html_end(request);
poststr(request, NULL);
return 0;
}
@@ -1823,8 +1782,7 @@ int http_fn_cfg_dgr(http_request_t *request) {
char tmpA[128];
http_setup(request, httpMimeTypeHTML);
- poststr(request,htmlHeader);
- HTTP_AddHeader(request);
+ http_html_start(request, "Device groups");
hprintf128(request,"Here you can configure Tasmota Device Groups");
@@ -1903,10 +1861,8 @@ int http_fn_cfg_dgr(http_request_t *request) {
poststr(request,"
Simple OTA system (you should rather use the OTA from App panel where you can drag and drop file easily without setting up server). Use RBL file for OTA. In the OTA below, you should paste link to RBL file (you need HTTP server).
");
poststr(request,"