LibrePortal/scripts/webui/data/utils/webui_container_setup.sh
librelad f0c5f607d7 fix(webui): point app/category icon generators at /core/icons
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/<app>.svg and /icons/categories/
<cat>.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 <librelad@digitalangels.vip>
2026-05-30 23:48:19 +01:00

31 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
webuiContainerSetup()
{
local app_name=$1
local type=$2 # install or uninstall
if [[ "$app_name" == "libreportal" && "$type" == "uninstall" ]]; then
isNotice "Skipping WebUI config refresh — LibrePortal (the WebUI) is being removed."
return 0
fi
webuiUpdateAppStatus $app_name $type;
webuiUpdateAppLog $app_name $type;
webuiGenerateAppsServicesConfig;
# Targeted patch (~0.5s) instead of full regen (~3.5s) for the
# single app being installed/uninstalled.
if declare -F webuiPatchAppConfigJson >/dev/null 2>&1; then
webuiPatchAppConfigJson "$app_name" >/dev/null 2>&1 \
|| webuiGenerateLibrePortalConfig
else
webuiGenerateLibrePortalConfig
fi
# The patch path rewrites apps.json (which references
# /core/icons/apps/<app>.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
webuiSyncAppIcon "$app_name" >/dev/null 2>&1 || true
fi
}