fluentd-ui 1.0.0.alpha.2 → 1.0.0.alpha.3
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/ChangeLog.md +5 -0
- data/Gemfile.lock +56 -1
- data/README.md +2 -2
- data/app/controllers/api/config_definitions_controller.rb +55 -0
- data/app/controllers/api_controller.rb +20 -3
- data/app/controllers/concerns/setting_concern.rb +18 -2
- data/app/controllers/fluentd/settings/in_tail_controller.rb +13 -5
- data/app/controllers/fluentd/settings/out_forward_controller.rb +0 -9
- data/app/controllers/fluentd/settings/out_s3_controller.rb +0 -5
- data/app/controllers/fluentd/settings/out_tdlog_controller.rb +9 -0
- data/app/form_builders/fluentd_form_builder.rb +83 -0
- data/app/helpers/settings_helper.rb +81 -18
- data/app/javascript/packs/application.js +4 -0
- data/app/javascript/packs/in_tail_parse.js +159 -0
- data/app/javascript/packs/owned_plugin_form.js +141 -0
- data/app/javascript/packs/parser_multiline_form.js +51 -0
- data/app/javascript/packs/plugin_setting.js +19 -0
- data/app/models/concerns/fluentd/setting/configurable.rb +113 -0
- data/app/models/concerns/fluentd/setting/pattern.rb +11 -0
- data/app/models/concerns/fluentd/setting/plugin.rb +78 -0
- data/app/models/concerns/fluentd/setting/plugin_config.rb +74 -0
- data/app/models/concerns/fluentd/setting/plugin_parameter.rb +121 -0
- data/app/models/concerns/fluentd/setting/section_parser.rb +36 -0
- data/app/models/concerns/fluentd/setting/section_validator.rb +21 -0
- data/app/models/fluentd.rb +5 -5
- data/app/models/fluentd/setting/buffer_file.rb +23 -0
- data/app/models/fluentd/setting/buffer_memory.rb +17 -0
- data/app/models/fluentd/setting/formatter_csv.rb +21 -0
- data/app/models/fluentd/setting/formatter_hash.rb +19 -0
- data/app/models/fluentd/setting/formatter_json.rb +25 -0
- data/app/models/fluentd/setting/formatter_ltsv.rb +21 -0
- data/app/models/fluentd/setting/formatter_msgpack.rb +13 -0
- data/app/models/fluentd/setting/formatter_out_file.rb +21 -0
- data/app/models/fluentd/setting/formatter_single_value.rb +20 -0
- data/app/models/fluentd/setting/formatter_stdout.rb +19 -0
- data/app/models/fluentd/setting/formatter_tsv.rb +21 -0
- data/app/models/fluentd/setting/in_forward.rb +7 -17
- data/app/models/fluentd/setting/in_http.rb +13 -19
- data/app/models/fluentd/setting/in_monitor_agent.rb +6 -19
- data/app/models/fluentd/setting/in_syslog.rb +14 -12
- data/app/models/fluentd/setting/in_tail.rb +7 -84
- data/app/models/fluentd/setting/out_elasticsearch.rb +12 -21
- data/app/models/fluentd/setting/out_forward.rb +22 -66
- data/app/models/fluentd/setting/out_mongo.rb +20 -26
- data/app/models/fluentd/setting/out_s3.rb +18 -30
- data/app/models/fluentd/setting/out_stdout.rb +21 -18
- data/app/models/fluentd/setting/out_tdlog.rb +35 -0
- data/app/models/fluentd/setting/parser_apache.rb +13 -0
- data/app/models/fluentd/setting/parser_apache2.rb +13 -0
- data/app/models/fluentd/setting/parser_apache_error.rb +13 -0
- data/app/models/fluentd/setting/parser_csv.rb +22 -0
- data/app/models/fluentd/setting/parser_in_http.rb +13 -0
- data/app/models/fluentd/setting/parser_json.rb +25 -0
- data/app/models/fluentd/setting/parser_ltsv.rb +30 -0
- data/app/models/fluentd/setting/parser_msgpack.rb +13 -0
- data/app/models/fluentd/setting/parser_multiline.rb +24 -0
- data/app/models/fluentd/setting/parser_nginx.rb +13 -0
- data/app/models/fluentd/setting/parser_none.rb +19 -0
- data/app/models/fluentd/setting/parser_regexp.rb +26 -0
- data/app/models/fluentd/setting/parser_syslog.rb +29 -0
- data/app/models/fluentd/setting/parser_tsv.rb +19 -0
- data/app/models/fluentd/setting/section.rb +38 -0
- data/app/models/fluentd/setting/storage_local.rb +22 -0
- data/app/models/fluentd/setting/type/array.rb +17 -0
- data/app/models/fluentd/setting/type/bool.rb +18 -0
- data/app/models/fluentd/setting/type/enum.rb +17 -0
- data/app/models/fluentd/setting/type/hash.rb +17 -0
- data/app/models/fluentd/setting/type/regexp.rb +17 -0
- data/app/models/fluentd/setting/type/section.rb +17 -0
- data/app/models/fluentd/setting/type/size.rb +17 -0
- data/app/models/fluentd/setting/type/time.rb +17 -0
- data/app/views/api/settings/_element.json.jbuilder +1 -1
- data/app/views/fluentd/settings/in_forward/_form.html.haml +16 -0
- data/app/views/fluentd/settings/in_tail/_form.html.haml +22 -29
- data/app/views/fluentd/settings/in_tail/after_file_choose.html.haml +1 -1
- data/app/views/fluentd/settings/in_tail/after_format.html.haml +4 -4
- data/app/views/fluentd/settings/in_tail/confirm.html.haml +5 -5
- data/app/views/fluentd/settings/source_and_output.html.haml +1 -1
- data/app/views/shared/_global_nav.html.erb +8 -8
- data/app/views/shared/settings/_form.html.haml +40 -9
- data/app/views/shared/settings/show.html.haml +4 -1
- data/app/views/shared/vue/_in_tail_parse.html.haml +20 -0
- data/app/views/shared/vue/_owned_plugin_form.html.haml +68 -0
- data/app/views/shared/vue/_parser_multiline_form.html.haml +19 -0
- data/app/views/shared/vue/_setting.html.erb +1 -1
- data/config/application.rb +1 -1
- data/config/environment.rb +3 -0
- data/config/initializers/types.rb +7 -0
- data/config/routes.rb +2 -1
- data/fluentd-ui.gemspec +5 -0
- data/lib/fluentd-ui/version.rb +1 -1
- data/lib/regexp_preview.rb +2 -2
- data/lib/regexp_preview/multi_line.rb +53 -63
- data/lib/regexp_preview/single_line.rb +40 -46
- data/spec/features/fluentd/setting/out_forward_spec.rb +1 -1
- data/spec/features/fluentd/setting/out_stdout_spec.rb +1 -1
- data/spec/features/{out_td_spec.rb → out_tdlog_spec.rb} +3 -3
- data/spec/lib/regexp_preview/multi_line_spec.rb +29 -34
- data/spec/lib/regexp_preview/single_line_spec.rb +89 -87
- data/spec/models/fluentd/setting/in_forward_spec.rb +75 -0
- data/spec/models/fluentd/setting/in_http_spec.rb +31 -0
- data/spec/models/fluentd/setting/in_monitor_agent_spec.rb +31 -0
- data/spec/models/fluentd/setting/in_syslog_spec.rb +65 -7
- data/spec/models/fluentd/setting/in_tail_spec.rb +47 -0
- data/spec/models/fluentd/setting/out_elasticsearch_spec.rb +31 -0
- data/spec/models/fluentd/setting/out_mongo_spec.rb +35 -12
- data/spec/models/fluentd/setting/out_s3_spec.rb +128 -0
- data/spec/models/fluentd/setting/out_stdout_spec.rb +31 -0
- data/spec/models/fluentd/setting/out_tdlog_spec.rb +47 -0
- metadata +164 -38
- data/app/controllers/fluentd/settings/out_td_controller.rb +0 -18
- data/app/helpers/fluentd/settings_helper.rb +0 -2
- data/app/javascript/packs/in_tail_format.js +0 -174
- data/app/models/fluentd/setting/common.rb +0 -185
- data/app/models/fluentd/setting/out_td.rb +0 -48
- data/app/views/shared/vue/_in_tail_format.html.erb +0 -43
- data/spec/models/fluentd/setting/common_spec.rb +0 -178
- data/spec/models/fluentd/setting/out_td_spec.rb +0 -38
@@ -1,178 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Fluentd::Setting::Common do
|
4
|
-
let(:klass) { Fluentd::Setting::Common }
|
5
|
-
|
6
|
-
describe "class methods" do
|
7
|
-
describe "#booleans" do
|
8
|
-
subject do
|
9
|
-
Class.new do
|
10
|
-
include Fluentd::Setting::Common
|
11
|
-
attr_accessor :bool1, :bool2, :foo
|
12
|
-
booleans :bool1, :bool2
|
13
|
-
end.new
|
14
|
-
end
|
15
|
-
|
16
|
-
it { subject.column_type(:bool1).should == :boolean }
|
17
|
-
it { subject.column_type(:bool2).should == :boolean }
|
18
|
-
it { subject.column_type(:foo).should_not == :boolean }
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "#flags" do
|
22
|
-
subject do
|
23
|
-
Class.new do
|
24
|
-
include Fluentd::Setting::Common
|
25
|
-
attr_accessor :flag1, :flag2, :foo
|
26
|
-
flags :flag1, :flag2
|
27
|
-
end.new
|
28
|
-
end
|
29
|
-
|
30
|
-
it { subject.column_type(:flag1).should == :flag }
|
31
|
-
it { subject.column_type(:flag2).should == :flag }
|
32
|
-
it { subject.column_type(:foo).should_not == :flag }
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "#hidden" do
|
36
|
-
subject do
|
37
|
-
Class.new do
|
38
|
-
include Fluentd::Setting::Common
|
39
|
-
attr_accessor :hide
|
40
|
-
hidden :hide
|
41
|
-
end.new
|
42
|
-
end
|
43
|
-
|
44
|
-
it { subject.column_type(:hide).should == :hidden }
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "#choice" do
|
48
|
-
subject do
|
49
|
-
Class.new do
|
50
|
-
include Fluentd::Setting::Common
|
51
|
-
attr_accessor :choice, :foo
|
52
|
-
choice :choice, %w(a b c)
|
53
|
-
end.new
|
54
|
-
end
|
55
|
-
|
56
|
-
it { subject.column_type(:choice).should == :choice }
|
57
|
-
it { subject.values_of(:choice).should == %w(a b c) }
|
58
|
-
it { subject.column_type(:foo).should_not == :choice }
|
59
|
-
end
|
60
|
-
|
61
|
-
describe "#nested" do
|
62
|
-
before do
|
63
|
-
@child_class = Class.new do
|
64
|
-
include Fluentd::Setting::Common
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
subject do
|
69
|
-
child = @child_class
|
70
|
-
Class.new do
|
71
|
-
include Fluentd::Setting::Common
|
72
|
-
attr_accessor :child, :foo
|
73
|
-
nested :child, child
|
74
|
-
end.new
|
75
|
-
end
|
76
|
-
|
77
|
-
it { subject.column_type(:child).should == :nested }
|
78
|
-
it { subject.child_class(:child).should == @child_class }
|
79
|
-
it { subject.column_type(:foo).should_not == :nested }
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "instance methods" do
|
84
|
-
describe "plugin name" do
|
85
|
-
before do
|
86
|
-
klass = Class.new do
|
87
|
-
include Fluentd::Setting::Common
|
88
|
-
end
|
89
|
-
Object.const_set(class_name, klass)
|
90
|
-
end
|
91
|
-
after { Object.send(:remove_const, class_name) }
|
92
|
-
subject { Object.const_get(class_name).new }
|
93
|
-
|
94
|
-
context "InFoo" do
|
95
|
-
let(:class_name) { "InFoo" }
|
96
|
-
it "plugin_type_name == foo" do
|
97
|
-
subject.plugin_type_name.should == "foo"
|
98
|
-
end
|
99
|
-
it "should be input_plugin" do
|
100
|
-
subject.should be_input_plugin
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
context "OutBar" do
|
105
|
-
let(:class_name) { "OutBar" }
|
106
|
-
it "plugin_type_name == bar" do
|
107
|
-
subject.plugin_type_name.should == "bar"
|
108
|
-
end
|
109
|
-
it "should be output_plugin" do
|
110
|
-
subject.should be_output_plugin
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
describe "generate config file" do
|
116
|
-
before do
|
117
|
-
class Child
|
118
|
-
include Fluentd::Setting::Common
|
119
|
-
KEYS = [:child_foo]
|
120
|
-
attr_accessor(*KEYS)
|
121
|
-
end
|
122
|
-
@klass = Class.new do
|
123
|
-
include Fluentd::Setting::Common
|
124
|
-
const_set(:KEYS, [:key1, :key2, :flag1, :hide, :ch, :child, :string])
|
125
|
-
attr_accessor(*const_get(:KEYS))
|
126
|
-
booleans :key1, :key2
|
127
|
-
flags :flag1
|
128
|
-
hidden :hide
|
129
|
-
choice :ch, %w(foo bar)
|
130
|
-
nested :child, Child
|
131
|
-
end
|
132
|
-
end
|
133
|
-
after { Object.send(:remove_const, :Child) }
|
134
|
-
|
135
|
-
subject { @klass.new(params).to_config("dummy") }
|
136
|
-
|
137
|
-
describe "boolean" do
|
138
|
-
# NOTE: "true" and "false" are the string because the are given by HTTP request
|
139
|
-
let(:params) { {key1: "true", key2: "false"} }
|
140
|
-
|
141
|
-
it { should include("key1 true\n") }
|
142
|
-
it { should include("key2 false\n") }
|
143
|
-
end
|
144
|
-
|
145
|
-
describe "flag" do
|
146
|
-
context "true" do
|
147
|
-
let(:params) { {flag1: "true"} }
|
148
|
-
it { should include("flag1\n") }
|
149
|
-
end
|
150
|
-
context "false" do
|
151
|
-
let(:params) { {flag1: "false"} }
|
152
|
-
it { should_not include("flag1\n") }
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
describe "hidden" do
|
157
|
-
let(:params) { {hide: "foo"} }
|
158
|
-
it { should include("hide foo\n") }
|
159
|
-
end
|
160
|
-
|
161
|
-
describe "choice" do
|
162
|
-
let(:params) { {ch: "foo"} }
|
163
|
-
it { should include("ch foo\n") }
|
164
|
-
end
|
165
|
-
|
166
|
-
describe "string" do
|
167
|
-
let(:params) { {string: "foobar"} }
|
168
|
-
it { should include("string foobar\n") }
|
169
|
-
end
|
170
|
-
|
171
|
-
describe "nested" do
|
172
|
-
let(:params) { {child: {"0" => { child_foo: "hi" }}} }
|
173
|
-
it { should match(%r!<child>\n\s+child_foo hi\n\s+</child>!) }
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Fluentd::Setting::OutTd do
|
4
|
-
let(:klass) { described_class }
|
5
|
-
let(:instance) { klass.new(valid_attributes) }
|
6
|
-
let(:valid_attributes) {
|
7
|
-
{
|
8
|
-
match: "td.*.*",
|
9
|
-
apikey: "APIKEY",
|
10
|
-
auto_create_table: "true",
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
14
|
-
describe "#valid?" do
|
15
|
-
it "should be invalid if tag parameter lacked" do
|
16
|
-
params = valid_attributes.dup
|
17
|
-
params.delete(:match)
|
18
|
-
klass.new(params).should_not be_valid
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "#plugin_type_name" do
|
23
|
-
subject { instance.plugin_type_name }
|
24
|
-
it { should == "tdlog" }
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "#input_plugin" do
|
28
|
-
it { instance.should_not be_input_plugin }
|
29
|
-
it { instance.should be_output_plugin }
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "#to_config" do
|
33
|
-
subject { instance.to_config }
|
34
|
-
it { should include("type tdlog") }
|
35
|
-
it { should include("APIKEY") }
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|