mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 01:07:09 +02:00
Remove dead code
This commit is contained in:
parent
fdf9f4621c
commit
df1773c26f
@ -15,54 +15,4 @@ class Fluentd::SettingsController < ApplicationController
|
||||
@fluentd.agent.restart if @fluentd.agent.running?
|
||||
redirect_to daemon_setting_path(@fluentd)
|
||||
end
|
||||
|
||||
def in_tail_after_file_choose
|
||||
@setting = Fluentd::Setting::InTail.new({
|
||||
:path => params[:path],
|
||||
:tag => nil,
|
||||
})
|
||||
end
|
||||
|
||||
def in_tail_after_format
|
||||
@setting = Fluentd::Setting::InTail.new(setting_params)
|
||||
end
|
||||
|
||||
def in_tail_confirm
|
||||
@setting = Fluentd::Setting::InTail.new(setting_params)
|
||||
if params[:back]
|
||||
return render :in_tail_after_file_choose
|
||||
end
|
||||
unless @setting.valid?
|
||||
return render :in_tail_after_format
|
||||
end
|
||||
end
|
||||
|
||||
def in_tail_finish
|
||||
@setting = Fluentd::Setting::InTail.new(setting_params)
|
||||
if params[:back]
|
||||
return render :in_tail_after_format
|
||||
end
|
||||
|
||||
unless @setting.valid?
|
||||
return render "in_tail_after_format"
|
||||
end
|
||||
|
||||
if @fluentd.agent.configuration.to_s.include?(@setting.to_conf.strip)
|
||||
@setting.errors.add(:base, :duplicated_conf)
|
||||
return render "in_tail_after_format"
|
||||
end
|
||||
|
||||
@fluentd.agent.config_append @setting.to_conf
|
||||
@fluentd.agent.restart if @fluentd.agent.running?
|
||||
redirect_to daemon_setting_path(@fluentd)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def setting_params
|
||||
setting_params = params.require(:setting).permit(:path, :format, :regexp, *Fluentd::Setting::InTail.known_formats, :tag, :rotate_wait, :pos_file, :read_from_head, :refresh_interval)
|
||||
{
|
||||
:pos_file => "/tmp/fluentd-#{@fluentd.id}-#{Time.now.to_i}.pos",
|
||||
}.merge setting_params
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user