feat: add favicon and app icons
- Update favicon to match the LogoIcon. - Serve icons from the native C web server. - Ignore generated asset headers in .gitignore.
No files matched your search
@@ -4,9 +4,7 @@
|
||||
*.o
|
||||
|
||||
# Generated Asset Headers
|
||||
include/assets_index_html.h
|
||||
include/assets_cache_appcache.h
|
||||
include/assets_cacert_pem.h
|
||||
include/assets_*.h
|
||||
|
||||
# Frontend build artifacts
|
||||
frontend/dist/
|
||||
|
||||
@@ -22,6 +22,9 @@ ASSET_HEADER := include/assets_index_html.h
|
||||
CA_HEADER := include/assets_cacert_pem.h
|
||||
MANIFEST_HEADER := include/assets_cache_appcache.h
|
||||
FRONTEND_MANIFEST := frontend/dist/cache.appcache
|
||||
FAVICON_SVG_HEADER := include/assets_favicon_svg.h
|
||||
ICON_PNG_HEADER := include/assets_icon_png.h
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +59,14 @@ $(MANIFEST_HEADER): $(FRONTEND_DIST)
|
||||
@echo "Generating Manifest asset header..."
|
||||
$(PYTHON) tools/gen_assets.py $(FRONTEND_MANIFEST) $(MANIFEST_HEADER) cache_appcache
|
||||
|
||||
$(FAVICON_SVG_HEADER): $(FRONTEND_DIST)
|
||||
@echo "Generating Favicon SVG asset header..."
|
||||
$(PYTHON) tools/gen_assets.py frontend/dist/favicon.svg $(FAVICON_SVG_HEADER) favicon_svg
|
||||
|
||||
$(ICON_PNG_HEADER): $(FRONTEND_DIST)
|
||||
@echo "Generating Icon PNG asset header..."
|
||||
$(PYTHON) tools/gen_assets.py frontend/dist/icon.png $(ICON_PNG_HEADER) icon_png
|
||||
|
||||
$(CA_HEADER):
|
||||
@echo "Downloading CA bundle..."
|
||||
wget -O include/cacert.pem https://curl.se/ca/cacert.pem
|
||||
@@ -67,14 +78,14 @@ $(FRONTEND_DIST):
|
||||
@echo "Please run 'make frontend-build' locally on your host machine first."
|
||||
@exit 1
|
||||
|
||||
$(ELF): $(ASSET_HEADER) $(MANIFEST_HEADER) $(CA_HEADER) $(SRCS)
|
||||
$(ELF): $(ASSET_HEADER) $(MANIFEST_HEADER) $(CA_HEADER) $(FAVICON_SVG_HEADER) $(ICON_PNG_HEADER) $(SRCS)
|
||||
@echo "Building $(ELF)..."
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(ELF) $(SRCS) $(LIBS)
|
||||
@echo "Stripping $(ELF)..."
|
||||
$(STRIP) $(ELF)
|
||||
|
||||
clean:
|
||||
rm -f $(ELF) $(ASSET_HEADER) $(MANIFEST_HEADER) $(CA_HEADER) src/*.o
|
||||
rm -f $(ELF) $(ASSET_HEADER) $(MANIFEST_HEADER) $(CA_HEADER) $(FAVICON_SVG_HEADER) $(ICON_PNG_HEADER) src/*.o
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/png" href="/icon.png" />
|
||||
<link rel="apple-touch-icon" href="/icon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>[[TITLE_PLACEHOLDER]]</title>
|
||||
</head>
|
||||
|
||||
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filtLine truncated
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
||||
<rect width="512" height="512" rx="112" fill="#0095ff"/>
|
||||
<g transform="translate(60, 64) scale(16)" fill="#ffffff">
|
||||
<!-- Sidebar Line -->
|
||||
<rect x="2" y="4" width="2.5" height="16" rx="1"/>
|
||||
|
||||
<!-- Payload Grid -->
|
||||
<rect x="7.5" y="7" width="4" height="4" rx="1"/>
|
||||
<rect x="13" y="7" width="4" height="4" rx="1"/>
|
||||
<rect x="18.5" y="7" width="4" height="4" rx="1"/>
|
||||
|
||||
<rect x="7.5" y="13" width="4" height="4" rx="1"/>
|
||||
<rect x="13" y="13" width="4" height="4" rx="1"/>
|
||||
<rect x="18.5" y="13" width="4" height="4" rx="1"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 665 B |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "assets_index_html.h"
|
||||
#include "assets_cache_appcache.h"
|
||||
#include "assets_favicon_svg.h"
|
||||
#include "assets_icon_png.h"
|
||||
|
||||
#include "pldmgr.h"
|
||||
|
||||
@@ -720,9 +722,10 @@ static enum MHD_Result on_request(void *cls, struct MHD_Connection *conn,
|
||||
}
|
||||
}
|
||||
|
||||
/* Only log significant requests, not pollers like /log */
|
||||
/* Only log significant requests, not pollers like /log or static assets */
|
||||
if (strcmp(url, ROUTE_LOG) != 0 && strcmp(url, ROUTE_INDEX) != 0 &&
|
||||
strcmp(url, ROUTE_INDEX_HTML) != 0) {
|
||||
strcmp(url, ROUTE_INDEX_HTML) != 0 && strcmp(url, "/favicon.svg") != 0 &&
|
||||
strcmp(url, "/icon.png") != 0) {
|
||||
pldmgr_log("[PLDMGR] Request: %s %s\n", method, url);
|
||||
}
|
||||
|
||||
@@ -801,6 +804,18 @@ static enum MHD_Result on_request(void *cls, struct MHD_Connection *conn,
|
||||
MHD_RESPMEM_PERSISTENT);
|
||||
MHD_add_response_header(resp, "Content-Type", "text/cache-manifest");
|
||||
MHD_add_response_header(resp, "Cache-Control", "no-cache, must-revalidate");
|
||||
} else if (strcmp(url, "/favicon.svg") == 0) {
|
||||
resp = MHD_create_response_from_buffer(assets_favicon_svg_len,
|
||||
(void *)assets_favicon_svg,
|
||||
MHD_RESPMEM_PERSISTENT);
|
||||
MHD_add_response_header(resp, "Content-Type", "image/svg+xml");
|
||||
MHD_add_response_header(resp, "Cache-Control", "max-age=604800");
|
||||
} else if (strcmp(url, "/icon.png") == 0) {
|
||||
resp = MHD_create_response_from_buffer(assets_icon_png_len,
|
||||
(void *)assets_icon_png,
|
||||
MHD_RESPMEM_PERSISTENT);
|
||||
MHD_add_response_header(resp, "Content-Type", "image/png");
|
||||
MHD_add_response_header(resp, "Cache-Control", "max-age=604800");
|
||||
} else if (strcmp(url, ROUTE_CHECK) == 0) {
|
||||
|
||||
|
||||
|
||||