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