From 8aa34ce408450f519fb4e2428853529a02a243e4 Mon Sep 17 00:00:00 2001 From: ollo Date: Thu, 29 Dec 2016 22:20:19 +0100 Subject: [PATCH] More content in the page added; parsers skips the amount of read bytes, not the amount of sent bytes --- webpage.html | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ webserver.lua | 5 +++-- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 webpage.html diff --git a/webpage.html b/webpage.html new file mode 100644 index 0000000..6b9daf4 --- /dev/null +++ b/webpage.html @@ -0,0 +1,56 @@ +WordClock Setup Page + + +

Welcome to the WordClock

+

Initial Setup

+Please note that all settings are mandatory

+
+ + + + + + + + + + + + +
WIFI-SSIDSSID of the wireless network
WIFI-PasswordPassword of the wireless network
SNTP ServerServer to sync the time with. Only one ntp server is allowed.
Offset to UTC timeDefine the offset to UTC time in hours. For example +1 hour for Germany
Color
1. Minute Color
2. Minute Color
3. Minute Color
4. Minute Color
+
diff --git a/webserver.lua b/webserver.lua index c08443c..6112685 100644 --- a/webserver.lua +++ b/webserver.lua @@ -29,6 +29,9 @@ function sendPage(conn, nameOfFile, replaceMap) local line = file.readline() while (line ~= nil) do + -- increase the amount of sent bytes + sentBytes=sentBytes+string.len(line) + -- all placeholder begin with a $, so search for it in the current line if (line:find("$") ~= nil) then -- Replace the placeholder with the dynamic content @@ -41,8 +44,6 @@ function sendPage(conn, nameOfFile, replaceMap) end buf = buf .. line - -- increase the amount of sent bytes - sentBytes=sentBytes+string.len(line) -- Sent after 1k data if (string.len(buf) >= 1000) then line=nil