-
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.
Read-only pages for browsing firmware repository
With this commit we add following pages to support firmware repository browsing: ``` - firmware registry list - firmware registry details + display firmware_binaries - firmware binary details + display firmware constraints - firmware contstraint details + display firmware binaries ``` Signed-off-by: Miha Pleško <[email protected]>
- Loading branch information
1 parent
eacc599
commit 6d6bacf
Showing
22 changed files
with
590 additions
and
9 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,51 @@ | ||
class FirmwareBinaryController < ApplicationController | ||
before_action :check_privileges | ||
before_action :get_session_data | ||
|
||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
include Mixins::GenericListMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::ListnavMixin | ||
include Mixins::BreadcrumbsMixin | ||
|
||
def self.display_methods | ||
%w[firmware_constraints] | ||
end | ||
|
||
def self.model | ||
FirmwareBinary | ||
end | ||
|
||
def display_firmware_constraints | ||
nested_list(FirmwareConstraint, :breadcrumb_title => _('Firmware Constraints')) | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i[properties relationships]] | ||
end | ||
helper_method :textual_group_list | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _('Cloud')}, | ||
{:title => _('Infrastructure')}, | ||
{:title => _('Firmware Registries')}, | ||
{ | ||
:title => @record.firmware_registry.name, | ||
:url => url_for(:controller => :firmware_registry, :id => @record.firmware_registry.id, :action => :show) | ||
}, | ||
{ | ||
:title => _('Firmware Binaries'), | ||
:url => url_for(:controller => :firmware_registry, :id => @record.firmware_registry.id, :action => :show, | ||
:display => :firmware_binaries) | ||
}, | ||
], | ||
} | ||
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,46 @@ | ||
class FirmwareConstraintController < ApplicationController | ||
before_action :check_privileges | ||
before_action :get_session_data | ||
|
||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
include Mixins::GenericListMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::ListnavMixin | ||
include Mixins::BreadcrumbsMixin | ||
|
||
def self.display_methods | ||
%w[firmware_binaries] | ||
end | ||
|
||
def self.model | ||
FirmwareConstraint | ||
end | ||
|
||
def display_firmware_binaries | ||
nested_list(FirmwareBinary, :breadcrumb_title => _('Firmware Binaries')) | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i[properties relationships]] | ||
end | ||
helper_method :textual_group_list | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _('Cloud')}, | ||
{:title => _('Infrastructure')}, | ||
{ | ||
:title => _('Firmware Registries'), | ||
:url => url_for(:controller => :firmware_registry, :action => :show_list) | ||
}, | ||
{:title => _('Firmware Constraints'), :url => controller_url}, | ||
], | ||
} | ||
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,48 @@ | ||
class FirmwareRegistryController < ApplicationController | ||
before_action :check_privileges | ||
before_action :get_session_data | ||
|
||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
include Mixins::GenericListMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::ListnavMixin | ||
include Mixins::BreadcrumbsMixin | ||
|
||
menu_section :firmware_registry | ||
|
||
def self.display_methods | ||
%w[firmware_binaries] | ||
end | ||
|
||
def self.model | ||
FirmwareRegistry | ||
end | ||
|
||
def title | ||
_('Firmware Registry') | ||
end | ||
|
||
def display_firmware_binaries | ||
nested_list(FirmwareBinary, :breadcrumb_title => _('Firmware Binaries')) | ||
end | ||
|
||
private | ||
|
||
def textual_group_list | ||
[%i[properties relationships]] | ||
end | ||
helper_method :textual_group_list | ||
|
||
def breadcrumbs_options | ||
{ | ||
:breadcrumbs => [ | ||
{:title => _('Compute')}, | ||
{:title => _('Infrastructure')}, | ||
{:title => _('Firmware Registries'), :url => controller_url}, | ||
], | ||
} | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
app/helpers/application_helper/toolbar/firmware_registry_center.rb
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,16 @@ | ||
class ApplicationHelper::Toolbar::FirmwareRegistryCenter < ApplicationHelper::Toolbar::Basic | ||
button_group( | ||
'firmware_registry_reload', | ||
[ | ||
button( | ||
:firmware_registry_reload, | ||
'fa fa-refresh fa-lg', | ||
N_('Refresh this page'), | ||
N_('Refresh'), | ||
:url_parms => "main_div", | ||
:send_checked => true, | ||
:klass => ApplicationHelper::Button::ButtonWithoutRbacCheck | ||
) | ||
] | ||
) | ||
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,3 @@ | ||
module FirmwareBinaryHelper | ||
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,35 @@ | ||
module FirmwareBinaryHelper::TextualSummary | ||
include TextualMixins::TextualName | ||
include TextualMixins::TextualDescription | ||
|
||
def textual_group_properties | ||
TextualGroup.new( | ||
_("Properties"), | ||
%i[name description version created updated] | ||
) | ||
end | ||
|
||
def textual_group_relationships | ||
TextualGroup.new(_("Relationships"), %i[firmware_registry firmware_constraints]) | ||
end | ||
|
||
def textual_created | ||
{:label => _("Created On"), :value => format_timezone(@record.created_at)} | ||
end | ||
|
||
def textual_updated | ||
{:label => _("Updated On"), :value => format_timezone(@record.updated_at)} | ||
end | ||
|
||
def textual_version | ||
@record.version | ||
end | ||
|
||
def textual_firmware_registry | ||
textual_link(@record.firmware_registry) | ||
end | ||
|
||
def textual_firmware_constraints | ||
textual_link(@record.firmware_constraints) | ||
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,3 @@ | ||
module FirmwareConstraintHelper | ||
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,32 @@ | ||
module FirmwareConstraintHelper::TextualSummary | ||
def textual_group_properties | ||
TextualGroup.new( | ||
_("Properties"), | ||
%i[manufacturer model created updated] | ||
) | ||
end | ||
|
||
def textual_group_relationships | ||
TextualGroup.new(_("Relationships"), %i[firmware_binaries]) | ||
end | ||
|
||
def textual_created | ||
{:label => _("Created On"), :value => format_timezone(@record.created_at)} | ||
end | ||
|
||
def textual_updated | ||
{:label => _("Updated On"), :value => format_timezone(@record.updated_at)} | ||
end | ||
|
||
def textual_manufacturer | ||
@record.manufacturer | ||
end | ||
|
||
def textual_model | ||
@record.model | ||
end | ||
|
||
def textual_firmware_binaries | ||
textual_link(@record.firmware_binaries) | ||
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,3 @@ | ||
module FirmwareRegistryHelper | ||
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,31 @@ | ||
module FirmwareRegistryHelper::TextualSummary | ||
include TextualMixins::TextualName | ||
|
||
def textual_group_properties | ||
TextualGroup.new(_("Properties"), %i[name last_refresh_on last_refresh_error created updated]) | ||
end | ||
|
||
def textual_group_relationships | ||
TextualGroup.new(_("Relationships"), %i[firmware_binaries]) | ||
end | ||
|
||
def textual_last_refresh_on | ||
{:label => _("Last Refresh"), :value => format_timezone(@record.last_refresh_on)} | ||
end | ||
|
||
def textual_last_refresh_error | ||
@record.last_refresh_error | ||
end | ||
|
||
def textual_created | ||
{:label => _("Created On"), :value => format_timezone(@record.created_at)} | ||
end | ||
|
||
def textual_updated | ||
{:label => _("Updated On"), :value => format_timezone(@record.updated_at)} | ||
end | ||
|
||
def textual_firmware_binaries | ||
textual_link(@record.firmware_binaries) | ||
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,5 @@ | ||
#main_div | ||
- if %w(firmware_constraints).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- 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,5 @@ | ||
#main_div | ||
- if %w(firmware_binaries).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- 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,5 @@ | ||
#main_div | ||
- if %w(firmware_binaries).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- 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, "stack_prop") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= link_to_with_icon(_('Summary'), {:action => 'show', :id => @record, :display => 'main'}, | ||
:title => _("Show Summary")) | ||
|
||
= miq_accordion_panel(_("Relationships"), false, "stack_rel") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= link_to(_('Firmware Registry'), | ||
{:controller => "firmware_registry", | ||
:action => 'show', | ||
:id => @record.firmware_registry_id}, | ||
:title => _("Show Firmware Registry")) | ||
%li | ||
= li_link(:count => @record.firmware_constraints.size, | ||
:text => _("Firmware Constraints"), | ||
:display => 'firmware_constraints', | ||
:record_id => @record.id, | ||
:title => _("Show all Firmware Constraints")) |
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,19 @@ | ||
- 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, "stack_prop") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= link_to_with_icon(_('Summary'), {:action => 'show', :id => @record, :display => 'main'}, | ||
:title => _("Show Summary")) | ||
|
||
= miq_accordion_panel(_("Relationships"), false, "stack_rel") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= li_link(:count => @record.firmware_binaries.size, | ||
:text => _("Firmware Binaries"), | ||
:display => 'firmware_binaries', | ||
:record_id => @record.id, | ||
:title => _("Show all Firmware Binaries")) |
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,19 @@ | ||
- 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, "stack_prop") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= link_to_with_icon(_('Summary'), {:action => 'show', :id => @record, :display => 'main'}, | ||
:title => _("Show Summary")) | ||
|
||
= miq_accordion_panel(_("Relationships"), false, "stack_rel") do | ||
%ul.nav.nav-pills.nav-stacked | ||
%li | ||
= li_link(:count => @record.firmware_binaries.size, | ||
:text => _("Firmware Binaries"), | ||
:display => 'firmware_binaries', | ||
:record_id => @record.id, | ||
:title => _("Show all Firmware Binaries")) |
Oops, something went wrong.