@@ -5,7 +5,7 @@ import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
5
5
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper" ;
6
6
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper" ;
7
7
import Grid from "@material-ui/core/Grid" ;
8
- import { factorForDropdown } from "../../../../common/utils" ;
8
+ import { factorForDropdown , getTotalSize } from "../../../../common/utils" ;
9
9
import { Button , LinearProgress } from "@material-ui/core" ;
10
10
11
11
interface IAddZoneProps {
@@ -30,6 +30,29 @@ const styles = (theme: Theme) =>
30
30
sizeFactorContainer : {
31
31
marginLeft : 8 ,
32
32
} ,
33
+ bottomContainer : {
34
+ display : "flex" ,
35
+ flexGrow : 1 ,
36
+ alignItems : "center" ,
37
+ "& div" : {
38
+ flexGrow : 1 ,
39
+ width : "100%" ,
40
+ } ,
41
+ } ,
42
+ factorElements : {
43
+ display : "flex" ,
44
+ justifyContent : "flex-start" ,
45
+ } ,
46
+ sizeNumber : {
47
+ fontSize : 35 ,
48
+ fontWeight : 700 ,
49
+ textAlign : "center" ,
50
+ } ,
51
+ sizeDescription : {
52
+ fontSize : 14 ,
53
+ color : "#777" ,
54
+ textAlign : "center" ,
55
+ } ,
33
56
...modalBasic ,
34
57
} ) ;
35
58
@@ -45,6 +68,11 @@ const AddZoneModal = ({
45
68
const [ sizeFactor , setSizeFactor ] = useState < string > ( "GiB" ) ;
46
69
const [ volumeConfiguration , setVolumeConfig ] = useState < string > ( "" ) ;
47
70
const [ storageClass , setStorageClass ] = useState < string > ( "" ) ;
71
+
72
+ const instanceCapacity : number =
73
+ parseFloat ( volumeConfiguration ) * volumesPerInstance ;
74
+ const totalCapacity : number = instanceCapacity * numberOfInstances ;
75
+
48
76
return (
49
77
< ModalWrapper
50
78
onClose = { ( ) => onCloseZoneAndReload ( false ) }
@@ -133,15 +161,31 @@ const AddZoneModal = ({
133
161
value = { storageClass }
134
162
/>
135
163
</ Grid >
136
- < Grid item xs = { 12 } className = { classes . buttonContainer } >
137
- < Button
138
- type = "submit"
139
- variant = "contained"
140
- color = "primary"
141
- disabled = { addSending }
142
- >
143
- Save
144
- </ Button >
164
+ < Grid item xs = { 12 } className = { classes . bottomContainer } >
165
+ < div className = { classes . factorElements } >
166
+ < div >
167
+ < div className = { classes . sizeNumber } >
168
+ { getTotalSize ( instanceCapacity . toString ( 10 ) , sizeFactor ) }
169
+ </ div >
170
+ < div className = { classes . sizeDescription } > Instance Capacity</ div >
171
+ </ div >
172
+ < div >
173
+ < div className = { classes . sizeNumber } >
174
+ { getTotalSize ( totalCapacity . toString ( 10 ) , sizeFactor ) }
175
+ </ div >
176
+ < div className = { classes . sizeDescription } > Total Capacity</ div >
177
+ </ div >
178
+ </ div >
179
+ < div className = { classes . buttonContainer } >
180
+ < Button
181
+ type = "submit"
182
+ variant = "contained"
183
+ color = "primary"
184
+ disabled = { addSending }
185
+ >
186
+ Save
187
+ </ Button >
188
+ </ div >
145
189
</ Grid >
146
190
{ addSending && (
147
191
< Grid item xs = { 12 } >
0 commit comments