Commit cc3c7722d98c831e918bd5563a7a991e317feef9
Committed by
Paulo Meireles
1 parent
ac00c0d5
Exists in
master
and in
23 other branches
Showing error stack trace
Showing
1 changed file
with
11 additions
and
81 deletions
Show diff stats
plugins/mezuro/views/content_viewer/show_project.rhtml
| 1 | 1 | <% @project = Kalibro::Client::ProjectClient.new.project(@page.name) %> |
| 2 | 2 | |
| 3 | -<h1> <%= @project.name %>'s Info</h1> | |
| 4 | 3 | <table id="show_info"> |
| 5 | 4 | <tr> |
| 6 | 5 | <td><%= _("Name") %></td> |
| ... | ... | @@ -15,99 +14,30 @@ |
| 15 | 14 | <td><%= @project.description %></td> |
| 16 | 15 | </tr> |
| 17 | 16 | <tr> |
| 18 | - <td><%= _("Repository type") %></td> | |
| 17 | + <td><%= _("Repository type") %></td> | |
| 19 | 18 | <td><%= @project.repository.type %></td> |
| 20 | 19 | </tr> |
| 21 | 20 | <tr> |
| 22 | - <td><%= _("Repository address") %></td> | |
| 21 | + <td><%= _("Repository address") %></td> | |
| 23 | 22 | <td><%= @project.repository.address %></td> |
| 24 | 23 | </tr> |
| 25 | 24 | <tr> |
| 26 | - <td><%= _("Configuration") %></td> | |
| 25 | + <td><%= _("Configuration") %></td> | |
| 27 | 26 | <td><%= @project.configuration_name %></td> |
| 28 | 27 | </tr> |
| 29 | 28 | </table> |
| 30 | 29 | |
| 31 | 30 | <br /> |
| 32 | 31 | |
| 33 | -<% if @project.state == 'ERROR' %> | |
| 32 | +<% if ! @project.error.nil? %> | |
| 34 | 33 | <h3>ERROR</h3> |
| 35 | - <br /> | |
| 36 | - <br /> | |
| 34 | + <% @error = @project.error %> | |
| 37 | 35 | <p> |
| 38 | - <%= _("Possible causes:") %> | |
| 39 | - <ul> | |
| 40 | - <li><%= _("Server is down") %></li> | |
| 41 | - <li><%= _("Invalid URL") %> </li> | |
| 42 | - <li><%= _("Incorrect language") %> </li> | |
| 43 | - </ul> | |
| 36 | + <%= "State when error ocurred: #{@project.state}" %> | |
| 37 | + <br/> | |
| 38 | + <%= @error.message %> | |
| 39 | + <ul><% @error.stack_trace.each do |trace| %> | |
| 40 | + <li><%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %></li> | |
| 41 | + <% end %></ul> | |
| 44 | 42 | </p> |
| 45 | 43 | <% end %> |
| 46 | - | |
| 47 | -<% if @project.state.end_with? 'ING' %> | |
| 48 | - <div id="progress_message"> | |
| 49 | - <%= _("The server is calculating metric results.<br/>Reload the page manually in a few moments.") %> | |
| 50 | - </div> | |
| 51 | -<% end %> | |
| 52 | - | |
| 53 | - | |
| 54 | -<% if @project.state == 'READY' %> | |
| 55 | - | |
| 56 | - <% if @project.configuration.nil? %> | |
| 57 | - <% metric_results = @client.last_module_result(@project.name).metric_results %> | |
| 58 | - | |
| 59 | - <h3> <%= _("Total Metrics") %> </h3> | |
| 60 | - <table id="total_metrics"> | |
| 61 | - <% total_results = metric_results.each.select {|result| result.native_metric.scope == 'APPLICATION'} %> | |
| 62 | - <% total_results.each_with_index do |result, index| %> | |
| 63 | - <tr id="tr_<%= result.native_metric.code %>" class="d<%= index % 2 %>"> | |
| 64 | - <td> <%= result.native_metric.name %> </td> | |
| 65 | - <td class="metric_box"> <%= result.value %> </td> | |
| 66 | - </tr> | |
| 67 | - <% end %> | |
| 68 | - </table> | |
| 69 | - | |
| 70 | - <h3> <%= _("Statistical Metrics") %> </h3> | |
| 71 | - <% statistical_results = metric_results.each.select {|result| result.native_metric.scope == 'CLASS'} %> | |
| 72 | - <% statistical_results.each do |result| %> | |
| 73 | - <div id="statistical_metrics"> | |
| 74 | - | |
| 75 | - <table id="<%= @project.name %>_<%= result.native_metric.code %>_list"> | |
| 76 | - <thead> | |
| 77 | - <th> | |
| 78 | - <img id="<%= @project.name %>_<%= result.native_metric.code %>_plus" | |
| 79 | - onclick="collapse('<%= @project.name %>_<%= result.native_metric.code %>')" | |
| 80 | - alt="+" src="/plugins/mezuro/images/plus.png" class="collapsable"/> | |
| 81 | - <img id="<%= @project.name %>_<%= result.native_metric.code %>_minus" style="display: none" | |
| 82 | - onclick="collapse('<%= @project.name %>_<%= result.native_metric.code %>')" | |
| 83 | - alt="-" src="/plugins/mezuro/images/minus.png" class="collapsable"/> | |
| 84 | - <%= "#{result.native_metric.name}" %> | |
| 85 | - </th> | |
| 86 | - <th class="metric_box"> | |
| 87 | - <%= "#{result.average}"%> | |
| 88 | - </th> | |
| 89 | - </thead> | |
| 90 | - <% result.available_statistics.each_with_index do |statistic, index| %> | |
| 91 | - <tr class="d<%= index % 2 %> statistic" style="display: none"> | |
| 92 | - <td><%= statistic %></td> | |
| 93 | - <td class="metric_box"><%= result.statistic(statistic) %></td> | |
| 94 | - </tr> | |
| 95 | - <% end %> | |
| 96 | - </table> | |
| 97 | - </div> | |
| 98 | - <% end %> | |
| 99 | - | |
| 100 | - <% else %> | |
| 101 | - <% metric_results = @client.last_module_result(@project.name).compiled_metric_results %> | |
| 102 | - | |
| 103 | - <h3> <%= _("Metrics") %> </h3> | |
| 104 | - <table id="metrics"> | |
| 105 | - <% metric_results.each do |result| %> | |
| 106 | - <tr id="tr_<%= result.native_metric.code %>"> | |
| 107 | - <td> <%= result.native_metric.name %> </td> | |
| 108 | - <td class="metric_box"> <%= result.value %> </td> | |
| 109 | - </tr> | |
| 110 | - <% end %> | |
| 111 | - </table> | |
| 112 | - <% end %> | |
| 113 | -<% end %> | ... | ... |