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 816D8DB80 for ; Thu, 30 May 2013 00:04:05 +0000 (UTC) Received: (qmail 45786 invoked by uid 500); 30 May 2013 00:03:57 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 45446 invoked by uid 500); 30 May 2013 00:03:57 -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 44601 invoked by uid 99); 30 May 2013 00:03:56 -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, 30 May 2013 00:03:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6DECD89D53B; Thu, 30 May 2013 00:03:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ahuang@apache.org To: commits@cloudstack.apache.org Date: Thu, 30 May 2013 00:04:18 -0000 Message-Id: <4c5eee6b7de343f792cf8c00782223d8@git.apache.org> In-Reply-To: <07c94c0403b44fc1a640d87bdb704141@git.apache.org> References: <07c94c0403b44fc1a640d87bdb704141@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] git commit: updated refs/heads/vmsync to cd6aea1 CLOUDSTACK-2678: portable IP ranges - regions menu - Portable IP Ranges - implement Delete Portable IP Range action. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ecc30ddc Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ecc30ddc Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ecc30ddc Branch: refs/heads/vmsync Commit: ecc30ddc0dfcd8237c7e9822160b3be207017520 Parents: 78e50c3 Author: Jessica Wang Authored: Tue May 28 15:18:36 2013 -0700 Committer: Jessica Wang Committed: Tue May 28 15:18:36 2013 -0700 ---------------------------------------------------------------------- ui/scripts/regions.js | 94 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 91 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ecc30ddc/ui/scripts/regions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 5ca4167..b9b6dae 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -489,13 +489,11 @@ actions: { add: { label: 'Add Portable IP Range', - messages: { notification: function(args) { return 'Add Portable IP Range'; } }, - createForm: { title: 'Add Portable IP Range', fields: { @@ -557,7 +555,97 @@ poll: pollAsyncJobResult } } - } + }, + + detailView: { + name: 'Portable IP Range details', + actions: { + remove: { + label: 'Delete Portable IP Range', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete Portable IP Range'; + }, + notification: function(args) { + return 'Delete Portable IP Range'; + } + }, + action: function(args) { + var data = { + id: args.context.portableIpRanges[0].id + }; + $.ajax({ + url: createURL('deletePortableIpRange'), + data: data, + async: true, + success: function(json) { + var jid = json.deleteportablepublicipresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + id: { label: 'label.id' } + }, + { + startip: { label: 'label.start.IP' }, + endip: { label: 'label.end.IP' }, + gateway: { label: 'label.gateway' }, + netmask: { label: 'label.netmask' }, + vlan: { label: 'label.vlan' }, + portableipaddress: { + label: 'Portable IPs', + converter: function(args) { + var text1 = ''; + if(args != null) { + for(var i = 0; i < args.length; i++) { + if(i > 0) { + text1 += ', '; + } + text1 += args[i].ipaddress; + } + } + return text1; + } + } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listPortableIpRanges'), + data: { + id: args.context.portableIpRanges[0].id + }, + success: function(json) { + var item = json.listportableipresponse.portableiprange[0]; + args.response.success({ + data: item + }); + }, + error: function(json) { + args.response.error(parseXMLHttpResponse(json)); + } + }); + } + } + } + } } },