index.ts
4.62 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
171
172
173
174
175
176
177
178
179
180
import { FormSchema } from '/@/components/Form';
/**
* RabbitMq表单相关默认值配置
*/
class RabbitMqFormPartialConfig {
static topicPattern = 'my-topic'; //消息主题默认值
static host = true; //主机
static port = 5672; //端口
static virtualHost = '/'; //虚拟端口(以/开头)
static username = 'guest'; //用户名
static password = 'guest'; //密码
static connectionTimeout = 60000; //连接超时(毫秒)
static handshakeTimeout = 10000; //握手超时(毫秒)
static automaticRecoveryEnabled = false;
//anonymous Select options配置
static getMessageProperties() {
return [
{ label: 'BASIC', value: 'BASIC' },
{ label: 'TEXT_PLAIN', value: 'TEXT_PLAIN' },
{ label: 'MINIMAL_BASIC', value: 'MINIMAL_BASIC' },
{ label: 'MINIMAL_PERSISTENT_BASIC', value: 'MINIMAL_PERSISTENT_BASIC' },
{ label: 'PERSISTENT_BASIC', value: 'PERSISTENT_BASIC' },
{ label: 'PERSISTENT_TEXT_PLAIN', value: 'PERSISTENT_TEXT_PLAIN' },
];
}
}
export const modeRabbitMqForm: FormSchema[] = [
{
field: 'name',
label: '名称',
colProps: { span: 12 },
required: true,
component: 'Input',
componentProps: {
maxLength: 255,
placeholder: '请输入名称',
},
},
{
field: 'exchangeNamePattern',
label: '交换名称模式',
colProps: { span: 12 },
component: 'Input',
defaultValue: '',
componentProps: {
maxLength: 255,
placeholder: '请输入模式',
},
},
{
field: 'routingKeyPattern',
label: '路由密钥模式',
colProps: { span: 12 },
defaultValue: '',
component: 'Input',
componentProps: {
maxLength: 255,
placeholder: '请输入模式',
},
},
{
field: 'messageProperties',
component: 'Select',
label: '消息属性',
colProps: { span: 12 },
defaultValue: null,
componentProps: {
placeholder: '请选择消息属性',
options: RabbitMqFormPartialConfig.getMessageProperties(),
},
},
{
field: 'host',
label: '主机',
colProps: { span: 12 },
component: 'Input',
required: RabbitMqFormPartialConfig.host,
defaultValue: 'localhost',
componentProps: {
maxLength: 255,
placeholder: 'localhost',
},
},
{
field: 'port',
label: '端口',
colProps: { span: 12 },
component: 'InputNumber',
defaultValue: RabbitMqFormPartialConfig.port,
required: true,
componentProps: {
maxLength: 255,
placeholder: '请输入Port',
},
},
{
field: 'virtualHost',
label: '虚拟端口',
colProps: { span: 12 },
component: 'Input',
defaultValue: RabbitMqFormPartialConfig.virtualHost,
componentProps: {
maxLength: 255,
placeholder: '/',
},
},
{
field: 'username',
label: '用户名',
colProps: { span: 12 },
component: 'Input',
defaultValue: RabbitMqFormPartialConfig.username,
componentProps: {
maxLength: 255,
placeholder: '请输入用户名',
},
},
{
field: 'password',
label: '密码',
colProps: { span: 12 },
component: 'InputPassword',
defaultValue: RabbitMqFormPartialConfig.password,
componentProps: {
maxLength: 255,
placeholder: '请输入密码',
},
},
{
field: 'automaticRecoveryEnabled',
label: '是否启用',
colProps: { span: 12 },
defaultValue: RabbitMqFormPartialConfig.automaticRecoveryEnabled,
component: 'Checkbox',
renderComponentContent: '自动恢复',
},
{
field: 'connectionTimeout',
label: '连接超时(毫秒)',
colProps: { span: 12 },
component: 'InputNumber',
defaultValue: RabbitMqFormPartialConfig.connectionTimeout,
componentProps: {
maxLength: 255,
placeholder: '请输入Connection timeout (ms)',
},
},
{
field: 'handshakeTimeout',
label: '握手超时(毫秒)',
colProps: { span: 12 },
component: 'InputNumber',
defaultValue: RabbitMqFormPartialConfig.handshakeTimeout,
componentProps: {
maxLength: 255,
placeholder: '请输入Handshake timeout (ms)',
},
},
{
field: 'clientProperties',
label: '客户端属性',
colProps: { span: 24 },
component: 'JAddInput',
defaultValue: {},
},
{
field: 'description',
label: '说明',
colProps: { span: 24 },
component: 'InputTextArea',
componentProps: {
maxLength: 255,
rows: 4,
placeholder: '请输入说明',
},
},
];