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 BE00997E4 for ; Fri, 24 May 2013 01:01:07 +0000 (UTC) Received: (qmail 72718 invoked by uid 500); 24 May 2013 01:01:07 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 72671 invoked by uid 500); 24 May 2013 01:01:07 -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 72657 invoked by uid 99); 24 May 2013 01:01:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 01:01:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 325A46921; Fri, 24 May 2013 01:01:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Date: Fri, 24 May 2013 01:01:08 -0000 Message-Id: <248dda7f60124e58bfac40e1dc024b57@git.apache.org> In-Reply-To: <0fc44cef7180424587a3a5d525cb9dd6@git.apache.org> References: <0fc44cef7180424587a3a5d525cb9dd6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/50] [abbrv] git commit: updated refs/heads/object_store to 98af424 Add base internal LB provider module Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0a443697 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0a443697 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0a443697 Branch: refs/heads/object_store Commit: 0a443697ea48d48310a24c5e25a2298522183901 Parents: 92ad6ab Author: Brian Federle Authored: Tue May 21 15:26:55 2013 -0700 Committer: Brian Federle Committed: Tue May 21 15:26:59 2013 -0700 ---------------------------------------------------------------------- .../internalLbProvider/internalLbProvider.js | 182 +++++++++++++++ ui/modules/modules.js | 3 +- 2 files changed, 184 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a443697/ui/modules/internalLbProvider/internalLbProvider.js ---------------------------------------------------------------------- diff --git a/ui/modules/internalLbProvider/internalLbProvider.js b/ui/modules/internalLbProvider/internalLbProvider.js new file mode 100644 index 0000000..aaa386e --- /dev/null +++ b/ui/modules/internalLbProvider/internalLbProvider.js @@ -0,0 +1,182 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +(function($, cloudStack) { + cloudStack.modules.internalLbProvider = function(module) { + var internalLbDeviceViewAll = [ + { + label: 'Devices', + path: '_zone.internalLbDevices' + } + ]; + + var internalLbListView = { + id: 'internalLbDevices', + fields: { + resourcename: { label: 'Resource Name' }, + provider: { label: 'Provider' } + }, + dataProvider: function(args) { + args.response.success({ data: [] }); + }, + actions: { + add: { + label: 'Add internal LB device', + + messages: { + notification: function(args) { + return 'Add internal LB device'; + } + }, + + createForm: { + title: 'Add internal LB device', + fields: { + hostname: { + label: 'label.host', + validation: { required: true } + }, + username: { + label: 'label.username', + validation: { required: true } + }, + password: { + label: 'label.password', + isPassword: true, + validation: { required: true } + } + } + }, + + action: function(args) { + args.response.success(); + }, + + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + detailView: { + name: 'Internal LB resource details', + actions: { + remove: { + label: 'delete Internal LB resource', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete Internal LB resource'; + }, + notification: function(args) { + return 'delete Internal LB resource'; + } + }, + action: function(args) { + args.response.success(); + }, + notification: { + poll: function(args) { + args.complete(); + } + } + } + }, + + tabs: { + details: { + title: 'label.details', + fields: [ + { + resourcename: { label: 'Resource Name' } + }, + { + resourceid: { label: 'Resource ID'}, + provider: { label: 'Provider' }, + RESOURCE_NAME: { label: 'Resource Name'} + } + ], + dataProvider: function(args) { + args.response.success({ data: args.context.internalLbDevices[0] }); + } + } + } + } + }; + + var internalLbProviderDetailView = { + id: 'internalLbProvider', + label: 'internal LB', + viewAll: internalLbDeviceViewAll, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + state: { label: 'label.state' }, + id: { label: 'label.id' }, + servicelist: { + label: 'Services', + converter: function(args){ + if(args) + return args.join(', '); + else + return ''; + } + } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listNetworkServiceProviders'), + data: { + name: 'InternalLb', + physicalnetworkid: args.context.physicalNetworks[0].id + }, + success: function(json){ + var items = json.listnetworkserviceprovidersresponse.networkserviceprovider; + if(items != null && items.length > 0) { + args.response.success({ data: items[0] }); + } + else { + args.response.success({ + data: { + name: 'InternalLb', + state: 'Disabled' + } + }) + } + } + }); + } + } + } + }; + + module.infrastructure.networkServiceProvider({ + id: 'internalLb', + name: 'Internal LB', + //state: 'Disabled', //don't know state until log in and visit Infrastructure menu > zone detail > physical network > network service providers + listView: internalLbListView, + + detailView: internalLbProviderDetailView + }); + }; +}(jQuery, cloudStack)); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0a443697/ui/modules/modules.js ---------------------------------------------------------------------- diff --git a/ui/modules/modules.js b/ui/modules/modules.js index d4502a1..3170122 100644 --- a/ui/modules/modules.js +++ b/ui/modules/modules.js @@ -18,6 +18,7 @@ cloudStack.modules = [ 'infrastructure', 'vnmcNetworkProvider', - 'vnmcAsa1000v' + 'vnmcAsa1000v', + 'internalLbProvider' ]; }(jQuery, cloudStack));