Sha256: 770f377bd71ccce6f96029745b9845f664ff3151e1fe9b78ab717024f67a0e12

Contents?: true

Size: 1.04 KB

Versions: 29

Compression:

Stored size: 1.04 KB

Contents

module ComplianceHostsHelper
  def host_policy_breakdown_chart(report, options = {})
    data = []
    [[:passed, _('Passed')],
     [:failed, _('Failed')],
     [:othered, _('Other')],].each do |i|
      data << { :label => i[1], :data => report[i[0]], :color => ArfReportDashboardHelper::COLORS[i[0]] }
    end
    flot_pie_chart 'overview', _('Compliance reports breakdown'), data, options
  end

  def host_arf_reports_chart(policy_id)
    passed = []
    failed = []
    othered = []
    @host.arf_reports.of_policy(policy_id).each do |report|
      passed  << [report.created_at.to_i * 1000, report.passed]
      failed  << [report.created_at.to_i * 1000, report.failed]
      othered << [report.created_at.to_i * 1000, report.othered]
    end
    [{ :label => _("Passed"), :data => passed, :color => ArfReportDashboardHelper::COLORS[:passed] },
     { :label => _("Failed"), :data => failed, :color => ArfReportDashboardHelper::COLORS[:failed] },
     { :label => _("Othered"), :data => othered, :color => ArfReportDashboardHelper::COLORS[:othered] }]
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
foreman_openscap-1.0.6 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.5 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.4 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.3 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.2 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.1 app/helpers/compliance_hosts_helper.rb
foreman_openscap-1.0.0 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.12.3 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.5 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.12.2 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.12.1 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.12.0 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.4 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.3 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.2 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.1 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.11.0 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.10.4 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.10.3 app/helpers/compliance_hosts_helper.rb
foreman_openscap-0.10.2 app/helpers/compliance_hosts_helper.rb