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 30052F15D for ; Mon, 13 May 2013 21:04:13 +0000 (UTC) Received: (qmail 3270 invoked by uid 500); 13 May 2013 21:04:13 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 3242 invoked by uid 500); 13 May 2013 21:04:13 -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 3232 invoked by uid 99); 13 May 2013 21:04:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 21:04:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B3B07758A; Mon, 13 May 2013 21:04: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 Message-Id: <2fff51c35d0548daa88bd12f564b6a94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/ui-vpc-redesign to 40dc221 Date: Mon, 13 May 2013 21:04:11 +0000 (UTC) Updated Branches: refs/heads/ui-vpc-redesign 57d21051b -> 40dc2211d Implement 'add tier' action handling Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/40dc2211 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/40dc2211 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/40dc2211 Branch: refs/heads/ui-vpc-redesign Commit: 40dc2211db4062d614ad8690c988ea451628c019 Parents: 57d2105 Author: Brian Federle Authored: Mon May 13 14:03:58 2013 -0700 Committer: Brian Federle Committed: Mon May 13 14:03:58 2013 -0700 ---------------------------------------------------------------------- ui/modules/vpc/vpc.js | 65 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 63 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/40dc2211/ui/modules/vpc/vpc.js ---------------------------------------------------------------------- diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js index cb712bc..22a8250 100644 --- a/ui/modules/vpc/vpc.js +++ b/ui/modules/vpc/vpc.js @@ -62,10 +62,69 @@ return $router; }, - tierPlaceholder: function() { + tierPlaceholder: function(args) { + var context = args.context; var $placeholder = $('
').addClass('tier-placeholder'); $placeholder.append($('').append('Create network')); + $placeholder.click(function() { + var addAction = cloudStack.vpc.tiers.actions.add; + var form = cloudStack.dialog.createForm({ + context: context, + form: addAction.createForm, + after: function(args) { + var $loading = $('
').addClass('loading-overlay') + .prependTo($placeholder); + + addAction.action({ + context: context, + data: args.data, + response: { + success: function(args) { + var tier = args.data; + + cloudStack.ui.notifications.add( + // Notification + { + desc: addAction.label + }, + + // Success + function(args) { + $loading.remove(); + // addNewTier({ + // ipAddresses: ipAddresses, + // $browser: $browser, + // tierDetailView: tierDetailView, + // context: $.extend(true, {}, context, { + // networks: [tier] + // }), + // tier: tier, + // acl: acl, + // $tiers: $tiers, + // actions: actions, + // actionPreFilter: actionPreFilter, + // vmListView: vmListView + // }); + }, + + {}, + + // Error + function(args) { + $loading.remove(); + } + ); + }, + error: function(errorMsg) { + cloudStack.dialog.notice({ message: _s(errorMsg) }); + $loading.remove(); + } + } + }); + } + }); + }); return $placeholder; }, @@ -168,7 +227,9 @@ }); // Add placeholder tier - $tiers.append(elems.tierPlaceholder()); + $tiers.append(elems.tierPlaceholder({ + context: context + })); } } });