Class: MiscController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- MiscController
- Defined in:
- app/controllers/misc_controller.rb
Instance Method Summary collapse
- #download_info ⇒ Object
- #information ⇒ Object
- #show ⇒ Object
- #update_fluentd_ui ⇒ Object
- #upgrading_status ⇒ Object
Instance Method Details
#download_info ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/misc_controller.rb', line 37 def download_info fluentd = Fluentd.instance path = Rails.root.join("tmp/system_info.zip") File.unlink(path) if File.exists?(path) Zip::File.open(path, Zip::File::CREATE) do |zip| zip.get_output_stream('fluentd.log') {|f| f.puts fluentd.agent.log.read } zip.add("fluentd-ui.log", log_path) add_env_file_to(zip) add_version_file_to(zip) end send_file path end |
#information ⇒ Object
13 14 15 16 |
# File 'app/controllers/misc_controller.rb', line 13 def information @env = ENV @plugins = Plugin.installed end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/misc_controller.rb', line 9 def show redirect_to misc_information_path end |
#update_fluentd_ui ⇒ Object
18 19 20 21 |
# File 'app/controllers/misc_controller.rb', line 18 def update_fluentd_ui @current_pid = $$ render "update_fluentd_ui", layout: "sign_in" end |
#upgrading_status ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/misc_controller.rb', line 23 def upgrading_status if FluentdUiRestartJob::LOCK.present? return render text: "updating" end if $$.to_s == params[:old_pid] # restarting fluentd-ui is finished, but PID doesn't changed. # maybe error occured at FluentdUiRestart#perform render text: "failed" else render text: "finished" end end |