From 584234c4f1c6881b172f18d39ddc0bb685f1902d Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:18:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BB=E9=A2=98=E8=89=B2=E4=B8=8D=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=9A=84=E9=97=AE=E9=A2=98=20(#5449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/assets/images/favicon-gold.png | Bin 0 -> 1684 bytes frontend/src/assets/images/favicon.svg | 9 +++++++++ frontend/src/utils/xpack.ts | 9 ++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 frontend/src/assets/images/favicon-gold.png create mode 100644 frontend/src/assets/images/favicon.svg diff --git a/frontend/src/assets/images/favicon-gold.png b/frontend/src/assets/images/favicon-gold.png new file mode 100644 index 0000000000000000000000000000000000000000..2574ecbef9626e611ce77211e1ee9a42de858bd5 GIT binary patch literal 1684 zcmZ8g3piA17#=1Ot6XwP*qUx6m31wt$mF)U4e92xt%zr(6cy2Aw@5@d=ggESiCmJ2 z#F{zBNXj)*DOxI_XlBmLkR;9iXLQ-^Jm>u9`@iq~-uM0f=bY2-t`5qII*KF`N!iKK z-V?mn5RU>GtThb>Z<9!}f$qP0QNdOME;?OOR3yRZ5)6~HFp0P_U4rHGH=G?TXTGUE zGmJqa^%r@S>HHd|087R1z{0955j#^{moBbGM%foeF=(ugIr4YLI}XCb(s^8nKyoq# z7=m*%a5ju{m_iH^av7jYgu)_>Dds|AHiL&|@-c+Z%@AOafQ#UqOdN%Aj3H!0LNrr| z!6G(8gd%(l;=7QM z3}BTC0WgsvVnU8^2yU=Na4^VpiI@eE#?uZ70DCD&F)BkzFLdv4WOO`G(FkEi5!g#gGFQ#VZ zmR4)5*V(M!u+i4eezSvhRI%nAo`E^b_%a zo=QkOlbmukHSJt_Mkb6fm>04xX6Iba&C9=bt+1%LFs;@s=xpB;Lw}5!y`N%Ux16mqhs&KKTLd_{Pg)b z_mdSEOJ=u=gT0JI*0`5MBFj73+j=?P<8=koXts0dFD;BBQz zNva<8nk>2oRn>eOYrHo`;LAF3e}WcQ6=M<*Kg+bu>g+g;|137hAb)7?DTUX6V zSTH0%&}(IEztXx}E72&s?@@tL)V{Z}$u-5hB7d73#JlR4(la}c7x7`oi_ab#$H`5N z9rli#!sDMA>atH-!cP0`vMcOV?2vohWb=@e8`_t%cWGjqe`juX=O$a`4R7qh(T2lM zr!JW!h#NQBg+!Gt)2%39mKN3g#;ccmP-EQ7%b)*&oIMoatXPlC=Z6+47Pz@v`*>JG z?)#}-kdv18NO4GzjkeE9jq2f{s;irCWlwp}&QMCF=0(RQ>xaTVhMuh4_X=4Z1A5_} zsP1HR9=`rU?Q~<08B_Na6uY~6>&-hq7g=Yp?PGn zYNG$pl}Cxb>zifIl{!N)6j5}JLbkE|{&Rop#!oB=2af~`&IT${Uyc?)));zhK;%2V? z*FaU>R7u~daL1YNmgM+atX{MA@Ovz + + + + + + + + diff --git a/frontend/src/utils/xpack.ts b/frontend/src/utils/xpack.ts index 505f6311d..8901ab466 100644 --- a/frontend/src/utils/xpack.ts +++ b/frontend/src/utils/xpack.ts @@ -18,7 +18,12 @@ export function initFavicon() { const link = (document.querySelector("link[rel*='icon']") || document.createElement('link')) as HTMLLinkElement; link.type = 'image/x-icon'; link.rel = 'shortcut icon'; - link.href = favicon ? '/api/v1/images/favicon' : '/public/favicon.png'; + if (globalStore.isDarkGoldTheme) { + let goldLink = new URL(`../assets/images/favicon-gold.png`, import.meta.url).href; + link.href = favicon ? '/api/v1/images/favicon' : goldLink; + } else { + link.href = favicon ? '/api/v1/images/favicon' : '/public/favicon.png'; + } document.getElementsByTagName('head')[0].appendChild(link); } @@ -29,9 +34,11 @@ export async function getXpackSetting() { searchXSetting = xpackModules['../xpack/api/modules/setting.ts']['searchXSetting'] || {}; const res = await searchXSetting(); if (!res) { + initFavicon(); resetXSetting(); return; } + initFavicon(); return res; } }