Add more info to admin dashboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
e3a718574c
commit
b07c02eb13
6 changed files with 72 additions and 12 deletions
|
@ -2,5 +2,6 @@ class Admin::DashboardController < Admin::ApplicationController
|
|||
def index
|
||||
@projects = Project.order("created_at DESC").limit(10)
|
||||
@users = User.order("created_at DESC").limit(10)
|
||||
@groups = Group.order("created_at DESC").limit(10)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -187,14 +187,6 @@ module ApplicationHelper
|
|||
Gitlab.config.extra
|
||||
end
|
||||
|
||||
def public_icon
|
||||
content_tag :i, nil, class: 'icon-globe cblue'
|
||||
end
|
||||
|
||||
def private_icon
|
||||
content_tag :i, nil, class: 'icon-lock cgreen'
|
||||
end
|
||||
|
||||
def search_placeholder
|
||||
if @project && @project.persisted?
|
||||
"Search in this project"
|
||||
|
|
17
app/helpers/icons_helper.rb
Normal file
17
app/helpers/icons_helper.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
module IconsHelper
|
||||
def boolean_to_icon(value)
|
||||
if value.to_s == "true"
|
||||
content_tag :i, nil, class: 'icon-circle cgreen'
|
||||
else
|
||||
content_tag :i, nil, class: 'icon-circle cgray'
|
||||
end
|
||||
end
|
||||
|
||||
def public_icon
|
||||
content_tag :i, nil, class: 'icon-globe cblue'
|
||||
end
|
||||
|
||||
def private_icon
|
||||
content_tag :i, nil, class: 'icon-lock cgreen'
|
||||
end
|
||||
end
|
|
@ -51,6 +51,19 @@
|
|||
= time_ago_in_words user.created_at
|
||||
ago
|
||||
|
||||
.span4
|
||||
%h4 Latest groups
|
||||
%hr
|
||||
- @groups.each do |group|
|
||||
%p
|
||||
= link_to [:admin, group] do
|
||||
= group.name
|
||||
%span.light.pull-right
|
||||
= time_ago_in_words group.created_at
|
||||
ago
|
||||
|
||||
%br
|
||||
.row
|
||||
.span4
|
||||
%h4 Stats
|
||||
%hr
|
||||
|
@ -82,3 +95,34 @@
|
|||
Milestones
|
||||
%span.light.pull-right
|
||||
= Milestone.count
|
||||
.span4
|
||||
%h4
|
||||
Features
|
||||
%hr
|
||||
%p
|
||||
Sign up
|
||||
%span.light.pull-right
|
||||
= boolean_to_icon gitlab_config.signup_enabled
|
||||
%p
|
||||
LDAP
|
||||
%span.light.pull-right
|
||||
= boolean_to_icon Gitlab.config.ldap.enabled
|
||||
%p
|
||||
Gravatar
|
||||
%span.light.pull-right
|
||||
= boolean_to_icon Gitlab.config.gravatar.enabled
|
||||
%p
|
||||
OmniAuth
|
||||
%span.light.pull-right
|
||||
= boolean_to_icon Gitlab.config.omniauth.enabled
|
||||
.span4
|
||||
%h4 Components
|
||||
%hr
|
||||
%p
|
||||
GitLab
|
||||
%span.pull-right
|
||||
= Gitlab::VERSION
|
||||
%p
|
||||
GitLab Shell
|
||||
%span.pull-right
|
||||
= Gitlab::Shell.new.version
|
||||
|
|
|
@ -196,6 +196,15 @@ module Gitlab
|
|||
Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git"
|
||||
end
|
||||
|
||||
# Return GitLab shell version
|
||||
def version
|
||||
gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION"
|
||||
|
||||
if File.readable?(gitlab_shell_version_file)
|
||||
File.read(gitlab_shell_version_file)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def gitlab_shell_user_home
|
||||
|
|
|
@ -611,10 +611,7 @@ namespace :gitlab do
|
|||
end
|
||||
|
||||
def gitlab_shell_version
|
||||
gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION"
|
||||
if File.readable?(gitlab_shell_version_file)
|
||||
File.read(gitlab_shell_version_file)
|
||||
end
|
||||
Gitlab::Shell.new.version
|
||||
end
|
||||
|
||||
def has_gitlab_shell3?
|
||||
|
|
Loading…
Reference in a new issue