diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 83e5960b9..a9b93269a 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -1,6 +1,7 @@ class QualityAnalysisController < ApplicationController before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :authorize + before_filter :connect_jenkins, :only => [:create] layout "base_projects" include ApplicationHelper require 'jenkins_api_client' @@ -13,71 +14,98 @@ class QualityAnalysisController < ApplicationController end def create - gitlab_address = Redmine::Configuration['gitlab_address'] - jenkins_address = Redmine::Configuration['jenkins_address'] - @client = JenkinsApi::Client.new(:server_url => jenkins_address, - :username => "temp", - :password => '123123') - #@client.exists?(job_name) - @g = Gitlab.client - user_name = User.find(params[:user_id]).try(:login) - branch = params[:branch].nil? ? "master" : params[:branch] - language = params[:language] - path = params[:path] - identifier = params[:identifier] - qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first - version = qa.nil? ? 1 : qa.sonar_version + 1 - properties = "sonar.projectKey=#{user_name}:#{identifier} - sonar.projectName=#{user_name}:#{identifier} + begin + user_name = User.find(params[:user_id]).try(:login) + identifier = params[:identifier] + rep_id = params[:rep_id] + # REDO + job_name = "#{user_name}-#{rep_id}" + sonar_name = "#{user_name}:#{rep_id}" + + # Checks if the given job exists in Jenkins. + unless @client.job.exists?(job_name) + @g = Gitlab.client + branch = params[:branch] + language = swith_language_type(params[:language]) + path = params[:path].blank? ? "./" : params[:path] + qa = QualityAnalysis.where(:project_id => @project.id, :author_login => user_name).first + version = qa.nil? ? 1 : qa.sonar_version + 1 + properties = "sonar.projectKey=#{sonar_name} + sonar.projectName=#{sonar_name} sonar.projectVersion=#{version} sonar.sources=#{path} sonar.language=#{language.downcase} sonar.sourceEncoding=utf-8" - git_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git" - - # # # modify config - @doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml'))) - @doc.at_xpath("//hudson.plugins.git.UserRemoteConfig/url").content = git_url - @doc.at_xpath("//hudson.plugins.git.BranchSpec/name").content = "*/#{branch}" - @doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties #sonar-properties - # - # replace config.xml of jenkins - @client = @client.job.create("#{user_name}_#{identifier}", @doc.to_xml) - # relace gitlab hook - # genkins address - @g.add_project_hook(@project.gpid, jenkins_address + "/project/#{user_name}_#{identifier}") - if qa.nil? - QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, :sonar_version => version, :path => path, :branch => branch, :language => language) + git_url = @gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ identifier + "."+"git" + + # modify config.yml + @doc = Nokogiri::XML(File.open(File.join(Rails.root, 'tmp', 'config.xml'))) + @doc.at_xpath("//hudson.plugins.git.UserRemoteConfig/url").content = git_url + @doc.at_xpath("//hudson.plugins.git.BranchSpec/name").content = "*/#{branch}" + @doc.at_xpath("//hudson.plugins.sonar.SonarRunnerBuilder/properties").content = properties # sonar-properties + + # return '200' if successed + jenkins_job = @client.job.create("#{job_name}", @doc.to_xml) + + # replace gitlab hook + @g.add_project_hook(@project.gpid, @jenkins_address + "/project/#{job_name}") + # build job + logger.error("Jenkins status of create ==> #{jenkins_job}") + # return '201' if build successed + code = @client.job.build("#{job_name}") + logger.error("build result ==> #{code}") + d = @client.delete("#{job_name}") if jenkins_job == '200' && code != '201' + logger.error("delete result ==> #{code}") + if qa.blank? && code == '201' + QualityAnalysis.create(:project_id => @project.id, :author_login => user_name, :rep_identifier => identifier, + :sonar_version => version, :path => path, :branch => branch, :language => language, :sonar_name => "#{user_name}:#{rep_id}") + else + qa.update_attribute(:sonar_version, version) + end + end + rescue => e + 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.js + # end + end + # get language type + def swith_language_type language + if language == "c#" + "cs" + elsif language == "python" + "py" + elsif language == "c" + "c++" else - qa.update_attribute(:sonar_version, version) + language end end + # resource_id: login + @repository.id def index - @sonar_address = Redmine::Configuration['sonar_address'] - # if params[:resource_id].nil? - # @name_flag = true - # @quality_analyses = QualityAnalysis.where(:project_id => @project.id) - # # @quality_analyses.map {|qa| qa.} - # # if @quality_analyses.count > 0 - # # @quality_analyses.each do |qa| - # # ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] - # # - # # end - # # end - # # projects_date = open(@sonar_address + "/api/projects/index").read - # # arr = JSON.parse(projects_date).map {|m| m["nm"]} - # # arr.map - # else - qa = QualityAnalysis.where(:project_id => @project.id).first - @resource_id = qa.author_login+":"+qa.rep_identifier - @name_flag = false - complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read - @complexity =JSON.parse(complexity_date).first - issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read - @sonar_issues = JSON.parse(issue_date).first - # end + begin + @resource_id = params[:resource_id] + @sonar_address = Redmine::Configuration['sonar_address'] + if params[:resource_id].nil? + @name_flag = true + projects_date = open(@sonar_address + "/api/projects/index").read + arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] + @quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)} + + else + complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read + @complexity =JSON.parse(complexity_date).first + issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read + @sonar_issues = JSON.parse(issue_date).first + end + rescue => e + puts e + end + end # Find project of id params[:project_id] @@ -96,4 +124,14 @@ class QualityAnalysisController < ApplicationController end end + def connect_jenkins + @gitlab_address = Redmine::Configuration['gitlab_address'] + @jenkins_address = Redmine::Configuration['jenkins_address'] + + # connect jenkins + @client = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => "temp", :password => '123123') + rescue => e + logger.error("failed to connect Jenkins ==> #{e}") + end + end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index cbb5b2f69..7c3acb2cc 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -20,6 +20,8 @@ require 'SVG/Graph/BarHorizontal' require 'digest/sha1' require 'redmine/scm/adapters/abstract_adapter' require 'tempfile' +require 'json' +require 'open-uri' class ChangesetNotFound < Exception; end class InvalidRevisionParam < Exception; end @@ -358,6 +360,11 @@ update end def show + # sonar_address = Redmine::Configuration['sonar_address'] + # projects_date = open(sonar_address + "/api/projects/index").read + # arr = JSON.parse(projects_date).map {|m| m["nm"]} + # arr.map + ## TODO: the below will move to filter, done. if !User.current.member_of?(@project) && @project.hidden_repo render_403 diff --git a/app/helpers/quality_analysis_helper.rb b/app/helpers/quality_analysis_helper.rb index 9c6c07109..2a7d350e7 100644 --- a/app/helpers/quality_analysis_helper.rb +++ b/app/helpers/quality_analysis_helper.rb @@ -3,19 +3,19 @@ module QualityAnalysisHelper def sqale_rating_status val arr = [] - if val.to_i > 0 && val.to_i < 5 + if val < 5 arr << "很好" arr << "b_green2" - elsif val.to_i > 5 && val.to_i < 10 + elsif val. > 5 && val < 10 arr << "较好" arr << "b_slow_yellow" - elsif val.to_i > 10 && val.to_i < 20 + elsif val > 10 && val < 20 arr << "中等" arr << "b_yellow" - elsif val.to_i > 20 && val.to_i < 50 + elsif val > 20 && val < 50 arr << "较差" arr << "b_slow_red" - elsif val.to_i > 20 + elsif val > 20 arr << "很差" arr << "b_red" end @@ -23,13 +23,13 @@ module QualityAnalysisHelper def complexity_status val arr = [] - if val.to_i < 10 + if val < 10 arr << "良好" arr << "b_green2" - elsif val.to_i > 10 && val.to_i < 15 + elsif val > 10 && val < 15 arr << "较高" arr << "b_yellow" - elsif val.to_i > 15 + elsif val > 15 arr << "很高" arr << "b_red" end @@ -37,13 +37,13 @@ module QualityAnalysisHelper def duplicated_lines_density_status val arr = [] - if val.to_i < 30 + if val < 30 arr << "良好" arr << "b_green2" - elsif val.to_i > 30 && val.to_i < 50 + elsif val > 30 && val < 50 arr << "较高" arr << "b_yellow" - elsif val.to_i > 50 + elsif val > 50 arr << "很高" arr << "b_red" end @@ -51,28 +51,28 @@ module QualityAnalysisHelper def comment_lines_density_status val arr = [] - if val.to_i < 20 + if val < 20 arr << "较低" arr << "b_yellow" - elsif val.to_i > 20 && val.to_i < 50 + elsif val > 20 && val < 50 arr << "正常" arr << "b_green2" - elsif val.to_i > 50 + elsif val > 50 arr << "较高" arr << "b_red" end end def score_sqale_rating val - if val.to_i > 0 && val.to_i < 5 + if val > 0 && val < 5 "5" - elsif val.to_i > 5 && val.to_i < 10 + elsif val > 5 && val < 10 "4" - elsif val.to_i > 10 && val.to_i < 20 + elsif val > 10 && val < 20 "3" - elsif val.to_i > 20 && val.to_i < 50 + elsif val > 20 && val < 50 "2" - elsif val.to_i > 20 + elsif val > 20 "1" end end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 3cf781f76..b525c4aed 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -41,6 +41,11 @@ module RepositoriesHelper identifiers.include?(iden) ? false :true end + def quality_analysis login, rep_id + long_rep_id = "#{login}:#{rep_id}" + QualityAnalysis.where(:sonar_name => long_rep_id).first + end + # 获取文件目录的最新动态 def get_trees_last_changes(project_id, rev, ent_name) g = Gitlab.client diff --git a/app/models/quality_analysis.rb b/app/models/quality_analysis.rb index 229be9826..8b8034c65 100644 --- a/app/models/quality_analysis.rb +++ b/app/models/quality_analysis.rb @@ -1,5 +1,5 @@ class QualityAnalysis < ActiveRecord::Base - attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language + attr_accessible :author_login, :project_id, :rep_identifier, :sonar_version, :branch, :path, :rep_identifier, :language, :sonar_name def user_rep_name self.author_login+":"+self.rep_identifier diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 2c7d36fb5..6961fcbac 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -55,6 +55,12 @@ <%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %> <% end %> + + <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> + + <% end %> <% end %> diff --git a/app/views/quality_analysis/_hightchars.html.erb b/app/views/quality_analysis/_hightchars.html.erb index fb60eaed3..9e6cdf5aa 100644 --- a/app/views/quality_analysis/_hightchars.html.erb +++ b/app/views/quality_analysis/_hightchars.html.erb @@ -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' // } @@ -209,7 +209,7 @@ }, series: [{ name: '复杂度', - data: [<%= @complexity["msr"][6]["val"] %>] + data: [<%= @complexity["msr"][6].nil? ? 0 : @complexity["msr"][6]["val"] %>] // tooltip: { // valueSuffix: ' km/h' // } @@ -329,7 +329,7 @@ }, series: [{ name: '重复率', - data: [<%= @complexity["msr"][7]["val"] %>] + data: [<%= @complexity["msr"][7].nil? ? 0 : @complexity["msr"][7]["val"] %>] // tooltip: { // valueSuffix: ' km/h' // } @@ -454,7 +454,7 @@ }, series: [{ name: '质量等级', - data: [<%= @complexity["msr"][5]["val"] %>] + data: [<%= @complexity["msr"][5].nil? ? 0 : @complexity["msr"][5]["val"] %>] // tooltip: { // valueSuffix: ' km/h' // } diff --git a/app/views/quality_analysis/_result_list.html.erb b/app/views/quality_analysis/_result_list.html.erb index 507ded0fe..6124812c8 100644 --- a/app/views/quality_analysis/_result_list.html.erb +++ b/app/views/quality_analysis/_result_list.html.erb @@ -6,17 +6,17 @@
  • 版本
  • 分支
  • 语言
  • -
  • 时间
  • +
  • 路径
  • <% if @quality_analyses.count >0 %> <% @quality_analyses.each do |qa| %> <% end %> diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index 8f1cb8443..e55e65bcd 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -1,72 +1,90 @@ <%= javascript_include_tag 'highcharts','highcharts-more' %> - <%= render :partial => "hightchars" %> -
    -

    质量分析

    -
    +
    +

    质量分析

    +
    当前分支:<%= params[:branch] %>
    项目代码质量分析报告
    概要信息
    -
    -
    -
    -

    -

    质量等级

    -

    <%= @complexity["msr"][9]["frmt_val"] %> borderRadius"><%= sqale_rating_status(@complexity["msr"][9]["val"])[0] %>

    -
    -
    -

    -

    复杂度

    -

    <%= @complexity["msr"][6]["val"] %> borderRadius"><%= complexity_status(@complexity["msr"][6]["val"])[0] %>

    +<% if @complexity["msr"].count > 3 %> + <%= render :partial => "hightchars" %> +
    +
    +
    +

    +

    质量等级

    +

    <%= @complexity["msr"][9].nil? ? "A" : @complexity["msr"][9]["frmt_val"] %> + borderRadius"><%= @complexity["msr"][9].blank? ? "很好" : sqale_rating_status(@complexity["msr"][9]["val"].to_i)[0] %>

    +
    +
    +

    +

    复杂度

    +

    <%= @complexity["msr"][6].nil? ? 0 : @complexity["msr"][6]["val"] %> + borderRadius"><%= @complexity["msr"][6].nil? ? 0 : complexity_status(@complexity["msr"][6]["val"].to_i)[0] %>

    +
    -
    -
    -
    -

    -

    代码重复度

    -

    <%= @complexity["msr"][7]["frmt_val"] %> borderRadius"><%= duplicated_lines_density_status(@complexity["msr"][7]["val"])[0] %>

    -
    -
    -

    -

    注释率

    -

    <%= @complexity["msr"][5]["frmt_val"] %> borderRadius"><%=comment_lines_density_status(@complexity["msr"][5]["val"])[0] %>

    +
    +
    +

    +

    代码重复度

    +

    <%= @complexity["msr"][7].nil? ? 0 : @complexity["msr"][7]["frmt_val"] %> + borderRadius"><%= @complexity["msr"][7].nil? ? 0 : duplicated_lines_density_status(@complexity["msr"][7]["val"].to_i)[0] %>

    +
    +
    +

    +

    注释率

    +

    <%= @complexity["msr"][5].nil? ? 0 : @complexity["msr"][5]["frmt_val"] %> + borderRadius"><%= @complexity["msr"][5].nil? ? 0 : comment_lines_density_status(@complexity["msr"][5]["val"].to_i)[0] %>

    +
    -
    -
    质量等级<%= score_sqale_rating(@complexity["msr"][9]["val"]) %>/5分可定性评价为:质量<%= sqale_rating_status(@complexity["msr"][9]["val"])[0] %>
    +<% end %> + +
    质量等级<%=@complexity["msr"][9].nil? ? 0 : score_sqale_rating(@complexity["msr"][9]["val"].to_i) %>/5分 + 可定性评价为:质量<%=@complexity["msr"][9].nil? ? "很好" : sqale_rating_status(@complexity["msr"][9]["val"])[0] %>
    -
    技术债务<%= @complexity["msr"][8]["frmt_val"] %>查看详情
    -
    质量问题 - <%= @sonar_issues["msr"][0]["frmt_val"] %>问题分类如下:
    +
    技术债务<%=@complexity["msr"][8].nil? ? 0 : @complexity["msr"][8]["frmt_val"] %> + 查看详情
    +
    质量问题 + <%=@sonar_issues["msr"][0].nil? ? 0 : @sonar_issues["msr"][0]["frmt_val"] %>问题分类如下:
    -
    阻断<%= @sonar_issues["msr"][1]["frmt_val"] %>%;">
    -
    严重<%= @sonar_issues["msr"][2]["frmt_val"] %>%;">
    -
    主要<%= @sonar_issues["msr"][3]["frmt_val"] %>%;">
    -
    次要<%= @sonar_issues["msr"][4]["frmt_val"] %>%;">
    -
    信息<%= @sonar_issues["msr"][5]["frmt_val"] %>%;">
    +
    阻断 + <%= @sonar_issues["msr"][1].nil? ? 0 : @sonar_issues["msr"][1]["frmt_val"] %> + %;">
    +
    严重 + <%= @sonar_issues["msr"][2].nil? ? 0 : @sonar_issues["msr"][2]["frmt_val"] %> + %;">
    +
    主要 + <%= @sonar_issues["msr"][3].nil? ? 0 : @sonar_issues["msr"][3]["frmt_val"] %> + %;">
    +
    次要 + <%=@sonar_issues["msr"][4].nil? ? 0 : @sonar_issues["msr"][4]["frmt_val"] %> + %;">
    +
    信息 + <%=@sonar_issues["msr"][5].nil? ? 0 : @sonar_issues["msr"][5]["frmt_val"] %>%;">
    -
    代码规模可定性评价为:<%= lines_scale(@complexity["msr"][0]["frmt_val"]) %>
    +
    代码规模可定性评价为:<%=@complexity["msr"][0].nil? ? 0 : lines_scale(@complexity["msr"][0]["frmt_val"].to_i) %>

    代码行数

    -

    <%= @complexity["msr"][0]["frmt_val"] %>

    +

    <%= @complexity["msr"][0].nil? ? 0 : @complexity["msr"][0]["frmt_val"] %>

    文件

    -

    <%= @complexity["msr"][2]["frmt_val"] %>

    +

    <%= @complexity["msr"][2].nil? ? 0 : @complexity["msr"][2]["frmt_val"] %>

    目录

    -

    <%= @complexity["msr"][3]["frmt_val"] %>

    +

    <%= @complexity["msr"][3].nil? ? 0 : @complexity["msr"][3]["frmt_val"] %>

    -

    <%= @complexity["msr"][1]["frmt_val"] %>

    +

    <%= @complexity["msr"][1].nil? ? 0 : @complexity["msr"][1]["frmt_val"] %>

    方法

    -

    <%= @complexity["msr"][4]["frmt_val"] %>

    +

    <%=@complexity["msr"][4].nil? ? 0 : @complexity["msr"][4]["frmt_val"] %>

    diff --git a/app/views/repositories/_quality_analysis.html.erb b/app/views/repositories/_quality_analysis.html.erb index f9726fb9b..d583f54c6 100644 --- a/app/views/repositories/_quality_analysis.html.erb +++ b/app/views/repositories/_quality_analysis.html.erb @@ -1,9 +1,9 @@
    代码质量分析
    - <%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier), :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 %>
    - +
    @@ -12,7 +12,7 @@
    - <%= select_tag :language, options_for_select(["java","python","ruby","c++","c#", "Web"]), :id => 'branch', :class => "analysis-option-box" %> + <%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %>
    diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 22a64a219..067056983 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -1,14 +1,18 @@ <%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>

    <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>

    - ZIP下载 - <%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %> - <%# if User.current.member_of?(@project) %> - <%#= link_to "质量分析", quality_analysis_path(:id => @project.id), :remote => true, :class => "btn_zipdown fr" %> - <%# end %> - <%# else %> + <% unless @entries.nil? %> + ZIP下载 + <%# 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? && is_project_manager?(User.current.id, @project.id) %> + <%= 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 %> <%#= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id, :resource_id => @proje), :class => "btn_zipdown fr" %> - <%# end %> + <%# end %> + <% end %>
    <% if @entries.nil? %> diff --git a/config/routes.rb b/config/routes.rb index 3ad84d9b1..5dc509abd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -932,6 +932,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' diff --git a/db/migrate/20160624103411_add_name_to_quality_analyses.rb b/db/migrate/20160624103411_add_name_to_quality_analyses.rb deleted file mode 100644 index a40342b42..000000000 --- a/db/migrate/20160624103411_add_name_to_quality_analyses.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNameToQualityAnalyses < ActiveRecord::Migration - def change - # add_column :quality_analyses, :language, :string - end -end diff --git a/db/migrate/20160627090316_add_sonar_name_to_quality_analyses.rb b/db/migrate/20160627090316_add_sonar_name_to_quality_analyses.rb new file mode 100644 index 000000000..c69b5c909 --- /dev/null +++ b/db/migrate/20160627090316_add_sonar_name_to_quality_analyses.rb @@ -0,0 +1,5 @@ +class AddSonarNameToQualityAnalyses < ActiveRecord::Migration + def change + add_column :quality_analyses, :sonar_name, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 148a6e21b..16f39f6a1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160624032138) do +ActiveRecord::Schema.define(:version => 20160627090316) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "application_settings", :force => true do |t| + t.integer "default_projects_limit" + t.boolean "signup_enabled" + t.boolean "signin_enabled" + t.boolean "gravatar_enabled" + t.text "sign_in_text" + t.datetime "created_at" + t.datetime "updated_at" + t.string "home_page_url" + t.integer "default_branch_protection", :default => 2 + t.boolean "twitter_sharing_enabled", :default => true + t.text "restricted_visibility_levels" + t.boolean "version_check_enabled", :default => true + t.integer "max_attachment_size", :default => 10, :null => false + t.integer "default_project_visibility" + t.integer "default_snippet_visibility" + t.text "restricted_signup_domains" + t.boolean "user_oauth_applications", :default => true + t.string "after_sign_out_path" + t.integer "session_expire_delay", :default => 10080, :null => false + end + create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -156,6 +178,20 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.string "typeName", :limit => 50 end + create_table "audit_events", :force => true do |t| + t.integer "author_id", :null => false + t.string "type", :null => false + t.integer "entity_id", :null => false + t.string "entity_type", :null => false + t.text "details" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" + add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" + add_index "audit_events", ["type"], :name => "index_audit_events_on_type" + create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -253,6 +289,17 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" + create_table "broadcast_messages", :force => true do |t| + t.text "message", :null => false + t.datetime "starts_at" + t.datetime "ends_at" + t.integer "alert_type" + t.datetime "created_at" + t.datetime "updated_at" + t.string "color" + t.string "font" + end + create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -551,11 +598,8 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "is_copy", :default => 0 t.integer "visits", :default => 0 t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" end - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" create_table "custom_fields", :force => true do |t| @@ -619,6 +663,15 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "deploy_keys_projects", :force => true do |t| + t.integer "deploy_key_id", :null => false + t.integer "project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -668,6 +721,16 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "created_at" end + create_table "emails", :force => true do |t| + t.integer "user_id", :null => false + t.string "email", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true + add_index "emails", ["user_id"], :name => "index_emails_on_user_id" + create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -690,6 +753,25 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "events", :force => true do |t| + t.string "target_type" + t.integer "target_id" + t.string "title" + t.text "data" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "action" + t.integer "author_id" + end + + add_index "events", ["action"], :name => "index_events_on_action" + add_index "events", ["author_id"], :name => "index_events_on_author_id" + add_index "events", ["created_at"], :name => "index_events_on_created_at" + add_index "events", ["project_id"], :name => "index_events_on_project_id" + add_index "events", ["target_id"], :name => "index_events_on_target_id" + add_index "events", ["target_type"], :name => "index_events_on_target_type" + create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -792,6 +874,15 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + create_table "forked_project_links", :force => true do |t| + t.integer "forked_to_project_id", :null => false + t.integer "forked_from_project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true + create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -921,6 +1012,17 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "identities", :force => true do |t| + t.string "extern_uid" + t.string "provider" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" + add_index "identities", ["user_id"], :name => "index_identities_on_user_id" + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1064,6 +1166,20 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "private", :default => 0 end + create_table "keys", :force => true do |t| + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.text "key" + t.string "title" + t.string "type" + t.string "fingerprint" + t.boolean "public", :default => false, :null => false + end + + add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" + add_index "keys", ["user_id"], :name => "index_keys_on_user_id" + create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1075,6 +1191,27 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "owner_type", :default => 0 end + create_table "label_links", :force => true do |t| + t.integer "label_id" + t.integer "target_id" + t.string "target_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" + add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" + + create_table "labels", :force => true do |t| + t.string "title" + t.string "color" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "labels", ["project_id"], :name => "index_labels_on_project_id" + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1125,23 +1262,47 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "viewed_count", :default => 0 end - create_table "mess", :id => false, :force => true do |t| - t.string "课程名" - t.integer "课程ID", :default => 0, :null => false - t.string "教师姓", :default => "", :null => false - t.string "教师名", :limit => 30, :default => "", :null => false - t.string "主贴名", :default => "", :null => false - t.integer "主贴或回帖ID", :default => 0, :null => false - t.integer "回帖对应主贴ID" - t.integer "帖子点赞数" - t.integer "主贴回复数", :default => 0, :null => false - t.text "主贴或回帖内容" - t.datetime "发帖时间", :null => false - t.integer "发帖或回帖用户ID", :default => 0, :null => false - t.string "发帖或回帖用户姓", :default => "", :null => false - t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false + create_table "merge_request_diffs", :force => true do |t| + t.string "state" + t.text "st_commits", :limit => 2147483647 + t.text "st_diffs", :limit => 2147483647 + t.integer "merge_request_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" end + add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true + + create_table "merge_requests", :force => true do |t| + t.string "target_branch", :null => false + t.string "source_branch", :null => false + t.integer "source_project_id", :null => false + t.integer "author_id" + t.integer "assignee_id" + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "milestone_id" + t.string "state" + t.string "merge_status" + t.integer "target_project_id", :null => false + t.integer "iid" + t.text "description" + t.integer "position", :default => 0 + t.datetime "locked_at" + end + + add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" + add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" + add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" + add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" + add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" + add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" + add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" + add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" + add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true + add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1176,6 +1337,39 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" + create_table "milestones", :force => true do |t| + t.string "title", :null => false + t.integer "project_id", :null => false + t.text "description" + t.date "due_date" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.integer "iid" + end + + add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" + add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" + add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true + add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" + + create_table "namespaces", :force => true do |t| + t.string "name", :null => false + t.string "path", :null => false + t.integer "owner_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type" + t.string "description", :default => "", :null => false + t.string "avatar" + end + + add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" + add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true + add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" + add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true + add_index "namespaces", ["type"], :name => "index_namespaces_on_type" + create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1201,6 +1395,31 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "notes", :force => true do |t| + t.text "note" + t.string "noteable_type" + t.integer "author_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "project_id" + t.string "attachment" + t.string "line_code" + t.string "commit_id" + t.integer "noteable_id" + t.boolean "system", :default => false, :null => false + t.text "st_diff", :limit => 2147483647 + end + + add_index "notes", ["author_id"], :name => "index_notes_on_author_id" + add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" + add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" + add_index "notes", ["created_at"], :name => "index_notes_on_created_at" + add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" + add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" + add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" + add_index "notes", ["project_id"], :name => "index_notes_on_project_id" + add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" + create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1210,6 +1429,49 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "oauth_access_grants", :force => true do |t| + t.integer "resource_owner_id", :null => false + t.integer "application_id", :null => false + t.string "token", :null => false + t.integer "expires_in", :null => false + t.text "redirect_uri", :null => false + t.datetime "created_at", :null => false + t.datetime "revoked_at" + t.string "scopes" + end + + add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true + + create_table "oauth_access_tokens", :force => true do |t| + t.integer "resource_owner_id" + t.integer "application_id" + t.string "token", :null => false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at" + t.datetime "created_at", :null => false + t.string "scopes" + end + + add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true + add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" + add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true + + create_table "oauth_applications", :force => true do |t| + t.string "name", :null => false + t.string "uid", :null => false + t.string "secret", :null => false + t.text "redirect_uri", :null => false + t.string "scopes", :default => "", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" + end + + add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" + add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true + create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1367,6 +1629,23 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "allow_teacher", :default => 0 end + create_table "permissions", :force => true do |t| + t.string "controller", :limit => 30, :default => "", :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "description", :limit => 60, :default => "", :null => false + t.boolean "is_public", :default => false, :null => false + t.integer "sort", :default => 0, :null => false + t.boolean "mail_option", :default => false, :null => false + t.boolean "mail_enabled", :default => false, :null => false + end + + create_table "permissions_roles", :id => false, :force => true do |t| + t.integer "permission_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + end + + add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" + create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1449,6 +1728,11 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "project_import_data", :force => true do |t| + t.integer "project_id" + t.text "data" + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1539,6 +1823,30 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "protected_branches", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "developers_can_push", :default => false, :null => false + end + + add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" + + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "version", :default => 0.0 + t.integer "sonar_version", :default => 1 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1673,6 +1981,25 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.integer "is_teacher_score", :default => 0 end + create_table "services", :force => true do |t| + t.string "type" + t.string "title" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "active", :default => false, :null => false + t.text "properties" + t.boolean "template", :default => false + t.boolean "push_events", :default => true + t.boolean "issues_events", :default => true + t.boolean "merge_requests_events", :default => true + t.boolean "tag_push_events", :default => true + t.boolean "note_events", :default => true, :null => false + end + + add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" + add_index "services", ["project_id"], :name => "index_services_on_project_id" + create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1711,6 +2038,26 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "snippets", :force => true do |t| + t.string "title" + t.text "content", :limit => 2147483647 + t.integer "author_id", :null => false + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "file_name" + t.datetime "expires_at" + t.string "type" + t.integer "visibility_level", :default => 0, :null => false + end + + add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" + add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" + add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" + add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" + add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" + add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" + create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1849,6 +2196,17 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "subscriptions", :force => true do |t| + t.integer "user_id" + t.integer "subscribable_id" + t.string "subscribable_type" + t.boolean "subscribed" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true + create_table "syllabuses", :force => true do |t| t.string "title" t.text "description" @@ -2099,6 +2457,17 @@ ActiveRecord::Schema.define(:version => 20160624032138) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" + create_table "users_star_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" + add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true + add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" + create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2150,6 +2519,23 @@ ActiveRecord::Schema.define(:version => 20160624032138) do t.datetime "updated_at", :null => false end + create_table "web_hooks", :force => true do |t| + t.string "url" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :default => "ProjectHook" + t.integer "service_id" + t.boolean "push_events", :default => true, :null => false + t.boolean "issues_events", :default => false, :null => false + t.boolean "merge_requests_events", :default => false, :null => false + t.boolean "tag_push_events", :default => false + t.boolean "note_events", :default => false, :null => false + end + + add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" + add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" + create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 500923519..80340f77f 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -28,6 +28,7 @@ h2{ font-size:18px; } h3{ font-size:14px; } h4{ font-size:14px; } .f8 {font-size:8px;} +.f10 {font-size:10px;} .f12{font-size:12px; font-weight:normal;} .f14{font-size:14px;} .f16{font-size:16px;} @@ -1182,4 +1183,4 @@ a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; .reply_iconup{ position:absolute; top:21px; left:13px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;} /*20160622代码分析弹窗*/ -.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;} \ No newline at end of file +.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}