mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-15 10:47:06 +02:00
Add modal confirmation before delete fluentd
This commit is contained in:
parent
1ce231bdc8
commit
76daf0bd60
@ -19,8 +19,17 @@
|
|||||||
= "fluentd ##{d.id}"
|
= "fluentd ##{d.id}"
|
||||||
- unless d.agent.running?
|
- unless d.agent.running?
|
||||||
= link_to t(".edit"), edit_fluentd_path(d)
|
= link_to t(".edit"), edit_fluentd_path(d)
|
||||||
= link_to t(".destroy"), fluentd_path(d), method: :delete
|
%button{class: "btn btn-danger", data: {toggle: "modal", target:" #modal-destroy"}}
|
||||||
|
= t ".destroy"
|
||||||
%div.panel-body
|
%div.panel-body
|
||||||
|
:ruby
|
||||||
|
locals = {
|
||||||
|
head: t('.destroy_confirm_title', target: d.label),
|
||||||
|
body: t('.destroy_confirm_body'),
|
||||||
|
primary_button: link_to(t(".destroy"), fluentd_path(d), method: :delete, class: "btn btn-danger")
|
||||||
|
}
|
||||||
|
= render partial: "shared/modal", locals: locals
|
||||||
|
|
||||||
%h4
|
%h4
|
||||||
- if d.agent.running?
|
- if d.agent.running?
|
||||||
= icon("fa-play")
|
= icon("fa-play")
|
||||||
|
25
app/views/shared/_modal.html.erb
Normal file
25
app/views/shared/_modal.html.erb
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<% primary_button ||= "Save changes" %>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="modal-destroy" tabindex="-1" role="dialog" aria-labelledby="modal-destroyLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title" id="myModalLabel"><%= head %></h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<%= body %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
<%= primary_button %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-content -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
<!-- /.modal -->
|
@ -27,6 +27,9 @@ en:
|
|||||||
installing: "Installing: %{target}"
|
installing: "Installing: %{target}"
|
||||||
uninstalling: "Uninstalling: %{target}"
|
uninstalling: "Uninstalling: %{target}"
|
||||||
search: Search
|
search: Search
|
||||||
|
destroy_confirm_title: "%{target} Deletion"
|
||||||
|
destroy_confirm_body: |
|
||||||
|
Really delete?
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
common: &plugin_common
|
common: &plugin_common
|
||||||
|
@ -27,6 +27,9 @@ ja:
|
|||||||
installing: "インストール中: %{target}"
|
installing: "インストール中: %{target}"
|
||||||
uninstalling: "アンインストール中: %{target}"
|
uninstalling: "アンインストール中: %{target}"
|
||||||
search: 検索
|
search: 検索
|
||||||
|
destroy_confirm_title: "%{target}を削除"
|
||||||
|
destroy_confirm_body: |
|
||||||
|
削除しますか?
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
common: &plugin_common
|
common: &plugin_common
|
||||||
|
Loading…
Reference in New Issue
Block a user