Commit 2fff0da4ae404df13d464bb6e4fe4d7c49374103
Committed by
João M. M. da Silva
1 parent
a54a81a5
Exists in
master
and in
23 other branches
[Mezuro] Added selected metrics on show_configuration view
Showing
2 changed files
with
22 additions
and
1 deletions
Show diff stats
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
| ... | ... | @@ -31,7 +31,8 @@ end |
| 31 | 31 | metric_id = collector_name + ":" + metric.name %> |
| 32 | 32 | <tr class="metric" title="<%= metric.description %>"> |
| 33 | 33 | <td> |
| 34 | - <%= check_box_tag "article[metrics][]", metric_id, true, {:id => metric_id.gsub(/[\/ ]/, '_')} %> | |
| 34 | + <% #FIXME Tratar caso com 0 métricas selecionadas | |
| 35 | + <%= check_box_tag "article[metrics][]", metric_id, false, {:id => metric_id.gsub(/[\/ ]/, '_')} %> | |
| 35 | 36 | <%= label_tag metric_id, metric.name %> |
| 36 | 37 | </td> |
| 37 | 38 | </tr> | ... | ... |
plugins/mezuro/views/content_viewer/show_configuration.rhtml
| ... | ... | @@ -10,3 +10,23 @@ |
| 10 | 10 | <td><%= @configuration_content.description %></td> |
| 11 | 11 | </tr> |
| 12 | 12 | </table> |
| 13 | + | |
| 14 | +<h3>Metrics</h3> | |
| 15 | +<% @tool_names = Kalibro::Client::BaseToolClient.new | |
| 16 | +@tool_names.base_tool_names.each do |collector_name| %> | |
| 17 | + <h4><%=collector_name%></h4> | |
| 18 | + <table> | |
| 19 | + <% @configuration_content.metrics.each do |metric| | |
| 20 | + splitted_metric = metric.split(/:/) | |
| 21 | + metric_origin = splitted_metric[0] | |
| 22 | + metric_name = splitted_metric[1] | |
| 23 | + if( metric_origin == collector_name )%> | |
| 24 | + <tr class="metric" title="<%= metric_name %>"> | |
| 25 | + <td> | |
| 26 | + <%=metric_name%> | |
| 27 | + </td> | |
| 28 | + </tr> | |
| 29 | + <%end | |
| 30 | + end %> | |
| 31 | + </table> | |
| 32 | +<% end %> | ... | ... |