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 59C57FA0C for ; Fri, 26 Apr 2013 19:38:15 +0000 (UTC) Received: (qmail 82030 invoked by uid 500); 26 Apr 2013 19:38:14 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 81876 invoked by uid 500); 26 Apr 2013 19:38:14 -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 81849 invoked by uid 99); 26 Apr 2013 19:38:14 -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, 26 Apr 2013 19:38:14 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1337D88248B; Fri, 26 Apr 2013 19:38:14 +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: Fri, 26 Apr 2013 19:38:15 -0000 Message-Id: <12881fa8923e4c1d8773fb3b83d9fa93@git.apache.org> In-Reply-To: <3691ece5a79244c79e6dd2f1104112b4@git.apache.org> References: <3691ece5a79244c79e6dd2f1104112b4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/21] git commit: updated refs/heads/ui-add-remove-nics to b7b7753 CLOUDSTACK-2120: mixed zone management - UI: count total number of Primary Storages, Secondary Storages based on selected option in zone type dropdown on top menu. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f883b0f9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f883b0f9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f883b0f9 Branch: refs/heads/ui-add-remove-nics Commit: f883b0f90489348b287b5425a83d6517c0ba092a Parents: 880f98c Author: Jessica Wang Authored: Thu Apr 25 14:24:44 2013 -0700 Committer: Jessica Wang Committed: Thu Apr 25 14:25:34 2013 -0700 ---------------------------------------------------------------------- ui/scripts/system.js | 35 +++++++++++++++++++++++------------ 1 files changed, 23 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f883b0f9/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 312d5f4..fea7669 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -269,29 +269,40 @@ }, primaryStorageCount: function(data) { + var data2 = { + page: 1, + pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. + }; + if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type + $.extend(data2, { + zonetype: cloudStack.context.zoneType + }); + } $.ajax({ url: createURL('listStoragePools'), - data: { - page: 1, - pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. - }, + data: data2, success: function(json) { - dataFns.secondaryStorageCount($.extend(data, { - primaryStorageCount: json.liststoragepoolsresponse.count ? - json.liststoragepoolsresponse.count : 0 + dataFns.secondaryStorageCount($.extend(data, { + primaryStorageCount: json.liststoragepoolsresponse.count ? json.liststoragepoolsresponse.count : 0 })); } }); }, secondaryStorageCount: function(data) { + var data2 = { + type: 'SecondaryStorage', + page: 1, + pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. + }; + if(cloudStack.context.zoneType != null && cloudStack.context.zoneType.length > 0) { //Basic type or Advanced type + $.extend(data2, { + zonetype: cloudStack.context.zoneType + }); + } $.ajax({ url: createURL('listHosts'), - data: { - type: 'SecondaryStorage', - page: 1, - pagesize: 1 //specifying pagesize as 1 because we don't need any embedded objects to be returned here. The only thing we need from API response is "count" property. - }, + data: data2, success: function(json) { dataFns.systemVmCount($.extend(data, { secondaryStorageCount: json.listhostsresponse.count ?