apache / apache/cloudstack

[4.22] Favicon only appears briefly, then disappears

未关闭
#12,079 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
component:UI
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

### 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:
Image

The favicon when it loads for 0.5 seconds:
Image

### 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.

贡献指南

打开贡献指南

调研方向

首先比较 index.html 中硬编码的 favicon 链接与 /etc/cloudstack/management/config.json 中的 loginFavicon 条目,然后跟踪 SPA 在登录页面初始化期间何时应用配置。完成的标准是:在 SPA 完成加载和页面转换后,配置的 favicon 仍保持可见,包括替换默认文件之后。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend, web-dev
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。