in src/routes/Plugin/Discovery/ProxySelectorModal.js [327:519]
message: getIntlContent(
"SHENYU.DISCOVERY.SELECTOR.FORWARDPORT.INPUT",
),
},
],
initialValue: forwardPort,
})(
<Input
allowClear
disabled={!isAdd}
placeholder={getIntlContent(
"SHENYU.DISCOVERY.SELECTOR.FORWARDPORT.INPUT",
)}
/>,
)}
</FormItem>
<FormItem
label={getIntlContent("SHENYU.DISCOVERY.SELECTOR.PROPS")}
{...formItemLayout}
>
<div
className={styles.handleWrap}
style={{
display: "flex",
}}
>
<div>
{pluginHandleList.map((handleList, index) => {
return (
<div
key={index}
style={{
display: "flex",
justifyContent: "space-between",
flexDirection: "row",
}}
>
<ul
className={classnames({
[styles.handleUl]: true,
[styles.springUl]: true,
})}
style={{ width: "100%" }}
>
{handleList.map((item) => {
let required = item.required === "1";
let defaultValue =
item.value === 0 || item.value === false
? item.value
: item.value || item.defaultValue;
let placeholder = item.placeholder || item.label;
let checkRule = item.checkRule;
let fieldName = item.field + index;
let rules = [];
if (required) {
rules.push({
required: { required },
message:
getIntlContent(
"SHENYU.COMMON.PLEASEINPUT",
) + item.label,
});
}
if (checkRule) {
rules.push({
// eslint-disable-next-line no-eval
pattern: eval(checkRule),
message: `${getIntlContent(
"SHENYU.PLUGIN.RULE.INVALID",
)}:(${checkRule})`,
});
}
if (item.dataType === 1) {
return (
<li key={fieldName}>
<Tooltip title={placeholder}>
<FormItem>
{getFieldDecorator(fieldName, {
rules,
initialValue: defaultValue,
})(
<Input
allowClear
disabled={!isAdd}
addonBefore={
<div
style={{ width: labelWidth }}
>
{item.label}
</div>
}
placeholder={placeholder}
key={fieldName}
/>,
)}
</FormItem>
</Tooltip>
</li>
);
} else if (
item.dataType === 3 &&
item.dictOptions
) {
return (
<li key={fieldName}>
<Tooltip title={placeholder}>
<FormItem>
{getFieldDecorator(fieldName, {
rules,
initialValue:
defaultValue === true
? "true"
: defaultValue === false
? "false"
: defaultValue,
})(
<Select
disabled={!isAdd}
placeholder={placeholder}
style={{ width: 260 }}
>
{item.dictOptions.map((option) => {
const optionValue =
option.dictValue === true
? "true"
: option.dictValue === false
? "false"
: option.dictValue;
return (
<Option
key={optionValue}
value={optionValue}
>
{option.dictName} (
{item.label})
</Option>
);
})}
</Select>,
)}
</FormItem>
</Tooltip>
</li>
);
} else {
return (
<li key={fieldName}>
<Tooltip title={placeholder}>
<FormItem>
{getFieldDecorator(fieldName, {
rules,
initialValue: defaultValue,
})(
<Input
allowClear
disabled={!isAdd}
addonBefore={
<div
style={{ width: labelWidth }}
>
{item.label}
</div>
}
placeholder={placeholder}
key={fieldName}
/>,
)}
</FormItem>
</Tooltip>
</li>
);
}
})}
</ul>
</div>
);
})}
</div>
</div>
</FormItem>
</TabPane>
<TabPane
tab={getIntlContent("SHENYU.DISCOVERY.SELECTOR.CONFIG.DISCOVERY")}
key="2"
>
<FormItem
label={getIntlContent("SHENYU.DISCOVERY.CONFIGURATION.TYPE")}
{...formItemLayout}
>
{getFieldDecorator("selectedDiscoveryType", {
rules: [
{