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:
14
tools/create_tz_json.sh
Normal file
14
tools/create_tz_json.sh
Normal 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
tools/post_build.py
Normal file
9
tools/post_build.py
Normal 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)
|
Reference in New Issue
Block a user