Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> use-activeresource : improved workflow handling
  • From: Stefan Schubert <schubi@xxxxxxx>
  • Date: Mon, 14 Sep 2009 15:08:28 +0200
  • Message-id: <E1MoJ2U-0003KL-0c@xxxxxxxxxxxxxxxx>
ref: refs/heads/use-activeresource
commit 01ecf8e4f0362639d9d88d1c115b8c699c412bbb
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Mon Sep 14 15:08:28 2009 +0200

improved workflow handling
---
.../app/controllers/patch_updates_controller.rb | 8 ++++----
.../patch_updates/_patch_installation.html.erb | 8 +++++---
2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/plugins/patch_updates/app/controllers/patch_updates_controller.rb
b/plugins/patch_updates/app/controllers/patch_updates_controller.rb
index 7671db0..b92c685 100644
--- a/plugins/patch_updates/app/controllers/patch_updates_controller.rb
+++ b/plugins/patch_updates/app/controllers/patch_updates_controller.rb
@@ -57,7 +57,6 @@ class PatchUpdatesController < ApplicationController
def start_install_all
logger.debug "Start installation of all patches"

- flash.clear #no flash from load_proxy
respond_to do |format|
format.html { render :partial => "patch_installation", :locals => {
:patch => _("Installing all patches..."), :error => nil , :go_on => true }}
end
@@ -66,9 +65,8 @@ class PatchUpdatesController < ApplicationController
def stop_install_all
logger.debug "Stopping installation of all patches"

- flash.clear #no flash from load_proxy
respond_to do |format|
- format.html { render :partial => "patch_installation", :locals => {
:patch => _("Installing stopped"), :error => nil , :go_on => false }}
+ format.html { render :partial => "patch_installation", :locals => {
:patch => _("Installation stopped"), :error => nil , :go_on => false }}
end
end

@@ -76,6 +74,7 @@ class PatchUpdatesController < ApplicationController
# Install each patch. This function will be called periodically from the
controll center
def install_all
logger.debug "Installing one available patch...."
+
error = nil
patch_updates = nil
begin
@@ -85,6 +84,7 @@ class PatchUpdatesController < ApplicationController
patch_updates = nil
end

+ flash.clear #no flash from load_proxy
last_patch = ""
if patch_updates
#installing the first available patch
@@ -101,7 +101,7 @@ class PatchUpdatesController < ApplicationController
if last_patch.blank?
format.html { render :partial => "patch_installation", :locals => {
:patch => _("Installation finished"), :error => error , :go_on => false }}
else
- format.html { render :partial => "patch_installation", :locals => {
:patch => last_patch, :error => error , :go_on => true }}
+ format.html { render :partial => "patch_installation", :locals => {
:patch => _("#{last_patch} installed.") , :error => error }}
end
end
end
diff --git
a/plugins/patch_updates/app/views/patch_updates/_patch_installation.html.erb
b/plugins/patch_updates/app/views/patch_updates/_patch_installation.html.erb
index 8336eb9..82a94d7 100644
--- a/plugins/patch_updates/app/views/patch_updates/_patch_installation.html.erb
+++ b/plugins/patch_updates/app/views/patch_updates/_patch_installation.html.erb
@@ -1,5 +1,7 @@
<% javascript_tag do -%>
- check_var = <%= go_on%>;
+ <% if defined? go_on %>
+ continue_loop = <%= go_on %>;
+ <% end -%>
<% end -%>

<%= report_error(error, _("An error occured while installing patches.")) if
error %>
@@ -13,8 +15,8 @@
<% end %>
<span><%= patch %></span>
<% end %>
- <% if go_on %>
+ <% if !defined?(go_on) or go_on %>
<%= button_to_remote _("Stop"), :update =>"status_patches", :url=>{
:controller => :patch_updates, :action => :stop_install_all}, :confirm =>
_("Are you sure?") %>
<% end %>
- <%= periodically_call_remote(:condition => "check_var == true",:url=>{
:controller => :patch_updates, :action => :install_all}, :udpate
=>"status_patches", :frequency => 15) %>
+ <%= periodically_call_remote(:condition => "continue_loop == true",
:update =>"status_patches", :url=>{ :controller => :patch_updates, :action =>
:install_all}, :frequency => 20) %>
</div>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages