incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [16/100] [abbrv] git commit: CLOUDSTACK-483: Disable 'update' tab when host updates aren't supported
Date Thu, 06 Dec 2012 08:09:08 GMT
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 <brian.federle@citrix.com>
Authored: Wed Nov 14 10:29:35 2012 -0800
Committer: Brian Federle <brian.federle@citrix.com>
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',


Mime
View raw message