mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-13 17:57:10 +02:00
Set default value to owned plugin form
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
6e8f5a2979
commit
f194aae880
@ -72,6 +72,13 @@ const OwnedPluginForm = {
|
||||
},
|
||||
inputName: function(pluginType, option) {
|
||||
return `setting[${pluginType}[0]][${option.name}]`
|
||||
},
|
||||
checked: function(checked) {
|
||||
if (checked === true || checked === "true") {
|
||||
return "checked"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,17 @@
|
||||
"data-placement" => "right",
|
||||
"v-bind:title" => "option.desc"}
|
||||
{{ option.name }}
|
||||
%input{"v-bind:id" => "inputId(pluginType, option)",
|
||||
"v-bind:name" => "inputName(pluginType, option)",
|
||||
"type" => "text",
|
||||
"class" => "form-control"}
|
||||
%select{"v-bind:id" => "inputId(pluginType, option)",
|
||||
"v-bind:name" => "inputName(pluginType, option)",
|
||||
"class" => "form-control"}
|
||||
%option{"v-for" => "item in option.list",
|
||||
"v-bind:value" => "item",
|
||||
"v-bind:selected" => "option.default === item"}
|
||||
{{ item }}
|
||||
%template{"v-else-if" => 'option.type==="bool"'}
|
||||
%input{"v-bind:id" => "inputId(pluginType, option)",
|
||||
"v-bind:name" => "inputName(pluginType, option)",
|
||||
"v-bind:checked" => "checked(option.default)",
|
||||
"type" => "checkbox"}
|
||||
%label{"v-bind:for" => "inputId(pluginType, option)",
|
||||
"data-toggle" => "tooltip",
|
||||
@ -40,5 +44,6 @@
|
||||
{{ option.name }}
|
||||
%input{"v-bind:id" => "inputId(pluginType, option)",
|
||||
"v-bind:name" => "inputName(pluginType, option)",
|
||||
"v-bind:value" => "option.default",
|
||||
"type" => "text",
|
||||
"class" => "form-control"}
|
||||
|
Loading…
Reference in New Issue
Block a user