-
Notifications
You must be signed in to change notification settings - Fork 359
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 #3398 from skovic/network-device-ui-redesign
Change the way that network device details are displayed
- Loading branch information
Showing
18 changed files
with
271 additions
and
37 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,45 @@ | ||
class GuestDeviceController < ApplicationController | ||
include Mixins::GenericListMixin | ||
include Mixins::GenericShowMixin | ||
include Mixins::GenericSessionMixin | ||
include Mixins::MoreShowActions | ||
|
||
before_action :check_privileges | ||
before_action :session_data | ||
after_action :cleanup_action | ||
after_action :set_session_data | ||
|
||
def self.model | ||
@model ||= "GuestDevice".safe_constantize | ||
end | ||
|
||
def title | ||
_('Guest Devices') | ||
end | ||
|
||
def model | ||
self.class.model | ||
end | ||
|
||
def self.table_name | ||
@table_name ||= "guest_devices" | ||
end | ||
|
||
def session_data | ||
@title = _("Guest Devices") | ||
@layout = "guest_device" | ||
@lastaction = session[:guest_device_lastaction] | ||
end | ||
|
||
def set_session_data | ||
session[:layout] = @layout | ||
session[:guest_device_lastaction] = @lastaction | ||
end | ||
|
||
def textual_group_list | ||
[ | ||
%i(properties ports firmware), | ||
] | ||
end | ||
helper_method(:textual_group_list) | ||
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
2 changes: 2 additions & 0 deletions
2
app/helpers/application_helper/toolbar/guest_device_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,2 @@ | ||
class ApplicationHelper::Toolbar::GuestDeviceCenter < ApplicationHelper::Toolbar::Basic | ||
end |
2 changes: 2 additions & 0 deletions
2
app/helpers/application_helper/toolbar/guest_devices_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,2 @@ | ||
class ApplicationHelper::Toolbar::GuestDevicesCenter < ApplicationHelper::Toolbar::Basic | ||
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,3 @@ | ||
module GuestDeviceHelper | ||
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,54 @@ | ||
module GuestDeviceHelper::TextualSummary | ||
def textual_group_properties | ||
TextualGroup.new( | ||
_("Properties"), | ||
%i(device_name location manufacturer field_replaceable_unit) | ||
) | ||
end | ||
|
||
def textual_group_ports | ||
ports = {:labels => [_("Name"), _("MAC Address")]} | ||
ports[:values] = @record.child_devices.collect do |port| | ||
[ | ||
port.name, | ||
port.address | ||
] | ||
end | ||
|
||
TextualMultilabel.new( | ||
_("Ports"), | ||
ports | ||
) | ||
end | ||
|
||
def textual_group_firmware | ||
firmware = {:labels => [_("Name"), _("Version")]} | ||
firmware[:values] = @record.firmwares.collect do |fw| | ||
[ | ||
fw.name, | ||
fw.version | ||
] | ||
end | ||
|
||
TextualMultilabel.new( | ||
_("Firmware"), | ||
firmware | ||
) | ||
end | ||
|
||
def textual_device_name | ||
{:label => _("Name"), :value => @record.device_name} | ||
end | ||
|
||
def textual_manufacturer | ||
{:label => _("Manufacturer"), :value => @record.manufacturer} | ||
end | ||
|
||
def textual_location | ||
{:label => _("Location"), :value => @record.location} | ||
end | ||
|
||
def textual_field_replaceable_unit | ||
{:label => _("FRU"), :value => @record.field_replaceable_unit} | ||
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 @@ | ||
#main_div | ||
- if %w(guest_devices).include?(@display) | ||
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} | ||
- else | ||
- case @showtype | ||
- when "main" | ||
= 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' |
Empty file.
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,56 @@ | ||
#Report title | ||
title: Guest Devices | ||
|
||
#Menu name | ||
name: Guest Device | ||
|
||
|
||
db: GuestDevice | ||
|
||
|
||
# Columns to fetch from main table | ||
cols: | ||
- device_name | ||
- location | ||
- manufacturer | ||
- field_replaceable_unit | ||
|
||
|
||
include: | ||
|
||
|
||
include_for_find: | ||
:ext_management_system: {} | ||
|
||
|
||
col_order: | ||
- device_name | ||
- location | ||
- manufacturer | ||
- field_replaceable_unit | ||
|
||
col_formats: | ||
|
||
headers: | ||
- Device Name | ||
- Location | ||
- Manufacturer | ||
- Field Replaceable Unit | ||
|
||
|
||
conditions: | ||
|
||
|
||
order: Ascending | ||
|
||
|
||
sortby: | ||
- device_name | ||
|
||
group: n | ||
|
||
|
||
graph: | ||
|
||
|
||
dims: |
Oops, something went wrong.