From ba2eb092b49c939811906d64937d3b9d6f1ba139 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 16 May 2012 14:25:05 -0700 Subject: [PATCH] CS-14905: volume page - Attach Disk action - Instance dropdown - (1) Populate all instances when volume's hypervisor is "None". (2) Populate only instances whose hypervisor matches this volume's hypervisor when volume's hypervisor is not "None". --- ui/scripts/storage.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 7d357e20a5e..c98afd03129 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -33,7 +33,7 @@ fields: { name: { label: 'label.name' }, type: { label: 'label.type' }, - storagetype: { label: 'label.storage.type' }, + hypervisor: { label: 'label.hypervisor' }, vmdisplayname: { label: 'label.vm.display.name' }, state: { label: 'State', @@ -597,13 +597,18 @@ projectid: args.context.projects[0].id }; } - + + if(args.context.volumes[0].hypervisor != null && args.context.volumes[0].hypervisor.length > 0 && args.context.volumes[0].hypervisor != 'None') { + data = $.extend(data, { + hypervisor: args.context.volumes[0].hypervisor + }); + } + $(['Running', 'Stopped']).each(function() { $.ajax({ url: createURL('listVirtualMachines'), data: $.extend(data, { - state: this.toString(), - hypervisor: args.context.volumes[0].hypervisor + state: this.toString() }), async: false, success: function(json) { @@ -931,7 +936,8 @@ zonename: { label: 'label.zone' }, state: { label: 'label.state' }, type: { label: 'label.type' }, - storagetype: { label: 'label.storage.type' }, + storagetype: { label: 'label.storage.type' }, + hypervisor: { label: 'label.hypervisor' }, size : { label: 'Size ', converter: function(args) {