fix(ui): завершить локальную приёмку оптимизатора
This commit is contained in:
1 parent
5a23dfcfe6
commit
66fde3fc62
8 files changed
+41
-16
No files matched your search
@@ -221,7 +221,7 @@ function buildMockData(settings: OptimizerSettings): OptimizerData {
|
||||
function Chip({ children, color }: { children: React.ReactNode; color?: string }) {
|
||||
return (
|
||||
<span className={cn(
|
||||
"inline-flex items-center rounded px-1.5 py-0.5 text-[11px] font-medium border",
|
||||
"inline-flex shrink-0 whitespace-nowrap items-center rounded px-1.5 py-0.5 text-[11px] font-medium border",
|
||||
color ?? "bg-muted text-muted-foreground border-border",
|
||||
)}>{children}</span>
|
||||
)
|
||||
@@ -232,7 +232,7 @@ function ProbChip({ prob, best }: { prob: number; best?: boolean }) {
|
||||
<Chip color={best
|
||||
? "bg-success/10 text-success border-success/20"
|
||||
: "bg-muted text-muted-foreground border-border"
|
||||
}>{prob} б.</Chip>
|
||||
}><span className="sr-only">Индекс модели: </span>{prob} б.</Chip>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ function ConfChip({ conf }: { conf: string }) {
|
||||
MEDIUM: "bg-warning/10 text-warning border-warning/20",
|
||||
LOW: "bg-destructive/10 text-destructive border-destructive/20",
|
||||
}
|
||||
return <Chip color={map[conf] ?? map.LOW}>{conf}</Chip>
|
||||
return <Chip color={map[conf] ?? map.LOW}><span className="sr-only">Категория модели: </span>{conf}</Chip>
|
||||
}
|
||||
|
||||
function NInput({ value, onChange, min, max, label, disabled }: { disabled?: boolean; label: string; value: number; onChange: (v: number) => void; min?: number; max?: number }) {
|
||||
@@ -289,21 +289,21 @@ function HomeRouterCard({ entry, jumpHosts, pinned, applied, applying, onPin, on
|
||||
{/* Header */}
|
||||
<div className="flex items-center gap-3 px-4 py-3 border-b flex-wrap">
|
||||
<MonitorIcon aria-hidden="true" className="size-4 text-muted-foreground shrink-0" />
|
||||
<div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="min-w-0">
|
||||
<div className="flex items-center gap-2 flex-wrap min-w-0">
|
||||
<Flag code={home.country} />
|
||||
<span className="text-sm font-semibold font-mono">{home.label}</span>
|
||||
<span className="text-xs text-muted-foreground">{home.site}</span>
|
||||
<span className="text-[10px] text-muted-foreground border border-border rounded px-1.5 py-0.5 font-mono">{home.model}</span>
|
||||
<span className="text-sm font-semibold font-mono break-all">{home.label}</span>
|
||||
<span className="text-xs text-muted-foreground break-all">{home.site}</span>
|
||||
<span className="text-[10px] text-muted-foreground border border-border rounded px-1.5 py-0.5 font-mono break-all">{home.model}</span>
|
||||
</div>
|
||||
<div className="text-[11px] text-muted-foreground font-mono mt-0.5">
|
||||
<div className="text-[11px] text-muted-foreground font-mono mt-0.5 break-all">
|
||||
{home.wans.map(w => `${w.name} (${w.isp} · ${w.ip})`).join(" · ")}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Best route summary */}
|
||||
{bestRoute && (
|
||||
<div className="flex items-center gap-1.5 ml-2 text-xs text-muted-foreground">
|
||||
<div className="flex items-center gap-1.5 ml-2 text-xs text-muted-foreground flex-wrap min-w-0 break-all">
|
||||
<span className="font-mono font-semibold text-info ">{bestRoute.wan.name}</span>
|
||||
<ArrowRightIcon aria-hidden="true" className="size-3" />
|
||||
<span>{bestRoute.jh.label}</span>
|
||||
@@ -312,7 +312,7 @@ function HomeRouterCard({ entry, jumpHosts, pinned, applied, applying, onPin, on
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="ml-auto flex items-center gap-2">
|
||||
<div className="ml-auto flex items-center gap-2 flex-wrap min-w-0 max-w-full">
|
||||
{switchCount > 0 && (
|
||||
<Chip color="bg-warning/10 text-warning border-warning/20">
|
||||
Рекомендаций: {switchCount}
|
||||
@@ -374,12 +374,12 @@ function TopologyBar() {
|
||||
<div className="flex items-center gap-3 text-xs text-muted-foreground flex-wrap">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<MonitorIcon aria-hidden="true" className="size-3.5" />
|
||||
<span>Home Router</span>
|
||||
<span>Схема: Home Router</span>
|
||||
</div>
|
||||
<span className="text-border">→</span>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<WifiIcon aria-hidden="true" className="size-3.5 text-info" />
|
||||
<span>WAN1 / WAN2</span>
|
||||
<span>WAN-аплинк</span>
|
||||
</div>
|
||||
<span className="text-border">→</span>
|
||||
<div className="flex items-center gap-1.5">
|
||||
|
||||
Reference in new issue
Block a user