Skip to content

Commit db167c0

Browse files
committed
ui: option to apply same pool to all volumes during vm migrate
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent db5b6a5 commit db167c0

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@
380380
"label.app.name": "CloudStack",
381381
"label.application.policy.set": "Application Policy Set",
382382
"label.apply": "Apply",
383+
"label.apply.to.all": "Apply to all",
383384
"label.apply.tungsten.firewall.policy": "Apply Firewall Policy",
384385
"label.apply.tungsten.network.policy": "Apply Network Policy",
385386
"label.apply.tungsten.tag": "Apply tag",
@@ -3686,6 +3687,7 @@
36863687
"message.vnf.nic.move.down.fail": "Failed to move down this NIC",
36873688
"message.vnf.no.credentials": "No credentials found for the VNF appliance.",
36883689
"message.vnf.select.networks": "Please select the relevant network for each VNF NIC.",
3690+
"message.volume.pool.apply.to.all": "Selected storage pool will be applied to all existing volumes of the instance.",
36893691
"message.volume.state.allocated": "The volume is allocated but has not been created yet.",
36903692
"message.volume.state.attaching": "The volume is attaching to a volume from Ready state.",
36913693
"message.volume.state.copying": "The volume is being copied from the image store to primary storage, in case it's an uploaded volume.",

ui/src/components/view/InstanceVolumesStoragePoolSelectListView.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,19 @@ export default {
206206
closeVolumeStoragePoolSelector () {
207207
this.selectedVolumeForStoragePoolSelection = {}
208208
},
209-
handleVolumeStoragePoolSelection (volumeId, storagePool) {
209+
handleVolumeStoragePoolSelection (volumeId, storagePool, applyToAll) {
210210
for (const volume of this.volumes) {
211-
if (volume.id === volumeId) {
211+
if (applyToAll) {
212212
volume.selectedstorageid = storagePool.id
213213
volume.selectedstoragename = storagePool.name
214214
volume.selectedstorageclusterid = storagePool.clusterid
215-
break
215+
} else {
216+
if (volume.id === volumeId) {
217+
volume.selectedstorageid = storagePool.id
218+
volume.selectedstoragename = storagePool.name
219+
volume.selectedstorageclusterid = storagePool.clusterid
220+
break
221+
}
216222
}
217223
}
218224
this.updateVolumeToStoragePoolSelection()

ui/src/components/view/VolumeStoragePoolSelectForm.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
:autoAssignAllowed="autoAssignAllowed"
2626
@select="handleSelect" />
2727

28+
<a-form-item
29+
class="top-spaced">
30+
<template #label>
31+
<tooltip-label :title="$t('label.apply.to.all')" :tooltip="$t('message.volume.pool.apply.to.all')"/>
32+
</template>
33+
<a-switch
34+
v-model:checked="applyToAll" />
35+
</a-form-item>
36+
2837
<a-divider />
2938

3039
<div class="actions">
@@ -36,11 +45,13 @@
3645
</template>
3746

3847
<script>
48+
import TooltipLabel from '@/components/widgets/TooltipLabel'
3949
import StoragePoolSelectView from '@/components/view/StoragePoolSelectView'
4050
4151
export default {
4252
name: 'VolumeStoragePoolSelectionForm',
4353
components: {
54+
TooltipLabel,
4455
StoragePoolSelectView
4556
},
4657
props: {
@@ -70,7 +81,8 @@ export default {
7081
},
7182
data () {
7283
return {
73-
selectedStoragePool: null
84+
selectedStoragePool: null,
85+
applyToAll: false
7486
}
7587
},
7688
watch: {
@@ -95,7 +107,7 @@ export default {
95107
}
96108
},
97109
submitForm () {
98-
this.$emit('select', this.resource.id, this.selectedStoragePool)
110+
this.$emit('select', this.resource.id, this.selectedStoragePool, this.applyToAll)
99111
this.closeModal()
100112
}
101113
}

0 commit comments

Comments
 (0)