[4.22] Favicon only appears briefly, then disappears
- Vorherrschende Sprache
- Java
- Sterne
- 3.1k
- Forks
- 1.4k
- Ø Merge
- 6 T. 19 Std.
- Gemergte PRs (30 T.)
- 32
Beschreibung
### problem
When customizing the Primate UI’s favicon, it flashes for ~0.5 seconds during page load (while index.html is rendered) and then disappears as the SPA transitions to a white page before the login view fully loads. The favicon never reappears even though the icon file is valid and reachable.
The favicon 99% of the time:
The favicon when it loads for 0.5 seconds:
### versions
Environment
- Apache CloudStack version: 4.22.0.0
- OS: Ubuntu Noble (management server)
- Browser(s) tested: Chrome / Opera (same behavior)
- Deployment setup: Two management servers behind a VIP with HAProxy
### The steps to reproduce the bug
1. Replace default favicon:
> File: `/usr/share/cloudstack-management/webapp/cloud.ico`
> File: `/usr/share/cloudstack-management/webapp/assets/logo.svg`
2. Clear browser cache and reload the login page.
3. Observe favicon behavior during and after page load.
...
### What to do about it?
The Primate UI currently references two favicon sources:
- A hardcoded `` in `index.html`
- A configurable `"loginFavicon": "assets/logo.svg"` entry in `/etc/cloudstack/management/config.json`
This creates inconsistent behavior — the browser loads `cloud.ico` first (from `index.html`), then when the SPA initializes and renders based on `config.json`, the favicon reference isn’t updated or re-applied, causing it to disappear.
To fix this:
- Unify favicon handling so the UI consistently uses the favicon defined in `config.json` (similar to `appTitle` and `loginTitle`), and
- Remove or override the hardcoded `cloud.ico` link in `index.html` at runtime.
Alternatively, ensure the SPA explicitly re-sets the favicon after it mounts (e.g., by adding a small function that reads the `loginFavicon` key and updates `` dynamically).
This would let the favicon persist across page transitions and make it fully configurable, just like the logo and title.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den fest codierten Favicon-Link in index.html mit dem Eintrag loginFavicon in /etc/cloudstack/management/config.json zu vergleichen, und verfolge anschließend, wann die SPA während der Initialisierung der Anmeldeseite die Konfiguration anwendet. Erledigt ist die Aufgabe, wenn das konfigurierte Favicon nach dem vollständigen Laden der SPA und bei Seitenübergängen sichtbar bleibt, auch nach dem Ersetzen der Standarddateien.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend, web-dev
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100