mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 08:47:06 +02:00
Resolve some TODOs
This commit is contained in:
parent
bd1134f9a9
commit
a3d61c3cc8
@ -38,10 +38,7 @@ class Fluentd::Settings::InTailController < ApplicationController
|
||||
return render "after_format"
|
||||
end
|
||||
|
||||
File.open(@fluentd.agent.config_file, "a") do |f| # TODO: should update by agent class
|
||||
f.write "\n"
|
||||
f.write @setting.to_conf
|
||||
end
|
||||
@fluentd.agent.config_append @setting.to_conf
|
||||
@fluentd.agent.restart if @fluentd.agent.running?
|
||||
redirect_to fluentd_setting_path(@fluentd)
|
||||
end
|
||||
|
@ -3,17 +3,15 @@ class Fluentd::SettingsController < ApplicationController
|
||||
before_action :find_fluentd
|
||||
|
||||
def show
|
||||
@config = File.read(@fluentd.agent.config_file) # TODO
|
||||
@config = @fluentd.agent.config
|
||||
end
|
||||
|
||||
def edit
|
||||
@config = File.read(@fluentd.agent.config_file) # TODO
|
||||
@config = @fluentd.agent.config
|
||||
end
|
||||
|
||||
def update
|
||||
File.open(@fluentd.agent.config_file, "w") do |f| # TODO: should update by agent class
|
||||
f.write params[:config]
|
||||
end
|
||||
@fluentd.agent.config_write params[:config]
|
||||
@fluentd.agent.restart if @fluentd.agent.running?
|
||||
redirect_to fluentd_setting_path(@fluentd)
|
||||
end
|
||||
@ -54,10 +52,7 @@ class Fluentd::SettingsController < ApplicationController
|
||||
return render "in_tail_after_format"
|
||||
end
|
||||
|
||||
File.open(@fluentd.agent.config_file, "a") do |f| # TODO: should update by agent class
|
||||
f.write "\n"
|
||||
f.write @setting.to_conf
|
||||
end
|
||||
@fluentd.agent.config_append @setting.to_conf
|
||||
@fluentd.agent.restart if @fluentd.agent.running?
|
||||
redirect_to fluentd_setting_path(@fluentd)
|
||||
end
|
||||
|
@ -45,6 +45,23 @@ class Fluentd
|
||||
File.read(log_file) # TODO: large log file
|
||||
end
|
||||
|
||||
def config
|
||||
File.read(config_file)
|
||||
end
|
||||
|
||||
def config_write(content)
|
||||
File.open(config_file, "w") do |f|
|
||||
f.write content
|
||||
end
|
||||
end
|
||||
|
||||
def config_append(content)
|
||||
File.open(config_file, "a") do |f|
|
||||
f.write "\n"
|
||||
f.write content
|
||||
end
|
||||
end
|
||||
|
||||
def errors_since(since = 1.day.ago)
|
||||
errors = []
|
||||
logged_errors do |error|
|
||||
|
@ -1,7 +1,5 @@
|
||||
- page_title t('.page_title')
|
||||
|
||||
-# TODO: should more blush up this page
|
||||
|
||||
%table{class: "table table-striped table-hover", id: "plugins-table"}
|
||||
%thead
|
||||
%tr
|
||||
|
Loading…
Reference in New Issue
Block a user