-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7577 from Autosde/implement_show_list_for_storage…
…_consumers Implement show list for Host initiators
- Loading branch information
Showing
13 changed files
with
220 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class HostInitiatorController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::BreadcrumbsMixin | ||
include Mixins::GenericFormMixin | ||
include Mixins::GenericButtonMixin | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def show | ||
if params[:id].nil? | ||
@breadcrumbs.clear | ||
end | ||
super | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i[properties san_addresses], %i[tags]] | ||
end | ||
helper_method :textual_group_list | ||
|
||
def set_session_data | ||
session[:layout] = @layout | ||
end | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _("Storage")}, | ||
{:title => _("Block Storage")}, | ||
{:title => _("Host Initiators"), :url => controller_url}, | ||
], | ||
} | ||
end | ||
|
||
menu_section " host_initiator" | ||
|
||
feature_for_actions "#{controller_name}_show_list", *ADV_SEARCH_ACTIONS | ||
feature_for_actions "#{controller_name}_show_list", :download_data | ||
feature_for_actions "#{controller_name}_show", :download_summary_pdf | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ def display_methods | |
flavors | ||
floating_ips | ||
host_aggregates | ||
host_initiators | ||
hosts | ||
images | ||
instances | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,6 +236,7 @@ def show_adv_search? | |
security_policy_rule | ||
service | ||
storage_resource | ||
host_initiator | ||
templates | ||
vm | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module HostInitiatorHelper | ||
include_concern 'TextualSummary' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module HostInitiatorHelper::TextualSummary | ||
include TextualMixins::TextualGroupTags | ||
|
||
# | ||
# Groups | ||
# | ||
|
||
def textual_group_properties | ||
TextualGroup.new( | ||
_("Properties"), | ||
%i[ | ||
name | ||
ems | ||
physical_storage | ||
] | ||
) | ||
end | ||
|
||
def textual_group_san_addresses | ||
san_addresses_values = @record.san_addresses.map do |san_address| | ||
[san_address.class.display_name, san_address.address_value] | ||
end | ||
|
||
TextualMultilabel.new( | ||
_("SAN Addresses"), | ||
:labels => [_("Type"), _("Value")], | ||
:values => san_addresses_values | ||
) | ||
end | ||
|
||
# | ||
# Items | ||
# | ||
|
||
def textual_name | ||
{:label => _("Name"), :value => @record.name} | ||
end | ||
|
||
def textual_ems | ||
textual_link(@record.ext_management_system) | ||
end | ||
|
||
def textual_physical_storage | ||
textual_link(@record.physical_storage) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- if %w(host_initiator).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- else | ||
- if @showtype == "item" | ||
= render :partial => "layouts/item" | ||
- else | ||
= render :partial => "layouts/textual_groups_generic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#main_div | ||
= render :partial => 'layouts/gtl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# | ||
# This is an MIQ Report configuration file | ||
# Single value parameters are specified as: | ||
# single_value_parm: value | ||
# Multiple value parameters are specified as: | ||
# multi_value_parm: | ||
# - value 1 | ||
# - value 2 | ||
# | ||
|
||
# Report title | ||
title: Host Initiators | ||
|
||
# Menu name | ||
name: HostInitiator | ||
|
||
# Main DB table report is based on | ||
db: HostInitiator | ||
include: | ||
ext_management_system: | ||
columns: | ||
- name | ||
physical_storage: | ||
columns: | ||
- name | ||
|
||
# Columns to fetch from the main table | ||
cols: | ||
- name | ||
- v_total_addresses | ||
|
||
|
||
# Included tables and columns for query performance | ||
#include_for_find: | ||
# :tags: {} | ||
|
||
# Order of columns (from all tables) | ||
col_order: | ||
- name | ||
- ext_management_system.name | ||
- physical_storage.name | ||
- v_total_addresses | ||
|
||
|
||
# Column titles, in order | ||
headers: | ||
- Name | ||
- EMS Name | ||
- Storage System Name | ||
- Total addresses | ||
|
||
# Condition(s) string for the SQL query | ||
conditions: | ||
|
||
# Order string for the SQL query | ||
order: Ascending | ||
|
||
# Columns to sort the report on, in order | ||
sortby: | ||
- name | ||
|
||
# Group rows (y=yes,n=no,c=count) | ||
group: n | ||
|
||
# Graph type | ||
# Bar | ||
# Column | ||
# ColumnThreed | ||
# ParallelThreedColumn | ||
# Pie | ||
# PieThreed | ||
# StackedBar | ||
# StackedColumn | ||
# StackedThreedColumn | ||
|
||
graph: | ||
|
||
# Dimensions of graph (1 or 2) | ||
# Note: specifying 2 for a single dimension graph may not return expected results | ||
dims: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters