Mailinglist Archive: yast-commit (725 mails)

< Previous Next >
[yast-commit] <web-client> master : control center - added reboot/shutdown functionality
  • From: Ladislav Slezak <lslezak@xxxxxxxxxx>
  • Date: Fri, 14 Aug 2009 16:12:59 +0200
  • Message-id: <E1MbxXe-00087P-Mq@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 06227bbf2b3efbbcfaa15218fe14504b0892dbb5
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
Date: Fri Aug 14 15:21:47 2009 +0200

control center - added reboot/shutdown functionality

hide the buttons when the system plugin is not installed
---
webclient/app/views/controlpanel/index.rhtml | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/webclient/app/views/controlpanel/index.rhtml
b/webclient/app/views/controlpanel/index.rhtml
index 95a7324..da28c60 100644
--- a/webclient/app/views/controlpanel/index.rhtml
+++ b/webclient/app/views/controlpanel/index.rhtml
@@ -18,12 +18,19 @@
<% end %>
<div id="status-wrapper" class="">

+<% if ActionController::Routing.possible_controllers.include?("system") %>
+ <% host = Host.find(session[:host]) rescue nil %>
+ <% host_name = host.nil? ? 'the machine' : "'#{host.name}'" %>
<div id="machine-controle">
<ul>
- <li> <a class="button" href="#">Reboot</a></li>
- <li><a class="button" href="#">Shutdown</a></li>
+ <li><h4>System actions </h4></li>
+ <li><%= link_to _('Reboot'), {:controller => 'system', :action =>
'reboot'},
+ :confirm => _("Really reboot #{host_name}?"), :method => :put,
:class => 'button' %></li>
+ <li><%= link_to _('Shutdown'), {:controller => 'system', :action =>
'shutdown'},
+ :confirm => _("Really shutdown #{host_name}?"), :method => :put,
:class => 'button' %></li>
</ul>
</div>
+<% end %>

<h3><img src="/images/monitoring.png" height="23" width="23" border="0" />
<%= _("Status") %></h3>

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages