This commit is contained in:
Wolfgang Hottgenroth
2017-08-20 23:29:14 +02:00
parent 5281b6d075
commit b92451eb98
8 changed files with 104 additions and 50 deletions

View File

@ -12,8 +12,10 @@ tConfigBlock configBlock;
const uint32_t MAGIC = 0xC0DE0001;
extern ESP8266WebServer webServer;
void configServeIndex() {
webServer.send(200, "text/html", ""
webServer.send(200, "text/html",
""
"<!doctype html"
"<html lang=\"en\">"
" <head>"
@ -29,7 +31,8 @@ void configServeIndex() {
" <td>"
" <label for\"$configItem.key\">$configItem.label</label>"
" </td><td>"
" <input type=\"text\" name=\"$configItem.key\" id=\"$configItem.key\"/>"
" <input type=\"text\" name=\"$configItem.key\" id=\"$configItem.key\""
" />"
" </td>"
" </tr>"
#end if
@ -43,7 +46,9 @@ void configServeIndex() {
" </form>"
" </body>"
"</html>"
"");
);
#ifdef DEBUG
Serial.println("indexHtml request served");
#endif
@ -62,4 +67,17 @@ void configServeGetConfiguration() {
webServer.send(200, "text/html", "configuration saved");
}
void showConfiguration() {
Serial.println("Configuration is");
#for $configItem in $configItems
#if $configItem.label != "_"
Serial.print("$configItem.key = ");
Serial.println(configBlock.$configItem.key);
#end if
#end for
Serial.println("---");
}