From ff58052d2cd5f2ed821bef04c18960ef0d18fac2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 22 May 2013 13:18:24 -0700 Subject: [PATCH] CLOUDSTACK-747: internal LB in VPC - internal LB detailView - add rules tab, assignedVMs tab. --- ui/scripts/vpc.js | 49 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index fe3ce13e5f1..5c2f0266d1b 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -482,8 +482,7 @@ }, dataType: 'json', async: true, - success: function(data) { - debugger; + success: function(data) { var jid = data.assigntoloadbalancerruleresponse.jobid; args.response.success({ _custom: { jobId: jid } @@ -519,7 +518,51 @@ } }); } - } + }, + rules: { + title: 'label.rules', + multiple: true, + fields: [ + { + sourceport: { label: 'Source Port' }, + instanceport: { label: 'Instance Port' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listLoadBalancers'), + data: { + id: args.context.internalLoadBalancers[0].id + }, + success: function(json) { + var item = json.listloadbalancerssresponse.loadbalancer[0]; + args.response.success({ data: item.loadbalancerrule }); + } + }); + } + } , + assignedVms: { + title: 'Assigned VMs', + multiple: true, + fields: [ + { + name: { label: 'label.name' }, + ipaddress: { label: 'label.ip.address' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listLoadBalancers'), + data: { + id: args.context.internalLoadBalancers[0].id + }, + success: function(json) { + var item = json.listloadbalancerssresponse.loadbalancer[0]; + args.response.success({ data: item.loadbalancerinstance }); + } + }); + } + } } } }