Mailinglist Archive: yast-commit (1809 mails)

< Previous Next >
[yast-commit] <web-client> network : services - added 'status' link (refreshes the current status)
  • From: Ladislav Slezak <lslezak@xxxxxxxxxx>
  • Date: Mon, 31 Aug 2009 14:28:38 +0200
  • Message-id: <E1MjDJX-0001HD-0q@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit 4fc2439c6c8b84a872fe1bd77a5ae31bc3f6e9de
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
Date: Mon Aug 31 14:28:38 2009 +0200

services - added 'status' link (refreshes the current status)

- start/stop also refreshes the status
- display progress indicator while reading the status
---
plugins/services/app/views/services/index.rhtml | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/plugins/services/app/views/services/index.rhtml
b/plugins/services/app/views/services/index.rhtml
index 12e5281..7aaff03 100644
--- a/plugins/services/app/views/services/index.rhtml
+++ b/plugins/services/app/views/services/index.rhtml
@@ -27,13 +27,18 @@ end
<% @services.each do |service| %>
<li><b><%=h service.name %></b>

+<img src="/images/working.gif" height="12" width="12" border="0"
+ id="service_progress_<%=service.name%>" style="display: none" />
+
<span class='service_status' id='service_status_<%=service.name%>'>
<% if service.status.nil? %>
- <img src="/images/working.gif" height="12" width="12" border="0" />
<% javascript_tag do %>
$(document).ready( function() {
- <%= remote_function(:update => "service_status_#{service.name}",
- :url => { :controller => :services, :action => :show_status, :id =>
service.name }) %>
+ <%= remote_function :update => "service_status_#{service.name}",
+ :url => { :controller => :services, :action => :show_status, :id =>
service.name },
+ :loading => "$('#service_progress_#{service.name}').show();
$('#service_status_#{service.name}').hide()",
+ :complete => "$('#service_progress_#{service.name}').hide();
$('#service_status_#{service.name}').show()"
+ %>
});
<% end %>
<% else %>
@@ -52,7 +57,11 @@ $(document).ready( function() {
url[:custom] = 1 if params.has_key?("custom")
link_to_remote cmd,
:update => "resultdlg",
- :url => url
+ :url => url,
+ :loading =>
"$('#service_progress_#{service.name}').show();
$('#service_status_#{service.name}').hide()",
+ :complete => remote_function(:update =>
"service_status_#{service.name}",
+ :url => { :controller => :services, :action =>
:show_status, :id => service.name },
+ :complete =>
"$('#service_progress_#{service.name}').hide();
$('#service_status_#{service.name}').show()")
%>
<%
else %>
@@ -60,6 +69,11 @@ $(document).ready( function() {
<%
end
end %>
+
+ <%= link_to_remote _('status'), :update =>
"service_status_#{service.name}",
+ :url => { :controller => :services, :action => :show_status, :id =>
service.name },
+ :loading => "$('#service_progress_#{service.name}').show();
$('#service_status_#{service.name}').hide()",
+ :complete => "$('#service_progress_#{service.name}').hide();
$('#service_status_#{service.name}').show()" %>
</li>
<% end %>
</ul>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages