Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9B90E046 for ; Thu, 6 Dec 2012 08:09:21 +0000 (UTC) Received: (qmail 82727 invoked by uid 500); 6 Dec 2012 08:09:17 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 81728 invoked by uid 500); 6 Dec 2012 08:09:12 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 80135 invoked by uid 99); 6 Dec 2012 08:09:09 -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, 06 Dec 2012 08:09:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 03DD981948B; Thu, 6 Dec 2012 08:09:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: muralireddy@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [16/100] [abbrv] git commit: CLOUDSTACK-483: Disable 'update' tab when host updates aren't supported Message-Id: <20121206080909.03DD981948B@tyr.zones.apache.org> Date: Thu, 6 Dec 2012 08:09:08 +0000 (UTC) CLOUDSTACK-483: Disable 'update' tab when host updates aren't supported Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/7f905cd9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/7f905cd9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/7f905cd9 Branch: refs/heads/events-framework Commit: 7f905cd94a273696d8f6d3fb405e7fee70998c6a Parents: 499a28c Author: Brian Federle Authored: Wed Nov 14 10:29:35 2012 -0800 Committer: Brian Federle Committed: Wed Nov 14 10:29:35 2012 -0800 ---------------------------------------------------------------------- ui/scripts/system.js | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7f905cd9/ui/scripts/system.js ---------------------------------------------------------------------- diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 9e3932f..1f913f5 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -8421,6 +8421,33 @@ } }, + tabFilter: function(args) { + var hiddenTabs = []; + var hostUpdatesEnabled = false; + var host = args.context.hosts[0]; + + if (isAdmin()) { + // Host updates are only supported on XenServer and when host.updates.enabled is true; + $.ajax({ + url: createURL('listConfigurations'), + data: { + name: 'host.updates.enable' + }, + async: false, + success: function(json) { + var config = json.listconfigurationsresponse.configuration[0]; + + hostUpdatesEnabled = config.value == 'true' ? true : false; + } + }); + + if (!hostUpdatesEnabled || host.hypervisor != 'XenServer') { + hiddenTabs.push('hostUpdates'); + } + } + + return hiddenTabs; + }, tabs: { details: { title: 'label.details',