Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6AC1F657 for ; Thu, 25 Apr 2013 19:24:11 +0000 (UTC) Received: (qmail 64595 invoked by uid 500); 25 Apr 2013 19:24:11 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 64515 invoked by uid 500); 25 Apr 2013 19:24:11 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 64491 invoked by uid 99); 25 Apr 2013 19:24:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 19:24:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 12E568815D6; Thu, 25 Apr 2013 19:24:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bfederle@apache.org To: commits@cloudstack.apache.org Date: Thu, 25 Apr 2013 19:24:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/50] [abbrv] git commit: updated refs/heads/ui-add-remove-nics to e6d9e81 CLOUDSTACK-1910: cloudstack UI - Regions menu - GSLB - assigned load balancing - display assigned load balancing in listView and exclude assigned one from LB dropdown in Assign more load balancing dialog. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8f5d8d50 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8f5d8d50 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8f5d8d50 Branch: refs/heads/ui-add-remove-nics Commit: 8f5d8d505243372d241e1ce90a16cbaa9991c1d2 Parents: 1c89bc7 Author: Jessica Wang Authored: Wed Apr 24 14:55:50 2013 -0700 Committer: Jessica Wang Committed: Wed Apr 24 14:57:47 2013 -0700 ---------------------------------------------------------------------- ui/scripts/regions.js | 111 +++++++++++++++++++++++--------------------- 1 files changed, 58 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8f5d8d50/ui/scripts/regions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index ef6f976..334eb26 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -382,7 +382,7 @@ detailView: { name: 'GSLB details', - viewAll: { path: 'regions.lbUnderGSLB', label: 'load balancer rules' }, + viewAll: { path: 'regions.lbUnderGSLB', label: 'assigned load balancing' }, actions: { remove: { label: 'delete GSLB', @@ -452,77 +452,82 @@ } }, - lbUnderGSLB: { + lbUnderGSLB: { id: 'lbUnderGSLB', type: 'select', - title: 'assigned load balancer rules', + title: 'assigned load balancing', listView: { section: 'lbUnderGSLB', id: 'lbUnderGSLB', - label: 'assigned load balancer rules', + label: 'assigned load balancing', fields: { - name: { label: 'label.name' }, + 'name': { label: 'label.name' }, publicport: { label: 'label.public.port' }, - privateport: { label: 'label.private.port' }, - algorithm: { label: 'label.algorithm' } + privateport: { label: 'label.private.port' }, + algorithm: { label: 'label.algorithm' } }, - dataProvider: function(args) { - var data = { - globalloadbalancerruleid: args.context.GSLB[0].id, - listAll: true - }; - $.ajax({ - url: createURL('listLoadBalancerRules'), - data: data, - success: function(json) { - var items = json.listloadbalancerrulesresponse.loadbalancerrule; - args.response.success({ - data: items - }); - } + dataProvider: function(args) { + var items = args.context.GSLB[0].loadbalancerrule; + args.response.success({ + data: items }); }, - actions: { + actions: { add: { - label: 'assign load balancer rule to GSLB', - messages: { - confirm: function(args) { - return 'Please confirm you want to assign load balancer rule to GSLB'; - }, + label: 'assign more load balancing', + messages: { notification: function(args) { - return 'assign load balancer rule to GSLB'; + return 'assign more load balancing'; } }, createForm: { - title: 'assign load balancer rule to GSLB', + title: 'assign more load balancing', fields: { loadbalancerrule: { - label: 'load balancer rule', + label: 'load balancing rule', select: function(args) { - var data = { - globalloadbalancerruleid: args.context.GSLB[0].id, - listAll: true - }; - $.ajax({ - url: createURL('listLoadBalancerRules'), - data: data, - success: function(json) { - var items = json.listloadbalancerrulesresponse.loadbalancerrule; - args.response.success({ - data: items, - descriptionField: 'name' - }); - } - }); + var data = { + globalloadbalancerruleid: args.context.GSLB[0].id, + listAll: true + }; + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: data, + success: function(json) { + var allLbRules = json.listloadbalancerrulesresponse.loadbalancerrule; + var assignedLbRules = args.context.GSLB[0].loadbalancerrule; + var items = []; + if(allLbRules != null) { + for(var i = 0; i < allLbRules.length; i++) { + var isAssigned = false; + if(assignedLbRules != null) { + for(var k = 0; k < assignedLbRules.length; k++) { + if(allLbRules[i].id == assignedLbRules[k].id) { + isAssigned = true; + break; + } + } + } + if(isAssigned == false) { + items.push(allLbRules[i]); + } + } + } + args.response.success({ + data: items, + descriptionField: 'name' + }); + } + }); } } } }, action: function(args) { - var data = { - id: args.context.GSLB[0].id, - loadbalancerrulelist: args.data.loadbalancerrule - }; + var data = { + id: args.context.GSLB[0].id, + loadbalancerrulelist: args.data.loadbalancerrule + }; $.ajax({ url: createURL('assignToGlobalLoadBalancerRule'), data: data, @@ -547,16 +552,16 @@ }, detailView: { - name: 'load balancer rule details', + name: 'load balancing details', actions: { remove: { - label: 'remove load balancer rule from this GSLB', + label: 'remove load balancing from this GSLB', messages: { notification: function() { - return 'remove load balancer rule from GSLB'; + return 'remove load balancing from GSLB'; }, confirm: function() { - return 'Please confirm you want to remove load balancer rule from GSLB'; + return 'Please confirm you want to remove load balancing from GSLB'; } }, action: function(args) {