mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-15 18:57:10 +02:00
21 lines
529 B
Ruby
21 lines
529 B
Ruby
class Fluentd::SettingsController < ApplicationController
|
|
before_action :login_required
|
|
before_action :find_fluentd
|
|
|
|
def show
|
|
@config = File.read(@fluentd.agent.config_file) # TODO
|
|
end
|
|
|
|
def edit
|
|
@config = File.read(@fluentd.agent.config_file) # TODO
|
|
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.restart if @fluentd.agent.running?
|
|
redirect_to fluentd_setting_path(@fluentd)
|
|
end
|
|
end
|