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.
- checksums.yaml +4 -4
- data/.eslintrc.js +45 -0
- data/.travis.yml +17 -3
- data/Gemfile +2 -2
- data/Gemfile.lock +62 -63
- data/README.md +11 -0
- data/app/controllers/api/config_definitions_controller.rb +41 -17
- data/app/controllers/concerns/setting_concern.rb +0 -4
- data/app/controllers/fluentd/settings/in_tail_controller.rb +1 -1
- data/app/form_builders/fluentd_form_builder.rb +18 -6
- data/app/javascript/packs/application.js +20 -20
- data/app/javascript/packs/aws_credential.js +61 -0
- data/app/javascript/packs/codemirror.js +33 -37
- data/app/javascript/packs/config_field.js +93 -0
- data/app/javascript/packs/fluent_log.js +10 -9
- data/app/javascript/packs/in_tail_parse.js +77 -76
- data/app/javascript/packs/nested_settings.js +17 -16
- data/app/javascript/packs/notification.js +14 -14
- data/app/javascript/packs/out_forward_setting.js +14 -0
- data/app/javascript/packs/out_s3_setting.js +14 -0
- data/app/javascript/packs/owned_plugin_form.js +60 -57
- data/app/javascript/packs/parser_multiline_form.js +15 -14
- data/app/javascript/packs/plugin_setting.js +13 -13
- data/app/javascript/packs/settings.js +23 -18
- data/app/javascript/packs/transport_config.js +62 -0
- data/app/javascript/packs/transport_section.js +72 -0
- data/app/javascript/packs/treeview.js +11 -10
- data/app/models/concerns/fluentd/setting/configurable.rb +1 -3
- data/app/models/concerns/fluentd/setting/plugin.rb +29 -1
- data/app/models/concerns/fluentd/setting/plugin_config.rb +32 -8
- data/app/models/concerns/fluentd/setting/plugin_parameter.rb +74 -21
- data/app/models/concerns/fluentd/setting/registry_loader.rb +38 -0
- data/app/models/concerns/fluentd/setting/section_config.rb +52 -0
- data/app/models/concerns/fluentd/setting/section_parser.rb +25 -18
- data/app/models/fluentd/setting/in_forward.rb +29 -10
- data/app/models/fluentd/setting/in_syslog.rb +6 -6
- data/app/models/fluentd/setting/out_forward.rb +15 -3
- data/app/models/fluentd/setting/out_mongo.rb +0 -11
- data/app/models/fluentd/setting/out_s3.rb +17 -3
- data/app/models/fluentd/setting/out_tdlog.rb +3 -2
- data/app/models/fluentd/setting/section.rb +4 -0
- data/app/models/fluentd/setting/type/object.rb +17 -0
- data/app/views/fluentd/settings/in_forward/_form.html.haml +5 -3
- data/app/views/fluentd/settings/out_forward/_form.html.haml +18 -0
- data/app/views/fluentd/settings/out_s3/_form.html.haml +18 -0
- data/app/views/shared/settings/_form.html.haml +14 -10
- data/app/views/shared/settings/show.html.haml +2 -2
- data/app/views/shared/vue/_aws_credential.html.haml +22 -0
- data/app/views/shared/vue/_config_field.html.haml +49 -0
- data/app/views/shared/vue/_out_forward_setting.html.haml +13 -0
- data/app/views/shared/vue/_out_s3_setting.html.haml +19 -0
- data/app/views/shared/vue/_owned_plugin_form.html.haml +8 -48
- data/app/views/shared/vue/_transport_config.html.haml +20 -0
- data/app/views/shared/vue/_transport_section.html.haml +30 -0
- data/config/initializers/dig.rb +8 -0
- data/config/initializers/dummy_logger.rb +1 -0
- data/config/initializers/types.rb +2 -1
- data/config/locales/translation_ja.yml +2 -2
- data/fluentd-ui.gemspec +1 -0
- data/gemfiles/ruby2.2.gemfile +28 -0
- data/lib/dummy_logger.rb +13 -0
- data/lib/fluentd-ui/version.rb +1 -1
- data/package.json +5 -0
- data/spec/features/fluentd/setting/in_forward_spec.rb +1 -2
- data/spec/features/fluentd/setting/in_http_spec.rb +1 -2
- data/spec/features/fluentd/setting/in_monitor_agent_spec.rb +1 -2
- data/spec/features/fluentd/setting/out_forward_spec.rb +3 -5
- data/spec/features/fluentd/setting/out_stdout_spec.rb +1 -2
- data/spec/features/out_elasticsearch_spec.rb +3 -3
- data/spec/features/out_forward_spec.rb +6 -5
- data/spec/features/out_tdlog_spec.rb +3 -2
- data/spec/features/shared_examples/configurable_daemon_settings.rb +2 -2
- data/spec/features/source_and_output_spec.rb +2 -0
- data/spec/models/fluentd/setting/in_forward_spec.rb +65 -9
- data/spec/models/fluentd/setting/in_syslog_spec.rb +12 -7
- data/spec/models/fluentd/setting/in_tail_spec.rb +6 -0
- data/spec/models/fluentd/setting/out_mongo_spec.rb +2 -3
- data/spec/models/fluentd/setting/out_tdlog_spec.rb +1 -2
- data/spec/spec_helper.rb +5 -0
- data/yarn.lock +466 -12
- metadata +90 -39
- data/app/helpers/settings_helper.rb +0 -144
- data/app/models/concerns/fluentd/setting/section_validator.rb +0 -21
- data/app/views/fluentd/settings/_form.html.haml +0 -43
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nakagawa
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
@@ -45,6 +45,20 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 5.2.0
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: dig_rb
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.0
|
48
62
|
- !ruby/object:Gem::Dependency
|
49
63
|
name: bootsnap
|
50
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -364,6 +378,7 @@ extra_rdoc_files: []
|
|
364
378
|
files:
|
365
379
|
- ".babelrc"
|
366
380
|
- ".editorconfig"
|
381
|
+
- ".eslintrc.js"
|
367
382
|
- ".gitignore"
|
368
383
|
- ".postcssrc.yml"
|
369
384
|
- ".rspec"
|
@@ -414,17 +429,22 @@ files:
|
|
414
429
|
- app/decorators/plugin_decorator.rb
|
415
430
|
- app/form_builders/fluentd_form_builder.rb
|
416
431
|
- app/helpers/application_helper.rb
|
417
|
-
- app/helpers/settings_helper.rb
|
418
432
|
- app/javascript/packs/application.js
|
433
|
+
- app/javascript/packs/aws_credential.js
|
419
434
|
- app/javascript/packs/codemirror.js
|
435
|
+
- app/javascript/packs/config_field.js
|
420
436
|
- app/javascript/packs/fluent_log.js
|
421
437
|
- app/javascript/packs/in_tail_parse.js
|
422
438
|
- app/javascript/packs/nested_settings.js
|
423
439
|
- app/javascript/packs/notification.js
|
440
|
+
- app/javascript/packs/out_forward_setting.js
|
441
|
+
- app/javascript/packs/out_s3_setting.js
|
424
442
|
- app/javascript/packs/owned_plugin_form.js
|
425
443
|
- app/javascript/packs/parser_multiline_form.js
|
426
444
|
- app/javascript/packs/plugin_setting.js
|
427
445
|
- app/javascript/packs/settings.js
|
446
|
+
- app/javascript/packs/transport_config.js
|
447
|
+
- app/javascript/packs/transport_section.js
|
428
448
|
- app/javascript/packs/treeview.js
|
429
449
|
- app/javascript/stylesheets/application.scss
|
430
450
|
- app/jobs/all_plugin_check_update_job.rb
|
@@ -442,8 +462,9 @@ files:
|
|
442
462
|
- app/models/concerns/fluentd/setting/plugin.rb
|
443
463
|
- app/models/concerns/fluentd/setting/plugin_config.rb
|
444
464
|
- app/models/concerns/fluentd/setting/plugin_parameter.rb
|
465
|
+
- app/models/concerns/fluentd/setting/registry_loader.rb
|
466
|
+
- app/models/concerns/fluentd/setting/section_config.rb
|
445
467
|
- app/models/concerns/fluentd/setting/section_parser.rb
|
446
|
-
- app/models/concerns/fluentd/setting/section_validator.rb
|
447
468
|
- app/models/concerns/fluentd/setting_archive/archivable.rb
|
448
469
|
- app/models/fluent_gem.rb
|
449
470
|
- app/models/fluentd.rb
|
@@ -499,6 +520,7 @@ files:
|
|
499
520
|
- app/models/fluentd/setting/type/bool.rb
|
500
521
|
- app/models/fluentd/setting/type/enum.rb
|
501
522
|
- app/models/fluentd/setting/type/hash.rb
|
523
|
+
- app/models/fluentd/setting/type/object.rb
|
502
524
|
- app/models/fluentd/setting/type/regexp.rb
|
503
525
|
- app/models/fluentd/setting/type/section.rb
|
504
526
|
- app/models/fluentd/setting/type/size.rb
|
@@ -517,7 +539,6 @@ files:
|
|
517
539
|
- app/views/fluentd/errors.html.haml
|
518
540
|
- app/views/fluentd/log.html.haml
|
519
541
|
- app/views/fluentd/new.html.haml
|
520
|
-
- app/views/fluentd/settings/_form.html.haml
|
521
542
|
- app/views/fluentd/settings/edit.html.haml
|
522
543
|
- app/views/fluentd/settings/histories/_list.html.haml
|
523
544
|
- app/views/fluentd/settings/histories/index.html.haml
|
@@ -528,6 +549,8 @@ files:
|
|
528
549
|
- app/views/fluentd/settings/in_tail/after_format.html.haml
|
529
550
|
- app/views/fluentd/settings/in_tail/confirm.html.haml
|
530
551
|
- app/views/fluentd/settings/in_tail/show.html.haml
|
552
|
+
- app/views/fluentd/settings/out_forward/_form.html.haml
|
553
|
+
- app/views/fluentd/settings/out_s3/_form.html.haml
|
531
554
|
- app/views/fluentd/settings/running_backup/show.html.haml
|
532
555
|
- app/views/fluentd/settings/show.html.haml
|
533
556
|
- app/views/fluentd/settings/source_and_output.html.haml
|
@@ -550,12 +573,18 @@ files:
|
|
550
573
|
- app/views/shared/settings/_diff.html.erb
|
551
574
|
- app/views/shared/settings/_form.html.haml
|
552
575
|
- app/views/shared/settings/show.html.haml
|
576
|
+
- app/views/shared/vue/_aws_credential.html.haml
|
577
|
+
- app/views/shared/vue/_config_field.html.haml
|
553
578
|
- app/views/shared/vue/_fluent_log.html.erb
|
554
579
|
- app/views/shared/vue/_in_tail_parse.html.haml
|
555
580
|
- app/views/shared/vue/_notification.html.erb
|
581
|
+
- app/views/shared/vue/_out_forward_setting.html.haml
|
582
|
+
- app/views/shared/vue/_out_s3_setting.html.haml
|
556
583
|
- app/views/shared/vue/_owned_plugin_form.html.haml
|
557
584
|
- app/views/shared/vue/_parser_multiline_form.html.haml
|
558
585
|
- app/views/shared/vue/_setting.html.erb
|
586
|
+
- app/views/shared/vue/_transport_config.html.haml
|
587
|
+
- app/views/shared/vue/_transport_section.html.haml
|
559
588
|
- app/views/shared/vue/_treeview.html.erb
|
560
589
|
- app/views/tutorials/chapter1.html.erb
|
561
590
|
- app/views/tutorials/chapter2.html.haml
|
@@ -588,6 +617,8 @@ files:
|
|
588
617
|
- config/initializers/backtrace_silencers.rb
|
589
618
|
- config/initializers/content_security_policy.rb
|
590
619
|
- config/initializers/cookies_serializer.rb
|
620
|
+
- config/initializers/dig.rb
|
621
|
+
- config/initializers/dummy_logger.rb
|
591
622
|
- config/initializers/filter_parameter_logging.rb
|
592
623
|
- config/initializers/fluentd_ui_update_check.rb
|
593
624
|
- config/initializers/inflections.rb
|
@@ -624,7 +655,9 @@ files:
|
|
624
655
|
- docs/screenshots/plugin.gif
|
625
656
|
- docs/screenshots/setting.gif
|
626
657
|
- fluentd-ui.gemspec
|
658
|
+
- gemfiles/ruby2.2.gemfile
|
627
659
|
- lib/assets/.keep
|
660
|
+
- lib/dummy_logger.rb
|
628
661
|
- lib/file_reverse_reader.rb
|
629
662
|
- lib/fluentd-ui.rb
|
630
663
|
- lib/fluentd-ui/command.rb
|
@@ -643,7 +676,7 @@ files:
|
|
643
676
|
- public/404.html
|
644
677
|
- public/422.html
|
645
678
|
- public/500.html
|
646
|
-
- public/assets/.sprockets-manifest-
|
679
|
+
- public/assets/.sprockets-manifest-d4bcbf913b3d249ea8bf167d3e16dd5c.json
|
647
680
|
- public/assets/application-db8ee881ff43fff5b8f3a6c96c92c2c62428cc6340162b5fde8d0cbf80c03d2f.css
|
648
681
|
- public/assets/application-db8ee881ff43fff5b8f3a6c96c92c2c62428cc6340162b5fde8d0cbf80c03d2f.css.gz
|
649
682
|
- public/assets/fontawesome-webfont-2adefcbc041e7d18fcf2d417879dc5a09997aa64d675b7a3c4b6ce33da13f3fe.woff2
|
@@ -658,43 +691,61 @@ files:
|
|
658
691
|
- public/fluentd-logo-right-text.png
|
659
692
|
- public/fluentd-logo.png
|
660
693
|
- public/fluentd.png
|
661
|
-
- public/packs/application-3f916ccb17fbe565e2e0.js
|
662
|
-
- public/packs/application-3f916ccb17fbe565e2e0.js.gz
|
663
|
-
- public/packs/application-3f916ccb17fbe565e2e0.js.map
|
664
694
|
- public/packs/application-d41d8cd98f00b204e9800998ecf8427e.css
|
665
695
|
- public/packs/application-d41d8cd98f00b204e9800998ecf8427e.css.map
|
666
|
-
- public/packs/
|
667
|
-
- public/packs/
|
668
|
-
- public/packs/
|
669
|
-
- public/packs/
|
670
|
-
- public/packs/
|
671
|
-
- public/packs/
|
672
|
-
- public/packs/
|
673
|
-
- public/packs/
|
674
|
-
- public/packs/
|
696
|
+
- public/packs/application-d9c1a8fd897e89f4339b.js
|
697
|
+
- public/packs/application-d9c1a8fd897e89f4339b.js.gz
|
698
|
+
- public/packs/application-d9c1a8fd897e89f4339b.js.map
|
699
|
+
- public/packs/aws_credential-b4452e1117b0c532dc5b.js
|
700
|
+
- public/packs/aws_credential-b4452e1117b0c532dc5b.js.gz
|
701
|
+
- public/packs/aws_credential-b4452e1117b0c532dc5b.js.map
|
702
|
+
- public/packs/codemirror-ee4da72eacbf03f4a8a6.js
|
703
|
+
- public/packs/codemirror-ee4da72eacbf03f4a8a6.js.gz
|
704
|
+
- public/packs/codemirror-ee4da72eacbf03f4a8a6.js.map
|
705
|
+
- public/packs/config_field-f5bced5c699aea7c0ab8.js
|
706
|
+
- public/packs/config_field-f5bced5c699aea7c0ab8.js.gz
|
707
|
+
- public/packs/config_field-f5bced5c699aea7c0ab8.js.map
|
708
|
+
- public/packs/fluent_log-1a50e9efd568574f6edb.js
|
709
|
+
- public/packs/fluent_log-1a50e9efd568574f6edb.js.gz
|
710
|
+
- public/packs/fluent_log-1a50e9efd568574f6edb.js.map
|
711
|
+
- public/packs/in_tail_parse-3560e8785b8cb75ea466.js
|
712
|
+
- public/packs/in_tail_parse-3560e8785b8cb75ea466.js.gz
|
713
|
+
- public/packs/in_tail_parse-3560e8785b8cb75ea466.js.map
|
675
714
|
- public/packs/manifest.json
|
676
715
|
- public/packs/manifest.json.gz
|
677
|
-
- public/packs/nested_settings-
|
678
|
-
- public/packs/nested_settings-
|
679
|
-
- public/packs/nested_settings-
|
680
|
-
- public/packs/notification-
|
681
|
-
- public/packs/notification-
|
682
|
-
- public/packs/notification-
|
683
|
-
- public/packs/
|
684
|
-
- public/packs/
|
685
|
-
- public/packs/
|
686
|
-
- public/packs/
|
687
|
-
- public/packs/
|
688
|
-
- public/packs/
|
689
|
-
- public/packs/
|
690
|
-
- public/packs/
|
691
|
-
- public/packs/
|
692
|
-
- public/packs/
|
693
|
-
- public/packs/
|
694
|
-
- public/packs/
|
695
|
-
- public/packs/
|
696
|
-
- public/packs/
|
697
|
-
- public/packs/
|
716
|
+
- public/packs/nested_settings-2313b8ea59398970c904.js
|
717
|
+
- public/packs/nested_settings-2313b8ea59398970c904.js.gz
|
718
|
+
- public/packs/nested_settings-2313b8ea59398970c904.js.map
|
719
|
+
- public/packs/notification-f768826be3e0288d203f.js
|
720
|
+
- public/packs/notification-f768826be3e0288d203f.js.gz
|
721
|
+
- public/packs/notification-f768826be3e0288d203f.js.map
|
722
|
+
- public/packs/out_forward_setting-2ebc255e3b4891700e66.js
|
723
|
+
- public/packs/out_forward_setting-2ebc255e3b4891700e66.js.gz
|
724
|
+
- public/packs/out_forward_setting-2ebc255e3b4891700e66.js.map
|
725
|
+
- public/packs/out_s3_setting-c2eedb503f4fb371e42f.js
|
726
|
+
- public/packs/out_s3_setting-c2eedb503f4fb371e42f.js.gz
|
727
|
+
- public/packs/out_s3_setting-c2eedb503f4fb371e42f.js.map
|
728
|
+
- public/packs/owned_plugin_form-52fca2df13bbf399f7a7.js
|
729
|
+
- public/packs/owned_plugin_form-52fca2df13bbf399f7a7.js.gz
|
730
|
+
- public/packs/owned_plugin_form-52fca2df13bbf399f7a7.js.map
|
731
|
+
- public/packs/parser_multiline_form-cca4bfb7c59eb3f2ede8.js
|
732
|
+
- public/packs/parser_multiline_form-cca4bfb7c59eb3f2ede8.js.gz
|
733
|
+
- public/packs/parser_multiline_form-cca4bfb7c59eb3f2ede8.js.map
|
734
|
+
- public/packs/plugin_setting-32ba7f4e6c6de0e11658.js
|
735
|
+
- public/packs/plugin_setting-32ba7f4e6c6de0e11658.js.gz
|
736
|
+
- public/packs/plugin_setting-32ba7f4e6c6de0e11658.js.map
|
737
|
+
- public/packs/settings-4d636bb21519790524e9.js
|
738
|
+
- public/packs/settings-4d636bb21519790524e9.js.gz
|
739
|
+
- public/packs/settings-4d636bb21519790524e9.js.map
|
740
|
+
- public/packs/transport_config-b705288a973da0417b6f.js
|
741
|
+
- public/packs/transport_config-b705288a973da0417b6f.js.gz
|
742
|
+
- public/packs/transport_config-b705288a973da0417b6f.js.map
|
743
|
+
- public/packs/transport_section-7d8d57db27f97637dbd8.js
|
744
|
+
- public/packs/transport_section-7d8d57db27f97637dbd8.js.gz
|
745
|
+
- public/packs/transport_section-7d8d57db27f97637dbd8.js.map
|
746
|
+
- public/packs/treeview-bef4810c6ab5bec914a4.js
|
747
|
+
- public/packs/treeview-bef4810c6ab5bec914a4.js.gz
|
748
|
+
- public/packs/treeview-bef4810c6ab5bec914a4.js.map
|
698
749
|
- public/robots.txt
|
699
750
|
- public/td-logo.png
|
700
751
|
- spec/controllers/application_controller_spec.rb
|
@@ -1,144 +0,0 @@
|
|
1
|
-
module SettingsHelper
|
2
|
-
def field(form, key, opts = {})
|
3
|
-
html = '<div class="form-group">'
|
4
|
-
|
5
|
-
field_resolver(html, form, key, opts)
|
6
|
-
|
7
|
-
html << "</div>"
|
8
|
-
html.html_safe
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def field_resolver(html, form, key, opts)
|
14
|
-
plugin_class = form.object.class
|
15
|
-
type = plugin_class.column_type(key)
|
16
|
-
if type && !@_used_param.key?(key)
|
17
|
-
case type
|
18
|
-
when :enum
|
19
|
-
enum_field(html, form, key, opts)
|
20
|
-
when :bool
|
21
|
-
bool_field(html, form, key, opts)
|
22
|
-
else
|
23
|
-
other_field(html, form, key, opts)
|
24
|
-
end
|
25
|
-
@_used_param[key] = true
|
26
|
-
end
|
27
|
-
if plugin_class._sections[key] && !@_used_section.key?(key)
|
28
|
-
section_field(html, form, key, opts)
|
29
|
-
@_used_section[key] = true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def section_field(html, form, key, opts = {})
|
34
|
-
klass = form.object.class._sections[key]
|
35
|
-
children = form.object.__send__(key) || { "0" => {} }
|
36
|
-
# <parse>/<format> section is not multiple in most cases
|
37
|
-
multi = if [:parse, :format].include?(key)
|
38
|
-
false
|
39
|
-
else
|
40
|
-
klass.multi
|
41
|
-
end
|
42
|
-
|
43
|
-
children.each do |index, child|
|
44
|
-
open_section_div(html, multi) do |_html|
|
45
|
-
_html << append_and_remove_links if multi
|
46
|
-
_html << h(form.label(key))
|
47
|
-
_html << section_fields(form, key, index, klass, child)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def open_section_div(html, multi)
|
53
|
-
html << %Q!<div class="js-nested-column #{ multi ? "js-multiple" : "" } well well-sm">!
|
54
|
-
yield html
|
55
|
-
html << "</div>"
|
56
|
-
end
|
57
|
-
|
58
|
-
def section_fields(form, key, index, klass, child)
|
59
|
-
html = ""
|
60
|
-
object = klass.new(child)
|
61
|
-
form.fields_for("#{key}[#{index}]", object) do |ff|
|
62
|
-
klass._types.keys.each do |kk|
|
63
|
-
if kk == :type
|
64
|
-
html << owned_plugin_type_field(ff, kk, key)
|
65
|
-
else
|
66
|
-
html << field(ff, kk)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
html
|
71
|
-
end
|
72
|
-
|
73
|
-
def nested_field(html, form, key, opts = {})
|
74
|
-
klass = child_data(form, key)[:class]
|
75
|
-
options = child_data(form, key)[:options]
|
76
|
-
children = form.object.send(key) || {"0" => {}}
|
77
|
-
|
78
|
-
children.each_pair do |index, child|
|
79
|
-
html << open_nested_div(options[:multiple])
|
80
|
-
html << append_and_remove_links if options[:multiple]
|
81
|
-
html << h(form.label(key))
|
82
|
-
html << nested_fields(form, key, index, klass, child)
|
83
|
-
html << "</div>"
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def open_nested_div(multiple)
|
88
|
-
%Q!<div class="js-nested-column #{ multiple ? "js-multiple" : "" } well well-sm">!
|
89
|
-
end
|
90
|
-
|
91
|
-
def nested_fields(form, key, index, klass, child)
|
92
|
-
nested_html = ""
|
93
|
-
form.fields_for("#{key}[#{index}]", klass.new(child)) do |ff|
|
94
|
-
klass::KEYS.each do |k|
|
95
|
-
nested_html << field(ff, k)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
nested_html
|
100
|
-
end
|
101
|
-
|
102
|
-
def append_and_remove_links
|
103
|
-
%Q!<a class="btn btn-xs btn-default js-append">#{icon('fa-plus')}</a> ! +
|
104
|
-
%Q!<a class="btn btn-xs btn-default js-remove" style="display:none">#{icon('fa-minus')}</a> !
|
105
|
-
end
|
106
|
-
|
107
|
-
def child_data(form, key)
|
108
|
-
form.object.class.children[key]
|
109
|
-
end
|
110
|
-
|
111
|
-
def enum_field(html, form, key, opts = {})
|
112
|
-
html << h(form.label(key))
|
113
|
-
html << " " # NOTE: Adding space for padding
|
114
|
-
html << form.select(key, form.object.list_of(key), opts, { class: "enum" })
|
115
|
-
end
|
116
|
-
|
117
|
-
def bool_field(html, form, key, opts = {})
|
118
|
-
html << form.check_box(key, {}, "true", "false")
|
119
|
-
html << " " # NOTE: Adding space for padding
|
120
|
-
html << h(form.label(key))
|
121
|
-
end
|
122
|
-
|
123
|
-
def other_field(html, form, key, opts = {})
|
124
|
-
return unless form.object.respond_to?(key)
|
125
|
-
html << h(form.label(key))
|
126
|
-
html << form.text_field(key, class: "form-control")
|
127
|
-
end
|
128
|
-
|
129
|
-
def owned_plugin_type_field(form, key, plugin_type)
|
130
|
-
registry_type = case plugin_type
|
131
|
-
when :parse
|
132
|
-
"PARSER_REGISTRY"
|
133
|
-
when :format
|
134
|
-
"FORMATTER_REGISTRY"
|
135
|
-
end
|
136
|
-
plugin_registry = Fluent::Plugin.const_get("#{registry_type}")
|
137
|
-
html = '<div class="form-group">'
|
138
|
-
html << form.label(key)
|
139
|
-
html << " " # NOTE: Adding space for padding
|
140
|
-
html << form.select(key, plugin_registry.map.keys, {}, { class: "owned" })
|
141
|
-
html << '</div>'
|
142
|
-
html
|
143
|
-
end
|
144
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class Fluentd
|
2
|
-
module Setting
|
3
|
-
module SectionValidator
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
included do
|
7
|
-
validate :validate_sections
|
8
|
-
end
|
9
|
-
|
10
|
-
def validate_sections
|
11
|
-
self._section_params.each do |name, sections|
|
12
|
-
sections.each do |section|
|
13
|
-
if section.invalid?
|
14
|
-
errors.add(name, :invalid, message: section.errors.full_messages)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
|
2
|
-
- @setting.errors.full_messages.each do |e|
|
3
|
-
.alert.alert-danger= e
|
4
|
-
|
5
|
-
.form-group
|
6
|
-
= f.label :path
|
7
|
-
= f.hidden_field :path
|
8
|
-
= f.text_field :path, class: "form-control", disabled: true
|
9
|
-
.form-group
|
10
|
-
= f.label :format
|
11
|
-
= f.hidden_field :format
|
12
|
-
= f.text_field :format, class: "form-control", disabled: true
|
13
|
-
- if @setting.known_formats[@setting.format.to_sym]
|
14
|
-
- @setting.known_formats[@setting.format.to_sym].each do |key|
|
15
|
-
%label= key
|
16
|
-
= f.hidden_field key
|
17
|
-
= @setting.send(key)
|
18
|
-
%br
|
19
|
-
- else
|
20
|
-
%label= @setting.format
|
21
|
-
= f.hidden_field :regexp
|
22
|
-
= @setting.regexp
|
23
|
-
.form-group
|
24
|
-
= f.label :tag
|
25
|
-
= f.text_field :tag, class: "form-control"
|
26
|
-
.form-group
|
27
|
-
= f.label :pos_file
|
28
|
-
= f.text_field :pos_file, class: "form-control"
|
29
|
-
.well.well-sm
|
30
|
-
%h4{"data-toggle" => "collapse", "href" => "#advanced-setting"}
|
31
|
-
= icon('fa-caret-down')
|
32
|
-
= t('terms.advanced_setting')
|
33
|
-
#advanced-setting.collapse
|
34
|
-
.form-group
|
35
|
-
= f.label :rotate_wait
|
36
|
-
= f.text_field :rotate_wait, class: "form-control"
|
37
|
-
.form-group
|
38
|
-
= f.label :read_from_head
|
39
|
-
= f.check_box :read_from_head, class: "form-control"
|
40
|
-
.form-group
|
41
|
-
= f.label :refresh_interval
|
42
|
-
= f.text_field :refresh_interval, class: "form-control"
|
43
|
-
|