Skip to content

Commit

Permalink
Added physical server power operations buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashsilva committed Oct 18, 2017
1 parent 83ed40f commit 9667dd0
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 2 deletions.
50 changes: 48 additions & 2 deletions app/helpers/application_helper/toolbar/physical_server_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,63 @@ class ApplicationHelper::Toolbar::PhysicalServerCenter < ApplicationHelper::Tool
:confirm => N_("Power off the server?"),
:options => {:feature => :power_off}
),
button(
:physical_server_power_off_now,
nil,
N_('Power off the server immediately'),
N_('Power Off Immediately'),
:image => "power_off",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "power_off_now", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Power off the server immediately?"),
:options => {:feature => :power_off_now}
),
button(
:physical_server_restart,
nil,
N_('Restart the server'),
N_('Restart'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart", "controller": "physicalServerToolbarController"}'},
:data => {
'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart", "controller": "physicalServerToolbarController"}'
},
:confirm => N_("Restart the server?"),
:options => {:feature => :restart}
),
button(
:physical_server_restart_now,
nil,
N_('Restart Server Immediately'),
N_('Restart Immediately'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_now", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart the server immediately?"),
:options => {:feature => :restart_now}
),
button(
:physical_server_restart_to_sys_setup,
nil,
N_('Restart Server to System Setup'),
N_('Restart to System Setup'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_to_sys_setup", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart the server to UEFI settings?"),
:options => {:feature => :restart_to_sys_setup}
),
button(
:physical_server_restart_mgmt_controller,
nil,
N_('Restart Management Controller'),
N_('Restart Management Controller'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_mgmt_controller", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart management controller?"),
:options => {:feature => :restart_mgmt_controller}
)
]
),
select(
Expand Down
52 changes: 52 additions & 0 deletions app/helpers/application_helper/toolbar/physical_servers_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ class ApplicationHelper::Toolbar::PhysicalServersCenter < ApplicationHelper::Too
:onwhen => "1+",
:options => {:feature => :power_off}
),
button(
:physical_server_power_off_now,
nil,
N_('Power off the servers immediately'),
N_('Power Off Immediately'),
:image => "power_off",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "power_off_now", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Power off the servers immediately?"),
:enabled => false,
:onwhen => "1+",
:options => {:feature => :power_off_now}
),
button(
:physical_server_restart,
nil,
Expand All @@ -82,6 +95,45 @@ class ApplicationHelper::Toolbar::PhysicalServersCenter < ApplicationHelper::Too
:onwhen => "1+",
:options => {:feature => :restart}
),
button(
:physical_server_restart_now,
nil,
N_('Restart Servers Immediately'),
N_('Restart Immediately'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_now", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart the servers immediately?"),
:enabled => false,
:onwhen => "1+",
:options => {:feature => :restart_now}
),
button(
:physical_server_restart_to_sys_setup,
nil,
N_('Restart Servers to System Setup'),
N_('Restart to System Setup'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_to_sys_setup", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart the servers to system setup?"),
:enabled => false,
:onwhen => "1+",
:options => {:feature => :restart_to_sys_setup}
),
button(
:physical_server_restart_mgmt_controller,
nil,
N_('Restart Management Controller'),
N_('Restart Management Controller'),
:image => "power_reset",
:data => {'function' => 'sendDataWithRx',
'function-data' => '{"type": "restart_mgmt_controller", "controller": "physicalServerToolbarController"}'},
:confirm => N_("Restart management controller for the selected servers?"),
:enabled => false,
:onwhen => "1+",
:options => {:feature => :restart_mgmt_controller}
)
]
),
select(
Expand Down

0 comments on commit 9667dd0

Please sign in to comment.