Commit b07c02eb13fca5f991575bb0955373d54f1a2d9d

Authored by Dmitriy Zaporozhets
1 parent e3a71857

Add more info to admin dashboard

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/controllers/admin/dashboard_controller.rb
@@ -2,5 +2,6 @@ class Admin::DashboardController &lt; Admin::ApplicationController @@ -2,5 +2,6 @@ class Admin::DashboardController &lt; Admin::ApplicationController
2 def index 2 def index
3 @projects = Project.order("created_at DESC").limit(10) 3 @projects = Project.order("created_at DESC").limit(10)
4 @users = User.order("created_at DESC").limit(10) 4 @users = User.order("created_at DESC").limit(10)
  5 + @groups = Group.order("created_at DESC").limit(10)
5 end 6 end
6 end 7 end
app/helpers/application_helper.rb
@@ -187,14 +187,6 @@ module ApplicationHelper @@ -187,14 +187,6 @@ module ApplicationHelper
187 Gitlab.config.extra 187 Gitlab.config.extra
188 end 188 end
189 189
190 - def public_icon  
191 - content_tag :i, nil, class: 'icon-globe cblue'  
192 - end  
193 -  
194 - def private_icon  
195 - content_tag :i, nil, class: 'icon-lock cgreen'  
196 - end  
197 -  
198 def search_placeholder 190 def search_placeholder
199 if @project && @project.persisted? 191 if @project && @project.persisted?
200 "Search in this project" 192 "Search in this project"
app/helpers/icons_helper.rb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +module IconsHelper
  2 + def boolean_to_icon(value)
  3 + if value.to_s == "true"
  4 + content_tag :i, nil, class: 'icon-circle cgreen'
  5 + else
  6 + content_tag :i, nil, class: 'icon-circle cgray'
  7 + end
  8 + end
  9 +
  10 + def public_icon
  11 + content_tag :i, nil, class: 'icon-globe cblue'
  12 + end
  13 +
  14 + def private_icon
  15 + content_tag :i, nil, class: 'icon-lock cgreen'
  16 + end
  17 +end
app/views/admin/dashboard/index.html.haml
@@ -52,6 +52,19 @@ @@ -52,6 +52,19 @@
52 ago 52 ago
53 53
54 .span4 54 .span4
  55 + %h4 Latest groups
  56 + %hr
  57 + - @groups.each do |group|
  58 + %p
  59 + = link_to [:admin, group] do
  60 + = group.name
  61 + %span.light.pull-right
  62 + = time_ago_in_words group.created_at
  63 + ago
  64 +
  65 +%br
  66 +.row
  67 + .span4
55 %h4 Stats 68 %h4 Stats
56 %hr 69 %hr
57 %p 70 %p
@@ -82,3 +95,34 @@ @@ -82,3 +95,34 @@
82 Milestones 95 Milestones
83 %span.light.pull-right 96 %span.light.pull-right
84 = Milestone.count 97 = Milestone.count
  98 + .span4
  99 + %h4
  100 + Features
  101 + %hr
  102 + %p
  103 + Sign up
  104 + %span.light.pull-right
  105 + = boolean_to_icon gitlab_config.signup_enabled
  106 + %p
  107 + LDAP
  108 + %span.light.pull-right
  109 + = boolean_to_icon Gitlab.config.ldap.enabled
  110 + %p
  111 + Gravatar
  112 + %span.light.pull-right
  113 + = boolean_to_icon Gitlab.config.gravatar.enabled
  114 + %p
  115 + OmniAuth
  116 + %span.light.pull-right
  117 + = boolean_to_icon Gitlab.config.omniauth.enabled
  118 + .span4
  119 + %h4 Components
  120 + %hr
  121 + %p
  122 + GitLab
  123 + %span.pull-right
  124 + = Gitlab::VERSION
  125 + %p
  126 + GitLab Shell
  127 + %span.pull-right
  128 + = Gitlab::Shell.new.version
lib/gitlab/backend/shell.rb
@@ -196,6 +196,15 @@ module Gitlab @@ -196,6 +196,15 @@ module Gitlab
196 Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git" 196 Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git"
197 end 197 end
198 198
  199 + # Return GitLab shell version
  200 + def version
  201 + gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION"
  202 +
  203 + if File.readable?(gitlab_shell_version_file)
  204 + File.read(gitlab_shell_version_file)
  205 + end
  206 + end
  207 +
199 protected 208 protected
200 209
201 def gitlab_shell_user_home 210 def gitlab_shell_user_home
lib/tasks/gitlab/check.rake
@@ -611,10 +611,7 @@ namespace :gitlab do @@ -611,10 +611,7 @@ namespace :gitlab do
611 end 611 end
612 612
613 def gitlab_shell_version 613 def gitlab_shell_version
614 - gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION"  
615 - if File.readable?(gitlab_shell_version_file)  
616 - File.read(gitlab_shell_version_file)  
617 - end 614 + Gitlab::Shell.new.version
618 end 615 end
619 616
620 def has_gitlab_shell3? 617 def has_gitlab_shell3?