You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by David Nalley <da...@gnsa.us> on 2012/11/14 19:33:01 UTC

Re: git commit: CLOUDSTACK-483: Disable 'update' tab when host updates aren't supported

Why is update support being added in the first place? - I thought
there was widespread agreement that host updates were outside the
scope of CloudStack.



On Wed, Nov 14, 2012 at 1:31 PM,  <bf...@apache.org> wrote:
> Updated Branches:
>   refs/heads/master 499a28cb4 -> 7f905cd94
>
>
> 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/master
> Commit: 7f905cd94a273696d8f6d3fb405e7fee70998c6a
> Parents: 499a28c
> Author: Brian Federle <br...@citrix.com>
> Authored: Wed Nov 14 10:29:35 2012 -0800
> Committer: Brian Federle <br...@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',
>