mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 10:56:11 +02:00
Display success flash should be succeed only
This commit is contained in:
parent
4d88f76887
commit
fd2ceda5a4
@ -2,26 +2,29 @@ class Fluentd::AgentsController < ApplicationController
|
||||
before_action :find_fluentd
|
||||
|
||||
def start
|
||||
unless @fluentd.agent.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
|
||||
flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.start'))
|
||||
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
|
||||
end
|
||||
|
||||
def stop
|
||||
unless @fluentd.agent.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
|
||||
flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.stop'))
|
||||
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
|
||||
end
|
||||
|
||||
def restart
|
||||
unless @fluentd.agent.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
|
||||
flash[:success] = t("messages.fluentd_start_stop_delay_notice", action: t('fluentd.common.restart'))
|
||||
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user