ref: refs/heads/master
commit 082b8e0dc60a51e5ca92fd54d8b8fe18e8e214b6
Author: Stefan Schubert
Date: Thu Jul 23 18:18:18 2009 +0200
improved layout for showing limits for disc free
---
.../status/app/controllers/status_controller.rb | 6 +++++-
plugins/status/app/views/status/index.html.erb | 14 +++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/plugins/status/app/controllers/status_controller.rb b/plugins/status/app/controllers/status_controller.rb
index d69d5f7..e1cab63 100644
--- a/plugins/status/app/controllers/status_controller.rb
+++ b/plugins/status/app/controllers/status_controller.rb
@@ -204,7 +204,11 @@ class StatusController < ApplicationController
end
if error_found
status += "; " unless status.blank?
- status += key + " " + _("limits exceeded")
+ if key == "df"
+ status += _("Disk free limits exceeded")
+ else
+ status += key + " " + _("limits exceeded")
+ end
end
end
diff --git a/plugins/status/app/views/status/index.html.erb b/plugins/status/app/views/status/index.html.erb
index 88ca7b5..cb305cc 100644
--- a/plugins/status/app/views/status/index.html.erb
+++ b/plugins/status/app/views/status/index.html.erb
@@ -154,9 +154,9 @@ function plotLineGraphError(graph_id, graph_title, graph_data ) {
<% @data_group.each do |key, map| %>
<% map.each do |graph_key, list_value| %>
<% graph_id = key + "_" + graph_key.tr('/','_') %>
+ <% limit_key = "/#{key}/#{graph_key}" %>
<% if key != "df" %>
$('#' + '<%= graph_id %>').html("");
- <% limit_key = "/#{key}/#{graph_key}" %>
<% if @limits_list.has_key?(limit_key) %>
<% if @limit_hits.include?(limit_key) %>
plotLineGraphError('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_',' ').capitalize %>', [<%= list_value.inspect %>, <%= @limits_list[limit_key].inspect %>]);
@@ -164,17 +164,17 @@ function plotLineGraphError(graph_id, graph_title, graph_data ) {
plotLineGraph('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_',' ').capitalize %>', [<%= list_value.inspect %>, <%= @limits_list[limit_key].inspect %>]);
<% end %>
<% else %>
- <% if @limit_hits.include?(limit_key) %>
- plotLineGraphError('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_',' ').capitalize %>', [<%= list_value.inspect %>]);
- <% else %>
- plotLineGraph('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_',' ').capitalize %>', [<%= list_value.inspect %>]);
- <% end %>
+ plotLineGraph('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_',' ').capitalize %>', [<%= list_value.inspect %>]);
<% end %>
<% else %>
<% if graph_key.end_with?("free") %>
$('#' + '<%= graph_id %>').html("");
<% used_key = graph_key[0..graph_key.length-5] + "used" %>
- plotPieGraph ('<%= graph_id %>', '<%= graph_key[2..graph_key.length-5].tr('_','/') %>', [["<%= _("free") %>", <%= list_value.last[1] %>], ["<%= _("used") %>", <%= map[used_key].last[1] %>]]);
+ <% if @limit_hits.include?(limit_key) %>
+ plotPieGraphError ('<%= graph_id %>', '<%= graph_key[2..graph_key.length-5].tr('_','/') %>', [["<%= _("free") %>", <%= list_value.last[1] %>], ["<%= _("used") %>", <%= map[used_key].last[1] %>]]);
+ <% else %>
+ plotPieGraph ('<%= graph_id %>', '<%= graph_key[2..graph_key.length-5].tr('_','/') %>', [["<%= _("free") %>", <%= list_value.last[1] %>], ["<%= _("used") %>", <%= map[used_key].last[1] %>]]);
+ <% end %>
<% end %>
<% end %>
<% end %>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org