Browse Source

SONAR-2414 use blue instead of green in clouds

tags/2.9
Simon Brandhof 13 years ago
parent
commit
d4d8521936

+ 1
- 1
sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb View File

@@ -31,7 +31,7 @@ class CloudController < ApplicationController
@snapshot=@project.last_snapshot

@size_metric=Metric.by_key(params[:size]||'ncloc')
@color_metric=Metric.by_key(params[:color]||'violations_density')
@color_metric=Metric.by_key(params[:color]||'coverage')
snapshot_conditions='snapshots.islast=:islast AND snapshots.scope=:scope AND snapshots.qualifier!=:test_qualifier AND
(snapshots.id=:sid OR (snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path))'

+ 5
- 2
sonar-server/src/main/webapp/WEB-INF/app/models/measure_color.rb View File

@@ -61,12 +61,15 @@ class MeasureColor
end
end

max_color=options[:max_color]||MAX_COLOR
min_color=options[:min_color]||MIN_COLOR
mean_color=options[:mean_color]||MEAN_COLOR
if percent<0.0
NONE_COLOR
elsif (percent > 50.0)
MAX_COLOR.mix_with(MEAN_COLOR, (percent - 50.0) * 2.0)
max_color.mix_with(mean_color, (percent - 50.0) * 2.0)
else
MIN_COLOR.mix_with(MEAN_COLOR, (50.0 - percent) * 2.0)
min_color.mix_with(mean_color, (50.0 - percent) * 2.0)
end
end


+ 8
- 2
sonar-server/src/main/webapp/WEB-INF/app/views/cloud/index.html.erb View File

@@ -37,7 +37,13 @@
</form>

<div id="cloud">
<% @snapshots.each do |s|
<%
color_options={
:check_alert_status => false,
:min_color => Color::RGB.from_html("EE0000"), # red
:mean_color => Color::RGB.from_html("4D05B1"), # purple
:max_color => Color::RGB.from_html("2360BF")} # blue
@snapshots.each do |s|
size_measure=@size_measure_by_sid[s.id]
if size_measure && size_measure.value
color_measure=@color_measure_by_sid[s.id]
@@ -51,7 +57,7 @@
title += " | #{@color_metric.short_name}: #{color_measure.formatted_value}"
end
%>
<a href="#" onclick="<%= link -%>" title="<%= title -%>"><span style="font-size:<%= font_size(size_measure.value) -%>%;color: <%= MeasureColor.color(color_measure, :check_alert_status => false).html -%>"><%= s.resource.name %></span></a>
<a href="#" onclick="<%= link -%>" title="<%= title -%>"><span style="font-size:<%= font_size(size_measure.value) -%>%;color: <%= MeasureColor.color(color_measure, color_options).html -%>"><%= s.resource.name %></span></a>
<% end
end %>
</div>

+ 1
- 1
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb View File

@@ -38,10 +38,10 @@
<% ActiveDashboard.user_dashboards(current_user).each do |active_dashboard| %>
<li class="<%= 'selected' if @dashboard && controller.controller_path=='dashboard' && active_dashboard.dashboard_id==@dashboard.id -%>"><a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= @project.id -%>?did=<%= active_dashboard.dashboard_id -%>"><%= active_dashboard.dashboard.name -%></a></li>
<% end %>
<li class="<%= 'selected' if request.request_uri.include?('/cloud/index') -%>"><a href="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>">Clouds</a></li>
<li class="<%= 'selected' if request.request_uri.include?('/components/index') -%>"><a href="<%= ApplicationController.root_context -%>/components/index/<%= @project.id -%>">Components</a></li>
<li class="<%= 'selected' if request.request_uri.include?('/drilldown/violations') -%>"><a href="<%= ApplicationController.root_context -%>/drilldown/violations/<%= @project.id -%>">Violations drilldown</a></li>
<li class="<%= 'selected' if controller.controller_path=='timemachine' -%>"><a href="<%= ApplicationController.root_context -%>/timemachine/index/<%= @project.id -%>">Time machine</a></li>
<li class="<%= 'selected' if request.request_uri.include?('/cloud/index') -%>"><a href="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>">Clouds</a></li>
<% controller.java_facade.getPages(Navigation::SECTION_RESOURCE, @project.scope, @project.qualifier, @project.language).each do |page| %>
<li class="<%= 'selected' if request.request_uri.include?("page=#{page.getId()}") -%>"><a href="<%= ApplicationController.root_context -%>/plugins/resource/<%= @project.id-%>?page=<%= page.getId() -%>"><%= page.getTitle() %></a></li>
<% end %>

Loading…
Cancel
Save