class ForemanOpenscap::PolicyDashboard::Data

def fetch_data

def fetch_data
  report.update(
    { :compliant_hosts => Host::Managed.comply_with(@policy).count,
      :incompliant_hosts => Host::Managed.not_comply_with(@policy).count,
      :inconclusive_hosts => Host::Managed.inconclusive_with(@policy).count,
      :report_missing => Host::Managed.policy_reports_missing(@policy).count,
      :assigned_hosts => Host::Managed.assigned_to_policy(@policy).count,
      :unassigned_hosts => Host::Managed.removed_from_policy(@policy).count }
  )
end

def hosts

def hosts
  @hosts ||= Host.authorized(:view_hosts, Host)
end

def initialize(policy, filter = "")

def initialize(policy, filter = "")
  @policy = policy
  @filter = filter
  @report = {}
  fetch_data
end