1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-10 01:17:40 +03:00

B #687: filter by hidden columns

This commit is contained in:
Alejandro Huertas 2020-05-18 14:53:33 +02:00
parent 5b384c1770
commit 4b6307de10
No known key found for this signature in database
GPG Key ID: 3044AF06BE405104

View File

@ -571,8 +571,8 @@ module CLIHelper
# @return [Array] Array with selected columns information
def data_array(data, options)
res_data = data.collect do |d|
@columns.collect do |_, params|
params[:proc].call(d).to_s
@default_columns.collect do |c|
@columns[c][:proc].call(d).to_s if @columns[c]
end
end
@ -580,6 +580,10 @@ module CLIHelper
filter_data!(res_data, options) if options[:filter]
end
return res_data unless options[:list]
@default_columns = options[:list].collect {|o| o.upcase.to_sym }
res_data
end
@ -797,10 +801,6 @@ module CLIHelper
rescue StandardError => e
CLIHelper.fail(e.message)
end
return unless options[:list]
@default_columns = options[:list].collect {|o| o.upcase.to_sym }
end
# Filter data