@@ -151,7 +151,8 @@ const TEMPLATE_SELECT_OPTIONS = [
151151 value: {' value' : ' Memory Cube XL' , ' name' : ' Memory Cube XL' }
152152 },
153153]
154- const DISK_TYPE_SELECT_OPTIONS = [
154+
155+ const ADDITIONAL_DISK_TYPE_OPTIONS = [
155156 {
156157 label: ' HDD' ,
157158 value: {' value' : ' HDD' , ' name' : ' HDD' }
@@ -168,6 +169,9 @@ const DISK_TYPE_SELECT_OPTIONS = [
168169 label: ' SSD Premium' ,
169170 value: {' value' : ' SSD Premium' , ' name' : ' SSD Premium' }
170171 },
172+ ]
173+
174+ const DISK_TYPE_SELECT_OPTIONS = ADDITIONAL_DISK_TYPE_OPTIONS .concat ([
171175 {
172176 label: ' DAS' ,
173177 value: {' value' : ' DAS' , ' name' : ' DAS' }
@@ -176,7 +180,7 @@ const DISK_TYPE_SELECT_OPTIONS = [
176180 label: ' ISO' ,
177181 value: {' value' : ' ISO' , ' name' : ' ISO' }
178182 },
179- ]
183+ ])
180184
181185function initSelect (initialValue , defaultSelectOptions , apiSelectOptions ) {
182186 let usedSelectOptions = apiSelectOptions || defaultSelectOptions
@@ -455,6 +459,7 @@ export default defineComponent({
455459 nicDhcp: this .value ? .nicDhcp || false ,
456460 nicIps: this .value ? .nicIps || [],
457461 additionalLans: this .value ? .additionalLans || [],
462+ additionalDisks: this .value ? .additionalDisks || [],
458463 waitForIpChange: this .value ? .waitForIpChange || false ,
459464 waitForIpChangeTimeout: this .value ? .waitForIpChangeTimeout || ' 600' ,
460465 natId: this .value ? .natId ,
@@ -525,6 +530,31 @@ export default defineComponent({
525530 this .additionalLans = event ;
526531 },
527532
533+ onChangeAdditionalDisks (event ) {
534+
535+ for (let el of event ) {
536+ let spl = el .split (' :' )
537+ if (spl .length != 2 ) {
538+ alert (' Invalid entry detected: ' + el + ' . The accepted format is DISK_TYPE:DISK_SIZE!' );
539+ return ;
540+ }
541+ let diskType = spl[0 ]
542+ if (! ADDITIONAL_DISK_TYPE_OPTIONS .map ((val ) => {return val .value .value }).includes (diskType)) {
543+ alert (' Invalid Disk Type detected: ' + diskType + ' . Must the one of ' + ADDITIONAL_DISK_TYPE_OPTIONS .map ((val ) => {return val .value .value }));
544+ return ;
545+ }
546+ ADDITIONAL_DISK_TYPE_OPTIONS .map ((val ) => {return val .value .value })
547+
548+ let diskSize = spl[1 ]
549+ if (Number .isNaN (parseInt (diskSize))) {
550+ alert (' Invalid disk size detected: ' + diskSize );
551+ return ;
552+ }
553+ }
554+
555+ this .additionalDisks = event .sort ();
556+ },
557+
528558 onChangeNatPublicIps (event ) {
529559 for (let ip of event ) {
530560 if (! validateIp (ip)) {
@@ -722,6 +752,7 @@ export default defineComponent({
722752 this .value .nicDhcp = this .nicDhcp ;
723753 this .value .nicIps = this .nicIps ;
724754 this .value .additionalLans = this .additionalLans ;
755+ this .value .additionalDisks = this .additionalDisks ;
725756 this .value .waitForIpChange = this .waitForIpChange ;
726757 this .value .waitForIpChangeTimeout = this .waitForIpChangeTimeout ;
727758 this .value .natId = this .natId ;
@@ -990,6 +1021,17 @@ export default defineComponent({
9901021 / >
9911022 < p class = " help-block" > Optional . Exiting Ionos LAN names . Every LAN in the datacenter which has its name in this list will be connected to the server, names which are not found will be ignored.< / p>
9921023 < / div>
1024+ < div class = " col span-4" >
1025+ < StringList
1026+ label= " Additional Disks"
1027+ v- model: value= " additionalDisks"
1028+ : items= " additionalDisks"
1029+ : mode= " mode"
1030+ : disabled= " busy"
1031+ @change= " onChangeAdditionalDisks($event)"
1032+ / >
1033+ < p class = " help-block" > Optional . Additional disks, the format for a disk is DISK_TYPE : SIZE .< / p>
1034+ < / div>
9931035 < / div>
9941036 < div class = " row mt-10" >
9951037 < div class = " col span-4" >
0 commit comments