Sha256: 1b515fd507fb9916c1d36f2e914f9e3337f26a49211cfb8de5e086164b62366b

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

class Fluentd::AgentsController < ApplicationController
  before_action :find_fluentd

  def start
    if @fluentd.agent.start
      flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.start'))
    else
      flash[:error] = t("messages.fluentd_start_failed", brand: fluentd_ui_title) + @fluentd.agent.log_tail(1).first
    end
    redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
  end

  def stop
    if @fluentd.agent.stop
      flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.stop'))
    else
      flash[:error] = t("messages.fluentd_stop_failed", brand: fluentd_ui_title)
    end
    redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
  end

  def restart
    if @fluentd.agent.restart
      flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.restart'))
    else
      flash[:error] = t("messages.fluentd_restart_failed", brand: fluentd_ui_title) + @fluentd.agent.log_tail(1).first
    end
    redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
  end

  def log_tail
    @logs = @fluentd.agent.log_tail(params[:limit]).reverse if @fluentd
    render json: @logs
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fluentd-ui-0.3.11 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.10 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.9 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.8 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.7 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.6 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.5 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.3 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.2 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.1 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.3.0 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.2.0 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.1.4 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.1.3 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.1.2 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.1.1 app/controllers/fluentd/agents_controller.rb
fluentd-ui-0.1.0 app/controllers/fluentd/agents_controller.rb