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 7235A106F6 for ; Thu, 18 Apr 2013 02:25:50 +0000 (UTC) Received: (qmail 98342 invoked by uid 500); 18 Apr 2013 02:25:50 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 98320 invoked by uid 500); 18 Apr 2013 02:25:50 -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 98289 invoked by uid 99); 18 Apr 2013 02:25:50 -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, 18 Apr 2013 02:25:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B9E7847553; Thu, 18 Apr 2013 02:25:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tsp@apache.org To: commits@cloudstack.apache.org Date: Thu, 18 Apr 2013 02:25:52 -0000 Message-Id: <173ccfb15f664af6bdf9aba777adc3a6@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/41] git commit: updated refs/heads/marvin_refactor to 94b18c6 CLOUDSTACK-1910: cloudstack UI - Regions menu - GSLB - (1) add detailView (2) implement Delete GSLB action. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8bef069f Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8bef069f Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8bef069f Branch: refs/heads/marvin_refactor Commit: 8bef069f01aaf1550b9cacb0363f04e5a01541ee Parents: 202930f Author: Jessica Wang Authored: Tue Apr 16 12:38:00 2013 -0700 Committer: Jessica Wang Committed: Tue Apr 16 12:38:37 2013 -0700 ---------------------------------------------------------------------- ui/scripts/regions.js | 139 ++++++++++++++++++++++++++++++++------------ 1 files changed, 102 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bef069f/ui/scripts/regions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index ec5e21b..2cfb0fe 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -246,8 +246,30 @@ }, description: { label: 'label.description' - }, - /* + }, + gslbdomainname: { + label: 'GSLB Domain Name', + validation: { required: true } + }, + gslblbmethod: { + label: 'Algorithm', + select: function(args) { + var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; + args.response.success({ + data: array1 + }); + } + }, + gslbservicetype: { + label: 'Service Type', + select: function(args) { + var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; + args.response.success({ + data: array1 + }); + }, + validation: { required: true } + }, domainid: { label: 'Domain', select: function(args) { @@ -293,31 +315,7 @@ else return true; } - }, - */ - gslblbmethod: { - label: 'Algorithm', - select: function(args) { - var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; - args.response.success({ - data: array1 - }); - } - }, - gslbdomainname: { - label: 'GSLB Domain Name', - validation: { required: true } - }, - gslbservicetype: { - label: 'Service Type', - select: function(args) { - var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; - args.response.success({ - data: array1 - }); - }, - validation: { required: true } - } + } } }, action: function(args) { @@ -330,23 +328,22 @@ gslbservicetype: args.data.gslbservicetype }; if(args.data.description != null && args.data.description.length > 0) - $.extend(data, { description: args.data.description }); - /* + $.extend(data, { description: args.data.description }); if(args.data.domainid != null && args.data.domainid.length > 0) $.extend(data, { domainid: args.data.domainid }); if(args.data.account != null && args.data.account.length > 0) $.extend(data, { account: args.data.account }); - */ + $.ajax({ url: createURL('createGlobalLoadBalancerRule'), data: data, success: function(json) { - var jid = json.creategloballoadbalancerruleresponse.jobid; + var jid = json.creategloballoadbalancerruleresponse.jobid; args.response.success( {_custom: {jobId: jid, - getUpdatedItem: function(json) { - return json.queryasyncjobresultresponse.jobresult.globalloadbalancerrule; + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.globalloadbalancer; } } } @@ -355,9 +352,7 @@ }); }, notification: { - poll: function(args) { - poll: pollAsyncJobResult - } + poll: pollAsyncJobResult } } }, @@ -383,7 +378,77 @@ data: null }); } - } + }, + + detailView: { + name: 'GSLB details', + //viewAll: { path: 'storage.snapshots', label: 'label.snapshots' }, + actions: { + remove: { + label: 'delete GSLB', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete this GSLB'; + }, + notification: function(args) { + return 'delete GSLB'; + } + }, + action: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL("deleteGlobalLoadBalancerRule"), + data: data, + success: function(json) { + var jid = json.deletegloballoadbalancerruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + description: { label: 'label.description' }, + gslbdomainname: { label: 'GSLB Domain Name' }, + gslblbmethod: { label: 'Algorithm' }, + gslbservicetype: { label: 'Service Type' }, + id: { label: 'ID' } + } + ], + dataProvider: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL('listGlobalLoadBalancerRules'), + data: data, + success: function(json) { + var item = json.listgloballoadbalancerrulesresponse.globalloadbalancerrule[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } } } }