From 7de8c46bddf3614a3324efbcbdab5539f92533e0 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 7 Oct 2014 14:59:48 +0200 Subject: [PATCH] SONAR-5632 Clicking "Download" on the "System Info" page fails --- .../webapp/WEB-INF/app/controllers/system_controller.rb | 8 ++++++-- .../src/main/webapp/WEB-INF/app/models/server.rb | 9 ++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb index d29a32f37d6..1c86a0f75b5 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb @@ -25,11 +25,15 @@ class SystemController < ApplicationController def index @server=Server.new - + + filename = 'SystemInfo' + server_id = @server.sonar_property(ServerIdConfigurationController::PROPERTY_SERVER_ID) + filename += '-' + server_id.to_s if server_id + respond_to do |format| format.html format.csv { - send_data(to_csv, :type => 'text/csv; charset=utf-8', :disposition => 'attachment; filename=sonar_system_info.csv') + send_data(to_csv, :type => 'text/csv; charset=utf-8', :disposition => "attachment; filename=#{filename}.csv") } end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb index 8e8514384f4..a5dec04afa9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb @@ -20,7 +20,7 @@ class Server def info - system_info + sonar_info + system_statistics + sonar_plugins + system_properties + search_info + system_info + sonar_info + system_statistics + sonar_plugins + system_properties + cluster_info + nodes_info end def system_info @@ -129,6 +129,9 @@ class Server system_properties end + def sonar_property(key) + Java::OrgSonarServerUi::JRubyFacade.getInstance().getContainer().getComponentByType(Java::OrgApacheCommonsConfiguration::Configuration.java_class).getProperty(key) + end private @@ -155,10 +158,6 @@ class Server java.text.SimpleDateFormat.new("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(date) end - def sonar_property(key) - Java::OrgSonarServerUi::JRubyFacade.getInstance().getContainer().getComponentByType(Java::OrgApacheCommonsConfiguration::Configuration.java_class).getProperty(key) - end - def realm_name realm_factory = Api::Utils.java_facade.getCoreComponentByClassname('org.sonar.server.user.SecurityRealmFactory') if realm_factory && realm_factory.getRealm() -- 2.39.5