Class: SystemInfoController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/system_info_controller.rb

Instance Method Summary (collapse)

Methods inherited from ApplicationController

can_access?, permission_mappings, set_access_control

Instance Method Details

- (Object) show



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'frontend/app/controllers/system_info_controller.rb', line 5

def show 
  @app_context = params[:app_context] ? params[:app_context] : "frontend_info"

  if @app_context  == "backend_info"
   @info = JSON.load( open( URI.join(AppConfig[:backend_url], "/system/info" ),
                           "X-ArchivesSpace-Session" => Thread.current[:backend_session],
                           "Accept" => 'application/json').read ) 
  elsif @app_context == "frontend_info" 
    @info = ASUtils.get_diagnostics.reject { |k,v| k == :exception } 
  else
    @info = nil
  end 
  
end

- (Object) stream_log



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'frontend/app/controllers/system_info_controller.rb', line 20

def stream_log
  @app_context = params[:app_context] ? params[:app_context] : "frontend_log"
 
  if @app_context == "backend_log"
    @log = open( URI.join(AppConfig[:backend_url], "/system/log" ),
              "X-ArchivesSpace-Session" => Thread.current[:backend_session] ).read 
  else
    @log = Rails.logger.backlog
  end

  render :text => @log

end