Fix route name fluentd -> daemon by sed

$ 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'
This commit is contained in:
uu59 2014-07-24 15:23:50 +09:00
parent 7f66da349f
commit 23a30452e4
36 changed files with 65 additions and 66 deletions

View File

@ -5,21 +5,21 @@ class Fluentd::AgentsController < ApplicationController
unless @fluentd.agent.start
flash[:error] = t("error.fluentd_start_failed") + @fluentd.agent.log_tail(1).first
end
redirect_to fluentd_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
end
def stop
unless @fluentd.agent.stop
flash[:error] = t("error.fluentd_stop_failed")
end
redirect_to fluentd_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
end
def restart
unless @fluentd.agent.restart
flash[:error] = t("error.fluentd_restart_failed") + @fluentd.agent.log_tail(1).first
end
redirect_to fluentd_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
redirect_to daemon_path(@fluentd), status: 303 # 303 is change HTTP Verb GET
end
def log_tail

View File

@ -22,7 +22,7 @@ class Fluentd::Settings::InSyslogController < ApplicationController
return render "show"
end
end
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -40,7 +40,7 @@ class Fluentd::Settings::InTailController < ApplicationController
@fluentd.agent.config_append @setting.to_conf
@fluentd.agent.restart if @fluentd.agent.running?
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -25,7 +25,7 @@ class Fluentd::Settings::OutForwardController < ApplicationController
return render "show"
end
end
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -24,7 +24,7 @@ class Fluentd::Settings::OutMongoController < ApplicationController
return render "show"
end
end
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -24,7 +24,7 @@ class Fluentd::Settings::OutS3Controller < ApplicationController
return render "show"
end
end
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -24,7 +24,7 @@ class Fluentd::Settings::OutTdController < ApplicationController
return render "show"
end
end
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -13,7 +13,7 @@ class Fluentd::SettingsController < ApplicationController
def update
@fluentd.agent.config_write params[:config]
@fluentd.agent.restart if @fluentd.agent.running?
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
def in_tail_after_file_choose
@ -54,7 +54,7 @@ class Fluentd::SettingsController < ApplicationController
@fluentd.agent.config_append @setting.to_conf
@fluentd.agent.restart if @fluentd.agent.running?
redirect_to fluentd_setting_path(@fluentd)
redirect_to daemon_setting_path(@fluentd)
end
private

View File

@ -15,7 +15,7 @@ class FluentdController < ApplicationController
unless @fluentd.save
return render :new
end
redirect_to fluentd_path
redirect_to daemon_path
end
def edit
@ -27,7 +27,7 @@ class FluentdController < ApplicationController
unless @fluentd.save
return render :edit
end
redirect_to fluentd_path
redirect_to daemon_path
end
def destroy

View File

@ -1,5 +1,5 @@
class WelcomeController < ApplicationController
def home
redirect_to fluentd_path
redirect_to daemon_path
end
end

View File

@ -1,3 +1,3 @@
- page_title t('.page_title')
= render partial: "form", locals: { btn: t(".update"), url: fluentd_path(@fluentd), method: :patch }
= render partial: "form", locals: { btn: t(".update"), url: daemon_path(@fluentd), method: :patch }

View File

@ -1,5 +1,5 @@
- page_title t('fluentd.common.recent_errors', days: @error_duration_days) do
- link_to raw_log_fluentd_path(@fluentd), class: "btn btn-primary pull-right" do
- link_to raw_log_daemon_path(@fluentd), class: "btn btn-primary pull-right" do
= icon('fa-download')
= t('fluentd.common.raw_log_link')

View File

@ -1,5 +1,5 @@
- page_title t('.page_title', label: @fluentd.label) do
- link_to raw_log_fluentd_path(@fluentd), class: "btn btn-primary pull-right" do
- link_to raw_log_daemon_path(@fluentd), class: "btn btn-primary pull-right" do
= icon('fa-download')
= t('fluentd.common.raw_log_link')

View File

@ -1,3 +1,3 @@
- page_title t('.page_title')
= render partial: "form", locals: { btn: t(".create"), url: fluentd_path, method: :post }
= render partial: "form", locals: { btn: t(".create"), url: daemon_path, method: :post }

View File

@ -1,6 +1,6 @@
- page_title t('.page_title', label: @fluentd.label)
= form_tag(fluentd_setting_path(@fluentd), method: :patch) do
= form_tag(daemon_setting_path(@fluentd), method: :patch) do
%div.form-group
= text_area_tag "config", @config, class: "form-control", rows: 40
%p.text.text-danger= t('plugins.notice_restart_for_config_edit')

View File

@ -1,6 +1,6 @@
= render "shared/setting_errors"
= form_for(@setting, url: finish_fluentd_setting_in_syslog_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= form_for(@setting, url: finish_daemon_setting_in_syslog_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= field(f, :tag)
= field(f, :bind)
= field(f, :port)

View File

@ -1,8 +1,8 @@
- page_title t(".page_title")
= link_to t('fluentd.settings.in_tail.restart_from_first'), fluentd_setting_in_tail_path(@fluentd)
= link_to t('fluentd.settings.in_tail.restart_from_first'), daemon_setting_in_tail_path(@fluentd)
= form_for(@setting, as: "setting", url: after_format_fluentd_setting_in_tail_path(@fluentd)) do |f|
= form_for(@setting, as: "setting", url: after_format_daemon_setting_in_tail_path(@fluentd)) do |f|
- @setting.errors.full_messages.each do |e|
%div.alert.alert-danger= e
@ -16,4 +16,4 @@
%p
= f.submit t('terms.next'), class: "btn btn-lg btn-primary pull-right"
= link_to t('terms.prev'), fluentd_setting_in_tail_path(@fluentd), class: "btn btn-lg btn-default"
= link_to t('terms.prev'), daemon_setting_in_tail_path(@fluentd), class: "btn btn-lg btn-default"

View File

@ -1,8 +1,8 @@
- page_title t(".page_title")
= link_to t('fluentd.settings.in_tail.restart_from_first'), fluentd_setting_in_tail_path(@fluentds)
= link_to t('fluentd.settings.in_tail.restart_from_first'), daemon_setting_in_tail_path(@fluentds)
= form_for(@setting, as: "setting", url: confirm_fluentd_setting_in_tail_path(@fluentd)) do |f|
= form_for(@setting, as: "setting", url: confirm_daemon_setting_in_tail_path(@fluentd)) do |f|
= render partial: "form", locals: { f: f }
%p

View File

@ -1,8 +1,8 @@
- page_title t(".page_title")
= link_to t('fluentd.settings.in_tail.restart_from_first'), fluentd_setting_in_tail_path(@fluentd)
= link_to t('fluentd.settings.in_tail.restart_from_first'), daemon_setting_in_tail_path(@fluentd)
= form_for(@setting, as: "setting", url: finish_fluentd_setting_in_tail_path(@fluentd)) do |f|
= form_for(@setting, as: "setting", url: finish_daemon_setting_in_tail_path(@fluentd)) do |f|
= render partial: "form", locals: { f: f }
%pre= @setting.to_conf

View File

@ -1,4 +1,4 @@
- page_title t(".page_title")
= render partial: "shared/vue/treeview", locals: {name: "path", action: after_file_choose_fluentd_setting_in_tail_path(@fluentd), submit_button: t('terms.next')}
= render partial: "shared/vue/treeview", locals: {name: "path", action: after_file_choose_daemon_setting_in_tail_path(@fluentd), submit_button: t('terms.next')}

View File

@ -1,6 +1,6 @@
= render "shared/setting_errors"
= form_for(@setting, url: finish_fluentd_setting_out_forward_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= form_for(@setting, url: finish_daemon_setting_out_forward_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= field(f, :match)
= field(f, :server)
= field(f, :secondary)

View File

@ -1,6 +1,6 @@
= render "shared/setting_errors"
= form_for(@setting, url: finish_fluentd_setting_out_mongo_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= form_for(@setting, url: finish_daemon_setting_out_mongo_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= field(f, :match)
= field(f, :host)
= field(f, :port)

View File

@ -1,6 +1,6 @@
= render "shared/setting_errors"
= form_for(@setting, url: finish_fluentd_setting_out_s3_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= form_for(@setting, url: finish_daemon_setting_out_s3_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= field(f, :match)
= field(f, :aws_key_id)
= field(f, :aws_sec_key)

View File

@ -1,6 +1,6 @@
= render "shared/setting_errors"
= form_for(@setting, url: finish_fluentd_setting_out_td_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= form_for(@setting, url: finish_daemon_setting_out_td_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
= field(f, :match)
= field(f, :apikey)
= field(f, :auto_create_table)

View File

@ -1,5 +1,5 @@
- page_title t('.page_title') do
- link_to edit_fluentd_setting_path(@fluentd), class: "btn btn-primary pull-right" do
- link_to edit_daemon_setting_path(@fluentd), class: "btn btn-primary pull-right" do
= icon('fa-pencil')
= t("terms.edit")

View File

@ -9,11 +9,11 @@
%h4= t('.in')
.panel-body
%p
= link_to(fluentd_setting_in_tail_path(@fluentd)) do
= link_to(daemon_setting_in_tail_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_in_tail")
%p
= link_to(fluentd_setting_in_syslog_path(@fluentd)) do
= link_to(daemon_setting_in_syslog_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_in_syslog")
.col-lg-1.arrow-right
@ -28,18 +28,18 @@
%h4= t('.out')
.panel-body
%p
= link_to(fluentd_setting_out_td_path(@fluentd)) do
= link_to(daemon_setting_out_td_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_out_td")
%p
= link_to(fluentd_setting_out_s3_path(@fluentd)) do
= link_to(daemon_setting_out_s3_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_out_s3")
%p
= link_to(fluentd_setting_out_mongo_path(@fluentd)) do
= link_to(daemon_setting_out_mongo_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_out_mongo")
%p
= link_to(fluentd_setting_out_forward_path(@fluentd)) do
= link_to(daemon_setting_out_forward_path(@fluentd)) do
= icon('fa-file-text-o fa-lg')
= t("fluentd.common.setup_out_forward")

View File

@ -14,14 +14,14 @@
.panel-body
- if flash[:error]
%div.alert.alert-danger= flash[:error]
= link_to icon("fa-play") << t("fluentd.common.start"), start_fluentd_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "disabled btn-default" : "btn-primary"}"
= link_to icon("fa-pause") << t("fluentd.common.stop"), stop_fluentd_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "btn-danger" : "disabled btn-default"}"
= link_to icon("fa-refresh") << t("fluentd.common.restart"), restart_fluentd_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "btn-warning" : "disabled btn-default"}"
= link_to icon("fa-play") << t("fluentd.common.start"), start_daemon_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "disabled btn-default" : "btn-primary"}"
= link_to icon("fa-pause") << t("fluentd.common.stop"), stop_daemon_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "btn-danger" : "disabled btn-default"}"
= link_to icon("fa-refresh") << t("fluentd.common.restart"), restart_daemon_agent_path(@fluentd), method: :put, class: "btn #{@fluentd.agent.running? ? "btn-warning" : "disabled btn-default"}"
.col-lg-6
.panel.panel-default
.panel-heading
.pull-right
= link_to t('terms.edit'), edit_fluentd_path, class: "btn btn-default"
= link_to t('terms.edit'), edit_daemon_path, class: "btn btn-default"
= link_to t('terms.destroy'), "#", class: "btn btn-danger", data: { toggle: "modal", target: "#setting-destroy-modal" }
%h4= t('fluentd.common.fluentd_info')
.modal.fade{id: "setting-destroy-modal"}
@ -35,7 +35,7 @@
.modal-body
= raw t('fluentd.common.destroy_fluentd_setting_warning')
.modal-footer
= form_tag(fluentd_path(@fluentd), method: :delete) do
= form_tag(daemon_path(@fluentd), method: :delete) do
%button.btn.btn-default{"data-dismiss" => "modal"}
Close
= submit_tag t('terms.destroy'), class: "btn btn-danger"

View File

@ -7,7 +7,7 @@
.row
.col-lg-12
%p
= link_to misc_update_fluentd_ui_path, class: "btn btn-primary btn-lg", method: :post do
= link_to misc_update_daemon_ui_path, class: "btn btn-primary btn-lg", method: :post do
= t('.update_fluentd_ui', version: FluentdUI.latest_version)
= t('.update_fluentd_ui_caution')

View File

@ -4,9 +4,9 @@
- if flash[:error]
%div.alert.alert-danger= flash[:error]
= link_to t("fluentd.common.detail"), fluentd_path(@fluentd)
= link_to t("fluentd.common.start"), start_fluentd_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.stop"), stop_fluentd_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.restart"), restart_fluentd_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.log"), log_fluentd_agent_path(@fluentd)
= link_to t("fluentd.common.config_file"), fluentd_setting_path(@fluentd)
= link_to t("fluentd.common.detail"), daemon_path(@fluentd)
= link_to t("fluentd.common.start"), start_daemon_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.stop"), stop_daemon_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.restart"), restart_daemon_agent_path(@fluentd), method: :put
= link_to t("fluentd.common.log"), log_daemon_agent_path(@fluentd)
= link_to t("fluentd.common.config_file"), daemon_setting_path(@fluentd)

View File

@ -6,19 +6,19 @@
<% if fluentd_exists? %>
<ul class="nav nav-second-level">
<li>
<%= link_to_other t('fluentd.show.page_title'), fluentd_path %>
<%= link_to_other t('fluentd.show.page_title'), daemon_path %>
</li>
<li>
<%= link_to_other t('fluentd.settings.source_and_output.page_title'), source_and_output_fluentd_setting_path %>
<%= link_to_other t('fluentd.settings.source_and_output.page_title'), source_and_output_daemon_setting_path %>
</li>
<li>
<%= link_to_other t('fluentd.settings.show.page_title'), fluentd_setting_path %>
<%= link_to_other t('fluentd.settings.show.page_title'), daemon_setting_path %>
</li>
<li>
<%= link_to_other t('fluentd.common.log'), log_fluentd_path %>
<%= link_to_other t('fluentd.common.log'), log_daemon_path %>
</li>
<li>
<%= link_to_other t('fluentd.errors.page_title'), errors_fluentd_path %>
<%= link_to_other t('fluentd.errors.page_title'), errors_daemon_path %>
</li>
</ul>
<% end %>

View File

@ -3,11 +3,11 @@
%div.row
%div.col-lg-6
%div.well
%span= link_to icon("fa-cog") << t("terms.setup", target: "fluentd"), new_fluentd_path(variant: "fluentd_gem"), class: "btn btn-primary btn-lg"
%span= link_to icon("fa-cog") << t("terms.setup", target: "fluentd"), new_daemon_path(variant: "fluentd_gem"), class: "btn btn-primary btn-lg"
%div.col-lg-6
%div.well
%span
= link_to icon("fa-cog") << t("terms.setup", target: "td-agent"), new_fluentd_path(variant: "td-agent"), class: "btn btn-lg #{has_td_agent_system? ? "btn-primary" : "btn-default disabled"}"
= link_to icon("fa-cog") << t("terms.setup", target: "td-agent"), new_daemon_path(variant: "td-agent"), class: "btn btn-lg #{has_td_agent_system? ? "btn-primary" : "btn-default disabled"}"
- unless has_td_agent_system?
= link_to t('terms.install_it', target: "td-agent"), "http://docs.treasuredata.com/articles/td-agent"

View File

@ -1,6 +1,6 @@
<!-- vue.js -->
<% auto_reload ||= true %>
<div id="fluent-log" logUrl="<%= log_tail_fluentd_agent_path(fluentd) %>" initialAutoReload="<%= auto_reload ? "true" : "" %>">
<div id="fluent-log" logUrl="<%= log_tail_daemon_agent_path(fluentd) %>" initialAutoReload="<%= auto_reload ? "true" : "" %>">
<p>
<button class="btn btn-primary" v-on="click: fetchLogs">
<%= t "terms.reload_log" %>

View File

@ -5,7 +5,7 @@
= link_to t('tutorials.chapter4.page_title') << " >>", tutorials_chapter4_path, class: "pull-right"
:markdown
#{t(".lesson_markdown", edit_config_url: edit_fluentd_setting_path(@fluentd))}
#{t(".lesson_markdown", edit_config_url: edit_daemon_setting_path(@fluentd))}
%p.clearfix
= link_to "<< " << t('tutorials.chapter2.page_title'), tutorials_chapter2_path, class: "pull-left"

View File

@ -10,7 +10,7 @@
= t('.step1')
- else
= icon('fa-warning text text-danger')
= link_to t('.step1'), fluentd_path
= link_to t('.step1'), daemon_path
%li
- if @fluentd && @fluentd.agent.running?
= icon('fa-check text text-success')
@ -18,7 +18,7 @@
- else
= icon('fa-warning text text-danger')
- if @fluentd
= link_to t('.step2'), fluentd_path(@fluentd)
= link_to t('.step2'), daemon_path(@fluentd)
- else
= t('.step2')

View File

@ -1,8 +1,7 @@
Rails.application.routes.draw do
root "welcome#home"
# GH-51: URLs are changed from "/fluentd/xxx" to "/daemon/xxx", but already used xxx_fluentd_path renaming is so hard, thus path: "/daemon" is used for save trouble
resource :fluentd, controller: :fluentd, path: "/daemon" do
resource :daemon, controller: :fluentd do
get "log"
get "raw_log"
get "errors"

View File

@ -14,8 +14,8 @@ describe "sessions" do
context "sign in with exists user" do
let(:user) { exists_user }
it "login success, then redirect to root_path, and redirect_to fluentd_path from root_path" do
current_path.should == fluentd_path
it "login success, then redirect to root_path, and redirect_to daemon_path from root_path" do
current_path.should == daemon_path
end
end