Skip to content

Commit

Permalink
Merge pull request #2431 from lucashsilva/physical_server_power_opera…
Browse files Browse the repository at this point in the history
…tions

Add physical server power operations buttons
  • Loading branch information
Dan Clarizio committed Oct 20, 2017
2 parents 164e565 + 0931908 commit e8b01e3
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
44 changes: 44 additions & 0 deletions app/helpers/application_helper/toolbar/physical_server_center.rb
Expand Up @@ -61,6 +61,17 @@ 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,
Expand All @@ -72,6 +83,39 @@ class ApplicationHelper::Toolbar::PhysicalServerCenter < ApplicationHelper::Tool
: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
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 e8b01e3

Please sign in to comment.