|
106 | 106 | @update-template-iso="updateFieldValue" /> |
107 | 107 | <span> |
108 | 108 | {{ $t('label.override.rootdisk.size') }} |
109 | | - <a-switch :disabled="template.deployasis" @change="val => { this.showRootDiskSizeChanger = val }" style="margin-left: 10px;"/> |
| 109 | + <a-switch |
| 110 | + :checked="showRootDiskSizeChanger && rootDiskSizeFixed > 0" |
| 111 | + :disabled="rootDiskSizeFixed > 0 || template.deployasis" |
| 112 | + @change="val => { this.showRootDiskSizeChanger = val }" |
| 113 | + style="margin-left: 10px;"/> |
110 | 114 | <div v-if="template.deployasis"> {{ this.$t('message.deployasis') }} </div> |
111 | 115 | </span> |
112 | 116 | <disk-size-selection |
|
185 | 189 | </a-form-item> |
186 | 190 | <compute-offering-selection |
187 | 191 | :compute-items="options.serviceOfferings" |
188 | | - :selected-template="template" |
| 192 | + :selected-template="template ? template : {}" |
189 | 193 | :row-count="rowCount.serviceOfferings" |
190 | 194 | :zoneId="zoneId" |
191 | 195 | :value="serviceOffering ? serviceOffering.id : ''" |
@@ -771,7 +775,8 @@ export default { |
771 | 775 | dataPreFill: {}, |
772 | 776 | showDetails: false, |
773 | 777 | showRootDiskSizeChanger: false, |
774 | | - securitygroupids: [] |
| 778 | + securitygroupids: [], |
| 779 | + rootDiskSizeFixed: 0 |
775 | 780 | } |
776 | 781 | }, |
777 | 782 | computed: { |
@@ -1422,6 +1427,8 @@ export default { |
1422 | 1427 | } |
1423 | 1428 | if (this.showRootDiskSizeChanger && values.rootdisksize && values.rootdisksize > 0) { |
1424 | 1429 | deployVmData.rootdisksize = values.rootdisksize |
| 1430 | + } else if (this.rootDiskSizeFixed > 0) { |
| 1431 | + deployVmData.rootdisksize = this.rootDiskSizeFixed |
1425 | 1432 | } |
1426 | 1433 | if (values.hypervisor && values.hypervisor.length > 0) { |
1427 | 1434 | deployVmData.hypervisor = values.hypervisor |
@@ -1958,6 +1965,10 @@ export default { |
1958 | 1965 | this.updateFieldValue('memory', this.selectedTemplateConfiguration.memory) |
1959 | 1966 | } |
1960 | 1967 | } |
| 1968 | + if (offering && offering.rootdisksize > 0) { |
| 1969 | + this.rootDiskSizeFixed = offering.rootdisksize / (1024 * 1024 * 1024.0).toFixed(2) |
| 1970 | + this.showRootDiskSizeChanger = false |
| 1971 | + } |
1961 | 1972 | } |
1962 | 1973 | } |
1963 | 1974 | } |
|
0 commit comments