@@ -25,6 +25,7 @@ import {
25
25
type InstanceCreate ,
26
26
type InstanceDiskAttachment ,
27
27
type NameOrId ,
28
+ type SiloIpPool ,
28
29
} from '@oxide/api'
29
30
import {
30
31
Images16Icon ,
@@ -46,6 +47,7 @@ import {
46
47
} from '~/components/form/fields/DisksTableField'
47
48
import { FileField } from '~/components/form/fields/FileField'
48
49
import { BootDiskImageSelectField as ImageSelectField } from '~/components/form/fields/ImageSelectField'
50
+ import { toIpPoolItem } from '~/components/form/fields/ip-pool-item'
49
51
import { NameField } from '~/components/form/fields/NameField'
50
52
import { NetworkInterfaceField } from '~/components/form/fields/NetworkInterfaceField'
51
53
import { NumberField } from '~/components/form/fields/NumberField'
@@ -57,7 +59,6 @@ import { FullPageForm } from '~/components/form/FullPageForm'
57
59
import { HL } from '~/components/HL'
58
60
import { getProjectSelector , useProjectSelector } from '~/hooks/use-params'
59
61
import { addToast } from '~/stores/toast'
60
- import { Badge } from '~/ui/lib/Badge'
61
62
import { Button } from '~/ui/lib/Button'
62
63
import { Checkbox } from '~/ui/lib/Checkbox'
63
64
import { toComboboxItems } from '~/ui/lib/Combobox'
@@ -609,7 +610,7 @@ const AdvancedAccordion = ({
609
610
} : {
610
611
control : Control < InstanceCreateInput >
611
612
isSubmitting : boolean
612
- siloPools : Array < { name : string ; isDefault : boolean } >
613
+ siloPools : Array < SiloIpPool >
613
614
} ) => {
614
615
// we track this state manually for the sole reason that we need to be able to
615
616
// tell, inside AccordionItem, when an accordion is opened so we can scroll its
@@ -733,17 +734,7 @@ const AdvancedAccordion = ({
733
734
label = "IP pool for ephemeral IP"
734
735
placeholder = { defaultPool ? `${ defaultPool } (default)` : 'Select a pool' }
735
736
selected = { `${ siloPools . find ( ( pool ) => pool . name === selectedPool ) ?. name } ` }
736
- items = {
737
- siloPools . map ( ( pool ) => ( {
738
- label : (
739
- < div className = "flex items-center gap-2" >
740
- { pool . name }
741
- { pool . isDefault && < Badge > default</ Badge > }
742
- </ div >
743
- ) ,
744
- value : pool . name ,
745
- } ) ) || [ ]
746
- }
737
+ items = { siloPools . map ( toIpPoolItem ) }
747
738
disabled = { ! assignEphemeralIp || isSubmitting }
748
739
required
749
740
onChange = { ( value ) => {
0 commit comments