Module: Katello::Concerns::DashboardHelperExtensions
- Defined in:
- app/helpers/katello/concerns/dashboard_helper_extensions.rb
Instance Method Summary collapse
- #host_query ⇒ Object
- #invalid_consumer_count ⇒ Object
- #partial_consumer_count ⇒ Object
- #removed_widgets ⇒ Object
- #total_host_count ⇒ Object
- #unknown_consumer_count ⇒ Object
- #unsubscribed_hypervisor_count ⇒ Object
- #valid_consumer_count ⇒ Object
Instance Method Details
#host_query ⇒ Object
4 5 6 |
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 4 def host_query ::Host::Managed.('view_hosts', ::Host::Managed).where(:organization => Organization.current) end |
#invalid_consumer_count ⇒ Object
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_count ⇒ Object
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_widgets ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 32 def = super if Organization.current&.simple_content_access? .reject! { || ::Widget.singleton_class::SUBSCRIPTION_TEMPLATES.include? [:template] } end end |
#total_host_count ⇒ Object
8 9 10 |
# File 'app/helpers/katello/concerns/dashboard_helper_extensions.rb', line 8 def total_host_count host_query.size end |
#unknown_consumer_count ⇒ Object
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_count ⇒ Object
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_count ⇒ Object
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 |