This commit is contained in:
Your Name 2016-06-29 11:10:19 +08:00
parent 36944e8cce
commit 3390a2d05f
6 changed files with 8 additions and 8 deletions

View File

@ -67,18 +67,18 @@ class QualityAnalysisController < ApplicationController
puts e
end
# respond_to do |format|
# format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch)}
# #format.html{redirect_to project_quality_analysis_path(:project_id => @project.id, :resource_id => sonar_name, :branch => branch)}
# format.js
# end
end
# get language type
def swith_language_type language
if language = "c#"
if language == "c#"
"cs"
elsif language = "python"
elsif language == "python"
"py"
elsif language = "c"
elsif language == "c"
"c++"
else
language

View File

@ -94,7 +94,7 @@
},
series: [{
name: '代码质量',
data: [<%= @complexity["msr"][9]["val"] %>]
data: [<%= @complexity["msr"][9].nil? ? 0 : @complexity["msr"][9]["val"] %>]
// tooltip: {
// valueSuffix: ' km/h'
// }

View File

@ -1 +0,0 @@
alert("正在分析中…………(大概需要30分钟请耐心等待)")

View File

@ -1,6 +1,6 @@
<div class="f16 fb fontBlue mb10">代码质量分析</div>
<div>
<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier, :rep_id => @repository.id, :remote => true), :id => 'quality_analyses_form') do %>
<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier, :rep_id => @repository.id), :remote => true, :id => 'quality_analyses_form') do %>
<div class="ui form">
<div class="mb10" style="margin-right:13px;">
<textarea id="path_description" name="path" rows="8" placeholder="目录相对于根目录,用半角逗号隔开。如:src/main/java,libs,res/script" style="height: 87px; resize:vertical;" class="analysis-option-box"></textarea>

View File

@ -6,7 +6,7 @@
<%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%# if User.current.member_of?(@project) %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id), :remote => true, :class => "btn_zipdown fr" %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<%# end %>
<%# else %>

View File

@ -928,6 +928,7 @@ RedmineApp::Application.routes.draw do
}
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/quality_analysis', :to => 'repositories#quality_analysis'
get 'projects/:id/repository/graph', :to => 'repositories#graph'