File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed
Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,11 @@ def show_list
4040 options = { :model => "GuestDevice" , :named_scope => [ :with_ethernet_type ] }
4141 process_show_list ( options )
4242 end
43+
44+ def textual_group_list
45+ [
46+ %i( properties ports firmware ) ,
47+ ]
48+ end
49+ helper_method ( :textual_group_list )
4350end
Original file line number Diff line number Diff line change 1+ module GuestDeviceHelper
2+ include_concern 'TextualSummary'
3+ end
Original file line number Diff line number Diff line change 1+ module GuestDeviceHelper ::TextualSummary
2+ def textual_group_properties
3+ TextualGroup . new (
4+ _ ( "Properties" ) ,
5+ %i( device_name location manufacturer field_replaceable_unit )
6+ )
7+ end
8+
9+ def textual_group_ports
10+ ports = { :labels => [ _ ( "Name" ) , _ ( "MAC Address" ) ] }
11+ ports [ :values ] = @record . child_devices . collect do |port |
12+ [
13+ port . name ,
14+ port . address
15+ ]
16+ end
17+
18+ TextualMultilabel . new (
19+ _ ( "Ports" ) ,
20+ ports
21+ )
22+ end
23+
24+ def textual_group_firmware
25+ firmware = { :labels => [ _ ( "Name" ) , _ ( "Version" ) ] }
26+ firmware [ :values ] = @record . firmwares . collect do |fw |
27+ [
28+ fw . name ,
29+ fw . version
30+ ]
31+ end
32+
33+ TextualMultilabel . new (
34+ _ ( "Firmware" ) ,
35+ firmware
36+ )
37+ end
38+
39+ def textual_device_name
40+ { :label => _ ( "Name" ) , :value => @record . device_name }
41+ end
42+
43+ def textual_manufacturer
44+ { :label => _ ( "Manufacturer" ) , :value => @record . manufacturer }
45+ end
46+
47+ def textual_location
48+ { :label => _ ( "Location" ) , :value => @record . location }
49+ end
50+
51+ def textual_field_replaceable_unit
52+ { :label => _ ( "FRU" ) , :value => @record . field_replaceable_unit }
53+ end
54+ end
You can’t perform that action at this time.
0 commit comments