Skip to content

Commit e545259

Browse files
Added JS Script to pick Favicon, Title from config file (#7418)
1 parent 2a56c61 commit e545259

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ui/public/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"logo": "assets/logo.svg",
1515
"minilogo": "assets/mini-logo.svg",
1616
"banner": "assets/banner.svg",
17+
"loginPageTitle": "CloudStack",
18+
"loginPageFavicon": "assets/logo.svg",
1719
"error": {
1820
"403": "assets/403.png",
1921
"404": "assets/404.png",

ui/public/index.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<meta charset="utf-8">
2323
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2424
<meta name="viewport" content="width=device-width,initial-scale=1.0">
25-
<link rel="icon" href="<%= BASE_URL %>cloud.ico">
26-
<title>Apache CloudStack</title>
25+
<link id="favicon" rel="icon" href="<%= BASE_URL %>cloud.ico">
26+
<title id="title" >Apache CloudStack</title>
2727
<style>
2828
.loader {
2929
border: 16px solid #F3F3F3;
@@ -54,4 +54,12 @@
5454
<div class="loader"></div>
5555
</div>
5656
</body>
57+
<script type="text/javascript">
58+
fetch('./config.json')
59+
.then(response => response.json())
60+
.then(data => {
61+
document.getElementById("favicon").setAttribute("href", data.loginPageFavicon);
62+
document.getElementById("title").innerHTML = data.loginPageTitle;
63+
}).catch((err) => {});
64+
</script>
5765
</html>

0 commit comments

Comments
 (0)