mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 00:37:06 +02:00
$ git grep --name-only -E "[a-z0-9A-Z_]*fluentd_[a-zA-Z0-9_]*path" app/ | xargs gsed -i -E 's#([a-z0-9A-Z_]*)fluentd([a-zA-Z0-9_]*path)#\1daemon\2#g'
43 lines
1.0 KiB
Ruby
43 lines
1.0 KiB
Ruby
class Fluentd::Settings::OutForwardController < ApplicationController
|
|
before_action :login_required
|
|
before_action :find_fluentd
|
|
|
|
def show
|
|
@setting = Fluentd::Setting::OutForward.new({
|
|
secondary: {
|
|
"0" => {
|
|
type: "file",
|
|
}
|
|
}
|
|
})
|
|
end
|
|
|
|
def finish
|
|
@setting = Fluentd::Setting::OutForward.new(setting_params)
|
|
unless @setting.valid?
|
|
return render "show"
|
|
end
|
|
|
|
@fluentd.agent.config_append @setting.to_config
|
|
if @fluentd.agent.running?
|
|
unless @fluentd.agent.restart
|
|
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
|
return render "show"
|
|
end
|
|
end
|
|
redirect_to daemon_setting_path(@fluentd)
|
|
end
|
|
|
|
private
|
|
|
|
def setting_params
|
|
params.require(:fluentd_setting_out_forward).permit(*Fluentd::Setting::OutForward::KEYS).merge(
|
|
params.require(:fluentd_setting_out_forward).permit(
|
|
:server => Fluentd::Setting::OutForward::Server::KEYS,
|
|
:secondary => Fluentd::Setting::OutForward::Secondary::KEYS,
|
|
),
|
|
)
|
|
end
|
|
|
|
end
|