fixed display of proxy groups and emoji on windows
This commit is contained in:
@@ -29,6 +29,7 @@ interface IProxyGroup {
|
|||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string;
|
||||||
now: string;
|
now: string;
|
||||||
|
hidden: boolean;
|
||||||
all: (string | { name: string })[];
|
all: (string | { name: string })[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ function getDelayBadgeVariant(delayValue: number): 'default' | 'secondary' | 'de
|
|||||||
if (delayValue < 0) return 'secondary';
|
if (delayValue < 0) return 'secondary';
|
||||||
if (delayValue >= 10000) return 'destructive';
|
if (delayValue >= 10000) return 'destructive';
|
||||||
if (delayValue >= 500) return 'destructive';
|
if (delayValue >= 500) return 'destructive';
|
||||||
if (delayValue >= 200) return 'outline';
|
if (delayValue >= 150) return 'destructive';
|
||||||
return 'default';
|
return 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ const ProxySelectItem = ({ proxyName, groupName }: { proxyName: string, groupNam
|
|||||||
isJustUpdated && "bg-primary/20 border-primary/50"
|
isJustUpdated && "bg-primary/20 border-primary/50"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{delay < 0 ? '---' : delay}
|
{(delay < 0) || (delay > 10000) ? '---' : delay}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
@@ -172,9 +173,16 @@ export const ProxySelectors: React.FC = () => {
|
|||||||
|
|
||||||
const selectorGroups = useMemo(() => {
|
const selectorGroups = useMemo(() => {
|
||||||
if (!proxies?.groups) return [];
|
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]);
|
}, [proxies]);
|
||||||
|
|
||||||
|
|
||||||
const proxyOptions = useMemo(() => {
|
const proxyOptions = useMemo(() => {
|
||||||
let options: { name: string }[] = [];
|
let options: { name: string }[] = [];
|
||||||
if (isDirectMode) return [{ name: "DIRECT" }];
|
if (isDirectMode) return [{ name: "DIRECT" }];
|
||||||
@@ -202,11 +210,11 @@ export const ProxySelectors: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<div className="flex justify-center flex-col md:flex-row gap-2 md:items-end">
|
<div className="flex justify-center flex-col gap-2 md:items-end">
|
||||||
<div className="flex flex-col items-start gap-2">
|
<div className="flex flex-col items-start gap-2">
|
||||||
<label className="text-sm font-medium text-muted-foreground">{t("Group")}</label>
|
<label className="text-sm font-medium text-muted-foreground">{t("Group")}</label>
|
||||||
<Select value={selectedGroup} onValueChange={handleGroupChange} disabled={isGlobalMode || isDirectMode}>
|
<Select value={selectedGroup} onValueChange={handleGroupChange} disabled={isGlobalMode || isDirectMode}>
|
||||||
<SelectTrigger className="w-48">
|
<SelectTrigger className="w-100">
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
@@ -227,7 +235,7 @@ export const ProxySelectors: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col items-start gap-2">
|
<div className="flex flex-col items-start gap-2">
|
||||||
<div className="flex justify-between items-center w-48">
|
<div className="flex justify-between items-center w-100">
|
||||||
<label className="text-sm font-medium text-muted-foreground">{t("Proxy")}</label>
|
<label className="text-sm font-medium text-muted-foreground">{t("Proxy")}</label>
|
||||||
<Button variant="ghost" size="sm" onClick={handleSortChange} disabled={isDirectMode}>
|
<Button variant="ghost" size="sm" onClick={handleSortChange} disabled={isDirectMode}>
|
||||||
{sortType === 'default' && <ChevronsUpDown className="h-4 w-4" />}
|
{sortType === 'default' && <ChevronsUpDown className="h-4 w-4" />}
|
||||||
@@ -236,7 +244,7 @@ export const ProxySelectors: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<Select value={selectedProxy} onValueChange={handleProxyChange} disabled={isDirectMode}>
|
<Select value={selectedProxy} onValueChange={handleProxyChange} disabled={isDirectMode}>
|
||||||
<SelectTrigger className="w-48">
|
<SelectTrigger className="w-100">
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
--sidebar-accent-foreground: oklch(0.208 0.042 265.755);
|
--sidebar-accent-foreground: oklch(0.208 0.042 265.755);
|
||||||
--sidebar-border: oklch(0.929 0.013 255.508);
|
--sidebar-border: oklch(0.929 0.013 255.508);
|
||||||
--sidebar-ring: oklch(0.704 0.04 256.788);
|
--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 {
|
.dark {
|
||||||
|
|||||||
Reference in New Issue
Block a user