fluentd-ui 1.0.0.alpha.3 → 1.0.0.beta.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +45 -0
  3. data/.travis.yml +17 -3
  4. data/Gemfile +2 -2
  5. data/Gemfile.lock +62 -63
  6. data/README.md +11 -0
  7. data/app/controllers/api/config_definitions_controller.rb +41 -17
  8. data/app/controllers/concerns/setting_concern.rb +0 -4
  9. data/app/controllers/fluentd/settings/in_tail_controller.rb +1 -1
  10. data/app/form_builders/fluentd_form_builder.rb +18 -6
  11. data/app/javascript/packs/application.js +20 -20
  12. data/app/javascript/packs/aws_credential.js +61 -0
  13. data/app/javascript/packs/codemirror.js +33 -37
  14. data/app/javascript/packs/config_field.js +93 -0
  15. data/app/javascript/packs/fluent_log.js +10 -9
  16. data/app/javascript/packs/in_tail_parse.js +77 -76
  17. data/app/javascript/packs/nested_settings.js +17 -16
  18. data/app/javascript/packs/notification.js +14 -14
  19. data/app/javascript/packs/out_forward_setting.js +14 -0
  20. data/app/javascript/packs/out_s3_setting.js +14 -0
  21. data/app/javascript/packs/owned_plugin_form.js +60 -57
  22. data/app/javascript/packs/parser_multiline_form.js +15 -14
  23. data/app/javascript/packs/plugin_setting.js +13 -13
  24. data/app/javascript/packs/settings.js +23 -18
  25. data/app/javascript/packs/transport_config.js +62 -0
  26. data/app/javascript/packs/transport_section.js +72 -0
  27. data/app/javascript/packs/treeview.js +11 -10
  28. data/app/models/concerns/fluentd/setting/configurable.rb +1 -3
  29. data/app/models/concerns/fluentd/setting/plugin.rb +29 -1
  30. data/app/models/concerns/fluentd/setting/plugin_config.rb +32 -8
  31. data/app/models/concerns/fluentd/setting/plugin_parameter.rb +74 -21
  32. data/app/models/concerns/fluentd/setting/registry_loader.rb +38 -0
  33. data/app/models/concerns/fluentd/setting/section_config.rb +52 -0
  34. data/app/models/concerns/fluentd/setting/section_parser.rb +25 -18
  35. data/app/models/fluentd/setting/in_forward.rb +29 -10
  36. data/app/models/fluentd/setting/in_syslog.rb +6 -6
  37. data/app/models/fluentd/setting/out_forward.rb +15 -3
  38. data/app/models/fluentd/setting/out_mongo.rb +0 -11
  39. data/app/models/fluentd/setting/out_s3.rb +17 -3
  40. data/app/models/fluentd/setting/out_tdlog.rb +3 -2
  41. data/app/models/fluentd/setting/section.rb +4 -0
  42. data/app/models/fluentd/setting/type/object.rb +17 -0
  43. data/app/views/fluentd/settings/in_forward/_form.html.haml +5 -3
  44. data/app/views/fluentd/settings/out_forward/_form.html.haml +18 -0
  45. data/app/views/fluentd/settings/out_s3/_form.html.haml +18 -0
  46. data/app/views/shared/settings/_form.html.haml +14 -10
  47. data/app/views/shared/settings/show.html.haml +2 -2
  48. data/app/views/shared/vue/_aws_credential.html.haml +22 -0
  49. data/app/views/shared/vue/_config_field.html.haml +49 -0
  50. data/app/views/shared/vue/_out_forward_setting.html.haml +13 -0
  51. data/app/views/shared/vue/_out_s3_setting.html.haml +19 -0
  52. data/app/views/shared/vue/_owned_plugin_form.html.haml +8 -48
  53. data/app/views/shared/vue/_transport_config.html.haml +20 -0
  54. data/app/views/shared/vue/_transport_section.html.haml +30 -0
  55. data/config/initializers/dig.rb +8 -0
  56. data/config/initializers/dummy_logger.rb +1 -0
  57. data/config/initializers/types.rb +2 -1
  58. data/config/locales/translation_ja.yml +2 -2
  59. data/fluentd-ui.gemspec +1 -0
  60. data/gemfiles/ruby2.2.gemfile +28 -0
  61. data/lib/dummy_logger.rb +13 -0
  62. data/lib/fluentd-ui/version.rb +1 -1
  63. data/package.json +5 -0
  64. data/spec/features/fluentd/setting/in_forward_spec.rb +1 -2
  65. data/spec/features/fluentd/setting/in_http_spec.rb +1 -2
  66. data/spec/features/fluentd/setting/in_monitor_agent_spec.rb +1 -2
  67. data/spec/features/fluentd/setting/out_forward_spec.rb +3 -5
  68. data/spec/features/fluentd/setting/out_stdout_spec.rb +1 -2
  69. data/spec/features/out_elasticsearch_spec.rb +3 -3
  70. data/spec/features/out_forward_spec.rb +6 -5
  71. data/spec/features/out_tdlog_spec.rb +3 -2
  72. data/spec/features/shared_examples/configurable_daemon_settings.rb +2 -2
  73. data/spec/features/source_and_output_spec.rb +2 -0
  74. data/spec/models/fluentd/setting/in_forward_spec.rb +65 -9
  75. data/spec/models/fluentd/setting/in_syslog_spec.rb +12 -7
  76. data/spec/models/fluentd/setting/in_tail_spec.rb +6 -0
  77. data/spec/models/fluentd/setting/out_mongo_spec.rb +2 -3
  78. data/spec/models/fluentd/setting/out_tdlog_spec.rb +1 -2
  79. data/spec/spec_helper.rb +5 -0
  80. data/yarn.lock +466 -12
  81. metadata +90 -39
  82. data/app/helpers/settings_helper.rb +0 -144
  83. data/app/models/concerns/fluentd/setting/section_validator.rb +0 -21
  84. data/app/views/fluentd/settings/_form.html.haml +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 371bb07d552eafadfce633dfec5adb819f3035e0d1c2f741a02935aacc5224ab
4
- data.tar.gz: 62b220afde0c306b9d86ecddf71cefe85afe2008e4b08a80ab8fc01166002272
3
+ metadata.gz: 794ea2baa6fe49cd78dd3feb08d53b274ec5170e540c608cfb43884763b01d75
4
+ data.tar.gz: b6acf734d3d4a58ac825dcb4c573feb26673fc9675665ed38549634502345e47
5
5
  SHA512:
6
- metadata.gz: 834685ca65b72e54d287fdbcd74abed5df9b2d856c04126364de5e4714597e3f099bec3d38cd933496c15e7cbaac3b1271760a5c6070be1afebb2814c1a5a94c
7
- data.tar.gz: 9880d835ba57727cb5a10816e49cae0e4854062fe88cde847231ca630f73eab3232238925e8e457ae610d11c306ab1bc55369a4106236febf1bbf2d873bdd984
6
+ metadata.gz: 47d4631642d6a1f2ed3767ba849d6eb32bf0f50e6efda00d29ff2cc93567e53f177fa32134c7786b99f7be5bea9f60c67f7d154913b23b3b7ba6e29899a7b76f
7
+ data.tar.gz: 85691402c89fac3710a69c735f0ee8c54e1130740141499e3d676dec49fc8f9e924a66446bac19d6d4580ec55b0503c3ca5424dc765ea03d3c5486ad5314b0de
@@ -0,0 +1,45 @@
1
+ module.exports = {
2
+ "env": {
3
+ "browser": true,
4
+ "es6": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:vue/recommended"
9
+ ],
10
+ "parserOptions": {
11
+ "ecmaVersion": 2017,
12
+ "sourceType": "module"
13
+ },
14
+ "globals": {
15
+ "$": true,
16
+ "Rails": true,
17
+ "Vue": true
18
+ },
19
+ "rules": {
20
+ "indent": [
21
+ "error",
22
+ 2
23
+ ],
24
+ "linebreak-style": [
25
+ "error",
26
+ "unix"
27
+ ],
28
+ "quotes": [
29
+ "error",
30
+ "double"
31
+ ],
32
+ "semi": [
33
+ "error",
34
+ "always"
35
+ ],
36
+ "no-console": [
37
+ "off"
38
+ ],
39
+ "no-unused-vars": [
40
+ "off", {
41
+ "argsIgnorePattern": "^_"
42
+ }
43
+ ]
44
+ }
45
+ };
@@ -12,14 +12,28 @@ rvm:
12
12
  - 2.3.7
13
13
  - 2.2.10
14
14
 
15
+ gemfile:
16
+ - Gemfile
17
+ - gemfiles/ruby2.2.gemfile
18
+
19
+ matrix:
20
+ exclude:
21
+ - rvm: 2.2.10
22
+ gemfile: Gemfile
23
+ - rvm: 2.5.1
24
+ gemfile: gemfiles/ruby2.2.gemfile
25
+ - rvm: 2.4.4
26
+ gemfile: gemfiles/ruby2.2.gemfile
27
+ - rvm: 2.3.7
28
+ gemfile: gemfiles/ruby2.2.gemfile
29
+
15
30
  before_install:
16
31
  - google-chrome-stable --version
17
32
  - wget http://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
18
33
  - unzip chromedriver_linux64.zip
19
34
  - sudo mv chromedriver /usr/local/bin/chromedriver
35
+ - sudo sh -c 'curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent3.sh | sh'
36
+ - nvm install 10
20
37
 
21
38
  install:
22
- - bundle -v
23
- - gem i bundler
24
- - sudo sh -c 'curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent2.sh | sh'
25
39
  - bin/setup
data/Gemfile CHANGED
@@ -21,10 +21,10 @@ end
21
21
 
22
22
  group :test do
23
23
  gem "factory_bot_rails"
24
- gem "capybara", "~> 3.0.2"
24
+ gem "capybara", "~> 3.3.1"
25
25
  gem "capybara-screenshot"
26
26
  gem "simplecov", "~> 0.16.1", require: false
27
27
  gem "webmock", "~> 3.3.0"
28
28
  gem "timecop"
29
- gem "selenium-webdriver", "~> 3.11"
29
+ gem "selenium-webdriver", "~> 3.12.0"
30
30
  end
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluentd-ui (1.0.0.alpha.3)
4
+ fluentd-ui (1.0.0.beta.1)
5
5
  addressable
6
6
  bootsnap (>= 1.1.0)
7
7
  bundler
8
8
  diff-lcs
9
+ dig_rb (~> 1.0.0)
9
10
  draper (~> 3.0)
10
11
  fluent-plugin-elasticsearch (~> 2.10)
11
12
  fluent-plugin-mongo (~> 1.1)
@@ -78,48 +79,48 @@ GEM
78
79
  addressable (2.5.2)
79
80
  public_suffix (>= 2.0.2, < 4.0)
80
81
  arel (9.0.0)
81
- aws-eventstream (1.0.0)
82
- aws-partitions (1.87.0)
83
- aws-sdk-core (3.21.2)
82
+ aws-eventstream (1.0.1)
83
+ aws-partitions (1.96.0)
84
+ aws-sdk-core (3.22.1)
84
85
  aws-eventstream (~> 1.0)
85
86
  aws-partitions (~> 1.0)
86
87
  aws-sigv4 (~> 1.0)
87
88
  jmespath (~> 1.0)
88
- aws-sdk-kms (1.5.0)
89
+ aws-sdk-kms (1.6.0)
89
90
  aws-sdk-core (~> 3)
90
91
  aws-sigv4 (~> 1.0)
91
- aws-sdk-s3 (1.13.0)
92
+ aws-sdk-s3 (1.17.0)
92
93
  aws-sdk-core (~> 3, >= 3.21.2)
93
94
  aws-sdk-kms (~> 1)
94
95
  aws-sigv4 (~> 1.0)
95
- aws-sdk-sqs (1.3.0)
96
+ aws-sdk-sqs (1.4.0)
96
97
  aws-sdk-core (~> 3)
97
98
  aws-sigv4 (~> 1.0)
98
- aws-sigv4 (1.0.2)
99
- better_errors (2.1.1)
99
+ aws-sigv4 (1.0.3)
100
+ better_errors (2.4.0)
100
101
  coderay (>= 1.0.0)
101
- erubis (>= 2.6.6)
102
+ erubi (>= 1.0.0)
102
103
  rack (>= 0.9.0)
103
104
  bindex (0.5.0)
104
105
  binding_of_caller (0.8.0)
105
106
  debug_inspector (>= 0.0.1)
106
- bootsnap (1.3.0)
107
+ bootsnap (1.3.1)
107
108
  msgpack (~> 1.0)
108
109
  bson (4.3.0)
109
110
  builder (3.2.3)
110
- capybara (3.0.2)
111
+ capybara (3.3.1)
111
112
  addressable
112
113
  mini_mime (>= 0.1.3)
113
114
  nokogiri (~> 1.8)
114
115
  rack (>= 1.6.0)
115
116
  rack-test (>= 0.6.3)
116
- xpath (~> 3.0)
117
- capybara-screenshot (1.0.19)
117
+ xpath (~> 3.1)
118
+ capybara-screenshot (1.0.21)
118
119
  capybara (>= 1.0, < 4)
119
120
  launchy
120
121
  childprocess (0.9.0)
121
122
  ffi (~> 1.0, >= 1.0.11)
122
- coderay (1.1.1)
123
+ coderay (1.1.2)
123
124
  concurrent-ruby (1.0.5)
124
125
  cool.io (1.5.3)
125
126
  crack (0.4.3)
@@ -128,39 +129,39 @@ GEM
128
129
  debug_inspector (0.0.3)
129
130
  diff-lcs (1.3)
130
131
  dig_rb (1.0.1)
131
- docile (1.3.0)
132
+ docile (1.3.1)
132
133
  draper (3.0.1)
133
134
  actionpack (~> 5.0)
134
135
  activemodel (~> 5.0)
135
136
  activemodel-serializers-xml (~> 1.0)
136
137
  activesupport (~> 5.0)
137
138
  request_store (~> 1.0)
138
- elasticsearch (6.0.2)
139
- elasticsearch-api (= 6.0.2)
140
- elasticsearch-transport (= 6.0.2)
141
- elasticsearch-api (6.0.2)
139
+ elasticsearch (6.1.0)
140
+ elasticsearch-api (= 6.1.0)
141
+ elasticsearch-transport (= 6.1.0)
142
+ elasticsearch-api (6.1.0)
142
143
  multi_json
143
- elasticsearch-transport (6.0.2)
144
+ elasticsearch-transport (6.1.0)
144
145
  faraday
145
146
  multi_json
146
147
  erubi (1.7.1)
147
148
  erubis (2.7.0)
148
149
  excon (0.62.0)
149
- factory_bot (4.8.2)
150
+ factory_bot (4.10.0)
150
151
  activesupport (>= 3.0.0)
151
- factory_bot_rails (4.8.2)
152
- factory_bot (~> 4.8.2)
152
+ factory_bot_rails (4.10.0)
153
+ factory_bot (~> 4.10.0)
153
154
  railties (>= 3.0.0)
154
155
  faraday (0.15.2)
155
156
  multipart-post (>= 1.2, < 3)
156
- ffi (1.9.23)
157
- fluent-plugin-elasticsearch (2.10.1)
157
+ ffi (1.9.25)
158
+ fluent-plugin-elasticsearch (2.11.1)
158
159
  elasticsearch
159
160
  excon
160
161
  fluentd (>= 0.14.20)
161
- fluent-plugin-mongo (1.1.1)
162
+ fluent-plugin-mongo (1.1.2)
162
163
  fluentd (>= 0.14.12, < 2)
163
- mongo (~> 2.2.0)
164
+ mongo (~> 2.6.0)
164
165
  fluent-plugin-s3 (1.1.3)
165
166
  aws-sdk-s3 (~> 1.0)
166
167
  aws-sdk-sqs (~> 1.0)
@@ -168,7 +169,7 @@ GEM
168
169
  fluent-plugin-td (1.0.0)
169
170
  fluentd (>= 0.14.13, < 2)
170
171
  td-client (~> 1.0)
171
- fluentd (1.2.1)
172
+ fluentd (1.2.3)
172
173
  cool.io (>= 1.4.5, < 2.0.0)
173
174
  dig_rb (~> 1.0.0)
174
175
  http_parser.rb (>= 0.5.1, < 0.7.0)
@@ -209,7 +210,7 @@ GEM
209
210
  multi_json (>= 1.2)
210
211
  jmespath (1.4.0)
211
212
  json (2.1.0)
212
- kramdown (1.16.2)
213
+ kramdown (1.17.0)
213
214
  kramdown-haml (0.0.3)
214
215
  haml
215
216
  launchy (2.4.3)
@@ -225,28 +226,27 @@ GEM
225
226
  mini_mime (>= 0.1.1)
226
227
  marcel (0.3.2)
227
228
  mimemagic (~> 0.3.2)
228
- method_source (0.8.2)
229
+ method_source (0.9.0)
229
230
  mimemagic (0.3.2)
230
231
  mini_mime (1.0.0)
231
232
  mini_portile2 (2.3.0)
232
233
  minitest (5.11.3)
233
- mongo (2.2.7)
234
- bson (~> 4.0)
234
+ mongo (2.6.1)
235
+ bson (>= 4.3.0, < 5.0.0)
235
236
  msgpack (1.2.4)
236
237
  multi_json (1.13.1)
237
238
  multipart-post (2.0.0)
238
- nio4r (2.3.0)
239
- nokogiri (1.8.2)
239
+ nio4r (2.3.1)
240
+ nokogiri (1.8.4)
240
241
  mini_portile2 (~> 2.3.0)
241
- pry (0.10.4)
242
+ pry (0.11.3)
242
243
  coderay (~> 1.1.0)
243
- method_source (~> 0.8.1)
244
- slop (~> 3.4)
244
+ method_source (~> 0.9.0)
245
245
  pry-rails (0.3.6)
246
246
  pry (>= 0.10.4)
247
247
  public_suffix (3.0.2)
248
- puma (3.11.4)
249
- rack (2.0.4)
248
+ puma (3.12.0)
249
+ rack (2.0.5)
250
250
  rack-proxy (0.6.4)
251
251
  rack
252
252
  rack-test (1.0.0)
@@ -281,29 +281,29 @@ GEM
281
281
  ffi (>= 0.5.0, < 2)
282
282
  request_store (1.4.1)
283
283
  rack (>= 1.4)
284
- rspec-core (3.5.4)
285
- rspec-support (~> 3.5.0)
286
- rspec-expectations (3.5.0)
284
+ rspec-core (3.7.1)
285
+ rspec-support (~> 3.7.0)
286
+ rspec-expectations (3.7.0)
287
287
  diff-lcs (>= 1.2.0, < 2.0)
288
- rspec-support (~> 3.5.0)
289
- rspec-mocks (3.5.0)
288
+ rspec-support (~> 3.7.0)
289
+ rspec-mocks (3.7.0)
290
290
  diff-lcs (>= 1.2.0, < 2.0)
291
- rspec-support (~> 3.5.0)
292
- rspec-rails (3.5.2)
291
+ rspec-support (~> 3.7.0)
292
+ rspec-rails (3.7.2)
293
293
  actionpack (>= 3.0)
294
294
  activesupport (>= 3.0)
295
295
  railties (>= 3.0)
296
- rspec-core (~> 3.5.0)
297
- rspec-expectations (~> 3.5.0)
298
- rspec-mocks (~> 3.5.0)
299
- rspec-support (~> 3.5.0)
300
- rspec-support (3.5.0)
296
+ rspec-core (~> 3.7.0)
297
+ rspec-expectations (~> 3.7.0)
298
+ rspec-mocks (~> 3.7.0)
299
+ rspec-support (~> 3.7.0)
300
+ rspec-support (3.7.1)
301
301
  ruby_dep (1.5.0)
302
302
  ruby_parser (3.11.0)
303
303
  sexp_processor (~> 4.9)
304
304
  rubyzip (1.2.1)
305
305
  safe_yaml (1.0.4)
306
- sass (3.5.6)
306
+ sass (3.5.7)
307
307
  sass-listen (~> 4.0.0)
308
308
  sass-listen (4.0.0)
309
309
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -314,10 +314,10 @@ GEM
314
314
  sprockets (>= 2.8, < 4.0)
315
315
  sprockets-rails (>= 2.0, < 4.0)
316
316
  tilt (>= 1.1, < 3)
317
- selenium-webdriver (3.11.0)
317
+ selenium-webdriver (3.12.0)
318
318
  childprocess (~> 0.5)
319
319
  rubyzip (~> 1.2)
320
- serverengine (2.0.6)
320
+ serverengine (2.0.7)
321
321
  sigdump (~> 0.2.2)
322
322
  settingslogic (2.0.9)
323
323
  sexp_processor (4.11.0)
@@ -327,8 +327,7 @@ GEM
327
327
  json (>= 1.8, < 3)
328
328
  simplecov-html (~> 0.10.0)
329
329
  simplecov-html (0.10.2)
330
- slop (3.6.0)
331
- sprockets (3.7.1)
330
+ sprockets (3.7.2)
332
331
  concurrent-ruby (~> 1.0)
333
332
  rack (> 1, < 3)
334
333
  sprockets-rails (3.2.1)
@@ -345,12 +344,12 @@ GEM
345
344
  thor (0.20.0)
346
345
  thread_safe (0.3.6)
347
346
  tilt (2.0.8)
348
- timecop (0.8.1)
347
+ timecop (0.9.1)
349
348
  tzinfo (1.2.5)
350
349
  thread_safe (~> 0.1)
351
350
  tzinfo-data (1.2018.5)
352
351
  tzinfo (>= 1.0.0)
353
- web-console (3.6.0)
352
+ web-console (3.6.2)
354
353
  actionview (>= 5.0)
355
354
  activemodel (>= 5.0)
356
355
  bindex (>= 0.4.0)
@@ -359,14 +358,14 @@ GEM
359
358
  addressable (>= 2.3.6)
360
359
  crack (>= 0.3.2)
361
360
  hashdiff
362
- webpacker (3.5.3)
361
+ webpacker (3.5.5)
363
362
  activesupport (>= 4.2)
364
363
  rack-proxy (>= 0.6.1)
365
364
  railties (>= 4.2)
366
365
  websocket-driver (0.7.0)
367
366
  websocket-extensions (>= 0.1.0)
368
367
  websocket-extensions (0.1.3)
369
- xpath (3.0.0)
368
+ xpath (3.1.0)
370
369
  nokogiri (~> 1.8)
371
370
  yajl-ruby (1.4.0)
372
371
 
@@ -376,7 +375,7 @@ PLATFORMS
376
375
  DEPENDENCIES
377
376
  better_errors
378
377
  binding_of_caller
379
- capybara (~> 3.0.2)
378
+ capybara (~> 3.3.1)
380
379
  capybara-screenshot
381
380
  factory_bot_rails
382
381
  fluentd-ui!
@@ -386,7 +385,7 @@ DEPENDENCIES
386
385
  pry-rails
387
386
  rake
388
387
  rspec-rails (~> 3.0)
389
- selenium-webdriver (~> 3.11)
388
+ selenium-webdriver (~> 3.12.0)
390
389
  simplecov (~> 0.16.1)
391
390
  timecop
392
391
  web-console (~> 3.6)
data/README.md CHANGED
@@ -28,6 +28,14 @@ And some additional packages (Debian / Ubuntu)
28
28
  - libxslt1-dev
29
29
  - ruby-dev
30
30
 
31
+ ## How to install and run
32
+
33
+ $ gem install fluentd-ui
34
+ $ fluentd-ui setup
35
+ $ fluentd-ui start --daemonize
36
+
37
+ Access http://localhost:9292 by web browser.
38
+
31
39
  ## Development
32
40
 
33
41
  $ git clone https://github.com/fluent/fluentd-ui
@@ -47,6 +55,9 @@ NOTE: `chromedriver` executable binary should be located under your `$PATH`.
47
55
 
48
56
  ## Building fluentd-ui.gem
49
57
 
58
+ # Clear tmp/, public/assets and public/packs
59
+ $ bin/rails tmp:clear assets:clobber && touch tmp/.gitkeep
60
+
50
61
  # Generate pre-compiled assets
51
62
  $ RAILS_ENV=production bin/rails assets:precompile
52
63
 
@@ -22,18 +22,50 @@ class Api::ConfigDefinitionsController < ApplicationController
22
22
  target_class = Fluentd::Setting.const_get("#{prefix}_#{name}".classify)
23
23
  target = target_class.new
24
24
 
25
- common_options = target.common_options.map do |key|
26
- h = {
27
- name: key,
28
- type: target.column_type(key),
29
- desc: target.desc(key),
30
- default: target.default(key)
25
+ common_options = build_options(target, target.common_options)
26
+ advanced_options = build_options(target, target.advanced_options)
27
+
28
+ options = {
29
+ type: type,
30
+ name: name,
31
+ commonOptions: common_options,
32
+ advancedOptions: advanced_options
33
+ }
34
+
35
+ if type == "input" && ["forward", "syslog"].include?(name)
36
+ transport = target.class._sections[:transport]
37
+ transport_common_options = build_options(transport, target.transport_common_options)
38
+ transport_advanced_options = build_options(transport, target.transport_advanced_options)
39
+ options[:transport] = {
40
+ commonOptions: transport_common_options,
41
+ advancedOptions: transport_advanced_options
31
42
  }
32
- h[:list] = target.list_of(key) if target.column_type(key) == :enum
33
- h
34
43
  end
35
44
 
36
- advanced_options = target.advanced_options.map do |key|
45
+ if type == "output" && name == "forward"
46
+ tls_options = build_options(target, target.tls_options)
47
+ options[:tlsOptions] = tls_options
48
+ end
49
+
50
+ if target.respond_to?(:aws_credential_options)
51
+ aws_credential_options = build_options(target, target.aws_credential_options)
52
+ options[:awsCredentialOptions] = {
53
+ simple: aws_credential_options
54
+ }
55
+ target.aws_credential_sections.each do |key|
56
+ section = target._sections[key]
57
+ new_key = key.to_s.camelize(:lower).to_sym
58
+ options[:awsCredentialOptions][new_key] = build_options(section, section._types.keys)
59
+ end
60
+ end
61
+
62
+ render json: options
63
+ end
64
+
65
+ private
66
+
67
+ def build_options(target, keys)
68
+ keys.map do |key|
37
69
  h = {
38
70
  name: key,
39
71
  type: target.column_type(key),
@@ -43,13 +75,5 @@ class Api::ConfigDefinitionsController < ApplicationController
43
75
  h[:list] = target.list_of(key) if target.column_type(key) == :enum
44
76
  h
45
77
  end
46
-
47
- options = {
48
- type: type,
49
- name: name,
50
- commonOptions: common_options,
51
- advancedOptions: advanced_options
52
- }
53
- render json: options
54
78
  end
55
79
  end