mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 08:47: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'
35 lines
803 B
Ruby
35 lines
803 B
Ruby
class Fluentd::Settings::InSyslogController < ApplicationController
|
|
before_action :login_required
|
|
before_action :find_fluentd
|
|
|
|
def show
|
|
@setting = Fluentd::Setting::InSyslog.new({
|
|
bind: "0.0.0.0",
|
|
port: 5140,
|
|
})
|
|
end
|
|
|
|
def finish
|
|
@setting = Fluentd::Setting::InSyslog.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_in_syslog).permit(*Fluentd::Setting::InSyslog::KEYS)
|
|
end
|
|
|
|
end
|