From aa3592386374a54dd26675a2341f12aeb74db881 Mon Sep 17 00:00:00 2001 From: Karai Csaba Date: Thu, 28 Apr 2016 23:18:00 +0200 Subject: [PATCH] Skeleton for the web-server page --- esp-link/cgi.c | 1 + esp-link/cgiservices.c | 2 ++ html/home.html | 6 ++++++ html/web-server.html | 12 ++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 html/web-server.html diff --git a/esp-link/cgi.c b/esp-link/cgi.c index d0f7fb6..825fe52 100644 --- a/esp-link/cgi.c +++ b/esp-link/cgi.c @@ -215,6 +215,7 @@ int ICACHE_FLASH_ATTR cgiMenu(HttpdConnData *connData) { #endif "\"Debug log\", \"/log.html\"," "\"Upgrade Firmware\", \"/flash.html\"" + "\"Web Server\", \"/web-server.html\"" " ], " "\"version\": \"%s\", " "\"name\": \"%s\"" diff --git a/esp-link/cgiservices.c b/esp-link/cgiservices.c index 200039d..ef76287 100644 --- a/esp-link/cgiservices.c +++ b/esp-link/cgiservices.c @@ -68,6 +68,7 @@ int ICACHE_FLASH_ATTR cgiSystemInfo(HttpdConnData *connData) { "\"name\": \"%s\", " "\"reset cause\": \"%d=%s\", " "\"size\": \"%s\", " + "\"upload-size\": \"%d\", " "\"id\": \"0x%02X 0x%04X\", " "\"partition\": \"%s\", " "\"slip\": \"%s\", " @@ -79,6 +80,7 @@ int ICACHE_FLASH_ATTR cgiSystemInfo(HttpdConnData *connData) { rst_info->reason, rst_codes[rst_info->reason], flash_maps[system_get_flash_size_map()], + getUserPageSectionEnd()-getUserPageSectionStart(), fid & 0xff, (fid & 0xff00) | ((fid >> 16) & 0xff), part_id ? "user2.bin" : "user1.bin", flashConfig.slip_enable ? "enabled" : "disabled", diff --git a/html/home.html b/html/home.html index 138222e..de9862f 100644 --- a/html/home.html +++ b/html/home.html @@ -123,6 +123,12 @@ + Webpage size +
+ + +
+ Current partition Description:
diff --git a/html/web-server.html b/html/web-server.html new file mode 100644 index 0000000..f509230 --- /dev/null +++ b/html/web-server.html @@ -0,0 +1,12 @@ +
+
+

Web Server

+
+ +
+

User defined web pages can be uploaded to esp-link. This is useful if esp-link acts as a web server while MCU provides + the measurement data.

+
+ +
+ \ No newline at end of file