From 612ce62cae8408cdf66aaab339c1cc387b4bf9b1 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Wed, 15 May 2013 15:33:13 -0700 Subject: [PATCH] Add tier VM, PF, static NAT links --- ui/modules/vpc/vpc.js | 11 ++++++----- ui/scripts/instances.js | 8 ++++++++ ui/scripts/vpc.js | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js index 5c93e6cdbe6..64081a8a4d0 100644 --- a/ui/modules/vpc/vpc.js +++ b/ui/modules/vpc/vpc.js @@ -18,7 +18,9 @@ var elems = { tier: function(args) { var tier = args.tier; - var context = args.context; + var context = $.extend(true, {}, args.context, { + networks: [tier] + }); var dashboardItems = args.dashboardItems; var $tier = $('
').addClass('tier-item'); var $header = $('
').addClass('header'); @@ -41,9 +43,7 @@ var $detailView = $('
').detailView( $.extend(true, {}, cloudStack.vpc.tiers.detailView, { $browser: $browser, - context: $.extend(true, {}, context, { - networks: [tier] - }), + context: context, onActionComplete: function() { $tier.closest('.vpc-network-chart').trigger('reload'); } @@ -153,6 +153,7 @@ dashboard: function(args) { var $dashboard = $('
').addClass('dashboard'); var context = args.context; + var tier = context.networks[0]; $(args.dashboardItems).map(function(index, dashboardItem) { var $dashboardItem = $('
').addClass('dashboard-item'); @@ -167,7 +168,7 @@ $dashboardItem.click(function() { $('#browser .container').cloudBrowser('addPanel', { - title: dashboardItem.name, + title: tier.name + ' - ' + dashboardItem.name, maximizeIfSelected: true, complete: function($panel) { var section = cloudStack.vpc.sections[id]; diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index c76d843ed6e..31237a8855b 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -204,6 +204,14 @@ affinitygroupid: args.context.affinityGroups[0].id }); } + + if("vpc" in args.context && + "networks" in args.context) { + $.extend(data, { + vpcid: args.context.vpc[0].id, + networkid: args.context.networks[0].id + }); + } $.ajax({ url: createURL('listVirtualMachines'), diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index cbb3a6ff1c3..1e3efb71e2c 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -294,6 +294,26 @@ cloudStack.vpc = { // nTier sections sections: { + tierVMs: function() { + var list = $.extend(true, {}, cloudStack.sections.instances); + + list.listView.actions.add.action.custom = cloudStack.uiCustom.instanceWizard( + $.extend(true, {}, cloudStack.instanceWizard, { + pluginForm: { name: 'vpcTierInstanceWizard' } + }) + ); + + return list; + }, + + tierPortForwarders: function() { + return cloudStack.vpc.ipAddresses.listView(); + }, + + tierStaticNATs: function() { + return cloudStack.vpc.ipAddresses.listView(); + }, + // Internal load balancers tierLoadBalancers: { listView: {