Skip to content

Commit

Permalink
fix(url): rewrite url to :ns/:name pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Apr 3, 2024
1 parent 3d513c4 commit 7b0cc68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ui/src/pages/Cluster/Detail/Connection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { OBTerminal } from '@/components/Terminal/terminal'
import { Button, Row, message } from 'antd'
import { request } from '@umijs/max'
import { useRequest } from 'ahooks'
import { getNSName } from '../Overview/helper'
import { getClusterDetailReq } from '@/services'
import BasicInfo from '../Overview/BasicInfo'
import { useParams } from '@umijs/max'


const ClusterConnection: React.FC = () => {
Expand All @@ -19,10 +19,10 @@ const ClusterConnection: React.FC = () => {
})
}
}
const [[ns, name]] = useState(getNSName())
const {ns, name} = useParams();

const { data: clusterDetail } = useRequest(getClusterDetailReq, {
defaultParams: [{ name, ns }],
defaultParams: [{ name: name!, ns: ns! }],
})

const { runAsync } = useRequest(async (): Promise<{
Expand Down
7 changes: 3 additions & 4 deletions ui/src/pages/Tenant/Detail/Connection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { PageContainer } from '@ant-design/pro-components'
import { intl } from '@/utils/intl'
import { OBTerminal } from '@/components/Terminal/terminal'
import { Button, Row, message } from 'antd'
import { request } from '@umijs/max'
import { request, useParams } from '@umijs/max'
import { useRequest } from 'ahooks'
import { getNSName } from '@/pages/Cluster/Detail/Overview/helper';
import BasicInfo from '../Overview/BasicInfo'
import { getTenant } from '@/services/tenant'

Expand All @@ -20,7 +19,7 @@ const TenantConnection: React.FC = () => {
}
}

const [[ns, name]] = useState(getNSName());
const {ns, name} = useParams();

const { data: tenantDetailResponse, run: getTenantDetail } = useRequest(getTenant, {
manual: true,
Expand All @@ -37,7 +36,7 @@ const TenantConnection: React.FC = () => {
})

useEffect(() => {
getTenantDetail({ ns, name });
getTenantDetail({ ns: ns!, name: name! });
}, []);

const [terminalId, setTerminalId] = useState<string>()
Expand Down

0 comments on commit 7b0cc68

Please sign in to comment.