Sha256: 36204cfc092e18ba8cc7270dd3d6aefe1c4ad71efa1351aba7e03782c26d2806

Contents?: true

Size: 1.13 KB

Versions: 103

Compression:

Stored size: 1.13 KB

Contents

module Katello
  module Concerns
    module DashboardHelperExtensions
      def host_query
        ::Host::Managed.authorized('view_hosts', ::Host::Managed).where(:organization => Organization.current)
      end

      def total_host_count
        host_query.size
      end

      def partial_consumer_count
        host_query.search_for("subscription_status = partial").size
      end

      def valid_consumer_count
        host_query.search_for("subscription_status = valid").size
      end

      def invalid_consumer_count
        host_query.search_for("subscription_status = invalid").size
      end

      def unknown_consumer_count
        host_query.search_for("subscription_status = unknown or (null? subscription_uuid)").size
      end

      def unsubscribed_hypervisor_count
        host_query.search_for("subscription_status = unsubscribed_hypervisor").size
      end

      def removed_widgets
        widgets = super

        if Organization.current&.simple_content_access?
          widgets.reject! { |widget| ::Widget.singleton_class::SUBSCRIPTION_TEMPLATES.include? widget[:template] }
        end

        widgets
      end
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
katello-4.4.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.5.0.rc1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.4.0.2 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.4.0.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.4.0 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.4.0.rc2 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.4.0.rc1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.2.2 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0.rc4 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0.rc3 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0.rc2.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0.rc2 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.3.0.rc1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.2.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.2.0.1 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.1.4 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.0.3 app/helpers/katello/concerns/dashboard_helper_extensions.rb
katello-4.2.0.1.rc3 app/helpers/katello/concerns/dashboard_helper_extensions.rb