@@ -50,6 +50,7 @@ import { CopyableIp } from '~/ui/lib/CopyableIp'
50
50
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
51
51
import { TableEmptyBox } from '~/ui/lib/Table'
52
52
import { TipIcon } from '~/ui/lib/TipIcon'
53
+ import { Tooltip } from '~/ui/lib/Tooltip'
53
54
import { ALL_ISH } from '~/util/consts'
54
55
import { pb } from '~/util/path-builder'
55
56
@@ -85,27 +86,35 @@ const SubnetNameFromId = ({ value }: { value: string }) => {
85
86
return < span className = "text-default" > { subnet . name } </ span >
86
87
}
87
88
89
+ const EphemeralIPEmptyCell = ( ) => (
90
+ < Tooltip content = "Ephemeral IPs don’t have names or descriptions" placement = "top" >
91
+ < div >
92
+ < EmptyCell />
93
+ </ div >
94
+ </ Tooltip >
95
+ )
96
+
88
97
export async function clientLoader ( { params } : LoaderFunctionArgs ) {
89
98
const { project, instance } = getInstanceSelector ( params )
90
99
await Promise . all ( [
91
- apiQueryClient . prefetchQuery ( 'instanceNetworkInterfaceList' , {
100
+ apiQueryClient . fetchQuery ( 'instanceNetworkInterfaceList' , {
92
101
// we want this to cover all NICs; TODO: determine actual limit?
93
102
query : { project, instance, limit : ALL_ISH } ,
94
103
} ) ,
95
- apiQueryClient . prefetchQuery ( 'floatingIpList' , { query : { project, limit : ALL_ISH } } ) ,
104
+ apiQueryClient . fetchQuery ( 'floatingIpList' , { query : { project, limit : ALL_ISH } } ) ,
96
105
// dupe of page-level fetch but that's fine, RQ dedupes
97
- apiQueryClient . prefetchQuery ( 'instanceExternalIpList' , {
106
+ apiQueryClient . fetchQuery ( 'instanceExternalIpList' , {
98
107
path : { instance } ,
99
108
query : { project } ,
100
109
} ) ,
101
110
// This is covered by the InstancePage loader but there's no downside to
102
111
// being redundant. If it were removed there, we'd still want it here.
103
- apiQueryClient . prefetchQuery ( 'instanceView' , {
112
+ apiQueryClient . fetchQuery ( 'instanceView' , {
104
113
path : { instance } ,
105
114
query : { project } ,
106
115
} ) ,
107
116
// This is used in AttachEphemeralIpModal
108
- apiQueryClient . prefetchQuery ( 'projectIpPoolList' , { query : { limit : ALL_ISH } } ) ,
117
+ apiQueryClient . fetchQuery ( 'projectIpPoolList' , { query : { limit : ALL_ISH } } ) ,
109
118
] )
110
119
return null
111
120
}
@@ -171,11 +180,17 @@ const staticIpCols = [
171
180
cell : ( info ) => < Badge color = "neutral" > { info . getValue ( ) } </ Badge > ,
172
181
} ) ,
173
182
ipColHelper . accessor ( 'name' , {
174
- cell : ( info ) => ( info . getValue ( ) ? info . getValue ( ) : < EmptyCell /> ) ,
183
+ cell : ( info ) =>
184
+ info . row . original . kind === 'ephemeral' ? < EphemeralIPEmptyCell /> : info . getValue ( ) ,
175
185
} ) ,
176
186
ipColHelper . accessor ( ( row ) => ( 'description' in row ? row . description : undefined ) , {
177
187
header : 'description' ,
178
- cell : ( info ) => < DescriptionCell text = { info . getValue ( ) } /> ,
188
+ cell : ( info ) =>
189
+ info . row . original . kind === 'ephemeral' ? (
190
+ < EphemeralIPEmptyCell />
191
+ ) : (
192
+ < DescriptionCell text = { info . getValue ( ) } />
193
+ ) ,
179
194
} ) ,
180
195
]
181
196
0 commit comments