From f0fb52e3463080ea38b2308d150ff1a9d0d1a0f7 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 10 Jul 2012 18:40:58 -0700 Subject: [PATCH] cloudstack 3.0 UI - VPC - IP Addresses - Port Forwarding - Add VM - populate only VMs under selected tier. --- ui/scripts/network.js | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index fef850d6650..cd0a92914db 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -783,15 +783,23 @@ context: context, listView: $.extend(true, {}, cloudStack.sections.instances, { listView: { - dataProvider: function(args) { - $.ajax({ + dataProvider: function(args) { + var networkid; + if('vpc' in args.context) + networkid = args.context.multiData.tier; + else + networkid = args.context.ipAddresses[0].associatednetworkid; + + var data = { + page: args.page, + pageSize: pageSize, + networkid: networkid, + listAll: true + }; + + $.ajax({ url: createURL('listVirtualMachines'), - data: { - page: args.page, - pageSize: pageSize, - networkid: args.context.networks[0].id, - listAll: true - }, + data: data, dataType: 'json', async: true, success: function(data) { @@ -2465,11 +2473,17 @@ listView: $.extend(true, {}, cloudStack.sections.instances, { listView: { dataProvider: function(args) { - var data = { + var networkid; + if('vpc' in args.context) + networkid = args.context.multiData.tier; + else + networkid = args.context.ipAddresses[0].associatednetworkid; + + var data = { page: args.page, pageSize: pageSize, listAll: true, - networkid: args.context.ipAddresses[0].associatednetworkid + networkid: networkid }; if (!args.context.projects) {