]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5632 Clicking "Download" on the "System Info" page fails
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 7 Oct 2014 12:59:48 +0000 (14:59 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 7 Oct 2014 13:00:05 +0000 (15:00 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/system_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb

index d29a32f37d6007d516a6ba14156efb08bd5da0ab..1c86a0f75b52a4a08ba44e2010d37dc49bfb89c6 100644 (file)
@@ -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
index 8e8514384f4fa03397eeaebfb6352575db534646..a5dec04afa9863479988f6b60474df18a9caf187 100644 (file)
@@ -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()