Mailinglist Archive: yast-commit (1224 mails)

< Previous Next >
[yast-commit] <web-client> backgroud_patches_bnc550934 : showing flash if no data is available (bnc#524614)
  • From: Stefan Schubert <schubi@xxxxxxx>
  • Date: Thu, 12 Nov 2009 10:12:42 +0100
  • Message-id: <E1NDEzI-0001so-Ol@xxxxxxxxxxxxxxxx>
ref: refs/heads/backgroud_patches_bnc550934
commit a31f5e4c62058ff85094a86c38ff574bb3e067db
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Thu Nov 12 10:12:42 2009 +0100

showing flash if no data is available (bnc#524614)
---
.../status/app/controllers/status_controller.rb | 25 +++++++++++++++++--
1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/plugins/status/app/controllers/status_controller.rb
b/plugins/status/app/controllers/status_controller.rb
index 012449f..7b4cf03 100644
--- a/plugins/status/app/controllers/status_controller.rb
+++ b/plugins/status/app/controllers/status_controller.rb
@@ -101,11 +101,30 @@ class StatusController < ApplicationController

till = Time.new
from = till - 300 #last 5 minutes
- ActionController::Base.benchmark("Status data read from the server") do
- status = @client.find(:dummy_param, :params => { :start =>
from.to_i.to_s, :stop => till.to_i.to_s })
+ begin
+ ActionController::Base.benchmark("Status data read from the server") do
+ status = @client.find(:dummy_param, :params => { :start =>
from.to_i.to_s, :stop => till.to_i.to_s })
+ end
+ create_data_map status
+ rescue Exception => e
+ flash[:warning] = e.message
+ logger.warn e
end
- create_data_map status
# logger.debug @data_group.inspect
+
+ #checking if there is one valid data entry at least
+ found = false
+ @data_group.each do |key, map|
+ map.each do |graph_key, list_value|
+ unless list_value.empty?
+ found = true
+ break
+ end
+ end
+ break if found
+ end
+ flash[:notice] = _("No data found for showing system status.") unless found
+
true
end

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

< Previous Next >