mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 20:47:08 +03:00
add favicon
This commit is contained in:
@@ -2,7 +2,7 @@ idf_component_register( SRC_DIRS .
|
|||||||
INCLUDE_DIRS . ${IDF_PATH}/components/esp_http_server/src ${IDF_PATH}/components/esp_http_server/src/port/esp32 ${IDF_PATH}/components/esp_http_server/src/util ${IDF_PATH}/components/esp_http_server/src/
|
INCLUDE_DIRS . ${IDF_PATH}/components/esp_http_server/src ${IDF_PATH}/components/esp_http_server/src/port/esp32 ${IDF_PATH}/components/esp_http_server/src/util ${IDF_PATH}/components/esp_http_server/src/
|
||||||
REQUIRES squeezelite-ota json mdns
|
REQUIRES squeezelite-ota json mdns
|
||||||
PRIV_REQUIRES tools services platform_config esp_common json newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console esp_http_server
|
PRIV_REQUIRES tools services platform_config esp_common json newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console esp_http_server
|
||||||
EMBED_FILES style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz
|
EMBED_FILES style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz favicon.ico
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
|
# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
|
||||||
# please read the SDK documents if you need to do this.
|
# please read the SDK documents if you need to do this.
|
||||||
#
|
#
|
||||||
COMPONENT_EMBED_FILES := style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz
|
COMPONENT_EMBED_FILES := style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz favicon.ico
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
COMPONENT_EXTRA_INCLUDES += $(IDF_PATH)/components/esp_http_server/src $(IDF_PATH)/components/esp_http_server/src/port/esp32 $(IDF_PATH)/components/esp_http_server/src/util $(IDF_PATH)/components/esp_http_server/src/
|
COMPONENT_EXTRA_INCLUDES += $(IDF_PATH)/components/esp_http_server/src $(IDF_PATH)/components/esp_http_server/src/port/esp32 $(IDF_PATH)/components/esp_http_server/src/util $(IDF_PATH)/components/esp_http_server/src/
|
||||||
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO
|
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO
|
||||||
|
|||||||
BIN
components/wifi-manager/favicon.ico
Normal file
BIN
components/wifi-manager/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -101,6 +101,8 @@ extern const uint8_t code_js_start[] asm("_binary_code_js_start");
|
|||||||
extern const uint8_t code_js_end[] asm("_binary_code_js_end");
|
extern const uint8_t code_js_end[] asm("_binary_code_js_end");
|
||||||
extern const uint8_t index_html_start[] asm("_binary_index_html_start");
|
extern const uint8_t index_html_start[] asm("_binary_index_html_start");
|
||||||
extern const uint8_t index_html_end[] asm("_binary_index_html_end");
|
extern const uint8_t index_html_end[] asm("_binary_index_html_end");
|
||||||
|
extern const uint8_t favicon_ico_start[] asm("_binary_favicon_ico_start");
|
||||||
|
extern const uint8_t favicon_ico_end[] asm("_binary_favicon_ico_end");
|
||||||
esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error);
|
esp_err_t redirect_processor(httpd_req_t *req, httpd_err_code_t error);
|
||||||
|
|
||||||
|
|
||||||
@@ -407,11 +409,14 @@ esp_err_t resource_filehandler(httpd_req_t *req){
|
|||||||
const size_t file_size = (code_js_end - code_js_start);
|
const size_t file_size = (code_js_end - code_js_start);
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
httpd_resp_send(req, (const char *)code_js_start, file_size);
|
httpd_resp_send(req, (const char *)code_js_start, file_size);
|
||||||
}
|
} else if(strstr(filename, "style.css")) {
|
||||||
else if(strstr(filename, "style.css")) {
|
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
const size_t file_size = (style_css_end - style_css_start);
|
const size_t file_size = (style_css_end - style_css_start);
|
||||||
httpd_resp_send(req, (const char *)style_css_start, file_size);
|
httpd_resp_send(req, (const char *)style_css_start, file_size);
|
||||||
|
} else if(strstr(filename, "favicon.ico")) {
|
||||||
|
set_content_type_from_file(req, filename);
|
||||||
|
const size_t file_size = (favicon_ico_end - favicon_ico_start);
|
||||||
|
httpd_resp_send(req, (const char *)favicon_ico_start, file_size);
|
||||||
} else if(strstr(filename, "jquery.js")) {
|
} else if(strstr(filename, "jquery.js")) {
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
@@ -422,20 +427,17 @@ esp_err_t resource_filehandler(httpd_req_t *req){
|
|||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (popper_gz_end - popper_gz_start);
|
const size_t file_size = (popper_gz_end - popper_gz_start);
|
||||||
httpd_resp_send(req, (const char *)popper_gz_start, file_size);
|
httpd_resp_send(req, (const char *)popper_gz_start, file_size);
|
||||||
}
|
} else if(strstr(filename, "bootstrap.js")) {
|
||||||
else if(strstr(filename, "bootstrap.js")) {
|
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (bootstrap_js_gz_end - bootstrap_js_gz_start);
|
const size_t file_size = (bootstrap_js_gz_end - bootstrap_js_gz_start);
|
||||||
httpd_resp_send(req, (const char *)bootstrap_js_gz_start, file_size);
|
httpd_resp_send(req, (const char *)bootstrap_js_gz_start, file_size);
|
||||||
}
|
} else if(strstr(filename, "bootstrap.css")) {
|
||||||
else if(strstr(filename, "bootstrap.css")) {
|
|
||||||
set_content_type_from_file(req, filename);
|
set_content_type_from_file(req, filename);
|
||||||
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
httpd_resp_set_hdr(req, "Content-Encoding", "gzip");
|
||||||
const size_t file_size = (bootstrap_css_gz_end - bootstrap_css_gz_start);
|
const size_t file_size = (bootstrap_css_gz_end - bootstrap_css_gz_start);
|
||||||
httpd_resp_send(req, (const char *)bootstrap_css_gz_start, file_size);
|
httpd_resp_send(req, (const char *)bootstrap_css_gz_start, file_size);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ESP_LOGE_LOC(TAG, "Unknown resource [%s] from path [%s] ", filename,filepath);
|
ESP_LOGE_LOC(TAG, "Unknown resource [%s] from path [%s] ", filename,filepath);
|
||||||
/* Respond with 404 Not Found */
|
/* Respond with 404 Not Found */
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File does not exist");
|
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File does not exist");
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="/res/favicon.ico">
|
||||||
<link rel="stylesheet" href="/res/bootstrap.css">
|
<link rel="stylesheet" href="/res/bootstrap.css">
|
||||||
<link rel="stylesheet" href="/res/style.css">
|
<link rel="stylesheet" href="/res/style.css">
|
||||||
<script src="/res/jquery.js"></script>
|
<script src="/res/jquery.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user