fix(ui): завершить адаптивность оптимизатора маршрутов
This commit is contained in:
1 parent
0ee7f02e87
commit
fb70d80220
18 files changed
+173
-122
No files matched your search
@@ -37,7 +37,7 @@ function ProbChip({ prob, best }: { prob: number; best?: boolean }) {
|
||||
<Chip
|
||||
color={
|
||||
best
|
||||
? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20"
|
||||
? "bg-success/10 text-success border-success/20"
|
||||
: "bg-muted text-muted-foreground border-border"
|
||||
}
|
||||
>
|
||||
@@ -48,9 +48,9 @@ function ProbChip({ prob, best }: { prob: number; best?: boolean }) {
|
||||
|
||||
function ConfChip({ conf }: { conf: string }) {
|
||||
const map: Record<string, string> = {
|
||||
HIGH: "bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-500/20",
|
||||
MEDIUM: "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",
|
||||
LOW: "bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",
|
||||
HIGH: "bg-info/10 text-info border-info/20",
|
||||
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>
|
||||
}
|
||||
@@ -86,7 +86,7 @@ function RouteOptimizerFullRoutesDataGrid({
|
||||
{row.original._index + 1}
|
||||
</span>
|
||||
{isBest && (
|
||||
<span className="text-[9px] font-bold uppercase tracking-wide text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-1.5 py-0.5 rounded">
|
||||
<span className="text-[9px] font-bold uppercase tracking-wide text-success bg-success/10 border border-success/20 px-1.5 py-0.5 rounded">
|
||||
Лучший
|
||||
</span>
|
||||
)}
|
||||
@@ -103,8 +103,8 @@ function RouteOptimizerFullRoutesDataGrid({
|
||||
const r = row.original
|
||||
return (
|
||||
<div className="flex items-center gap-1.5 text-xs">
|
||||
<span className="font-mono font-semibold text-sky-600 dark:text-sky-400">{r.wan.name}</span>
|
||||
<ArrowRightIcon className="size-3 text-muted-foreground shrink-0" />
|
||||
<span className="font-mono font-semibold text-info ">{r.wan.name}</span>
|
||||
<ArrowRightIcon aria-hidden="true" className="size-3 text-muted-foreground shrink-0" />
|
||||
<div>
|
||||
<div className="font-medium">{r.jh.label}</div>
|
||||
<div className="font-mono text-[10px] text-muted-foreground">
|
||||
@@ -150,10 +150,10 @@ function RouteOptimizerFullRoutesDataGrid({
|
||||
className={cn(
|
||||
"font-mono text-xs text-center block",
|
||||
totalPing < 40
|
||||
? "text-emerald-600 dark:text-emerald-400"
|
||||
? "text-success "
|
||||
: totalPing < 80
|
||||
? "text-amber-600 dark:text-amber-400"
|
||||
: "text-red-500",
|
||||
? "text-warning "
|
||||
: "text-destructive",
|
||||
)}
|
||||
>
|
||||
{totalPing} мс
|
||||
@@ -263,7 +263,7 @@ function RouteOptimizerFullRoutesDataGrid({
|
||||
recordCount={visibleRoutes.length}
|
||||
tableClassNames={{
|
||||
headerRow: "border-b bg-muted/20",
|
||||
bodyRow: cn("group/row hover:bg-muted/30", "has-[[data-route-best=true]]:bg-emerald-500/5"),
|
||||
bodyRow: cn("group/row hover:bg-muted/30", "has-[[data-route-best=true]]:bg-success/5"),
|
||||
}}
|
||||
tableLayout={{ dense: true }}
|
||||
/>
|
||||
@@ -275,12 +275,12 @@ function RouteOptimizerFullRoutesDataGrid({
|
||||
>
|
||||
{expanded ? (
|
||||
<>
|
||||
<ChevronUpIcon className="size-3" />
|
||||
<ChevronUpIcon aria-hidden="true" className="size-3" />
|
||||
Свернуть
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<ChevronDownIcon className="size-3" />
|
||||
<ChevronDownIcon aria-hidden="true" className="size-3" />
|
||||
Показать все {routes.length} комбинаций
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user