fix(ui): открывать GRE-туннель с контекстом сервера
This commit is contained in:
1 parent
6c8e66693b
commit
67a152b7c8
7 files changed
+188
-14
No files matched your search
@@ -95,6 +95,7 @@ function ServerRailLayout({
|
||||
showType = true,
|
||||
headerRight,
|
||||
loading = false,
|
||||
preserveSelection = false,
|
||||
extra,
|
||||
header,
|
||||
banner,
|
||||
@@ -110,6 +111,7 @@ function ServerRailLayout({
|
||||
showType?: boolean
|
||||
headerRight?: ReactNode
|
||||
loading?: boolean
|
||||
preserveSelection?: boolean
|
||||
extra?: ReactNode
|
||||
header?: ReactNode
|
||||
banner?: ReactNode
|
||||
@@ -185,6 +187,7 @@ function ServerRailLayout({
|
||||
showType={showType}
|
||||
headerRight={railHeaderRight}
|
||||
loading={loading}
|
||||
preserveSelection={preserveSelection}
|
||||
className="min-h-0 flex-1"
|
||||
/>
|
||||
)
|
||||
@@ -222,6 +225,7 @@ function ServerRailLayout({
|
||||
showHeader={false}
|
||||
headerRight={headerRight}
|
||||
loading={loading}
|
||||
preserveSelection={preserveSelection}
|
||||
className="min-h-0 flex-1"
|
||||
/>
|
||||
{extra}
|
||||
|
||||
@@ -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