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

Commit 9d697c4

Browse files
committed
Fixing instance view
1 parent 5fdf19b commit 9d697c4

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
@@ -284,35 +284,13 @@ export default {
284284
},
285285
fetchInstances () {
286286
this.instanceLoading = true
287-
this.virtualmachines = []
288-
if (!this.isObjectEmpty(this.resource) && this.arrayHasItems(this.resource.virtualmachineids)) {
289-
var params = {}
290-
if (this.isAdminOrDomainAdmin()) {
291-
params.listall = true
287+
this.virtualmachines = this.resource.virtualmachines
288+
this.virtualmachines.map(vm => {
289+
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
290+
vm.ipaddress = vm.nic[0].ipaddress
292291
}
293-
if (this.isValidValueForKey(this.resource, 'projectid') &&
294-
this.resource.projectid !== '') {
295-
params.projectid = this.resource.projectid
296-
}
297-
params.ids = this.resource.virtualmachineids.join()
298-
api('listVirtualMachines', params).then(json => {
299-
const listVms = json.listvirtualmachinesresponse.virtualmachine
300-
if (this.arrayHasItems(listVms)) {
301-
for (var i = 0; i < listVms.length; ++i) {
302-
var vm = listVms[i]
303-
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
304-
vm.ipaddress = vm.nic[0].ipaddress
305-
listVms[i] = vm
306-
}
307-
}
308-
this.virtualmachines = this.virtualmachines.concat(listVms)
309-
}
310-
}).catch(error => {
311-
this.$notifyError(error)
312-
}).finally(() => {
313-
this.instanceLoading = false
314-
})
315-
}
292+
})
293+
this.instanceLoading = false
316294
},
317295
fetchPublicIpAddress () {
318296
this.networkLoading = true

0 commit comments

Comments
 (0)