mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-04 18:36:13 +02:00
Add action to update a note.
This commit is contained in:
parent
e2e884e317
commit
7e062f860f
20
app/controllers/fluentd/settings/notes_controller.rb
Normal file
20
app/controllers/fluentd/settings/notes_controller.rb
Normal file
@ -0,0 +1,20 @@
|
||||
class Fluentd::Settings::NotesController < ApplicationController
|
||||
before_action :login_required
|
||||
before_action :find_fluentd
|
||||
before_action :find_note, only: [:update]
|
||||
|
||||
def update
|
||||
if @note.update(params[:note][:content])
|
||||
flash[:success] = t('messages.note_updating_success')
|
||||
else
|
||||
flash[:error] = t('errors.messages.note_updating_failed')
|
||||
end
|
||||
redirect_to daemon_setting_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_note
|
||||
@note = Fluentd::SettingArchive::Note.find_by_file_id(@fluentd.agent.config_backup_dir, params[:id])
|
||||
end
|
||||
end
|
||||
@ -12,6 +12,7 @@ en:
|
||||
fluentd_status_running: Running
|
||||
fluentd_status_stopped: Stopped
|
||||
config_successfully_copied: "Config has been copied successfully. Please restart %{brand} to use the new config"
|
||||
note_updating_success: "Note successfully updated."
|
||||
|
||||
terms: &terms
|
||||
name: Name
|
||||
@ -284,6 +285,7 @@ en:
|
||||
is_a_directory: is a directory. should be a file
|
||||
duplicated_conf: Configurations is duplicated
|
||||
out_forward_blank_server: server settings should be at least one
|
||||
note_updating_failed: Updating the note is failed. See application logs.
|
||||
|
||||
activemodel: &activemodel
|
||||
errors:
|
||||
|
||||
@ -12,6 +12,7 @@ ja:
|
||||
fluentd_status_running: 稼働中
|
||||
fluentd_status_stopped: 停止中
|
||||
config_successfully_copied: "設定をコピーしました。反映させるには、 %{brand}を再起動してください。"
|
||||
note_updating_success: "メモを更新しました。"
|
||||
|
||||
terms: &terms
|
||||
name: アカウント名
|
||||
@ -289,6 +290,7 @@ ja:
|
||||
is_a_directory: はディレクトリです。ファイルを指定してください
|
||||
duplicated_conf: 同じ内容の設定がすでに存在しています
|
||||
out_forward_blank_server: serverの設定がありません。
|
||||
note_updating_failed: メモの更新に失敗しました。ログを確認して下さい。
|
||||
|
||||
activemodel: &activemodel
|
||||
errors:
|
||||
|
||||
@ -68,6 +68,8 @@ Rails.application.routes.draw do
|
||||
post "reuse", action: 'reuse', on: :member, as: 'reuse'
|
||||
end
|
||||
|
||||
resources :notes, only: [:update], module: :settings, controller: :notes
|
||||
|
||||
resource :running_backup, only: [:show], module: :settings, controller: :running_backup do
|
||||
post "reuse", action: 'reuse', on: :member, as: 'reuse'
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user