Skip to content

Commit 06c2e72

Browse files
authored
Move IP Address column in Internet Gateways table (#2839)
1 parent e71c828 commit 06c2e72

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

app/pages/project/vpcs/VpcGatewaysTab.tsx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { Columns } from '~/table/columns/common'
2020
import { useQueryTable } from '~/table/QueryTable'
2121
import { CopyableIp } from '~/ui/lib/CopyableIp'
2222
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
23+
import { TipIcon } from '~/ui/lib/TipIcon'
2324
import { ALL_ISH } from '~/util/consts'
2425
import { pb } from '~/util/path-builder'
2526
import type * as PP from '~/util/path-params'
@@ -68,17 +69,15 @@ export async function clientLoader({ params }: LoaderFunctionArgs) {
6869

6970
await Promise.all([
7071
...gateways.items.flatMap((gateway: InternetGateway) => [
71-
queryClient.prefetchQuery(
72+
queryClient.fetchQuery(
7273
gatewayIpAddressList({ project, vpc, gateway: gateway.name }).optionsFn()
7374
),
74-
queryClient.prefetchQuery(
75+
queryClient.fetchQuery(
7576
gatewayIpPoolList({ project, vpc, gateway: gateway.name }).optionsFn()
7677
),
7778
]),
7879
...routers.items.map((router) =>
79-
queryClient.prefetchQuery(
80-
routeList({ project, vpc, router: router.name }).optionsFn()
81-
)
80+
queryClient.fetchQuery(routeList({ project, vpc, router: router.name }).optionsFn())
8281
),
8382
queryClient.fetchQuery(projectIpPoolList.optionsFn()).then((pools) => {
8483
for (const pool of pools.items) {
@@ -91,6 +90,16 @@ export async function clientLoader({ params }: LoaderFunctionArgs) {
9190
return null
9291
}
9392

93+
export const AttachedIpAddressHeader = () => (
94+
<>
95+
Attached IP Address
96+
<TipIcon className="ml-1.5">
97+
Internet gateways without an IP address attached will use an address from the attached
98+
IP pool
99+
</TipIcon>
100+
</>
101+
)
102+
94103
export default function VpcInternetGatewaysTab() {
95104
const { project, vpc } = useVpcSelector()
96105

@@ -111,18 +120,18 @@ export default function VpcInternetGatewaysTab() {
111120
colHelper.accessor('description', Columns.description),
112121
colHelper.accessor('name', {
113122
// ID needed to avoid key collision with other name column
114-
id: 'ip-address',
115-
header: 'Attached IP Address',
123+
id: 'ip-pool',
124+
header: 'Attached IP Pool',
116125
cell: (info) => (
117-
<IpAddressCell project={project} vpc={vpc} gateway={info.getValue()} />
126+
<GatewayIpPoolCell project={project} vpc={vpc} gateway={info.getValue()} />
118127
),
119128
}),
120129
colHelper.accessor('name', {
121130
// ID needed to avoid key collision with other name column
122-
id: 'ip-pool',
123-
header: 'Attached IP Pool',
131+
id: 'ip-address',
132+
header: AttachedIpAddressHeader,
124133
cell: (info) => (
125-
<GatewayIpPoolCell project={project} vpc={vpc} gateway={info.getValue()} />
134+
<IpAddressCell project={project} vpc={vpc} gateway={info.getValue()} />
126135
),
127136
}),
128137
colHelper.accessor('name', {

0 commit comments

Comments
 (0)