File tree Expand file tree Collapse file tree
web/src/pages/ansible/docker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,10 @@ export const OSOptions = [
44 label : 'Ubuntu' ,
55 } ,
66] ;
7+
8+ export const versionOptions = [
9+ {
10+ label : 'Latest' ,
11+ value : 'latest' ,
12+ } ,
13+ ] ;
Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ import { FormWrapper } from '@/components/form/form-wrapper';
1717import { FormInput } from '@/components/form/form-input' ;
1818import HostsField from './components/hosts-fields' ;
1919import { FormSelect } from '@/components/form/form-select' ;
20- import { OSOptions } from './data/select-options' ;
20+ import { OSOptions , versionOptions } from './data/select-options' ;
2121
2222const DockerAnsible : FC = ( ) => {
2323 const defaultValues = {
2424 ansible_user : '' ,
2525 os : { label : 'Ubuntu' , value : 'ubuntu' } ,
2626 hosts : [ { value : '' } ] ,
27+ version : {
28+ label : 'Latest' ,
29+ value : 'latest' ,
30+ } ,
2731 } ;
2832
2933 const methods = useForm < DockerAnsible > ( {
@@ -49,6 +53,7 @@ const DockerAnsible: FC = () => {
4953 ...data ,
5054 hosts : data . hosts . map ( ( host ) => host . value ) ,
5155 os : data . os . value ,
56+ version : data . version . value ,
5257 } ;
5358
5459 await dockerAnsibleMutate ( body ) ;
@@ -94,7 +99,17 @@ const DockerAnsible: FC = () => {
9499 options = { OSOptions }
95100 />
96101 </ div >
97- < HostsField />
102+ < div className = "mb-4" >
103+ < HostsField />
104+ </ div >
105+ < div className = "mb-4" >
106+ < FormSelect
107+ name = { `version` }
108+ label = "Version"
109+ placeholder = "Select..."
110+ options = { versionOptions }
111+ />
112+ </ div >
98113 < button
99114 type = "submit"
100115 disabled = { dockerAnsiblePending }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export interface DockerAnsibleBody {
99 ansible_port : number ;
1010 os : string ;
1111 hosts : string [ ] ;
12+ version : string ;
1213}
1314
1415export interface dockerTemplateValidationError {
@@ -38,6 +39,10 @@ export const dockerAnsibleSchema = zod.object({
3839 } ) ,
3940 )
4041 . min ( 1 ) ,
42+ version : zod . object ( {
43+ label : zod . string ( ) ,
44+ value : zod . string ( ) ,
45+ } ) ,
4146} ) ;
4247
4348export type DockerAnsible = zod . infer < typeof dockerAnsibleSchema > ;
You can’t perform that action at this time.
0 commit comments