feat(webapps): show and correctly set the active WebUI's resource URL

The "Active WebUI" card (Settings > Web Applications) only showed
description and __APP_VERSION__, never the resourceUrl it's actually
built from — add it as a linked "Source" row.

That card also turned out to be misleading in local dev: it reads the
x:Application record whose urlPrefix matches /admin or /account, and a
freshly bootstrapped server keeps Stalwart's seeded default there
("Stalwart Web Interface", pointing at stalwartlabs/webui's release),
regardless of what's actually being served — in dev that's this fork,
served directly by Vite, which never touches that record at all.

dev-server-init.sh/.ps1 now point that record's description and
resourceUrl at this fork's own release, so the card (now including the
visible Source URL) reflects what's actually running instead of
Stalwart's factory default.

Verified end-to-end against a fresh container with both scripts.
This commit is contained in:
Steven RYDELL
2026-08-01 19:17:44 +02:00
parent 7fab3540ea
commit 40164a6652
4 changed files with 59 additions and 5 deletions
+14 -1
View File
@@ -590,7 +590,7 @@ export function DynamicList({ viewName }: DynamicListProps) {
objectName ?? 'x:Application',
accountId,
{},
['id', 'description', 'enabled', 'urlPrefix'],
['id', 'description', 'enabled', 'urlPrefix', 'resourceUrl'],
);
if (cancelled) return;
const active = result.list.find((item) => isActiveWebApplication(item));
@@ -1573,6 +1573,19 @@ export function DynamicList({ viewName }: DynamicListProps) {
<span className="text-muted-foreground">{t('webApplications.version', 'Version')}:</span>
<Badge variant="secondary">{__APP_VERSION__}</Badge>
</div>
{typeof activeWebApp.resourceUrl === 'string' && activeWebApp.resourceUrl && (
<div className="flex items-start gap-2 text-sm">
<span className="shrink-0 text-muted-foreground">{t('webApplications.resourceUrl', 'Source')}:</span>
<a
href={activeWebApp.resourceUrl}
target="_blank"
rel="noreferrer"
className="break-all text-primary hover:underline"
>
{activeWebApp.resourceUrl}
</a>
</div>
)}
</CardContent>
</Card>
)}