fluentd-ui 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +2 -1
  3. data/ChangeLog.md +8 -0
  4. data/Gemfile.lock +28 -28
  5. data/app/assets/stylesheets/application.css +1 -0
  6. data/app/controllers/misc_controller.rb +8 -0
  7. data/app/controllers/plugins_controller.rb +20 -3
  8. data/app/decorators/plugin_decorator.rb +18 -0
  9. data/app/helpers/application_helper.rb +0 -10
  10. data/app/javascript/packs/application.js +7 -5
  11. data/app/javascript/packs/codemirror.js +2 -1
  12. data/app/javascript/packs/{aws_credential.js → components/aws_credential.js} +0 -0
  13. data/app/javascript/packs/components/config_field.js +110 -0
  14. data/app/javascript/packs/{grep_container.js → components/grep_container.js} +1 -1
  15. data/app/javascript/packs/{grep_pattern.js → components/grep_pattern.js} +4 -2
  16. data/app/javascript/packs/components/owned_plugin_form.js +88 -0
  17. data/app/javascript/packs/{parser_multiline_form.js → components/parser_multiline_form.js} +0 -0
  18. data/app/javascript/packs/{owned_plugin_form.js → components/parser_plugin_form.js} +12 -20
  19. data/app/javascript/packs/{transport_config.js → components/transport_config.js} +0 -0
  20. data/app/javascript/packs/filter_grep_setting.js +2 -2
  21. data/app/javascript/packs/fluent_log.js +1 -1
  22. data/app/javascript/packs/in_tail_parse.js +20 -16
  23. data/app/javascript/packs/{notification.js → navigation.js} +8 -6
  24. data/app/javascript/packs/nested_settings.js +1 -1
  25. data/app/javascript/packs/out_forward_setting.js +3 -3
  26. data/app/javascript/packs/out_s3_setting.js +3 -3
  27. data/app/javascript/packs/plugin_setting.js +4 -2
  28. data/app/javascript/packs/settings.js +2 -2
  29. data/app/javascript/packs/store/index.js +21 -0
  30. data/app/javascript/packs/store/modules/parser_params.js +83 -0
  31. data/app/javascript/packs/transport_section.js +2 -2
  32. data/app/javascript/packs/treeview.js +1 -1
  33. data/app/models/concerns/fluentd/setting/configurable.rb +1 -1
  34. data/app/models/concerns/fluentd/setting/formatter_advanced_options.rb +22 -0
  35. data/app/models/concerns/fluentd/setting/label.rb +1 -1
  36. data/app/models/concerns/fluentd/setting/parser_advanced_options.rb +27 -0
  37. data/app/models/concerns/fluentd/setting/plugin.rb +12 -1
  38. data/app/models/fluentd/setting/buffer_file.rb +4 -0
  39. data/app/models/fluentd/setting/buffer_memory.rb +4 -0
  40. data/app/models/fluentd/setting/parser_ltsv.rb +1 -1
  41. data/app/models/fluentd/setting/parser_regexp.rb +2 -2
  42. data/app/models/fluentd/setting/parser_syslog.rb +2 -8
  43. data/app/models/plugin.rb +4 -4
  44. data/app/views/fluentd/settings/in_tail/_form.html.haml +3 -3
  45. data/app/views/fluentd/settings/in_tail/after_file_choose.html.haml +1 -1
  46. data/app/views/fluentd/settings/source_and_output.html.haml +10 -10
  47. data/app/views/layouts/application.html.erb +2 -28
  48. data/app/views/misc/information.html.haml +48 -44
  49. data/app/views/plugins/installed.html.haml +49 -60
  50. data/app/views/plugins/recommended.html.haml +54 -54
  51. data/app/views/sessions/new.html.haml +10 -4
  52. data/app/views/shared/settings/_form.html.haml +16 -13
  53. data/app/views/shared/vue/_aws_credential.html.haml +2 -4
  54. data/app/views/shared/vue/_config_field.html.haml +16 -30
  55. data/app/views/shared/vue/_grep_container.html.haml +13 -14
  56. data/app/views/shared/vue/_grep_pattern.html.haml +10 -6
  57. data/app/views/shared/vue/_in_tail_parse.html.haml +13 -13
  58. data/app/views/shared/vue/_navigation.html.haml +38 -0
  59. data/app/views/shared/vue/_owned_plugin_form.html.haml +18 -13
  60. data/app/views/shared/vue/_parser_multiline_form.html.haml +5 -3
  61. data/app/views/shared/vue/_parser_plugin_form.html.haml +40 -0
  62. data/app/views/shared/vue/_setting.html.haml +20 -0
  63. data/app/views/shared/vue/_sidemenu.html.haml +40 -0
  64. data/app/views/shared/vue/_transport_section.html.haml +10 -8
  65. data/app/views/shared/vue/_treeview.html.haml +30 -0
  66. data/config/locales/translation_en.yml +1 -0
  67. data/config/locales/translation_ja.yml +1 -0
  68. data/lib/fluentd-ui/version.rb +1 -1
  69. data/lib/regexp_preview/multi_line.rb +4 -3
  70. data/lib/regexp_preview/single_line.rb +4 -3
  71. data/package.json +3 -1
  72. data/test/test_helper.rb +5 -0
  73. data/yarn.lock +111 -5
  74. metadata +62 -78
  75. data/app/javascript/packs/config_field.js +0 -93
  76. data/app/views/shared/_global_nav.html.erb +0 -80
  77. data/app/views/shared/_modal.html.erb +0 -25
  78. data/app/views/shared/vue/_notification.html.erb +0 -27
  79. data/app/views/shared/vue/_setting.html.erb +0 -25
  80. data/app/views/shared/vue/_treeview.html.erb +0 -33
@@ -2,9 +2,9 @@
2
2
  "use strict";
3
3
  import "lodash/lodash";
4
4
 
5
- import ConfigField from "./config_field";
5
+ import ConfigField from "./components/config_field";
6
6
 
7
- $(document).ready(() => {
7
+ window.addEventListener("load", () => {
8
8
  new Vue({
9
9
  el: "#transport-section",
10
10
  components: {
@@ -1,7 +1,7 @@
1
1
  /* global _ */
2
2
  "use strict";
3
3
  import "lodash/lodash";
4
- $(document).ready(() => {
4
+ window.addEventListener("load", () => {
5
5
  new Vue({
6
6
  el: "#treeview",
7
7
  props: {
@@ -100,7 +100,7 @@ class Fluentd
100
100
 
101
101
  def config_argument(name, type = ActiveModel::Type::Value.new, **options)
102
102
  config_param(name, type, **options)
103
- self._argument_name = name
103
+ set_argument_name(name)
104
104
  end
105
105
 
106
106
  def set_argument_name(name)
@@ -0,0 +1,22 @@
1
+ class Fluentd
2
+ module Setting
3
+ module FormatterAdvancedOptions
4
+ extend ActiveSupport::Concern
5
+
6
+ def advanced_options
7
+ [
8
+ :time_type,
9
+ :time_format,
10
+ :timezone,
11
+ :utc,
12
+ ]
13
+ end
14
+
15
+ def hidden_options
16
+ [
17
+ :localtime
18
+ ]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -4,7 +4,7 @@ class Fluentd
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- config_argument(:label, :string)
7
+ config_param(:label, :string)
8
8
  end
9
9
  end
10
10
  end
@@ -0,0 +1,27 @@
1
+ class Fluentd
2
+ module Setting
3
+ module ParserAdvancedOptions
4
+ extend ActiveSupport::Concern
5
+
6
+ def advanced_options
7
+ [
8
+ :types,
9
+ :null_value_pattern,
10
+ :null_empty_string,
11
+ :estimate_current_event,
12
+ :time_key,
13
+ :time_type,
14
+ :time_format,
15
+ :keep_time_key,
16
+ :utc,
17
+ ]
18
+ end
19
+
20
+ def hidden_options
21
+ [
22
+ :localtime
23
+ ]
24
+ end
25
+ end
26
+ end
27
+ end
@@ -18,7 +18,6 @@ class Fluentd
18
18
  include Fluentd::Setting::PluginConfig
19
19
  include Fluentd::Setting::SectionParser
20
20
  include Fluentd::Setting::PluginParameter
21
- include Fluentd::Setting::Label
22
21
 
23
22
  included do
24
23
  cattr_accessor :plugin_type, :plugin_name, :config_definition
@@ -33,6 +32,18 @@ class Fluentd
33
32
  include Fluentd::Setting::Pattern
34
33
  end
35
34
 
35
+ if ["input", "filter", "output"].include?(type)
36
+ include Fluentd::Setting::Label
37
+ end
38
+
39
+ if ["parser"].include?(type)
40
+ include Fluentd::Setting::ParserAdvancedOptions
41
+ end
42
+
43
+ if ["formatter"].include?(type)
44
+ include Fluentd::Setting::FormatterAdvancedOptions
45
+ end
46
+
36
47
  self.load_plugin_config do |_name, params|
37
48
  params.each do |param_name, definition|
38
49
  if definition[:section]
@@ -18,6 +18,10 @@ class Fluentd
18
18
  :dir_permission
19
19
  ]
20
20
  end
21
+
22
+ def advanced_options
23
+ []
24
+ end
21
25
  end
22
26
  end
23
27
  end
@@ -12,6 +12,10 @@ class Fluentd
12
12
  def common_options
13
13
  []
14
14
  end
15
+
16
+ def advanced_options
17
+ []
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -21,7 +21,7 @@ class Fluentd
21
21
  end
22
22
 
23
23
  def advanced_options
24
- [
24
+ super + [
25
25
  :delimiter_pattern
26
26
  ]
27
27
  end
@@ -16,9 +16,9 @@ class Fluentd
16
16
  end
17
17
 
18
18
  def hidden_options
19
- [
19
+ super + [
20
20
  :ignorecase,
21
- :multiline
21
+ :multiline,
22
22
  ]
23
23
  end
24
24
  end
@@ -12,16 +12,10 @@ class Fluentd
12
12
  end
13
13
 
14
14
  def common_options
15
- [
16
- :time_format,
17
- :with_priority,
18
- ]
19
- end
20
-
21
- def advanced_options
22
15
  [
23
16
  :message_format,
24
- :rfc5424_time_format
17
+ :rfc5424_time_format,
18
+ :with_priority,
25
19
  ]
26
20
  end
27
21
  end
@@ -41,18 +41,18 @@ class Plugin
41
41
  end
42
42
 
43
43
  def installed?
44
- self.class.installed.find do |plugin|
44
+ self.class.installed.any? do |plugin|
45
45
  plugin.gem_name == gem_name
46
46
  end
47
47
  end
48
48
 
49
49
  def processing?
50
- !!WORKING.find{|data| data[:plugin].gem_name == gem_name}
50
+ WORKING.any?{|data| data[:plugin].gem_name == gem_name}
51
51
  end
52
52
 
53
53
  def installed_version
54
- return unless inst = installed?
55
- inst.version
54
+ return unless installed?
55
+ version
56
56
  end
57
57
 
58
58
  def latest_version?
@@ -23,11 +23,11 @@
23
23
  = form.field(:tag)
24
24
  = form.field(:pos_file)
25
25
 
26
- .well.well-sm
27
- %h4{"data-toggle" => "collapse", "href" => "#advanced-setting"}
26
+ .card.mb-3
27
+ %h4.card-header{"data-toggle" => "collapse", "href" => "#advanced-setting"}
28
28
  = icon('fa-caret-down')
29
29
  = t('terms.advanced_setting')
30
- #advanced-setting.collapse
30
+ #advanced-setting.card-body.collapse
31
31
  .form-group
32
32
  = form.field(:rotate_wait)
33
33
  .form-group
@@ -12,7 +12,7 @@
12
12
  = f.text_field :path, class: "form-control", disabled: true
13
13
  = render "shared/vue/in_tail_parse", setting: @setting
14
14
 
15
- .card
15
+ .card.mb-3
16
16
  %pre.card-body= file_tail(@setting.path, Settings.in_tail_preview_line_count).join("\n")
17
17
 
18
18
  %p
@@ -43,18 +43,18 @@
43
43
  %h2
44
44
  = t('.current')
45
45
  .float-right
46
- %button.btn.btn-outline-dark.btn-sm{"v-on:click" => "update", "v-if" => "!loading"}= icon('fa-refresh')
47
- %button.btn.btn-outline-dark.btn-sm{"v-if" => "loading"}= icon('fa-spin fa-refresh')
48
- .row
49
- .col-xl-4.input
46
+ %b-btn{"variant" => "outline-dark", "size" => "sm", "v-if" => "loading"}= icon('fa-spin fa-refresh')
47
+ %b-btn{"variant" => "outline-dark", "size" => "sm", "v-on:click" => "update", "v-if" => "!loading"}= icon('fa-refresh')
48
+ %b-row
49
+ %b-col.input{"cols" => "4"}
50
50
  %h3= t('.in')
51
- .col-xl-4.filter
51
+ %b-col.filter{"cols" => "4"}
52
52
  %h3= t('.filter')
53
- .col-xl-4.output
53
+ %b-col.output{"cols" => "4"}
54
54
  %h3= t('.out')
55
55
 
56
- .row{"v-for" => "(elements, label) in sections"}
57
- .col-xl-4.input
56
+ %b-row{"v-for" => "(elements, label) in sections"}
57
+ %b-col.input{"cols" => "4"}
58
58
  %h5 {{ label }}
59
59
  %div{"v-if" => "loaded && !elements.sources || elements.sources.length == 0"}
60
60
  %p.empty= t('.setting_empty')
@@ -67,7 +67,7 @@
67
67
  "v-bind:initial-type" => "source.type",
68
68
  "v-bind:initial-name" => "source.name",
69
69
  "v-bind:initial-arg" => "source.arg"}
70
- .col-xl-4.filter
70
+ %b-col.filter{"cols" => "4"}
71
71
  %h5 {{ label }}
72
72
  %div{"v-if" => "loaded && !elements.filters || elements.filters.length == 0"}
73
73
  %p.empty= t('.setting_empty')
@@ -81,7 +81,7 @@
81
81
  "v-bind:initial-name" => "filter.name",
82
82
  "v-bind:initial-arg" => "filter.arg"}
83
83
 
84
- .col-xl-4.output
84
+ %b-col.output{"cols" => "4"}
85
85
  %h5 {{ label }}
86
86
  %div{"v-if" => "loaded && !elements.matches || elements.matches.length == 0"}
87
87
  %p.empty= t('.setting_empty')
@@ -13,7 +13,7 @@
13
13
  <%= stylesheet_link_tag 'application', media: 'all'%>
14
14
  <%= stylesheet_pack_tag 'application', media: 'all'%>
15
15
  <%= javascript_pack_tag 'application' %>
16
- <%= javascript_pack_tag 'notification' %>
16
+ <%= javascript_pack_tag 'navigation' %>
17
17
  <%= content_for(:additional_javascript_pack_tag) %>
18
18
  <%= csrf_meta_tags %>
19
19
  <%= javascript_tag do %>
@@ -21,33 +21,7 @@
21
21
  <% end %>
22
22
  </head>
23
23
  <body class="fixed-nav bg-light">
24
- <nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top" id="mainNav">
25
- <%= link_to fluentd_ui_logo, root_path, class: "navbar-brand fluentd-ui-logo" %>
26
- <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
27
- <span class="navbar-toggler-icon"></span>
28
- </button>
29
- <div class="collapse navbar-collapse" id="navbarResponsive">
30
- <%= render partial: "shared/global_nav" %>
31
- <ul class="navbar-nav ml-auto">
32
- <%- if @fluentd %>
33
- <li class="nav-item fluentd-note">
34
- <%= @fluentd.note %>
35
- </li>
36
- <li class="nav-item fluentd-status">
37
- <a class="nav-link" href="<%= daemon_path %>" data-toggle="tooltip" data-placement="bottom" title="fluentd <%= fluentd_status_message %>">
38
- <%= fluentd_status_icon %>
39
- </a>
40
- </li>
41
- <%- end %>
42
-
43
- <%= render partial: "shared/vue/notification" %>
44
-
45
- <li class="nav-item">
46
- <%= link_to(icon("fa-fw fa-sign-out") + t("terms.sign_out"), sessions_path, method: :delete, class: "nav-link") %>
47
- </li>
48
- </ul>
49
- </div>
50
- </nav>
24
+ <%= render partial: "shared/vue/navigation" %>
51
25
 
52
26
  <div class="content-wrapper">
53
27
  <div class="container-fluid">
@@ -3,21 +3,20 @@
3
3
  = icon('fa-download')
4
4
  = t('.download_system_information')
5
5
 
6
- - if FluentdUI.update_available? && !FluentdUI.td_agent_ui?
7
- - # NOTE: td-agent-ui shouldn't have auto update feature
8
- .row
9
- .col-xl-12
10
- %p
11
- = link_to misc_update_fluentd_ui_path, class: "btn btn-primary btn-lg", method: :post do
12
- = t('.update_fluentd_ui', version: FluentdUI.latest_version, title: fluentd_ui_title)
13
- = t('.update_fluentd_ui_caution', brand: fluentd_ui_brand)
6
+ #information
7
+ - if FluentdUI.update_available? && !FluentdUI.td_agent_ui?
8
+ - # NOTE: td-agent-ui shouldn't have auto update feature
9
+ .row
10
+ .col-xl-12
11
+ %p
12
+ = link_to misc_update_fluentd_ui_path, class: "btn btn-primary btn-lg", method: :post do
13
+ = t('.update_fluentd_ui', version: FluentdUI.latest_version, title: fluentd_ui_title)
14
+ = t('.update_fluentd_ui_caution', brand: fluentd_ui_brand)
14
15
 
15
- .row
16
- .col-xl-6.col-sm-6.mb-3
17
- .card.card-default
18
- .card-header
19
- %h4= t("terms.version")
20
- .card-body
16
+ .row
17
+ .col-xl-6.col-sm-6.mb-3
18
+ %b-card{"header" => t("terms.version"),
19
+ "header-tags" => "h4"}
21
20
  %dl{class: "dl-horizontal"}
22
21
  %dt ruby
23
22
  %dd= RUBY_DESCRIPTION
@@ -27,13 +26,11 @@
27
26
  %dt fluentd-ui
28
27
  %dd= FluentdUI::VERSION
29
28
 
30
- .col-xl-6.col-sm-6.mb-3
31
- .card.card-default
32
- .card-header
33
- %h4= t('terms.installed_plugins')
34
- .card-body
29
+ .col-xl-6.col-sm-6.mb-3
30
+ %b-card{"header" => t('terms.installed_plugins'),
31
+ "header-tags" => "h4"}
35
32
  - if @plugins.present?
36
- %table{class: "table table-hover", id: "plugins-table"}
33
+ %table{class: "table table-hover table-sm", id: "plugins-table"}
37
34
  %thead
38
35
  %tr
39
36
  %th= t('plugins.common.name')
@@ -46,31 +43,38 @@
46
43
  - else
47
44
  = t "plugins.common.no_installed"
48
45
 
49
- .row
50
- .col-xl-12.col-sm-12
51
- .card.card-default
52
- .card-header
53
- %h4{"data-toggle" => "collapse", "href" => "#env-table"}
54
- = icon('fa-caret-down')
55
- = t('.env')
56
- %table{class: "table table-hover collapse", id: "env-table"}
57
- %thead
58
- %tr
59
- %th= t('.env_key')
60
- %th= t('.env_value')
61
- %tbody
62
- - @env.each_pair do |key, value|
63
- %tr
64
- %td= key
65
- %td= value
46
+ .row
47
+ .col-xl-12.col-sm-12
48
+ %b-card
49
+ %template{"slot" => "header"}
50
+ %h4{"v-b-toggle.env-table" => ""}
51
+ = icon('fa-caret-down')
52
+ = t('.env')
53
+ %b-collapse#env-table
54
+ %b-form-group.float-right(horizontal){"label" => t("terms.search")}
55
+ %b-input-group
56
+ %b-form-input{"v-model" => "filter"}
57
+ %b-input-group-append
58
+ %b-btn{ "v-bind:disabled" => "!filter", "v-on:click" => "filter = ''" }
59
+ Clear
60
+ %b-table(stripped hover small){"v-bind:items" => "items",
61
+ "v-bind:fields" => "fields",
62
+ "v-bind:filter" => "filter"}
66
63
 
67
64
  :javascript
68
- $(document).ready(function() {
69
- $('#env-table').dataTable({
70
- "autoWidth": false,
71
- "ordering": true,
72
- "paging": false,
73
- "info": false,
74
- "searching": false
65
+ window.addEventListener("load", () => {
66
+ new Vue({
67
+ name: "Information",
68
+ el: "#information",
69
+ data() {
70
+ return {
71
+ fields: {
72
+ key: { label: "#{t('.env_key')}", sortable: true },
73
+ value: { label: "#{t('.env_value')}" }
74
+ },
75
+ items: #{env_items.to_json.html_safe},
76
+ filter: null
77
+ };
78
+ }
75
79
  });
76
80
  });
@@ -1,67 +1,56 @@
1
1
  - page_title t('.page_title')
2
2
 
3
- %table{class: "table table-striped table-hover", id: "plugins-table"}
4
- %thead
5
- %tr
6
- %th{scope: "col"}
7
- %th{scope: "col"}= t('plugins.common.name')
8
- %th{scope: "col"}= t('plugins.common.authors')
9
- %th{scope: "col"}= t('plugins.common.summary')
10
- %th{scope: "col"}= t('plugins.common.installed_version')
11
- %th{scope: "col"}= t('plugins.common.latest_version')
12
- %th{scope: "col"}
13
- %tbody
14
- - @plugins.each do |plugin|
15
- %tr
16
- %td
17
- %button{class: "btn btn-danger", data: {toggle: "modal", target:" #plugin-modal-#{plugin.gem_name}"}}
18
- = t "terms.uninstall"
19
- .modal.fade{id: "plugin-modal-#{plugin.gem_name}"}
20
- .modal-dialog
21
- .modal-content
22
- .modal-header
23
- %button.close{"data-dismiss" => "modal"}
24
- = raw "&times;"
25
- %h4.modal-title
26
- = plugin.gem_name
27
- .modal-body
28
- = t('terms.confirm_body', action: t('terms.uninstall'))
29
- .modal-footer
30
- = form_tag(uninstall_plugins_path, method: :patch) do
31
- %button.btn.btn-secondary{"data-dismiss" => "modal"}
32
- Close
33
- = hidden_field_tag("plugins[]", plugin.gem_name)
34
- = submit_tag t('terms.uninstall'), class: "btn btn-danger"
35
- %td
36
- %label{for: "plugin_#{plugin.gem_name}"}
37
- = plugin.gem_name
38
- %td
39
- = plugin.authors
40
- %td
41
- = plugin.summary
42
- %td
43
- = plugin.installed_version
44
- %td
45
- = plugin.latest_version
46
- %td
47
- - if plugin.latest_version?
48
- = t('plugins.common.latest_version')
49
- - else
50
- = form_tag(upgrade_plugins_path, method: :patch) do
51
- = hidden_field_tag("plugins[name]", plugin.gem_name)
52
- = hidden_field_tag("plugins[version]", plugin.latest_version)
53
- = submit_tag t('plugins.common.install_latest_version'), class: "btn btn-primary"
3
+ #plugin-table
4
+ %b-form-group.float-right(horizontal){"label" => t("terms.search")}
5
+ %b-input-group
6
+ %b-form-input{"v-model" => "filter"}
7
+ %b-input-group-append
8
+ %b-btn{ "v-bind:disabled" => "!filter", "v-on:click" => "filter = ''" }
9
+ = t("terms.clear")
10
+ %b-table(stripped hover small){"v-bind:items" => "items",
11
+ "v-bind:fields" => "fields",
12
+ "v-bind:filter" => "filter"}
13
+ %template{"slot" => "uninstall_button", "slot-scope" => "row"}
14
+ %b-button{"variant" => "danger", "v-b-modal" => "row.item.uninstall_button"}
15
+ = t("terms.uninstall")
16
+ %b-modal{"v-bind:id" => "row.item.uninstall_button",
17
+ "v-bind:title" => "row.item.name"}
18
+ = t("terms.confirm_body", action: t("terms.uninstall"))
19
+ %template{"slot" => "modal-footer"}
20
+ = form_tag(uninstall_plugins_path, method: :patch) do
21
+ %b-button{"v-on:click" => "show=false"}
22
+ Close
23
+ %input{"type" => "hidden", "name" => "plugins[]", "v-bind:value" => "row.item.name"}
24
+ %b-button{"type" => "submit", "variant" => "danger"}
25
+ = t("terms.uninstall")
26
+ %template{"slot" => "is_latest_version", "slot-scope" => "row"}
27
+ %template{"v-if" => "row.value"}
28
+ = t("plugins.common.latest_version")
29
+ %template(v-else)
30
+ = form_tag(upgrade_plugins_path, method: :patch) do
31
+ %input{"type" => "hidden", "name" => "plugins[name]", "v-bind:value" => "row.item.name"}
32
+ %input{"type" => "hidden", "name" => "plugins[version]", "v-bind:value" => "row.item.latest_version"}
33
+ = submit_tag(t('plugins.common.install_latest_version'), class: "btn btn-primary")
54
34
 
55
35
  :javascript
56
- $(document).ready(function() {
57
- $('#plugins-table').dataTable({
58
- "autoWidth": false,
59
- "ordering": true,
60
- "paging": false,
61
- "info": false,
62
- "searching": true,
63
- "language": {
64
- "search": "#{t("terms.search")} "
36
+ window.addEventListener("load", () => {
37
+ new Vue({
38
+ name: "InstalledPlugins",
39
+ el: "#plugin-table",
40
+ data() {
41
+ return {
42
+ fields: {
43
+ uninstall_button: { label: "" },
44
+ name: { label: "#{t("plugins.common.name")}", sortable: true },
45
+ authors: { label: "#{t("plugins.common.authors")}", sortable: true },
46
+ summary: { label: "#{t("plugins.common.summary")}", sortable: true },
47
+ installed_version: { label: "#{t("plugins.common.installed_version")}", sortable: true },
48
+ latest_version: { label: "#{t("plugins.common.latest_version")}", sortable: true },
49
+ is_latest_version: { label: "" }
50
+ },
51
+ items: #{plugins_json.html_safe},
52
+ filter: null
53
+ }
65
54
  }
66
55
  });
67
56
  });