fluentd-ui 0.4.5 → 1.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

Files changed (243) hide show
  1. checksums.yaml +5 -5
  2. data/.babelrc +18 -0
  3. data/.editorconfig +11 -0
  4. data/.gitignore +7 -0
  5. data/.postcssrc.yml +3 -0
  6. data/.travis.yml +20 -4
  7. data/ChangeLog.md +7 -2
  8. data/Gemfile +8 -6
  9. data/Gemfile.lock +177 -178
  10. data/README.md +15 -10
  11. data/app/assets/stylesheets/application.css +6 -5
  12. data/app/controllers/concerns/setting_history_concern.rb +1 -1
  13. data/app/controllers/fluentd/agents_controller.rb +5 -0
  14. data/app/controllers/misc_controller.rb +2 -2
  15. data/app/controllers/plugins_controller.rb +4 -4
  16. data/app/helpers/application_helper.rb +8 -2
  17. data/app/helpers/settings_helper.rb +2 -2
  18. data/app/javascript/packs/application.js +31 -0
  19. data/app/{assets/javascripts/codemirror_fluentd.js → javascript/packs/codemirror.js} +32 -1
  20. data/app/javascript/packs/fluent_log.js +63 -0
  21. data/app/javascript/packs/in_tail_format.js +174 -0
  22. data/app/javascript/packs/nested_settings.js +40 -0
  23. data/app/javascript/packs/notification.js +60 -0
  24. data/app/javascript/packs/settings.js +122 -0
  25. data/app/javascript/packs/treeview.js +99 -0
  26. data/{vendor/assets/javascripts/.keep → app/javascript/stylesheets/application.scss} +0 -0
  27. data/app/jobs/all_plugin_check_update_job.rb +10 -0
  28. data/app/jobs/application_job.rb +2 -0
  29. data/app/{workers/fluentd_ui_restart.rb → jobs/fluentd_ui_restart_job.rb} +4 -4
  30. data/app/jobs/fluentd_ui_update_check_job.rb +11 -0
  31. data/app/{workers/gem_installer.rb → jobs/gem_installer_job.rb} +4 -5
  32. data/app/jobs/gem_uninstaller_job.rb +14 -0
  33. data/app/jobs/gem_update_check_job.rb +9 -0
  34. data/app/models/fluentd/agent.rb +9 -5
  35. data/app/models/fluentd/agent/common.rb +10 -6
  36. data/app/models/fluentd/agent/fluentd_gem.rb +2 -3
  37. data/app/models/fluentd/agent/td_agent/unix.rb +7 -5
  38. data/app/models/fluentd/setting/in_tail.rb +2 -2
  39. data/app/views/fluentd/_form.html.haml +1 -1
  40. data/app/views/fluentd/errors.html.haml +5 -6
  41. data/app/views/fluentd/log.html.haml +4 -5
  42. data/app/views/fluentd/settings/edit.html.haml +2 -1
  43. data/app/views/fluentd/settings/histories/_list.html.haml +1 -1
  44. data/app/views/fluentd/settings/histories/show.html.haml +6 -6
  45. data/app/views/fluentd/settings/in_tail/after_file_choose.html.haml +4 -3
  46. data/app/views/fluentd/settings/in_tail/after_format.html.haml +2 -2
  47. data/app/views/fluentd/settings/in_tail/confirm.html.haml +3 -3
  48. data/app/views/fluentd/settings/running_backup/show.html.haml +5 -5
  49. data/app/views/fluentd/settings/show.html.haml +7 -7
  50. data/app/views/fluentd/settings/source_and_output.html.haml +31 -18
  51. data/app/views/fluentd/show.html.haml +16 -15
  52. data/app/views/layouts/application.html.erb +31 -46
  53. data/app/views/layouts/sign_in.html.erb +9 -16
  54. data/app/views/misc/information.html.haml +13 -13
  55. data/app/views/misc/update_fluentd_ui.html.haml +3 -3
  56. data/app/views/plugins/installed.html.haml +8 -8
  57. data/app/views/plugins/recommended.html.haml +5 -5
  58. data/app/views/plugins/updated.html.haml +5 -5
  59. data/app/views/sessions/new.html.haml +5 -6
  60. data/app/views/shared/_global_nav.html.erb +9 -9
  61. data/app/views/shared/_initial_setup.html.haml +3 -3
  62. data/app/views/shared/_modal.html.erb +1 -1
  63. data/app/views/shared/settings/_form.html.haml +9 -8
  64. data/app/views/shared/settings/show.html.haml +4 -2
  65. data/app/views/shared/vue/_fluent_log.html.erb +6 -6
  66. data/app/views/shared/vue/_in_tail_format.html.erb +31 -29
  67. data/app/views/shared/vue/_notification.html.erb +5 -9
  68. data/app/views/shared/vue/_setting.html.erb +12 -10
  69. data/app/views/shared/vue/_treeview.html.erb +13 -10
  70. data/app/views/tutorials/chapter1.html.erb +3 -4
  71. data/app/views/tutorials/chapter2.html.haml +2 -2
  72. data/app/views/tutorials/chapter3.html.haml +2 -2
  73. data/app/views/tutorials/chapter4.html.haml +2 -2
  74. data/app/views/users/show.html.haml +1 -1
  75. data/bin/bundle +1 -1
  76. data/bin/fluentd-ui +1 -0
  77. data/bin/rails +1 -1
  78. data/bin/setup +16 -17
  79. data/bin/update +28 -0
  80. data/bin/webpack +15 -0
  81. data/bin/webpack-dev-server +15 -0
  82. data/bin/yarn +11 -0
  83. data/config/application.rb +18 -5
  84. data/config/boot.rb +2 -1
  85. data/config/environment.rb +1 -1
  86. data/config/environments/development.rb +27 -5
  87. data/config/environments/production.rb +34 -23
  88. data/config/environments/test.rb +7 -3
  89. data/config/initializers/application_controller_renderer.rb +8 -0
  90. data/config/initializers/assets.rb +14 -0
  91. data/config/initializers/content_security_policy.rb +25 -0
  92. data/config/initializers/cookies_serializer.rb +2 -0
  93. data/config/initializers/fluentd_ui_update_check.rb +2 -1
  94. data/config/initializers/new_framework_defaults_5_2.rb +35 -0
  95. data/config/initializers/prefetch_gem_updates.rb +4 -1
  96. data/config/initializers/wrap_parameters.rb +1 -6
  97. data/config/locales/ja.yml +61 -57
  98. data/config/routes.rb +1 -0
  99. data/config/spring.rb +6 -0
  100. data/config/webpack/development.js +5 -0
  101. data/config/webpack/environment.js +20 -0
  102. data/config/webpack/loaders/vue.js +13 -0
  103. data/config/webpack/production.js +5 -0
  104. data/config/webpack/test.js +5 -0
  105. data/config/webpacker.yml +69 -0
  106. data/fluentd-ui.gemspec +16 -6
  107. data/lib/fluentd-ui/version.rb +1 -1
  108. data/lib/regexp_preview/single_line.rb +5 -5
  109. data/package.json +19 -0
  110. data/spec/controllers/application_controller_spec.rb +2 -6
  111. data/spec/controllers/fluentd/agents_controller_spec.rb +12 -0
  112. data/spec/controllers/polling_controller_spec.rb +1 -1
  113. data/spec/factories/fluentd.rb +1 -1
  114. data/spec/factories/plugins.rb +2 -2
  115. data/spec/factories/user.rb +1 -1
  116. data/spec/features/fluentd/setting/histories_spec.rb +7 -6
  117. data/spec/features/fluentd/setting/running_backup_spec.rb +4 -3
  118. data/spec/features/setting_spec.rb +1 -0
  119. data/spec/features/source_and_output_spec.rb +16 -16
  120. data/spec/lib/regexp_preview/single_line_spec.rb +1 -1
  121. data/spec/models/fluentd_spec.rb +4 -4
  122. data/spec/spec_helper.rb +16 -4
  123. data/yarn.lock +6225 -0
  124. metadata +120 -154
  125. data/.bowerrc +0 -3
  126. data/app/assets/javascripts/application.js +0 -24
  127. data/app/assets/javascripts/codemirror.js +0 -29
  128. data/app/assets/javascripts/enable_bootstrap_tooltip.js +0 -3
  129. data/app/assets/javascripts/nested_setting.js +0 -41
  130. data/app/assets/javascripts/vue/fluent_log.js +0 -64
  131. data/app/assets/javascripts/vue/in_tail_format.js +0 -177
  132. data/app/assets/javascripts/vue/notification.js +0 -65
  133. data/app/assets/javascripts/vue/settings.js +0 -121
  134. data/app/assets/javascripts/vue/treeview.js +0 -97
  135. data/app/assets/javascripts/vue_common.js +0 -4
  136. data/app/workers/all_plugin_check_update.rb +0 -14
  137. data/app/workers/fluentd_ui_update_check.rb +0 -15
  138. data/app/workers/gem_uninstaller.rb +0 -15
  139. data/app/workers/gem_update_check.rb +0 -10
  140. data/bower.json +0 -11
  141. data/vendor/assets/javascripts/bower/.gitignore +0 -10
  142. data/vendor/assets/javascripts/bower/codemirror/.bower.json +0 -29
  143. data/vendor/assets/javascripts/bower/codemirror/bower.json +0 -16
  144. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +0 -309
  145. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +0 -8029
  146. data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +0 -38
  147. data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +0 -37
  148. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +0 -5
  149. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +0 -77
  150. data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +0 -36
  151. data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +0 -36
  152. data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +0 -30
  153. data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +0 -23
  154. data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +0 -23
  155. data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +0 -13
  156. data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +0 -32
  157. data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +0 -45
  158. data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +0 -35
  159. data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +0 -44
  160. data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +0 -45
  161. data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +0 -31
  162. data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +0 -12
  163. data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +0 -43
  164. data/vendor/assets/javascripts/bower/codemirror/theme/night.css +0 -26
  165. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +0 -36
  166. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +0 -36
  167. data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +0 -50
  168. data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +0 -23
  169. data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +0 -165
  170. data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +0 -28
  171. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +0 -35
  172. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +0 -36
  173. data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +0 -30
  174. data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +0 -32
  175. data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +0 -51
  176. data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +0 -43
  177. data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +0 -37
  178. data/vendor/assets/javascripts/bower/es6-promise/.bower.json +0 -15
  179. data/vendor/assets/javascripts/bower/es6-promise/bower.json +0 -5
  180. data/vendor/assets/javascripts/bower/es6-promise/promise.js +0 -684
  181. data/vendor/assets/javascripts/bower/es6-promise/promise.min.js +0 -1
  182. data/vendor/assets/javascripts/bower/lodash/.bower.json +0 -33
  183. data/vendor/assets/javascripts/bower/lodash/LICENSE.txt +0 -22
  184. data/vendor/assets/javascripts/bower/lodash/bower.json +0 -23
  185. data/vendor/assets/javascripts/bower/lodash/dist/lodash.compat.js +0 -7157
  186. data/vendor/assets/javascripts/bower/lodash/dist/lodash.compat.min.js +0 -61
  187. data/vendor/assets/javascripts/bower/lodash/dist/lodash.js +0 -6785
  188. data/vendor/assets/javascripts/bower/lodash/dist/lodash.min.js +0 -56
  189. data/vendor/assets/javascripts/bower/lodash/dist/lodash.underscore.js +0 -4979
  190. data/vendor/assets/javascripts/bower/lodash/dist/lodash.underscore.min.js +0 -39
  191. data/vendor/assets/javascripts/bower/vue/.bower.json +0 -29
  192. data/vendor/assets/javascripts/bower/vue/bower.json +0 -17
  193. data/vendor/assets/javascripts/bower/vue/dist/vue.js +0 -7977
  194. data/vendor/assets/javascripts/bower/vue/dist/vue.min.js +0 -7
  195. data/vendor/assets/javascripts/sb-admin-v2/bootstrap.js +0 -1951
  196. data/vendor/assets/javascripts/sb-admin-v2/bootstrap.min.js +0 -6
  197. data/vendor/assets/javascripts/sb-admin-v2/demo/dashboard-demo.js +0 -117
  198. data/vendor/assets/javascripts/sb-admin-v2/demo/flot-demo.js +0 -1242
  199. data/vendor/assets/javascripts/sb-admin-v2/demo/morris-demo.js +0 -155
  200. data/vendor/assets/javascripts/sb-admin-v2/jquery-1.10.2.js +0 -6
  201. data/vendor/assets/javascripts/sb-admin-v2/plugins/dataTables/dataTables.bootstrap.js +0 -245
  202. data/vendor/assets/javascripts/sb-admin-v2/plugins/dataTables/jquery.dataTables.js +0 -14013
  203. data/vendor/assets/javascripts/sb-admin-v2/plugins/flot/excanvas.min.js +0 -1
  204. data/vendor/assets/javascripts/sb-admin-v2/plugins/flot/jquery.flot.js +0 -2599
  205. data/vendor/assets/javascripts/sb-admin-v2/plugins/flot/jquery.flot.pie.js +0 -750
  206. data/vendor/assets/javascripts/sb-admin-v2/plugins/flot/jquery.flot.resize.js +0 -60
  207. data/vendor/assets/javascripts/sb-admin-v2/plugins/flot/jquery.flot.tooltip.min.js +0 -12
  208. data/vendor/assets/javascripts/sb-admin-v2/plugins/metisMenu/jquery.metisMenu.js +0 -45
  209. data/vendor/assets/javascripts/sb-admin-v2/plugins/morris/morris.js +0 -1888
  210. data/vendor/assets/javascripts/sb-admin-v2/plugins/morris/raphael-2.1.0.min.js +0 -10
  211. data/vendor/assets/javascripts/sb-admin-v2/sb-admin.js +0 -18
  212. data/vendor/assets/stylesheets/.keep +0 -0
  213. data/vendor/assets/stylesheets/sb-admin-v2/bootstrap.css +0 -5830
  214. data/vendor/assets/stylesheets/sb-admin-v2/bootstrap.min.css +0 -7
  215. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/css/font-awesome.css +0 -1338
  216. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/css/font-awesome.min.css +0 -4
  217. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/fonts/FontAwesome.otf +0 -0
  218. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  219. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/fonts/fontawesome-webfont.svg +0 -414
  220. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  221. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  222. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_bordered-pulled.scss +0 -16
  223. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_core.scss +0 -12
  224. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_fixed-width.scss +0 -6
  225. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_icons.scss +0 -412
  226. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_larger.scss +0 -13
  227. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_list.scss +0 -19
  228. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_mixins.scss +0 -20
  229. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_path.scss +0 -14
  230. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_rotated-flipped.scss +0 -9
  231. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_spinning.scss +0 -30
  232. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_stacked.scss +0 -20
  233. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/_variables.scss +0 -381
  234. data/vendor/assets/stylesheets/sb-admin-v2/font-awesome/scss/font-awesome.scss +0 -17
  235. data/vendor/assets/stylesheets/sb-admin-v2/fonts/glyphicons-halflings-regular.eot +0 -0
  236. data/vendor/assets/stylesheets/sb-admin-v2/fonts/glyphicons-halflings-regular.svg +0 -229
  237. data/vendor/assets/stylesheets/sb-admin-v2/fonts/glyphicons-halflings-regular.ttf +0 -0
  238. data/vendor/assets/stylesheets/sb-admin-v2/fonts/glyphicons-halflings-regular.woff +0 -0
  239. data/vendor/assets/stylesheets/sb-admin-v2/plugins/dataTables/dataTables.bootstrap.css +0 -233
  240. data/vendor/assets/stylesheets/sb-admin-v2/plugins/morris/morris-0.4.3.min.css +0 -2
  241. data/vendor/assets/stylesheets/sb-admin-v2/plugins/social-buttons/social-buttons.css +0 -68
  242. data/vendor/assets/stylesheets/sb-admin-v2/plugins/timeline/timeline.css +0 -144
  243. data/vendor/assets/stylesheets/sb-admin-v2/sb-admin.css +0 -329
@@ -1,28 +1,4 @@
1
- <script type="text/template" id="format-bundle">
2
- <div class="form-inline form-group">
3
- <label for="in_tail_setting_format">format</label>
4
- <select id="in_tail_setting_format" name="setting[format]" v-model="format" class="form-control">
5
- <option v-repeat="selectableFormats" value="{{ $value }}" v-attr="selected: format==$value">{{ $value }}</option>
6
- </select>
7
- </div>
8
- <div class="form-inline form-group" v-repeat="options">
9
- <label for="in_tail_setting_{{ $value }}" v-if="!useTextArea">{{ $value }} </label>
10
- <input id="in_tail_setting_{{ $value }}" type="{{ useTextArea ? 'hidden' : 'text' }}" name="setting[{{ $value }}]" v-model="params.setting[$value]" v-on="keyup: onKeyup" size="100%" class="form-control" />
11
- </div>
12
-
13
- <div v-if="useTextArea">
14
- <div class="form-inline form-group">
15
- <label for="in_tail_setting_format_firstline">format_firstline</label>
16
- <input id="in_tail_setting_format_firstline" type="text" name="setting[format_firstline]" v-model="params.setting['format_firstline']" v-on="keyup: onKeyup" size="100%" class="form-control" />
17
- </div>
18
-
19
- <div class="form-group">
20
- <p class="alert alert-warning"><%= t("fluentd.settings.in_tail.notice_for_multiline_limit") %></p>
21
- <label for="in_tail_setting_formats">formats</label>
22
- <textarea id="in_tail_setting_formats" type="text" name="setting[formats]" v-model="params.setting['formats']" v-on="keyup: onKeyup" rows='20' size='100%' class="form-control"></textarea>
23
- </div>
24
- </div>
25
- </script>
1
+ <%- add_javascript_pack_tag("in_tail_format") %>
26
2
 
27
3
  <div id="in_tail_format"
28
4
  formatOptionsJson="<%= formats.to_json %>"
@@ -31,11 +7,37 @@
31
7
  paramsJson="<%= params.to_json %>"
32
8
  >
33
9
 
34
- <div v-component="format-bundle" wait-for="data-loaded"></div>
10
+ <div class="form-inline form-group">
11
+ <label for="in_tail_setting_format">format</label>
12
+ <select id="in_tail_setting_format" name="setting[format]" v-model="format" class="form-control">
13
+ <option v-for="selectableFormat in selectableFormats" v-bind:value="selectableFormat" v-bind:selected="format==selectableFormat" v-if="selectableFormats">{{ selectableFormat }}</option>
14
+ </select>
15
+ </div>
16
+ <div class="form-inline form-group" v-for="option in options">
17
+ <label v-bind:for="'in_tail_setting_' + option" v-if="!useTextArea">{{ option }} </label>
18
+ <input v-bind:id="'in_tail_setting_' + option" v-bind:type="useTextArea ? 'hidden' : 'text'" v-bind:name="'setting[' + option + ']'" v-model="params.setting[option]" v-on:keyup="onKeyup" size="100%" class="form-control" />
19
+ </div>
35
20
 
36
- <pre>{{{ highlightedLines }}}</pre>
21
+ <div v-if="useTextArea">
22
+ <div class="form-inline form-group">
23
+ <label for="in_tail_setting_format_firstline">format_firstline</label>
24
+ <input id="in_tail_setting_format_firstline" type="text" name="setting[format_firstline]" v-model="params.setting['format_firstline']" v-on:keyup="onKeyup" size="100%" class="form-control" />
25
+ </div>
26
+
27
+ <div class="form-group">
28
+ <p class="alert alert-warning"><%= t("fluentd.settings.in_tail.notice_for_multiline_limit") %></p>
29
+ <label for="in_tail_setting_formats">formats</label>
30
+ <textarea id="in_tail_setting_formats" type="text" name="setting[formats]" v-model="params.setting['formats']" v-on:keyup="onKeyup" rows='20' size='100%' class="form-control"></textarea>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="card mb-3">
35
+ <pre class="card-body" v-html="highlightedLines"></pre>
36
+ </div>
37
37
 
38
- <div class="well well-sm">
39
- <%= raw t('fluentd.settings.in_tail_option_guide') %>
38
+ <div class="card mb-3">
39
+ <p class="card-body pb-0">
40
+ <%= raw t('fluentd.settings.in_tail_option_guide') %>
41
+ </p>
40
42
  </div>
41
43
  </div>
@@ -1,14 +1,10 @@
1
1
  <!-- vue.js -->
2
- <li class="dropdown" id="vue-notification">
3
- <a
4
- class="dropdown-toggle"
5
- data-toggle="dropdown" href="#"
6
- >
2
+ <li class="nav-item dropdown" id="vue-notification">
3
+ <a class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">
7
4
  <i class="fa fa-bell fa-fw"></i>
8
5
  <span class="badge" v-if="hasAlerts">{{ alertsCount }}</span>
9
- <i class="fa fa-caret-down"></i>
10
6
  </a>
11
- <ul class="nav dropdown-menu dropdown-alerts">
7
+ <ul class="dropdown-menu" aria-labelledby="alertsDropdown">
12
8
  <li v-if="!hasAlerts">
13
9
  <a>
14
10
  <div class="nothing text text-success">
@@ -17,11 +13,11 @@
17
13
  </div>
18
14
  </a>
19
15
  </li>
20
- <li v-repeat="alerts">
16
+ <li v-for="alert in alerts">
21
17
  <a>
22
18
  <div>
23
19
  <%= icon("fa-cog fa-fw fa-lg fa-spin") %>
24
- {{ text }}
20
+ {{ alert }}
25
21
  </div>
26
22
  </a>
27
23
  </li>
@@ -1,21 +1,23 @@
1
- <script type="text/template" id="vue-setting-section">
1
+ <%- add_javascript_pack_tag('codemirror') %>
2
2
 
3
- <div class='panel panel-default'>
4
- <div class='panel-heading' data-toggle='collapse' href='#{{ id }}' title='{{ content }}'>
3
+ <script type="text/x-template" id="vue-setting-section">
4
+
5
+ <div class="card card-primary mb-3">
6
+ <div class="card-header" data-toggle="collapse" v-bind:href="'#'+id" v-bind:title="content">
5
7
  {{ type }}
6
8
  <span v-if="name == 'match'">({{ arg }})</span>
7
9
  <i class="fa fa-caret-down"></i>
8
10
  </div>
9
- <div class='panel-body collapse' id='{{ id }}'>
11
+ <div class="card-body collapse" v-bind:id="id">
10
12
  <pre v-if="mode != 'edit'">{{ content }}</pre>
11
13
  <p v-if="mode == 'edit'">
12
- <textarea v-config-editor class="form-control" v-model="editContent" v-attr="disabled: processing"></textarea>
14
+ <textarea v-config-editor class="form-control" v-model="content" v-bind:disabled="processing"></textarea>
13
15
  </p>
14
- <p class="pull-right">
15
- <button v-if="mode != 'edit'" class="btn btn-default" v-on="click: onEdit"><%= t('terms.edit') %></button>
16
- <button v-if="mode != 'edit'" class="btn btn-danger" v-on="click: onDelete"><%= t('terms.destroy') %></button>
17
- <button v-if="mode == 'edit'" class="btn btn-default" v-on="click: onCancel"><%= t('terms.cancel') %></button>
18
- <button v-if="mode == 'edit'" class="btn btn-primary" v-on="click: onSubmit"><%= t('terms.save') %></button>
16
+ <p class="float-right">
17
+ <button v-if="mode != 'edit'" class="btn btn-secondary" v-on:click="onEdit"><%= t('terms.edit') %></button>
18
+ <button v-if="mode != 'edit'" class="btn btn-danger" v-on:click="onDelete"><%= t('terms.destroy') %></button>
19
+ <button v-if="mode == 'edit'" class="btn btn-secondary" v-on:click="onCancel"><%= t('terms.cancel') %></button>
20
+ <button v-if="mode == 'edit'" class="btn btn-primary" v-on:click="onSubmit"><%= t('terms.save') %></button>
19
21
  </p>
20
22
  </div>
21
23
  </div>
@@ -1,30 +1,33 @@
1
+ <% add_javascript_pack_tag("treeview") %>
1
2
  <% name ||= "" %>
2
3
  <% action ||= "" %>
3
4
  <% submit_button ||= "" %>
4
5
  <%= form_tag(action, method: :post) do %>
5
- <div id="treeview" initialPath="/var/log">
6
- <pre>{{ path }}</pre>
6
+ <div id="treeview">
7
+ <div class="card">
8
+ <pre class="card-body pb-0">{{ path }}</pre>
9
+ </div>
7
10
  <input type="hidden" name="<%= name %>" v-model="path" />
8
11
  <div class="dirs">
9
- <span v-repeat="currentDirs">
10
- <span v-if="$index > 0">
12
+ <span v-for="(dir, index) in currentDirs">
13
+ <span v-if="index > 0">
11
14
  <%= icon('fa-caret-right') %>
12
15
  </span>
13
- <span v-on="click: selectPath($value)" class="dir">{{ basename($value) }}</span>
16
+ <span v-on:click="selectPath(dir)" class="dir">{{ basename(dir) }}</span>
14
17
  </span>
15
18
  </div>
16
19
  <div class="tree">
17
- <span v-on="click: selectPath(path)" class="vue-path" v-class="selected: isSelected(path)" v-repeat="paths">
18
- <span v-if="is_dir"><%= icon("fa-folder") %></span>
19
- <span v-if="!is_dir"><%= icon("fa-file-o") %></span>
20
- {{ basename(path) }}
20
+ <span v-on:click="selectPath(value.path)" class="vue-path" v-bind:class="{ selected: isSelected(value.path) }" v-for="value in paths">
21
+ <span v-if="value.is_dir"><%= icon("fa-folder") %></span>
22
+ <span v-if="!value.is_dir"><%= icon("fa-file-o") %></span>
23
+ {{ basename(value.path) }}
21
24
  <br />
22
25
  </span>
23
26
  </div>
24
27
 
25
28
  <pre v-if="preview" class="preview">{{ preview }}</pre>
26
29
  <p>
27
- <%= submit_tag submit_button, class: "btn btn-lg btn-primary pull-right", "v-attr" => "disabled: selectedIsDir", "v-class" => "btn-disable: selectedIsDir" %>
30
+ <%= submit_tag submit_button, class: "btn btn-lg btn-primary float-right", "v-bind:disabled" => "selectedIsDir" %>
28
31
  </p>
29
32
  </div>
30
33
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <% page_title t(".page_title") %>
4
4
 
5
5
  <p class="clearfix">
6
- <%= link_to t('tutorials.chapter2.page_title') << " >>", tutorials_chapter2_path, class: "pull-right" %>
6
+ <%= link_to t('tutorials.chapter2.page_title') << " >>", tutorials_chapter2_path, class: "float-right" %>
7
7
  </p>
8
8
 
9
9
  <p>
@@ -14,7 +14,7 @@
14
14
  <div id="chapter1">
15
15
  <form>
16
16
  <p v-repeat="payloads">
17
- <input type="button" class="btn btn-default" v-on="click: sendRequest($data)" value="<%= t ".send" %>" />
17
+ <input type="button" class="btn btn-primary" v-on="click: sendRequest($data)" value="<%= t ".send" %>" />
18
18
  <code>
19
19
  $ curl -X POST http://localhost:<%= @in_http["port"] %>{{ path }} -F 'json={{ data | to_json }}'
20
20
  </code>
@@ -26,6 +26,5 @@
26
26
  <%= render partial: "shared/vue/fluent_log", locals: { fluentd: @fluentd } %>
27
27
 
28
28
  <p class="clearfix">
29
- <%= link_to t('tutorials.chapter2.page_title') << " >>", tutorials_chapter2_path, class: "pull-right" %>
29
+ <%= link_to t('tutorials.chapter2.page_title') << " >>", tutorials_chapter2_path, class: "float-right" %>
30
30
  </p>
31
-
@@ -2,11 +2,11 @@
2
2
 
3
3
  %p.clearfix
4
4
  = link_to "<< " << t('tutorials.chapter1.page_title'), tutorials_chapter1_path, class: "pull-left"
5
- = link_to t('tutorials.chapter3.page_title') << " >>", tutorials_chapter3_path, class: "pull-right"
5
+ = link_to t('tutorials.chapter3.page_title') << " >>", tutorials_chapter3_path, class: "float-right"
6
6
 
7
7
  :markdown
8
8
  #{t('.lesson_markdown', http_port: @in_http["port"])}
9
9
 
10
10
  %p.clearfix
11
11
  = link_to "<< " << t('tutorials.chapter1.page_title'), tutorials_chapter1_path, class: "pull-left"
12
- = link_to t('tutorials.chapter3.page_title') << " >>", tutorials_chapter3_path, class: "pull-right"
12
+ = link_to t('tutorials.chapter3.page_title') << " >>", tutorials_chapter3_path, class: "float-right"
@@ -2,11 +2,11 @@
2
2
 
3
3
  %p.clearfix
4
4
  = link_to "<< " << t('tutorials.chapter2.page_title'), tutorials_chapter2_path, class: "pull-left"
5
- = link_to t('tutorials.chapter4.page_title') << " >>", tutorials_chapter4_path, class: "pull-right"
5
+ = link_to t('tutorials.chapter4.page_title') << " >>", tutorials_chapter4_path, class: "float-right"
6
6
 
7
7
  :markdown
8
8
  #{t(".lesson_markdown", edit_config_url: edit_daemon_setting_path(@fluentd))}
9
9
 
10
10
  %p.clearfix
11
11
  = link_to "<< " << t('tutorials.chapter2.page_title'), tutorials_chapter2_path, class: "pull-left"
12
- = link_to t('tutorials.chapter4.page_title') << " >>", tutorials_chapter4_path, class: "pull-right"
12
+ = link_to t('tutorials.chapter4.page_title') << " >>", tutorials_chapter4_path, class: "float-right"
@@ -2,11 +2,11 @@
2
2
 
3
3
  %p.clearfix
4
4
  = link_to "<< " << t('tutorials.chapter3.page_title'), tutorials_chapter3_path, class: "pull-left"
5
- = link_to t('tutorials.chapter5.page_title') << " >>", tutorials_chapter5_path, class: "pull-right"
5
+ = link_to t('tutorials.chapter5.page_title') << " >>", tutorials_chapter5_path, class: "float-right"
6
6
 
7
7
  :markdown
8
8
  #{t ".lesson_markdown"}
9
9
 
10
10
  %p.clearfix
11
11
  = link_to "<< " << t('tutorials.chapter3.page_title'), tutorials_chapter3_path, class: "pull-left"
12
- = link_to t('tutorials.chapter5.page_title') << " >>", tutorials_chapter5_path, class: "pull-right"
12
+ = link_to t('tutorials.chapter5.page_title') << " >>", tutorials_chapter5_path, class: "float-right"
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- .col-xs-6
5
+ .col-xl-6.col-sm-6
6
6
  - if notice
7
7
  .alert.alert-success= notice
8
8
  - else
data/bin/bundle CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
3
  load Gem.bin_path('bundler', 'bundle')
data/bin/fluentd-ui CHANGED
@@ -7,6 +7,7 @@ dir = File.expand_path("../../", __FILE__)
7
7
  ENV["BUNDLE_GEMFILE"] ||= File.join(dir, "Gemfile.production")
8
8
  ENV["SECRET_KEY_BASE"] ||= SecureRandom.hex(64)
9
9
  ENV["RAILS_ENV"] ||= "production"
10
+ ENV["RAILS_SERVE_STATIC_FILES"] = "yes"
10
11
 
11
12
  require File.join(dir, "lib/fluentd-ui/command.rb")
12
13
 
data/bin/rails CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
3
  require_relative '../config/boot'
4
4
  require 'rails/commands'
data/bin/setup CHANGED
@@ -1,29 +1,28 @@
1
1
  #!/usr/bin/env ruby
2
- require 'pathname'
2
+ require 'fileutils'
3
+ include FileUtils
3
4
 
4
5
  # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+ APP_ROOT = File.expand_path('..', __dir__)
6
7
 
7
- Dir.chdir APP_ROOT do
8
- # This script is a starting point to setup your application.
9
- # Add necessary setup steps to this file:
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
10
11
 
11
- puts "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
12
+ chdir APP_ROOT do
13
+ # This script is a starting point to setup your application.
14
+ # Add necessary setup steps to this file.
14
15
 
15
- # puts "\n== Copying sample files =="
16
- # unless File.exist?("config/database.yml")
17
- # system "cp config/database.yml.sample config/database.yml"
18
- # end
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install --jobs=4 --retry=4')
19
19
 
20
- puts "\n== Preparing database =="
21
- system "bin/rake db:setup"
20
+ # Install JavaScript dependencies if using Yarn
21
+ system('bin/yarn')
22
22
 
23
23
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
24
+ system! 'bin/rails log:clear tmp:clear'
26
25
 
27
26
  puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
27
+ system! 'bin/rails restart'
29
28
  end
data/bin/update ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+ include FileUtils
4
+
5
+ # path to your application root.
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
11
+
12
+ chdir APP_ROOT do
13
+ # This script is a way to update your development environment automatically.
14
+ # Add necessary update steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ # Install JavaScript dependencies if using Yarn
21
+ # system('bin/yarn')
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system! 'bin/rails log:clear tmp:clear'
25
+
26
+ puts "\n== Restarting application server =="
27
+ system! 'bin/rails restart'
28
+ end
data/bin/webpack ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
+ ENV["NODE_ENV"] ||= "development"
5
+
6
+ require "pathname"
7
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8
+ Pathname.new(__FILE__).realpath)
9
+
10
+ require "rubygems"
11
+ require "bundler/setup"
12
+
13
+ require "webpacker"
14
+ require "webpacker/webpack_runner"
15
+ Webpacker::WebpackRunner.run(ARGV)
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
+ ENV["NODE_ENV"] ||= "development"
5
+
6
+ require "pathname"
7
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8
+ Pathname.new(__FILE__).realpath)
9
+
10
+ require "rubygems"
11
+ require "bundler/setup"
12
+
13
+ require "webpacker"
14
+ require "webpacker/dev_server_runner"
15
+ Webpacker::DevServerRunner.run(ARGV)
data/bin/yarn ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path('..', __dir__)
3
+ Dir.chdir(APP_ROOT) do
4
+ begin
5
+ exec "yarnpkg", *ARGV
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
@@ -1,10 +1,15 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
+ require "rails"
3
4
  # Pick the frameworks you want:
4
5
  require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ # require "active_record/railtie"
8
+ # require "active_storage/engine"
5
9
  require "action_controller/railtie"
6
10
  require "action_mailer/railtie"
7
11
  require "action_view/railtie"
12
+ # require "action_cable/engine"
8
13
  require "sprockets/railtie"
9
14
  # require "rails/test_unit/railtie"
10
15
 
@@ -12,21 +17,26 @@ require "sprockets/railtie"
12
17
  # you've limited to :test, :development, or :production.
13
18
  Bundler.require(*Rails.groups)
14
19
  # these gems are not required by Bundler.require
20
+ require "font-awesome-rails"
15
21
  require "draper"
16
22
  require "sass"
17
23
  require "haml-rails"
18
- require "jquery-rails"
19
24
  require "sucker_punch"
20
25
  require "settingslogic"
21
26
  require "kramdown-haml"
22
27
  require "jbuilder"
23
28
  require "diff/lcs"
29
+ require "webpacker"
24
30
 
25
31
  module FluentdUi
26
32
  class Application < Rails::Application
33
+ # Initialize configuration defaults for originally generated Rails version.
34
+ config.load_defaults 5.2
35
+
27
36
  # Settings in config/environments/* take precedence over those specified here.
28
- # Application configuration should go into files in config/initializers
29
- # -- all .rb files in that directory are automatically loaded.
37
+ # Application configuration can go into files in config/initializers
38
+ # -- all .rb files in that directory are automatically loaded after loading
39
+ # the framework and any gems in your application.
30
40
 
31
41
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
32
42
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
@@ -35,7 +45,10 @@ module FluentdUi
35
45
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
36
46
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
37
47
  config.i18n.default_locale = 'en'
38
- config.autoload_paths += %W(#{config.root}/app/workers #{config.root}/lib)
48
+ config.i18n.available_locales = %i(en ja)
49
+ config.autoload_paths += %W(#{config.root}/lib)
50
+
51
+ config.active_job.queue_adapter = :sucker_punch
39
52
 
40
53
  # NOTE: currently, fluentd-ui does not using ActiveRecord, and using Time.now instead of Time.zone.now for each different TZ for users.
41
54
  # If AR will be used, please comment in and check timezone.