mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +02:00
Remove dead/duplicated code
This commit is contained in:
parent
96e66540aa
commit
e37197bf5c
@ -1,11 +1,6 @@
|
|||||||
class Fluentd::AgentsController < ApplicationController
|
class Fluentd::AgentsController < ApplicationController
|
||||||
before_action :find_fluentd
|
before_action :find_fluentd
|
||||||
|
|
||||||
def show
|
|
||||||
@error_count = 10
|
|
||||||
@errors = @fluentd.agent.recent_errors(@error_count)
|
|
||||||
end
|
|
||||||
|
|
||||||
def start
|
def start
|
||||||
unless @fluentd.agent.start
|
unless @fluentd.agent.start
|
||||||
flash[:error] = t("error.fluentd_start_failed") + @fluentd.agent.log_tail(1).first
|
flash[:error] = t("error.fluentd_start_failed") + @fluentd.agent.log_tail(1).first
|
||||||
@ -27,10 +22,6 @@ class Fluentd::AgentsController < ApplicationController
|
|||||||
redirect_to fluentd_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
|
redirect_to fluentd_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
|
||||||
end
|
end
|
||||||
|
|
||||||
def log
|
|
||||||
render text: @fluentd.agent.log, content_type: "text/plain"
|
|
||||||
end
|
|
||||||
|
|
||||||
def log_tail
|
def log_tail
|
||||||
@logs = @fluentd.agent.log_tail(params[:limit]).reverse if @fluentd
|
@logs = @fluentd.agent.log_tail(params[:limit]).reverse if @fluentd
|
||||||
render json: @logs
|
render json: @logs
|
||||||
|
@ -47,10 +47,6 @@ class FluentdController < ApplicationController
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_fluentd
|
|
||||||
@fluentd = Fluentd.instance
|
|
||||||
end
|
|
||||||
|
|
||||||
def fluentd_params
|
def fluentd_params
|
||||||
params.require(:fluentd).permit(:log_file, :pid_file, :config_file, :variant, :api_endpoint)
|
params.require(:fluentd).permit(:log_file, :pid_file, :config_file, :variant, :api_endpoint)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user