@@ -5,7 +5,7 @@ import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
55import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper" ;
66import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper" ;
77import Grid from "@material-ui/core/Grid" ;
8- import { factorForDropdown } from "../../../../common/utils" ;
8+ import { factorForDropdown , getTotalSize } from "../../../../common/utils" ;
99import { Button , LinearProgress } from "@material-ui/core" ;
1010
1111interface IAddZoneProps {
@@ -30,6 +30,29 @@ const styles = (theme: Theme) =>
3030 sizeFactorContainer : {
3131 marginLeft : 8 ,
3232 } ,
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+ } ,
3356 ...modalBasic ,
3457 } ) ;
3558
@@ -45,6 +68,11 @@ const AddZoneModal = ({
4568 const [ sizeFactor , setSizeFactor ] = useState < string > ( "GiB" ) ;
4669 const [ volumeConfiguration , setVolumeConfig ] = useState < string > ( "" ) ;
4770 const [ storageClass , setStorageClass ] = useState < string > ( "" ) ;
71+
72+ const instanceCapacity : number =
73+ parseFloat ( volumeConfiguration ) * volumesPerInstance ;
74+ const totalCapacity : number = instanceCapacity * numberOfInstances ;
75+
4876 return (
4977 < ModalWrapper
5078 onClose = { ( ) => onCloseZoneAndReload ( false ) }
@@ -133,15 +161,31 @@ const AddZoneModal = ({
133161 value = { storageClass }
134162 />
135163 </ 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 >
145189 </ Grid >
146190 { addSending && (
147191 < Grid item xs = { 12 } >
0 commit comments