mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-02 10:50:49 +08:00
feat: add favicon support and enhance logo setup logic to ensure favicon updates alongside site logos
This commit is contained in:
9
app.js
9
app.js
@@ -1011,7 +1011,8 @@ function exposeManagerInstance(instance) {
|
||||
function setupSiteLogo() {
|
||||
const img = document.getElementById('site-logo');
|
||||
const loginImg = document.getElementById('login-logo');
|
||||
if (!img && !loginImg) return;
|
||||
const favicon = document.getElementById('favicon-link');
|
||||
if (!img && !loginImg && !favicon) return;
|
||||
|
||||
const inlineLogo = typeof window !== 'undefined' ? window.__INLINE_LOGO__ : null;
|
||||
if (inlineLogo) {
|
||||
@@ -1023,6 +1024,9 @@ function setupSiteLogo() {
|
||||
loginImg.src = inlineLogo;
|
||||
loginImg.style.display = 'inline-block';
|
||||
}
|
||||
if (favicon) {
|
||||
favicon.href = inlineLogo;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1044,6 +1048,9 @@ function setupSiteLogo() {
|
||||
loginImg.src = test.src;
|
||||
loginImg.style.display = 'inline-block';
|
||||
}
|
||||
if (favicon) {
|
||||
favicon.href = test.src;
|
||||
}
|
||||
};
|
||||
test.onerror = () => {
|
||||
idx++;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title data-i18n="title.login">CLI Proxy API Management Center</title>
|
||||
<link rel="icon" type="image/x-icon" id="favicon-link">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css">
|
||||
|
||||
Reference in New Issue
Block a user