File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (() => {
Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments