-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Physical Chassis List & Details pages
- Loading branch information
1 parent
e6d193c
commit 3e34c9f
Showing
19 changed files
with
688 additions
and
5 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
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,32 @@ | ||
class PhysicalChassisController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::MoreShowActions | ||
|
||
before_action :check_privileges | ||
before_action :get_session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.table_name | ||
@table_name ||= "physical_chassis" | ||
end | ||
|
||
def show_list | ||
disable_client_cache | ||
process_show_list | ||
end | ||
|
||
def textual_group_list | ||
[ | ||
%i(properties relationships), | ||
%i(management_network slots) | ||
] | ||
end | ||
helper_method(:textual_group_list) | ||
|
||
def self.display_methods | ||
%w(physical_chassis) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class PhysicalChassisDecorator < MiqDecorator | ||
def self.fonticon | ||
'pficon pficon-cluster' | ||
end | ||
|
||
def quadicon | ||
{ | ||
:top_left => { | ||
:text => t = physical_servers.count, | ||
:tooltip => n_("%{number} Physical Server", "%{number} Physical Servers", t) % {:number => t} | ||
}, | ||
:top_right => {}, | ||
:bottom_left => { | ||
:fonticon => fonticon, | ||
:tooltip => ui_lookup(:model => type), | ||
}, | ||
:bottom_right => QuadiconHelper.health_state(health_state) | ||
} | ||
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
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,3 @@ | ||
module PhysicalChassisHelper | ||
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,113 @@ | ||
module PhysicalChassisHelper::TextualSummary | ||
# | ||
# Textual Groups | ||
# Properties, Relationships, Management Network, Slots | ||
# | ||
def textual_group_properties | ||
TextualGroup.new( | ||
_("Properties"), | ||
%i(name product_name manufacturer serial_number part_number health_state uid_ems description) | ||
) | ||
end | ||
|
||
def textual_group_relationships | ||
TextualGroup.new( | ||
_("Relationships"), | ||
%i(ext_management_system physical_rack physical_servers) | ||
) | ||
end | ||
|
||
def textual_group_management_network | ||
TextualGroup.new( | ||
_("Management Network"), | ||
%i(ipaddress) | ||
) | ||
end | ||
|
||
def textual_group_slots | ||
TextualGroup.new( | ||
_("Chassis Slots"), | ||
%i(mm_slot_count switch_slot_count fan_slot_count blade_slot_count powersupply_slot_count) | ||
) | ||
end | ||
|
||
# | ||
# Properties | ||
# | ||
def textual_name | ||
{:label => _("Chassis name"), :value => @record.name } | ||
end | ||
|
||
def textual_product_name | ||
{:label => _("Product Name"), :value => @record.asset_detail["product_name"] } | ||
end | ||
|
||
def textual_manufacturer | ||
{:label => _("Manufacturer"), :value => @record.asset_detail["manufacturer"] } | ||
end | ||
|
||
def textual_serial_number | ||
{:label => _("Serial Number"), :value => @record.asset_detail["serial_number"] } | ||
end | ||
|
||
def textual_part_number | ||
{:label => _("Part Number"), :value => @record.asset_detail["part_number"] } | ||
end | ||
|
||
def textual_health_state | ||
{:label => _("Health State"), :value => @record.health_state} | ||
end | ||
|
||
def textual_uid_ems | ||
{:label => _("UUID"), :value => @record.uid_ems } | ||
end | ||
|
||
def textual_description | ||
{:label => _("Description"), :value => @record.asset_detail["description"]} | ||
end | ||
|
||
# | ||
# Relashionships | ||
# | ||
def textual_ext_management_system | ||
textual_link(ExtManagementSystem.find(@record.ems_id)) | ||
end | ||
|
||
def textual_physical_rack | ||
textual_link(@record.physical_rack) | ||
end | ||
|
||
def textual_physical_servers | ||
textual_link(@record.physical_servers) | ||
end | ||
|
||
# | ||
# Management Network | ||
# | ||
def textual_ipaddress | ||
{:label => _("IP"), :value => (@record.guest_devices.detect { |device| device.device_type == "management" })&.network&.ipaddress} | ||
end | ||
|
||
# | ||
# Chassis Slots | ||
# | ||
def textual_mm_slot_count | ||
{:label => _("Management Module Slot Count"), :value => @record.management_module_slot_count} | ||
end | ||
|
||
def textual_switch_slot_count | ||
{:label => _("Switch Slot Count"), :value => @record.switch_slot_count} | ||
end | ||
|
||
def textual_fan_slot_count | ||
{:label => _("Fan Slot Count"), :value => @record.fan_slot_count} | ||
end | ||
|
||
def textual_blade_slot_count | ||
{:label => _("Blade Slot Count"), :value => @record.blade_slot_count} | ||
end | ||
|
||
def textual_powersupply_slot_count | ||
{:label => _("Power Supply Slot Count"), :value => @record.powersupply_slot_count} | ||
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
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,17 @@ | ||
- if @record.try(:name) | ||
#accordion.panel-group | ||
= miq_accordion_panel(truncate(@record.name, :length => truncate_length), true, "icon") do | ||
= render :partial => 'shared/quadicon', :locals => {:record => @record} | ||
|
||
= miq_accordion_panel(_("Properties"), false, "ems_prop") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= link_to(_('Summary'), {:action => 'show', :id => @record, :display => 'main'}, {:title => _("Show Summary")}) | ||
|
||
= miq_accordion_panel(_("Relationships"), false, "ems_rel") do | ||
%ul.nav.nav-pills.nav-stacked | ||
- if @record.ext_management_system | ||
%li | ||
= link_to(_("Provider: %{name}") % {:name => @record.ext_management_system.name}, | ||
ems_physical_infra_path(@record.ext_management_system.id), | ||
:title => _("Show this parent Provider")) |
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,13 @@ | ||
#main_div | ||
- if %w(physical_rack physical_servers).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- if %w(physical_servers).include?(@display) | ||
%physical-server-toolbar#ems_physical_infra_show_list_form | ||
:javascript | ||
miq_bootstrap('#ems_physical_infra_show_list_form') | ||
- else | ||
- case @showtype | ||
- when "main" | ||
= render :partial => 'layouts/textual_groups_generic' | ||
- when "timeline" | ||
= render :partial => "layouts/tl_show_async" |
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
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,63 @@ | ||
#Report title | ||
title: Physical Chassis | ||
|
||
#Menu name | ||
name: Physical Chassis | ||
|
||
|
||
db: PhysicalChassis | ||
|
||
|
||
# Columns to fetch from main table | ||
cols: | ||
- name | ||
- type | ||
- health_state | ||
- asset_detail.product_name | ||
- asset_detail.manufacturer | ||
|
||
|
||
include: | ||
|
||
|
||
include_for_find: | ||
:ext_management_system: {} | ||
:compliances: {} | ||
:tags: {} | ||
|
||
|
||
col_order: | ||
- name | ||
- type | ||
- health_state | ||
- asset_detail.product_name | ||
- asset_detail.manufacturer | ||
|
||
col_formats: | ||
- | ||
- :model_name | ||
|
||
headers: | ||
- Name | ||
- Type | ||
- Health State | ||
- Product Name | ||
- Manufacturer | ||
|
||
|
||
conditions: | ||
|
||
|
||
order: Ascending | ||
|
||
|
||
sortby: | ||
- name | ||
|
||
group: n | ||
|
||
|
||
graph: | ||
|
||
|
||
dims: |
Oops, something went wrong.