Skip to content

Commit b71e323

Browse files
committed
fix issue with showing vm selection
1 parent 074d466 commit b71e323

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

ui/src/views/compute/BackupScheduleWizard.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ export default {
7575
const params = {}
7676
this.dataSource = []
7777
this.loading = true
78-
params.virtualmachineid = this.resource.id
78+
params.virtualmachineid = this.resource.id || this.resource.virtualmachineid
79+
80+
if (!params.virtualmachineid) {
81+
console.error('No VM ID found in resource:', this.resource)
82+
this.loading = false
83+
return
84+
}
85+
7986
getAPI('listBackupSchedule', params).then(json => {
8087
this.dataSource = json.listbackupscheduleresponse.backupschedule || []
8188
}).finally(() => {

ui/src/views/compute/backup/CreateBackupSchedule.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,23 @@ export default {
8383
computed: {
8484
resourceType () {
8585
if (!this.resource) return 'none'
86+
8687
if (this.resource.vmstate !== undefined ||
87-
this.resource.guestosid !== undefined || this.resource.hypervisor !== undefined ||
88-
this.resource.backupofferingid !== undefined) {
88+
this.resource.guestosid !== undefined ||
89+
this.resource.hypervisor !== undefined ||
90+
this.resource.backupofferingid !== undefined ||
91+
this.resource.serviceofferingid !== undefined) {
8992
return 'vm'
9093
}
91-
if (this.resource.intervaltype !== undefined && this.resource.schedule !== undefined) {
94+
if (this.resource.intervaltype !== undefined &&
95+
this.resource.schedule !== undefined) {
96+
return 'backupschedule'
97+
}
98+
99+
if (this.resource.virtualmachineid !== undefined) {
92100
return 'backupschedule'
93101
}
102+
94103
return 'unknown'
95104
},
96105
isVMResource () {
@@ -105,9 +114,7 @@ export default {
105114
}
106115
},
107116
created () {
108-
if (!this.isVMResource) {
109-
this.fetchVMs()
110-
}
117+
this.fetchVMs()
111118
},
112119
methods: {
113120
async fetchVMs () {

0 commit comments

Comments
 (0)