Project

General

Profile

Patch #31151 ยป appserver.diff

Vincent Robert, 2019-04-05 14:40

View differences:

app/controllers/admin_controller.rb
77 77
      [:text_rmagick_available,        Object.const_defined?(:Magick)],
78 78
      [:text_convert_available,        Redmine::Thumbnail.convert_available?]
79 79
    ]
80
    @request = request
80 81
  end
81 82
end
app/views/admin/info.html.erb
12 12
</table>
13 13
<br />
14 14
<div class="box">
15
<pre><%= Redmine::Info.environment %></pre>
15
<pre><%= Redmine::Info.environment(@request) %></pre>
16 16
</div>
17 17

  
18 18
<% html_title(l(:label_information_plural)) -%>
lib/redmine/info.rb
6 6
      def help_url; 'https://www.redmine.org/guide' end
7 7
      def versioned_name; "#{app_name} #{Redmine::VERSION}" end
8 8

  
9
      def environment
9
      def environment(request = nil)
10 10
        s = "Environment:\n"
11
        s << [
12
          ["Redmine version", Redmine::VERSION],
13
          ["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
14
          ["Rails version", Rails::VERSION::STRING],
15
          ["Environment", Rails.env],
16
          ["Database adapter", ActiveRecord::Base.connection.adapter_name],
17
          ["Mailer queue", ActionMailer::DeliveryJob.queue_adapter.class.name],
18
          ["Mailer delivery", ActionMailer::Base.delivery_method]
19
        ].map {|info| "  %-30s %s" % info}.join("\n") + "\n"
11
        environment_data = [["Redmine version", Redmine::VERSION],
12
                           ["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
13
                           ["Rails version", Rails::VERSION::STRING],
14
                           ["Environment", Rails.env],
15
                           ["Database adapter", ActiveRecord::Base.connection.adapter_name],
16
                           ["Mailer queue", ActionMailer::DeliveryJob.queue_adapter.class.name],
17
                           ["Mailer delivery", ActionMailer::Base.delivery_method]]
18
        environment_data << ["App server", request.get_header("SERVER_SOFTWARE")] if request.present?
19
        s << environment_data.map {|info| "  %-30s %s" % info}.join("\n") + "\n"
20 20

  
21 21
        s << "SCM:\n"
22 22
        Redmine::Scm::Base.all.each do |scm|
    (1-1/1)