Skip to content

Commit

Permalink
added missing files to ui v2
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed Dec 20, 2022
1 parent f2c73a4 commit 35685a1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 59 deletions.
2 changes: 1 addition & 1 deletion openevse-gui-v2
Submodule openevse-gui-v2 updated from 454a8d to 37df0e
10 changes: 8 additions & 2 deletions scripts/extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def data_to_header(env, target, source):
for source_file in source:
#print("Reading {}".format(source_file))
file = source_file.get_abspath()
if file.endswith(".css") or file.endswith(".js") or file.endswith(".htm") or file.endswith(".html") or file.endswith(".svg") or file.endswith(".json"):
if file.endswith(".css") or file.endswith(".js") or file.endswith(".htm") or file.endswith(".html") or file.endswith(".svg") or file.endswith(".json") or file.endswith(".webmanifest"):
output += text_to_header(file)
else:
output += binary_to_header(file)
Expand All @@ -77,7 +77,7 @@ def filtered_listdir_scan(dir):
out_files = []
for file in listdir(dir):
path = join(dir, file)
if isfile(path) and (pathlib.Path(file).suffix in (".html", ".js", ".css", ".json", ".gz", ".png", ".jpg", ".ico")):
if isfile(path) and (pathlib.Path(file).suffix in (".html", ".js", ".css", ".json", ".gz", ".png", ".jpg", ".ico", ".woff", ".woff2", ".webmanifest")):
out_files.append(path)
elif isdir(path):
out_files.extend(filtered_listdir_scan(path))
Expand Down Expand Up @@ -138,6 +138,12 @@ def make_static(env, target, source):
filetype = "SVG"
elif out_file.endswith(".json") or out_file.endswith(".json.gz"):
filetype = "JSON"
elif out_file.endswith(".woff"):
filetype = "WOFF"
elif out_file.endswith(".woff2"):
filetype = "WOFF2"
elif out_file.endswith(".webmanifest"):
filetype = "MANIFEST"

if filetype is not None:
c_name = get_c_name(out_file)
Expand Down
1 change: 1 addition & 0 deletions src/web_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const char _CONTENT_TYPE_SVG[] PROGMEM = "image/svg+xml";
const char _CONTENT_TYPE_ICO[] PROGMEM = "image/vnd.microsoft.icon";
const char _CONTENT_TYPE_WOFF[] PROGMEM = "font/woff";
const char _CONTENT_TYPE_WOFF2[] PROGMEM = "font/woff2";
const char _CONTENT_TYPE_MANIFEST[] PROGMEM = "application/manifest+json";

#define RAPI_RESPONSE_BLOCKED -300

Expand Down
2 changes: 2 additions & 0 deletions src/web_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extern const char _CONTENT_TYPE_WOFF[];
extern const char _CONTENT_TYPE_WOFF2[];
#define CONTENT_TYPE_WOFF2 FPSTR(_CONTENT_TYPE_WOFF2)

extern const char _CONTENT_TYPE_MANIFEST[];
#define CONTENT_TYPE_MANIFEST FPSTR(_CONTENT_TYPE_MANIFEST)

extern MongooseHttpServer server;

Expand Down
90 changes: 34 additions & 56 deletions src/web_static/web_server_static_files.h
Original file line number Diff line number Diff line change
@@ -1,58 +1,36 @@
#include "web_server.arduinoocpp_png.h"
#include "web_server.assets_js.h"
#include "web_server.emoncms_jpg.h"
#include "web_server.favicon_152_png.h"
#include "web_server.favicon_167_png.h"
#include "web_server.favicon_16x16_png.h"
#include "web_server.favicon_180_png.h"
#include "web_server.favicon_32x32_png.h"
#include "web_server.home_html_gz.h"
#include "web_server.home_js_gz.h"
#include "web_server.jquery_js_gz.h"
#include "web_server.lib_js_gz.h"
#include "web_server.localisation_js_gz.h"
#include "web_server.mqtt_png.h"
#include "web_server.ohm_jpg.h"
#include "web_server.shaper_png.h"
#include "web_server.solar_png.h"
#include "web_server.style_css_gz.h"
#include "web_server.term_html_gz.h"
#include "web_server.term_js_gz.h"
#include "web_server.wifi_portal_html_gz.h"
#include "web_server.wifi_portal_js_gz.h"
#include "web_server.wifi_signal_1_svg_gz.h"
#include "web_server.wifi_signal_2_svg_gz.h"
#include "web_server.wifi_signal_3_svg_gz.h"
#include "web_server.wifi_signal_4_svg_gz.h"
#include "web_server.wifi_signal_5_svg_gz.h"
#include "web_server.zones_json_gz.h"
#include "web_server.assets_favicon_1cdb852f_ico.h"
#include "web_server.assets_index_7a449041_css_gz.h"
#include "web_server.assets_index_efb4d96d_js_gz.h"
#include "web_server.assets_logo_mini_448a8e02_png.h"
#include "web_server.assets_roboto_all_400_normal_e41533d5_woff.h"
#include "web_server.assets_roboto_cyrillic_400_normal_495d38d4_woff2.h"
#include "web_server.assets_roboto_cyrillic_ext_400_normal_b7ef2cd1_woff2.h"
#include "web_server.assets_roboto_greek_400_normal_daf51ab5_woff2.h"
#include "web_server.assets_roboto_latin_400_normal_f6734f81_woff2.h"
#include "web_server.assets_roboto_latin_ext_400_normal_3c23eb02_woff2.h"
#include "web_server.assets_roboto_vietnamese_400_normal_77b24796_woff2.h"
#include "web_server.index_html.h"
#include "web_server.manifest_webmanifest.h"
#include "web_server.pwa_192x192_png.h"
#include "web_server.pwa_512x512_png.h"
#include "web_server.pwa_masquable_png.h"
#include "web_server.sw_js.h"
StaticFile staticFiles[] = {
{ "/arduinoocpp.png", CONTENT_ARDUINOOCPP_PNG, sizeof(CONTENT_ARDUINOOCPP_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_ARDUINOOCPP_PNG_ETAG, false },
{ "/assets.js", CONTENT_ASSETS_JS, sizeof(CONTENT_ASSETS_JS) - 1, _CONTENT_TYPE_JS, CONTENT_ASSETS_JS_ETAG, false },
{ "/emoncms.jpg", CONTENT_EMONCMS_JPG, sizeof(CONTENT_EMONCMS_JPG) - 1, _CONTENT_TYPE_JPEG, CONTENT_EMONCMS_JPG_ETAG, false },
{ "/favicon-152.png", CONTENT_FAVICON_152_PNG, sizeof(CONTENT_FAVICON_152_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_FAVICON_152_PNG_ETAG, false },
{ "/favicon-167.png", CONTENT_FAVICON_167_PNG, sizeof(CONTENT_FAVICON_167_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_FAVICON_167_PNG_ETAG, false },
{ "/favicon-16x16.png", CONTENT_FAVICON_16X16_PNG, sizeof(CONTENT_FAVICON_16X16_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_FAVICON_16X16_PNG_ETAG, false },
{ "/favicon-180.png", CONTENT_FAVICON_180_PNG, sizeof(CONTENT_FAVICON_180_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_FAVICON_180_PNG_ETAG, false },
{ "/favicon-32x32.png", CONTENT_FAVICON_32X32_PNG, sizeof(CONTENT_FAVICON_32X32_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_FAVICON_32X32_PNG_ETAG, false },
{ "/home.html", CONTENT_HOME_HTML_GZ, sizeof(CONTENT_HOME_HTML_GZ) - 1, _CONTENT_TYPE_HTML, CONTENT_HOME_HTML_GZ_ETAG, true },
{ "/home.js", CONTENT_HOME_JS_GZ, sizeof(CONTENT_HOME_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_HOME_JS_GZ_ETAG, true },
{ "/jquery.js", CONTENT_JQUERY_JS_GZ, sizeof(CONTENT_JQUERY_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_JQUERY_JS_GZ_ETAG, true },
{ "/lib.js", CONTENT_LIB_JS_GZ, sizeof(CONTENT_LIB_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_LIB_JS_GZ_ETAG, true },
{ "/localisation.js", CONTENT_LOCALISATION_JS_GZ, sizeof(CONTENT_LOCALISATION_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_LOCALISATION_JS_GZ_ETAG, true },
{ "/mqtt.png", CONTENT_MQTT_PNG, sizeof(CONTENT_MQTT_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_MQTT_PNG_ETAG, false },
{ "/ohm.jpg", CONTENT_OHM_JPG, sizeof(CONTENT_OHM_JPG) - 1, _CONTENT_TYPE_JPEG, CONTENT_OHM_JPG_ETAG, false },
{ "/shaper.png", CONTENT_SHAPER_PNG, sizeof(CONTENT_SHAPER_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_SHAPER_PNG_ETAG, false },
{ "/solar.png", CONTENT_SOLAR_PNG, sizeof(CONTENT_SOLAR_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_SOLAR_PNG_ETAG, false },
{ "/style.css", CONTENT_STYLE_CSS_GZ, sizeof(CONTENT_STYLE_CSS_GZ) - 1, _CONTENT_TYPE_CSS, CONTENT_STYLE_CSS_GZ_ETAG, true },
{ "/term.html", CONTENT_TERM_HTML_GZ, sizeof(CONTENT_TERM_HTML_GZ) - 1, _CONTENT_TYPE_HTML, CONTENT_TERM_HTML_GZ_ETAG, true },
{ "/term.js", CONTENT_TERM_JS_GZ, sizeof(CONTENT_TERM_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_TERM_JS_GZ_ETAG, true },
{ "/wifi_portal.html", CONTENT_WIFI_PORTAL_HTML_GZ, sizeof(CONTENT_WIFI_PORTAL_HTML_GZ) - 1, _CONTENT_TYPE_HTML, CONTENT_WIFI_PORTAL_HTML_GZ_ETAG, true },
{ "/wifi_portal.js", CONTENT_WIFI_PORTAL_JS_GZ, sizeof(CONTENT_WIFI_PORTAL_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_WIFI_PORTAL_JS_GZ_ETAG, true },
{ "/wifi_signal_1.svg", CONTENT_WIFI_SIGNAL_1_SVG_GZ, sizeof(CONTENT_WIFI_SIGNAL_1_SVG_GZ) - 1, _CONTENT_TYPE_SVG, CONTENT_WIFI_SIGNAL_1_SVG_GZ_ETAG, true },
{ "/wifi_signal_2.svg", CONTENT_WIFI_SIGNAL_2_SVG_GZ, sizeof(CONTENT_WIFI_SIGNAL_2_SVG_GZ) - 1, _CONTENT_TYPE_SVG, CONTENT_WIFI_SIGNAL_2_SVG_GZ_ETAG, true },
{ "/wifi_signal_3.svg", CONTENT_WIFI_SIGNAL_3_SVG_GZ, sizeof(CONTENT_WIFI_SIGNAL_3_SVG_GZ) - 1, _CONTENT_TYPE_SVG, CONTENT_WIFI_SIGNAL_3_SVG_GZ_ETAG, true },
{ "/wifi_signal_4.svg", CONTENT_WIFI_SIGNAL_4_SVG_GZ, sizeof(CONTENT_WIFI_SIGNAL_4_SVG_GZ) - 1, _CONTENT_TYPE_SVG, CONTENT_WIFI_SIGNAL_4_SVG_GZ_ETAG, true },
{ "/wifi_signal_5.svg", CONTENT_WIFI_SIGNAL_5_SVG_GZ, sizeof(CONTENT_WIFI_SIGNAL_5_SVG_GZ) - 1, _CONTENT_TYPE_SVG, CONTENT_WIFI_SIGNAL_5_SVG_GZ_ETAG, true },
{ "/zones.json", CONTENT_ZONES_JSON_GZ, sizeof(CONTENT_ZONES_JSON_GZ) - 1, _CONTENT_TYPE_JSON, CONTENT_ZONES_JSON_GZ_ETAG, true },
{ "/assets/favicon.1cdb852f.ico", CONTENT_FAVICON_1CDB852F_ICO, sizeof(CONTENT_FAVICON_1CDB852F_ICO) - 1, _CONTENT_TYPE_ICO, CONTENT_FAVICON_1CDB852F_ICO_ETAG, false },
{ "/assets/index.7a449041.css", CONTENT_INDEX_7A449041_CSS_GZ, sizeof(CONTENT_INDEX_7A449041_CSS_GZ) - 1, _CONTENT_TYPE_CSS, CONTENT_INDEX_7A449041_CSS_GZ_ETAG, true },
{ "/assets/index.efb4d96d.js", CONTENT_INDEX_EFB4D96D_JS_GZ, sizeof(CONTENT_INDEX_EFB4D96D_JS_GZ) - 1, _CONTENT_TYPE_JS, CONTENT_INDEX_EFB4D96D_JS_GZ_ETAG, true },
{ "/assets/logo-mini.448a8e02.png", CONTENT_LOGO_MINI_448A8E02_PNG, sizeof(CONTENT_LOGO_MINI_448A8E02_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_LOGO_MINI_448A8E02_PNG_ETAG, false },
{ "/assets/roboto-all-400-normal.e41533d5.woff", CONTENT_ROBOTO_ALL_400_NORMAL_E41533D5_WOFF, sizeof(CONTENT_ROBOTO_ALL_400_NORMAL_E41533D5_WOFF) - 1, _CONTENT_TYPE_WOFF, CONTENT_ROBOTO_ALL_400_NORMAL_E41533D5_WOFF_ETAG, false },
{ "/assets/roboto-cyrillic-400-normal.495d38d4.woff2", CONTENT_ROBOTO_CYRILLIC_400_NORMAL_495D38D4_WOFF2, sizeof(CONTENT_ROBOTO_CYRILLIC_400_NORMAL_495D38D4_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_CYRILLIC_400_NORMAL_495D38D4_WOFF2_ETAG, false },
{ "/assets/roboto-cyrillic-ext-400-normal.b7ef2cd1.woff2", CONTENT_ROBOTO_CYRILLIC_EXT_400_NORMAL_B7EF2CD1_WOFF2, sizeof(CONTENT_ROBOTO_CYRILLIC_EXT_400_NORMAL_B7EF2CD1_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_CYRILLIC_EXT_400_NORMAL_B7EF2CD1_WOFF2_ETAG, false },
{ "/assets/roboto-greek-400-normal.daf51ab5.woff2", CONTENT_ROBOTO_GREEK_400_NORMAL_DAF51AB5_WOFF2, sizeof(CONTENT_ROBOTO_GREEK_400_NORMAL_DAF51AB5_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_GREEK_400_NORMAL_DAF51AB5_WOFF2_ETAG, false },
{ "/assets/roboto-latin-400-normal.f6734f81.woff2", CONTENT_ROBOTO_LATIN_400_NORMAL_F6734F81_WOFF2, sizeof(CONTENT_ROBOTO_LATIN_400_NORMAL_F6734F81_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_LATIN_400_NORMAL_F6734F81_WOFF2_ETAG, false },
{ "/assets/roboto-latin-ext-400-normal.3c23eb02.woff2", CONTENT_ROBOTO_LATIN_EXT_400_NORMAL_3C23EB02_WOFF2, sizeof(CONTENT_ROBOTO_LATIN_EXT_400_NORMAL_3C23EB02_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_LATIN_EXT_400_NORMAL_3C23EB02_WOFF2_ETAG, false },
{ "/assets/roboto-vietnamese-400-normal.77b24796.woff2", CONTENT_ROBOTO_VIETNAMESE_400_NORMAL_77B24796_WOFF2, sizeof(CONTENT_ROBOTO_VIETNAMESE_400_NORMAL_77B24796_WOFF2) - 1, _CONTENT_TYPE_WOFF2, CONTENT_ROBOTO_VIETNAMESE_400_NORMAL_77B24796_WOFF2_ETAG, false },
{ "/index.html", CONTENT_INDEX_HTML, sizeof(CONTENT_INDEX_HTML) - 1, _CONTENT_TYPE_HTML, CONTENT_INDEX_HTML_ETAG, false },
{ "/manifest.webmanifest", CONTENT_MANIFEST_WEBMANIFEST, sizeof(CONTENT_MANIFEST_WEBMANIFEST) - 1, _CONTENT_TYPE_MANIFEST, CONTENT_MANIFEST_WEBMANIFEST_ETAG, false },
{ "/pwa-192x192.png", CONTENT_PWA_192X192_PNG, sizeof(CONTENT_PWA_192X192_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_PWA_192X192_PNG_ETAG, false },
{ "/pwa-512x512.png", CONTENT_PWA_512X512_PNG, sizeof(CONTENT_PWA_512X512_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_PWA_512X512_PNG_ETAG, false },
{ "/pwa-masquable.png", CONTENT_PWA_MASQUABLE_PNG, sizeof(CONTENT_PWA_MASQUABLE_PNG) - 1, _CONTENT_TYPE_PNG, CONTENT_PWA_MASQUABLE_PNG_ETAG, false },
{ "/sw.js", CONTENT_SW_JS, sizeof(CONTENT_SW_JS) - 1, _CONTENT_TYPE_JS, CONTENT_SW_JS_ETAG, false },
};

0 comments on commit 35685a1

Please sign in to comment.