Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Commit 2ca991c

Browse files
committed
Fixing cks instance view
1 parent d2fe459 commit 2ca991c

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

src/views/compute/KubernetesServiceTab.vue

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -286,35 +286,13 @@ export default {
286286
},
287287
fetchInstances () {
288288
this.instanceLoading = true
289-
this.virtualmachines = []
290-
if (!this.isObjectEmpty(this.resource) && this.arrayHasItems(this.resource.virtualmachineids)) {
291-
var params = {}
292-
if (this.isAdminOrDomainAdmin()) {
293-
params.listall = true
289+
this.virtualmachines = this.resource.virtualmachines
290+
this.virtualmachines.map(vm => {
291+
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
292+
vm.ipaddress = vm.nic[0].ipaddress
294293
}
295-
if (this.isValidValueForKey(this.resource, 'projectid') &&
296-
this.resource.projectid !== '') {
297-
params.projectid = this.resource.projectid
298-
}
299-
params.ids = this.resource.virtualmachineids.join()
300-
api('listVirtualMachines', params).then(json => {
301-
const listVms = json.listvirtualmachinesresponse.virtualmachine
302-
if (this.arrayHasItems(listVms)) {
303-
for (var i = 0; i < listVms.length; ++i) {
304-
var vm = listVms[i]
305-
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
306-
vm.ipaddress = vm.nic[0].ipaddress
307-
listVms[i] = vm
308-
}
309-
}
310-
this.virtualmachines = this.virtualmachines.concat(listVms)
311-
}
312-
}).catch(error => {
313-
this.$notifyError(error)
314-
}).finally(() => {
315-
this.instanceLoading = false
316-
})
317-
}
294+
})
295+
this.instanceLoading = false
318296
},
319297
fetchPublicIpAddress () {
320298
this.networkLoading = true

0 commit comments

Comments
 (0)