Display tooltip and guide for parser_multiline

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-15 17:38:41 +09:00
parent 41b18ffba1
commit fce12c5cb5
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1
3 changed files with 18 additions and 3 deletions

View File

@ -1,14 +1,17 @@
'use strict' 'use strict'
import 'lodash/lodash'
const ParserMultilineForm = { const ParserMultilineForm = {
template: "#vue-parser-multiline-form", template: "#vue-parser-multiline-form",
props: [ props: [
"pluginType" "pluginType",
"commonOptions"
], ],
data: function() { data: function() {
return { return {
formatFirstline: "", formatFirstline: "",
formats: "" formats: "",
formatFirstlineDesc: ""
} }
}, },
@ -26,6 +29,12 @@ const ParserMultilineForm = {
"format_firstline": this.formatFirstline, "format_firstline": this.formatFirstline,
"formats": this.formats "formats": this.formats
}) })
},
"commonOptions": function(newValue, oldValue) {
const option = _.find(newValue, (o) => {
return o.name === "format_firstline"
})
this.formatFirstlineDesc = option.desc
} }
}, },

View File

@ -16,6 +16,7 @@
{{ option }} {{ option }}
%parser-multiline-form{"v-if" => 'pluginName==="multiline"', %parser-multiline-form{"v-if" => 'pluginName==="multiline"',
"v-bind:plugin-type" => "pluginType", "v-bind:plugin-type" => "pluginType",
"v-bind:common-options" => "commonOptions",
"v-on:change-formats" => "onChangeFormats"} "v-on:change-formats" => "onChangeFormats"}
.form-group(v-else){"v-for" => "option in commonOptions"} .form-group(v-else){"v-for" => "option in commonOptions"}
%template{"v-if" => 'option.type==="enum"'} %template{"v-if" => 'option.type==="enum"'}

View File

@ -1,6 +1,9 @@
%script{type: "text/x-template", id: "vue-parser-multiline-form"} %script{type: "text/x-template", id: "vue-parser-multiline-form"}
.form-group .form-group
%label{"for" => "setting_parse_0__format_firstline"} %label{"for" => "setting_parse_0__format_firstline",
"data-toggle" => "tooltip",
"data-placement" => "right",
"v-bind:title" => "formatFirstlineDesc"}
Format first line Format first line
%input.form-control{"type" => "text", %input.form-control{"type" => "text",
"id" => "setting_parse_0__format_firstline", "id" => "setting_parse_0__format_firstline",
@ -8,6 +11,8 @@
"v-model.lazy" => "formatFirstline"} "v-model.lazy" => "formatFirstline"}
%label.mt-3{"v-bind:for" => "textareaId(pluginType)"} %label.mt-3{"v-bind:for" => "textareaId(pluginType)"}
Formats Formats
%p.alert.alert-warning
= t("fluentd.settings.in_tail.notice_for_multiline_limit")
%textarea.form-control{"v-bind:id" => "textareaId(pluginType)", %textarea.form-control{"v-bind:id" => "textareaId(pluginType)",
"v-bind:name" => "textareaName(pluginType)", "v-bind:name" => "textareaName(pluginType)",
"v-model.lazy" => "formats", "v-model.lazy" => "formats",