parent
582867cdb9
commit
93057fc3dc
@ -22,7 +22,7 @@ framework = arduino
|
||||
platform = espressif32@6.3.1
|
||||
|
||||
build_flags =
|
||||
-DCOMPONENT_EMBED_FILES=webapp_dist/index.html.gz:webapp_dist/zones.json.gz:webapp_dist/favicon.ico:webapp_dist/js/app.js.gz
|
||||
-DCOMPONENT_EMBED_FILES=webapp_dist/index.html.gz:webapp_dist/zones.json.gz:webapp_dist/favicon.ico:webapp_dist/favicon.png:webapp_dist/js/app.js.gz
|
||||
-DPIOENV=\"$PIOENV\"
|
||||
-Wall -Wextra -Werror
|
||||
-std=c++17
|
||||
|
||||
@ -6,11 +6,13 @@
|
||||
|
||||
extern const uint8_t file_index_html_start[] asm("_binary_webapp_dist_index_html_gz_start");
|
||||
extern const uint8_t file_favicon_ico_start[] asm("_binary_webapp_dist_favicon_ico_start");
|
||||
extern const uint8_t file_favicon_png_start[] asm("_binary_webapp_dist_favicon_png_start");
|
||||
extern const uint8_t file_zones_json_start[] asm("_binary_webapp_dist_zones_json_gz_start");
|
||||
extern const uint8_t file_app_js_start[] asm("_binary_webapp_dist_js_app_js_gz_start");
|
||||
|
||||
extern const uint8_t file_index_html_end[] asm("_binary_webapp_dist_index_html_gz_end");
|
||||
extern const uint8_t file_favicon_ico_end[] asm("_binary_webapp_dist_favicon_ico_end");
|
||||
extern const uint8_t file_favicon_png_end[] asm("_binary_webapp_dist_favicon_png_end");
|
||||
extern const uint8_t file_zones_json_end[] asm("_binary_webapp_dist_zones_json_gz_end");
|
||||
extern const uint8_t file_app_js_end[] asm("_binary_webapp_dist_js_app_js_gz_end");
|
||||
|
||||
@ -41,6 +43,11 @@ void WebApiWebappClass::init(AsyncWebServer* server)
|
||||
request->send(response);
|
||||
});
|
||||
|
||||
_server->on("/favicon.png", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
AsyncWebServerResponse* response = request->beginResponse_P(200, "image/png", file_favicon_png_start, file_favicon_png_end - file_favicon_png_start);
|
||||
request->send(response);
|
||||
});
|
||||
|
||||
_server->on("/zones.json", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
AsyncWebServerResponse* response = request->beginResponse_P(200, "application/json", file_zones_json_start, file_zones_json_end - file_zones_json_start);
|
||||
response->addHeader("Content-Encoding", "gzip");
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.png">
|
||||
<link rel="apple-touch-icon" href="/favicon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>OpenDTU</title>
|
||||
</head>
|
||||
|
||||
BIN
webapp/public/favicon.png
Normal file
BIN
webapp/public/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 682 B |
BIN
webapp_dist/favicon.png
Normal file
BIN
webapp_dist/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 682 B |
Binary file not shown.
Loading…
Reference in New Issue
Block a user