ch4n3.yoon

[Edit] fix bug

...@@ -16,6 +16,10 @@ import { ...@@ -16,6 +16,10 @@ import {
16 FormLabel, 16 FormLabel,
17 FormErrorMessage, 17 FormErrorMessage,
18 FormHelperText, 18 FormHelperText,
19 + VStack,
20 + StackDivider,
21 + Box,
22 + Text,
19 } from '@chakra-ui/react' 23 } from '@chakra-ui/react'
20 import http from '../utils/http' 24 import http from '../utils/http'
21 25
...@@ -118,11 +122,14 @@ const DockerContainerCreate = () => { ...@@ -118,11 +122,14 @@ const DockerContainerCreate = () => {
118 return ( 122 return (
119 <Container> 123 <Container>
120 <Divider hidden/> 124 <Divider hidden/>
121 - <Segment raised> 125 + <Heading>Create Docker Container</Heading>
122 - <Heading size='huge'>Create your own docker container</Heading>
123 - <Divider hidden/>
124 126
125 - <FormControl id="container"> 127 + <VStack
128 + divider={<StackDivider borderColor="gray.200"/>}
129 + spacing={4}
130 + align="stretch"
131 + >
132 + <FormControl id="container" isRequired>
126 <FormLabel>Container Name</FormLabel> 133 <FormLabel>Container Name</FormLabel>
127 <Input 134 <Input
128 type="email" 135 type="email"
...@@ -131,85 +138,22 @@ const DockerContainerCreate = () => { ...@@ -131,85 +138,22 @@ const DockerContainerCreate = () => {
131 <FormHelperText>컨테이너 이름을 입력해주세요.</FormHelperText> 138 <FormHelperText>컨테이너 이름을 입력해주세요.</FormHelperText>
132 </FormControl> 139 </FormControl>
133 140
134 - <div> 141 + <FormControl id="image">
135 - <Input 142 + <FormLabel>Image</FormLabel>
136 - label='Container Name' 143 + <Select placeholder="생성할 컨테이너의 OS를 설정해주세요">
137 - placeholder='Container Name' 144 + <option value="ubuntu 18.04">Ubuntu 18.04.5 LTS</option>
138 - onChange={handleContainerName} 145 + <option value="ubuntu 20.04">Ubuntu 20.04.2 LTS</option>
139 - />
140 -
141 - <Select label='Image'>
142 - <option value="option1">Option 1</option>
143 - <option value="option2">Option 2</option>
144 - <option value="option3">Option 3</option>
145 </Select> 146 </Select>
147 + </FormControl>
146 148
147 - {/*<Form.Group> 149 + <Button size="md" colorScheme="green" mt="24px"
148 - <Form.Dropdown 150 + onClick={() => createContainer()}
149 - label='Image' 151 + >
150 - selection 152 + Create Container
151 - options={getImageDropdownOptions()} 153 + </Button>
152 - defaultValue={getImageDropdownOptions()[0]} 154 + </VStack>
153 - onChange={handleImage}
154 - />
155 - </Form.Group>*/}
156 155
157 - <Input
158 - type='number'
159 - label='SSH Port'
160 - placeholder='22'
161 - disabled={randomPort}
162 - onChange={handlePort}
163 - />
164 156
165 - {/*<Form.Group>
166 - <Form.Input
167 - type='number'
168 - label='SSH Port'
169 - placeholder='22'
170 - disabled={randomPort}
171 - onChange={handlePort}
172 - />
173 - </Form.Group>*/}
174 - <Checkbox
175 - label='Use random port'
176 - checked={randomPort}
177 - onChange={handleRandomPort}
178 - />
179 - <Button
180 - color='violet'
181 - onClick={createContainer}
182 - content='Create'
183 - />
184 - <Button
185 - content='Container List'
186 - onClick={() => history.push('/docker/container/')}
187 - />
188 - </div>
189 - {/*
190 - <Transition.Group
191 - duration={300}
192 - >
193 - {isSuccess && (
194 - <>
195 - <Divider/>
196 - <Message
197 - success
198 - content={ssh}
199 - />
200 - </>
201 - )}
202 - {error && (
203 - <>
204 - <Divider/>
205 - <Message
206 - error
207 - content={error}
208 - />
209 - </>
210 - )}
211 - </Transition.Group>*/}
212 - </Segment>
213 </Container> 157 </Container>
214 ) 158 )
215 } 159 }
......