fix(ui): открывать GRE-туннель с контекстом сервера
This commit is contained in:
1 parent
6c8e66693b
commit
67a152b7c8
7 files changed
+188
-14
No files matched your search
@@ -96,6 +96,7 @@ function ServerTileRail({
|
||||
showType = true,
|
||||
headerRight,
|
||||
loading = false,
|
||||
preserveSelection = false,
|
||||
className,
|
||||
}: {
|
||||
items: ServerTileItem[]
|
||||
@@ -108,6 +109,7 @@ function ServerTileRail({
|
||||
showType?: boolean
|
||||
headerRight?: ReactNode
|
||||
loading?: boolean
|
||||
preserveSelection?: boolean
|
||||
className?: string
|
||||
}) {
|
||||
const [query, setQuery] = useState("")
|
||||
@@ -147,9 +149,10 @@ function ServerTileRail({
|
||||
const resolvedId = useMemo(() => {
|
||||
if (showAll && selectedId === ALL_SERVERS_ID) return ALL_SERVERS_ID
|
||||
if (items.some((item) => item.id === selectedId)) return selectedId
|
||||
if (preserveSelection) return ""
|
||||
if (showAll) return ALL_SERVERS_ID
|
||||
return items.find(isSelectable)?.id ?? items[0]?.id ?? ""
|
||||
}, [items, selectedId, showAll])
|
||||
}, [items, selectedId, showAll, preserveSelection])
|
||||
|
||||
useEffect(() => {
|
||||
if (resolvedId && resolvedId !== selectedId) onSelect(resolvedId)
|
||||
|
||||
Reference in new issue
Block a user