Skip to content

Commit 5542621

Browse files
committed
SAT-38427 - Implement CSV exports on the hosts overview
1 parent 066fa63 commit 5542621

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/foreman_rh_cloud/plugin.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ def self.register
142142
extend_page 'hosts/_list' do |context|
143143
context.with_profile :cloud, _('RH Cloud'), default: true do
144144
add_pagelet :hosts_table_column_header, key: :insights_recommendations_count, label: _('Recommendations'), sortable: true, width: '12%', class: 'hidden-xs ellipsis', priority: 100,
145-
export_data: CsvExporter::ExportDefinition.new(:insights_recommendations_count, callback: ->(host) { host&.insights_hits&.count })
145+
export_data: CsvExporter::ExportDefinition.new(:insights_recommendations_count, label: _('Recommendations'), callback: ->(host) { host&.insights_hits&.count })
146146
add_pagelet :hosts_table_column_content, key: :insights_recommendations_count, callback: ->(host) { hits_counts_cell(host) }, class: 'hidden-xs ellipsis text-center', priority: 100
147+
add_pagelet :hosts_table_column_header, key: :cves_count, label: _('Total CVEs'), width: '12%', class: 'hidden-xs ellipsis',
148+
export_data: CsvExporter::ExportDefinition.new(:cves_count, label: _('Total CVEs'), callback: ->(host) { host&.insights_attributes&.dig('cves_count') })
149+
add_pagelet :hosts_table_column_content, key: :cves_count, callback: ->(host) { host&.insights_attributes&.dig('cves_count') || '—' }, class: 'hidden-xs ellipsis'
147150
end
148151
end
149152

0 commit comments

Comments
 (0)