From f0c5f607d73c14ba9b9b1b0e001f7a0ec53395e2 Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 30 May 2026 23:48:19 +0100 Subject: [PATCH] fix(webui): point app/category icon generators at /core/icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The frontend modularization moved icons to frontend/core/icons/ and updated the frontend JS, but the host-side generators were never updated — they wrote the apps.json/categories 'icon' field as /icons/apps/.svg and /icons/categories/ .svg, and webui_app_icons.sh / webui_config.sh synced icon files into the non-existent frontend/icons/apps. Those served paths 404 (text/html catch-all), so every app card fell back to default.svg (the generic box) instead of its real logo. Repointed to /core/icons/... (where the SVGs actually live and serve as image/svg+xml): - webui_config.sh: icon dir + emitted apps.json icon path - webui_app_icons.sh: icon sync dir + comment - webui_container_setup.sh: comment - webui_create_app_categories.sh: 11 category icon paths Source fix only — the live apps.json refreshes on the next host-side regen (lpRegen). NOT touched: scripts/backup/engines/*.json '/icons/config/backup.svg' (that SVG lives at the oddly-nested components/admin/config/icons/config/ and serves at neither path — needs a placement decision, flagged separately). Signed-off-by: librelad --- .../data/generators/apps/webui_config.sh | 4 ++-- .../categories/webui_create_app_categories.sh | 22 +++++++++---------- scripts/webui/data/utils/webui_app_icons.sh | 4 ++-- .../webui/data/utils/webui_container_setup.sh | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/webui/data/generators/apps/webui_config.sh b/scripts/webui/data/generators/apps/webui_config.sh index 1c254a5..2bc2abd 100644 --- a/scripts/webui/data/generators/apps/webui_config.sh +++ b/scripts/webui/data/generators/apps/webui_config.sh @@ -162,7 +162,7 @@ EOF icon_file="$app_name.png" fi if [[ -n "$icon_file" ]]; then - local icons_apps_dir="${containers_dir}libreportal/frontend/icons/apps" + local icons_apps_dir="${containers_dir}libreportal/frontend/core/icons/apps" runFileOp mkdir -p "$icons_apps_dir" cp "$dir/$icon_file" "$icons_apps_dir/$icon_file" 2>/dev/null fi @@ -212,7 +212,7 @@ EOF fields+=(" \"backup_live_capable\": $backup_live_capable") [[ -n "$url" ]] && fields+=(" \"url\": \"$url\"") [[ -n "$description" ]] && fields+=(" \"description\": \"$description\"") - [[ -n "$icon_file" ]] && fields+=(" \"icon\": \"/icons/apps/$icon_file\"") + [[ -n "$icon_file" ]] && fields+=(" \"icon\": \"/core/icons/apps/$icon_file\"") [[ -n "$services_json" ]] && fields+=(" \"services\": [$services_json]") if [[ -n "$config_vars" ]]; then fields+=(" \"config\": {"$'\n'"${config_vars%,}"$'\n'" }") diff --git a/scripts/webui/data/generators/categories/webui_create_app_categories.sh b/scripts/webui/data/generators/categories/webui_create_app_categories.sh index e22188b..6b001e4 100755 --- a/scripts/webui/data/generators/categories/webui_create_app_categories.sh +++ b/scripts/webui/data/generators/categories/webui_create_app_categories.sh @@ -26,67 +26,67 @@ webuiCreateAppsCategories() { { "id": "recommended", "name": "Recommended", - "icon": "/icons/categories/recommended.svg", + "icon": "/core/icons/categories/recommended.svg", "description": "Hand-picked apps to round out your install" }, { "id": "communication", "name": "Communication", - "icon": "/icons/categories/communication.svg", + "icon": "/core/icons/categories/communication.svg", "description": "Communication and collaboration tools" }, { "id": "development", "name": "Development", - "icon": "/icons/categories/development.svg", + "icon": "/core/icons/categories/development.svg", "description": "Development tools and version control" }, { "id": "knowledge", "name": "Knowledge", - "icon": "/icons/categories/knowledge.svg", + "icon": "/core/icons/categories/knowledge.svg", "description": "Knowledge management and wikis" }, { "id": "media", "name": "Media", - "icon": "/icons/categories/media.svg", + "icon": "/core/icons/categories/media.svg", "description": "Media streaming and entertainment" }, { "id": "monitoring", "name": "Monitoring", - "icon": "/icons/categories/monitoring.svg", + "icon": "/core/icons/categories/monitoring.svg", "description": "Metrics, dashboards and observability" }, { "id": "networking", "name": "Networking", - "icon": "/icons/categories/networking.svg", + "icon": "/core/icons/categories/networking.svg", "description": "Network tools and services" }, { "id": "productivity", "name": "Productivity", - "icon": "/icons/categories/productivity.svg", + "icon": "/core/icons/categories/productivity.svg", "description": "Productivity and business tools" }, { "id": "security", "name": "Security", - "icon": "/icons/categories/security.svg", + "icon": "/core/icons/categories/security.svg", "description": "Security and privacy tools" }, { "id": "storage", "name": "Storage", - "icon": "/icons/categories/storage.svg", + "icon": "/core/icons/categories/storage.svg", "description": "File storage and sharing solutions" }, { "id": "system", "name": "System", - "icon": "/icons/categories/system.svg", + "icon": "/core/icons/categories/system.svg", "description": "LibrePortal itself and platform-level services" } ] diff --git a/scripts/webui/data/utils/webui_app_icons.sh b/scripts/webui/data/utils/webui_app_icons.sh index 20aa552..570a6f0 100755 --- a/scripts/webui/data/utils/webui_app_icons.sh +++ b/scripts/webui/data/utils/webui_app_icons.sh @@ -2,7 +2,7 @@ # Sync app icons from container template dirs to the LibrePortal frontend. # -# apps.json references /icons/apps/. unconditionally (see +# apps.json references /core/icons/apps/. unconditionally (see # webui_config.sh), so the icon file must physically exist in the frontend # icons dir or the apps page falls back to the default icon. @@ -13,7 +13,7 @@ webuiSyncAppIcon() { local app_name="$1" [[ -z "$app_name" ]] && return 1 - local icons_dir="${containers_dir}libreportal/frontend/icons/apps" + local icons_dir="${containers_dir}libreportal/frontend/core/icons/apps" mkdir -p "$icons_dir" # Icons live in the install template dir — copy_build_context.sh diff --git a/scripts/webui/data/utils/webui_container_setup.sh b/scripts/webui/data/utils/webui_container_setup.sh index 0d9d38a..e3fb021 100755 --- a/scripts/webui/data/utils/webui_container_setup.sh +++ b/scripts/webui/data/utils/webui_container_setup.sh @@ -22,7 +22,7 @@ webuiContainerSetup() webuiGenerateLibrePortalConfig fi # The patch path rewrites apps.json (which references - # /icons/apps/.svg) but doesn't place the icon file — sync it here + # /core/icons/apps/.svg) but doesn't place the icon file — sync it here # so the apps page never points at a missing icon. The full regen # copies icons itself; this is cheap and idempotent regardless. if declare -F webuiSyncAppIcon >/dev/null 2>&1; then