create.config.ts
5.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import { ProtocolEnum, ProtocolNameEnum, RequestMethodEnum } from '../../../enum/form';
import { RestApiCallFieldsEnum, RestApiCallFieldsNameEnum } from '../../../enum/formField/external';
import { FormSchema } from '/@/components/Form';
export const formSchemas: FormSchema[] = [
{
field: RestApiCallFieldsEnum.REST_ENDPOINT_URL_PATTERN,
label: RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN,
component: 'Input',
required: true,
helpMessage:
'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
componentProps: {
placeholder: `请输入${RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN}`,
},
},
{
field: RestApiCallFieldsEnum.REQUEST_METHOD,
label: RestApiCallFieldsNameEnum.REQUEST_METHOD,
component: 'Select',
required: true,
componentProps: {
options: Object.keys(RequestMethodEnum).map((value) => ({ label: value, value })),
getPopupContainer: () => document.body,
placeholder: `请选择${RestApiCallFieldsNameEnum.REQUEST_METHOD}`,
},
},
{
field: RestApiCallFieldsEnum.ENABLE_PROXY,
label: '',
component: 'Checkbox',
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.ENABLE_PROXY,
}),
},
{
field: RestApiCallFieldsEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY,
label: '',
component: 'Checkbox',
show: ({ model }) => !model[RestApiCallFieldsEnum.ENABLE_PROXY],
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY,
}),
},
{
field: RestApiCallFieldsEnum.IGNORE_REQUEST_BODY,
label: '',
component: 'Checkbox',
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.IGNORE_REQUEST_BODY,
}),
},
{
field: RestApiCallFieldsEnum.USE_SYSTEM_PROXY_PROPERTIES,
label: '',
component: 'Checkbox',
show: ({ model }) => model[RestApiCallFieldsEnum.ENABLE_PROXY],
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.USE_SYSTEM_PROXY_PROPERTIES,
}),
},
{
field: RestApiCallFieldsEnum.PROXY_SCHEME,
label: RestApiCallFieldsNameEnum.PROXY_SCHEME,
component: 'Select',
required: true,
colProps: { span: 8 },
componentProps: {
options: Object.keys(ProtocolEnum).map((value) => ({
label: ProtocolNameEnum[value],
value,
})),
getPopupContainer: () => document.body,
placeholder: `请选择${RestApiCallFieldsEnum.PROXY_SCHEME}`,
},
},
{
field: RestApiCallFieldsEnum.PROXY_HOST,
label: RestApiCallFieldsNameEnum.PROXY_HOST,
component: 'Input',
required: true,
colProps: { span: 8 },
componentProps: {
placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_HOST}`,
},
},
{
field: RestApiCallFieldsEnum.PROXY_PORT,
label: RestApiCallFieldsNameEnum.PROXY_PORT,
component: 'InputNumber',
required: true,
colProps: { span: 8 },
componentProps: {
placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_HOST}`,
},
},
{
field: RestApiCallFieldsEnum.PROXY_USER,
label: RestApiCallFieldsNameEnum.PROXY_USER,
component: 'Input',
componentProps: {
placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_USER}`,
},
},
{
field: RestApiCallFieldsEnum.PROXY_PASSWORD,
label: RestApiCallFieldsNameEnum.PROXY_PASSWORD,
component: 'Input',
componentProps: {
placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_PASSWORD}`,
},
},
{
field: RestApiCallFieldsEnum.READ_TIMEOUT_MS,
label: RestApiCallFieldsNameEnum.READ_TIMEOUT_MS,
component: 'InputNumber',
componentProps: {
min: 0,
placeholder: `请输入${RestApiCallFieldsNameEnum.READ_TIMEOUT_MS}`,
},
},
{
field: RestApiCallFieldsEnum.MAX_PARALLEL_REQUESTS_COUNT,
label: RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT,
component: 'InputNumber',
componentProps: {
min: 0,
placeholder: `请输入${RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT}`,
},
},
{
field: RestApiCallFieldsEnum.HEADERS,
label: RestApiCallFieldsNameEnum.HEADERS,
component: 'Input',
slot: RestApiCallFieldsEnum.HEADERS,
},
{
field: RestApiCallFieldsEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE,
label: '',
component: 'Checkbox',
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE,
}),
},
{
field: RestApiCallFieldsEnum.TRIM_QUEUE,
label: '',
component: 'Checkbox',
ifShow: ({ model }) => model[RestApiCallFieldsEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE],
renderComponentContent: () => ({
default: () => RestApiCallFieldsNameEnum.TRIM_QUEUE,
}),
},
{
field: RestApiCallFieldsEnum.MAX_QUEUE_SIZE,
label: RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE,
component: 'InputNumber',
ifShow: ({ model }) => model[RestApiCallFieldsEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE],
componentProps: {
min: 0,
placeholder: `请输入${RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE}`,
},
},
{
field: RestApiCallFieldsEnum.CREDENTIALS,
label: RestApiCallFieldsNameEnum.CREDENTIALS,
component: 'Input',
slot: RestApiCallFieldsEnum.CREDENTIALS,
},
];