From 87ee07d48134babebf61cd4cbaeec012b901f9e7 Mon Sep 17 00:00:00 2001 From: coolcoala Date: Fri, 11 Jul 2025 04:26:01 +0300 Subject: [PATCH] fixed display of proxy groups and emoji on windows --- src/components/home/proxy-selectors.tsx | 22 +++++++++++++++------- src/index.css | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/home/proxy-selectors.tsx b/src/components/home/proxy-selectors.tsx index a394bb0e..f1c366c1 100644 --- a/src/components/home/proxy-selectors.tsx +++ b/src/components/home/proxy-selectors.tsx @@ -29,6 +29,7 @@ interface IProxyGroup { name: string; type: string; now: string; + hidden: boolean; all: (string | { name: string })[]; } @@ -37,7 +38,7 @@ function getDelayBadgeVariant(delayValue: number): 'default' | 'secondary' | 'de if (delayValue < 0) return 'secondary'; if (delayValue >= 10000) return 'destructive'; if (delayValue >= 500) return 'destructive'; - if (delayValue >= 200) return 'outline'; + if (delayValue >= 150) return 'destructive'; return 'default'; } @@ -74,7 +75,7 @@ const ProxySelectItem = ({ proxyName, groupName }: { proxyName: string, groupNam isJustUpdated && "bg-primary/20 border-primary/50" )} > - {delay < 0 ? '---' : delay} + {(delay < 0) || (delay > 10000) ? '---' : delay} @@ -172,9 +173,16 @@ export const ProxySelectors: React.FC = () => { const selectorGroups = useMemo(() => { if (!proxies?.groups) return []; - return proxies.groups.filter((g: IProxyGroup) => g.type === 'Selector'); + + const allowedTypes = ["Selector", "URLTest", "Fallback"]; + + return proxies.groups.filter((g: IProxyGroup) => + allowedTypes.includes(g.type) && + !g.hidden + ); }, [proxies]); + const proxyOptions = useMemo(() => { let options: { name: string }[] = []; if (isDirectMode) return [{ name: "DIRECT" }]; @@ -202,11 +210,11 @@ export const ProxySelectors: React.FC = () => { return ( -
+
- + diff --git a/src/index.css b/src/index.css index 4a1fa7c0..9996c8df 100644 --- a/src/index.css +++ b/src/index.css @@ -74,6 +74,7 @@ --sidebar-accent-foreground: oklch(0.208 0.042 265.755); --sidebar-border: oklch(0.929 0.013 255.508); --sidebar-ring: oklch(0.704 0.04 256.788); + --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } .dark {