|
@@ -13,6 +13,7 @@ import { buildRemarkByTag, formatInboundTag, isApiRule } from './helpers';
|
|
|
|
|
|
|
|
export interface RoutingRule {
|
|
export interface RoutingRule {
|
|
|
enabled?: boolean;
|
|
enabled?: boolean;
|
|
|
|
|
+ comment?: string;
|
|
|
type?: string;
|
|
type?: string;
|
|
|
domain?: string | string[];
|
|
domain?: string | string[];
|
|
|
ip?: string | string[];
|
|
ip?: string | string[];
|
|
@@ -42,6 +43,7 @@ interface RuleFormModalProps {
|
|
|
|
|
|
|
|
const initialForm = (): RuleFormValues => ({
|
|
const initialForm = (): RuleFormValues => ({
|
|
|
enabled: true,
|
|
enabled: true,
|
|
|
|
|
+ comment: '',
|
|
|
domain: '',
|
|
domain: '',
|
|
|
ip: '',
|
|
ip: '',
|
|
|
port: '',
|
|
port: '',
|
|
@@ -104,6 +106,7 @@ export default function RuleFormModal({
|
|
|
if (rule) {
|
|
if (rule) {
|
|
|
methods.reset({
|
|
methods.reset({
|
|
|
enabled: rule.enabled !== false,
|
|
enabled: rule.enabled !== false,
|
|
|
|
|
+ comment: rule.comment || '',
|
|
|
domain: Array.isArray(rule.domain) ? rule.domain.join(',') : rule.domain || '',
|
|
domain: Array.isArray(rule.domain) ? rule.domain.join(',') : rule.domain || '',
|
|
|
ip: Array.isArray(rule.ip) ? rule.ip.join(',') : rule.ip || '',
|
|
ip: Array.isArray(rule.ip) ? rule.ip.join(',') : rule.ip || '',
|
|
|
port: rule.port || '',
|
|
port: rule.port || '',
|
|
@@ -132,6 +135,7 @@ export default function RuleFormModal({
|
|
|
const built: Record<string, unknown> = {
|
|
const built: Record<string, unknown> = {
|
|
|
type: 'field',
|
|
type: 'field',
|
|
|
enabled: v.enabled,
|
|
enabled: v.enabled,
|
|
|
|
|
+ comment: v.comment,
|
|
|
domain: csv(v.domain),
|
|
domain: csv(v.domain),
|
|
|
ip: csv(v.ip),
|
|
ip: csv(v.ip),
|
|
|
port: v.port,
|
|
port: v.port,
|
|
@@ -185,6 +189,10 @@ export default function RuleFormModal({
|
|
|
<Switch disabled={isApiRule(rule ?? {})} />
|
|
<Switch disabled={isApiRule(rule ?? {})} />
|
|
|
</FormField>
|
|
</FormField>
|
|
|
|
|
|
|
|
|
|
+ <FormField name="comment" label={t('comment')}>
|
|
|
|
|
+ <Input maxLength={200} showCount placeholder={t('comment')} />
|
|
|
|
|
+ </FormField>
|
|
|
|
|
+
|
|
|
<FormField
|
|
<FormField
|
|
|
name="sourceIP"
|
|
name="sourceIP"
|
|
|
label={
|
|
label={
|