Module: Katello::Concerns::DashboardHelperExtensions

Defined in:
app/helpers/katello/concerns/dashboard_helper_extensions.rb

Instance Method Summary collapse

Instance Method Details

#host_queryObject



4
5
6
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 4

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

#invalid_consumer_countObject



20
21
22
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 20

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

#partial_consumer_countObject



12
13
14
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 12

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

#removed_widgetsObject



32
33
34
35
36
37
38
39
40
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 32

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

#total_host_countObject



8
9
10
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 8

def total_host_count
  host_query.size
end

#unknown_consumer_countObject



24
25
26
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 24

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

#unsubscribed_hypervisor_countObject



28
29
30
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 28

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

#valid_consumer_countObject



16
17
18
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 16

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