Webinterface: index.html and timezones.json are now saved to the Flash as GZIP compressed binary data. Compression happens on-the-fly during pio run.

This commit is contained in:
fabian committed 2019-12-04 06:13:07 +01:00
1 parent 84530f76fd
commit fad4f2c707
7 files changed
+505 -42

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/bash
URL="https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv"
(
first=1
echo "{\"timezones\": {"
curl --silent "$URL" | while read line; do
[ $first -ne 1 ] && echo ","
first=0
echo -n "${line/\",\"/\":\"}"
done
echo
echo "}}"
) > src/webinterface/timezones.json
+9
View File
@@ -0,0 +1,9 @@
Import("env")
env.Execute("gzip -9 < src/webinterface/index.html > src/webinterface/index.html.gz")
env.Execute("gzip -9 < src/webinterface/timezones.json > src/webinterface/timezones.json.gz")
def build(source, target, env):
env.Execute("rm src/webinterface/index.html.gz src/webinterface/timezones.json.gz")
env.AddPostAction("buildprog", build)