1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-11 03:33:07 +00:00

Added most of the information requested in #5420 to the admin/info view.

This commit is contained in:
Holger Just 2010-08-15 02:04:19 +02:00
parent f07e57831c
commit 60b51bc938
5 changed files with 67 additions and 15 deletions

View File

@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'rake'
require 'rails/info'
class AdminController < ApplicationController
layout 'admin'
@ -75,12 +77,39 @@ class AdminController < ApplicationController
end
def info
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
@checklist = [
[:text_default_administrator_account_changed, User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?],
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
[:text_plugin_assets_writable, File.writable?(Engines.public_directory)],
[:text_rmagick_available, Object.const_defined?(:Magick)]
]
app_servers = {
'Mongrel' => {:name => 'Mongrel', :version => Proc.new{Mongrel::Const::MONGREL_VERSION}},
'Thin' => {:name => 'Thin', :version => Proc.new{Thin::VERSION::STRING}},
'Unicorn' => {:name => 'Unicorn', :version =>Proc.new{Unicorn::Const::UNICORN_VERSION}},
'PhusionPassenger' => {:name => 'Phusion Passenger', :version => Proc.new{PhusionPassenger::VERSION_STRING}},
'RailsFCGIHandler' => {:name => 'FastCGI'}
# TOOD: find a way to test for CGI
}
app_server = (Object.constants & app_servers.keys).collect do |server|
name = app_servers[server][:name].underscore.humanize
version = app_servers[server][:version].call if app_servers[server][:version]
[name, version].compact.join(" ")
end.join(",")
app_server = l(:label_unknown) unless app_server.present?
@infolist = Rails::Info.properties.dup
@infolist.insert(3, ['Rake version', RAKEVERSION])
@infolist.insert(11, [:text_log_file, Rails.configuration.log_path])
@infolist += [
[:text_app_server, app_server],
[:text_redmine_username, Etc.getlogin]
]
@pluginlist = Redmine::Plugin.all
end
end

View File

@ -0,0 +1,13 @@
<table class="list plugins">
<% plugins.each do |plugin| %>
<tr class="<%= cycle('odd', 'even') %>">
<td><span class="name"><%=h plugin.name %></span>
<%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
<%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
</td>
<td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
<td class="version"><%=h plugin.version %></td>
<td class="configure"><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
</tr>
<% end %>
</table>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_information_plural)%></h2>
<p><strong><%= Redmine::Info.versioned_name %></strong> (<%= @db_adapter_name %>)</p>
<p><strong><%= Redmine::Info.versioned_name %></strong></p>
<table class="list">
<% @checklist.each do |label, result| %>
@ -11,4 +11,20 @@
<% end %>
</table>
<h3><%=l(:label_environment)%></h3>
<table class="list">
<% @infolist.each do |label, info| %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%= label.is_a?(Symbol) ? l(label) : h(label) %></td>
<td><%= h(info) %></td>
</tr>
<% end %>
</table>
<% if @pluginlist.any? %>
<h3><%= l(:label_plugins) %></h3>
<%= render :partial => 'admin/plugins', :locals => {:plugins => @pluginlist} %>
<% end %>
<% html_title(l(:label_information_plural)) -%>

View File

@ -1,19 +1,7 @@
<h2><%= l(:label_plugins) %></h2>
<% if @plugins.any? %>
<table class="list plugins">
<% @plugins.each do |plugin| %>
<tr class="<%= cycle('odd', 'even') %>">
<td><span class="name"><%=h plugin.name %></span>
<%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
<%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
</td>
<td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
<td class="version"><%=h plugin.version %></td>
<td class="configure"><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
</tr>
<% end %>
</table>
<%= render :partial => 'admin/plugins', :locals => {:plugins => @plugins} %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>

View File

@ -763,6 +763,9 @@ en:
label_profile: Profile
label_subtask_plural: Subtasks
label_project_copy_notifications: Send email notifications during the project copy
label_unknown: Unknown
label_plugin_name: Plugin name
label_plugin_version: Plugin version
button_login: Login
button_submit: Submit
@ -857,6 +860,9 @@ en:
text_file_repository_writable: Attachments directory writable
text_plugin_assets_writable: Plugin assets directory writable
text_rmagick_available: RMagick available (optional)
text_app_server: Application server
text_redmine_username: System user
text_log_file: Log file
text_destroy_time_entries_question: "{{hours}} hours were reported on the issues you are about to delete. What do you want to do ?"
text_destroy_time_entries: Delete reported hours
text_assign_time_entries_to_project: Assign reported hours to the project