Commit 4aff8c9d1f202df9d52b3151baecf194e5a3f5d1

Authored by fengtao
1 parent 3e4a8da8

pref:优化设备配置 MqTT和CoAp相关字段名字

@@ -32,7 +32,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -32,7 +32,7 @@ export const CoapSchemas: FormSchema[] = [
32 { 32 {
33 field: 'coapDeviceType', 33 field: 'coapDeviceType',
34 component: 'Select', 34 component: 'Select',
35 - label: 'CoAP类型', 35 + label: 'CoAP 设备类型',
36 defaultValue: 'DEFAULT', 36 defaultValue: 'DEFAULT',
37 componentProps: { 37 componentProps: {
38 options: [ 38 options: [
@@ -45,7 +45,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -45,7 +45,7 @@ export const CoapSchemas: FormSchema[] = [
45 { 45 {
46 field: 'transportPayloadType', 46 field: 'transportPayloadType',
47 component: 'Select', 47 component: 'Select',
48 - label: '设备消息', 48 + label: 'CoAP 设备消息 Payload',
49 defaultValue: 'JSON', 49 defaultValue: 'JSON',
50 componentProps: { 50 componentProps: {
51 options: [ 51 options: [
@@ -59,14 +59,14 @@ export const CoapSchemas: FormSchema[] = [ @@ -59,14 +59,14 @@ export const CoapSchemas: FormSchema[] = [
59 { 59 {
60 field: 'powerMode', 60 field: 'powerMode',
61 component: 'Select', 61 component: 'Select',
62 - label: '模式', 62 + label: 'Power Saving Mode',
63 defaultValue: 'DRX', 63 defaultValue: 'DRX',
64 componentProps: { 64 componentProps: {
65 options: [ 65 options: [
66 - { label: 'Power Saving Mode', value: 'PSM' },  
67 - { label: 'Discontinuous Reception', value: 'DRX' }, 66 + { label: 'Power Saving Mode (PSM)', value: 'PSM' },
  67 + { label: 'Discontinuous Reception (DRX)', value: 'DRX' },
68 { 68 {
69 - label: 'Extended Discontinuous Reception', 69 + label: 'Extended Discontinuous Reception (eDRX)',
70 value: 'E_DRX', 70 value: 'E_DRX',
71 }, 71 },
72 ], 72 ],
@@ -76,7 +76,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -76,7 +76,7 @@ export const CoapSchemas: FormSchema[] = [
76 { 76 {
77 field: 'psmActivityTimer', 77 field: 'psmActivityTimer',
78 component: 'InputNumber', 78 component: 'InputNumber',
79 - label: 'Timer', 79 + label: 'PSM Activity Timer',
80 required: true, 80 required: true,
81 defaultValue: '10', 81 defaultValue: '10',
82 componentProps: { 82 componentProps: {
@@ -132,7 +132,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -132,7 +132,7 @@ export const CoapSchemas: FormSchema[] = [
132 { 132 {
133 field: 'pagingTransmissionWindow', 133 field: 'pagingTransmissionWindow',
134 component: 'InputNumber', 134 component: 'InputNumber',
135 - label: 'Paging', 135 + label: 'Paging Transmission Window',
136 required: true, 136 required: true,
137 defaultValue: '10', 137 defaultValue: '10',
138 componentProps: { 138 componentProps: {
@@ -159,7 +159,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -159,7 +159,7 @@ export const CoapSchemas: FormSchema[] = [
159 }, 159 },
160 { 160 {
161 field: 'deviceTelemetryProtoSchema', 161 field: 'deviceTelemetryProtoSchema',
162 - label: '遥测数据', 162 + label: '遥测数据 proto schema',
163 colProps: { span: 22 }, 163 colProps: { span: 22 },
164 component: 'InputTextArea', 164 component: 'InputTextArea',
165 componentProps: { 165 componentProps: {
@@ -189,7 +189,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -189,7 +189,7 @@ export const CoapSchemas: FormSchema[] = [
189 }, 189 },
190 { 190 {
191 field: 'deviceAttributesProtoSchema', 191 field: 'deviceAttributesProtoSchema',
192 - label: 'Attributes', 192 + label: 'Attributes proto schema',
193 colProps: { span: 22 }, 193 colProps: { span: 22 },
194 component: 'InputTextArea', 194 component: 'InputTextArea',
195 componentProps: { 195 componentProps: {
@@ -211,7 +211,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -211,7 +211,7 @@ export const CoapSchemas: FormSchema[] = [
211 }, 211 },
212 { 212 {
213 field: 'deviceRpcRequestProtoSchema', 213 field: 'deviceRpcRequestProtoSchema',
214 - label: 'RPC 请求 ', 214 + label: 'RPC 请求 proto schema',
215 colProps: { span: 22 }, 215 colProps: { span: 22 },
216 component: 'InputTextArea', 216 component: 'InputTextArea',
217 componentProps: { 217 componentProps: {
@@ -234,7 +234,7 @@ export const CoapSchemas: FormSchema[] = [ @@ -234,7 +234,7 @@ export const CoapSchemas: FormSchema[] = [
234 }, 234 },
235 { 235 {
236 field: 'deviceRpcResponseProtoSchema', 236 field: 'deviceRpcResponseProtoSchema',
237 - label: 'RPC 响应', 237 + label: 'RPC 响应 proto schema',
238 colProps: { span: 22 }, 238 colProps: { span: 22 },
239 component: 'InputTextArea', 239 component: 'InputTextArea',
240 componentProps: { 240 componentProps: {
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 }); 58 });
59 59
60 const [register, { validate, resetFields, setFieldsValue }] = useForm({ 60 const [register, { validate, resetFields, setFieldsValue }] = useForm({
61 - labelWidth: 100, 61 + labelWidth: 200,
62 schemas: CoapSchemas, 62 schemas: CoapSchemas,
63 actionColOptions: { 63 actionColOptions: {
64 span: 14, 64 span: 14,
@@ -20,7 +20,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -20,7 +20,7 @@ export const MqttSchemas: FormSchema[] = [
20 { 20 {
21 field: 'deviceTelemetryTopic', 21 field: 'deviceTelemetryTopic',
22 component: 'Input', 22 component: 'Input',
23 - label: '筛选器', 23 + label: '遥测数据 topic 筛选器',
24 required: true, 24 required: true,
25 defaultValue: 'v1/devices/me/telemetry', 25 defaultValue: 'v1/devices/me/telemetry',
26 componentProps: { 26 componentProps: {
@@ -32,7 +32,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -32,7 +32,7 @@ export const MqttSchemas: FormSchema[] = [
32 field: 'deviceAttributesTopic', 32 field: 'deviceAttributesTopic',
33 component: 'Input', 33 component: 'Input',
34 required: true, 34 required: true,
35 - label: 'topic filter', 35 + label: 'Attributes topic filter',
36 defaultValue: 'v1/devices/me/attributes', 36 defaultValue: 'v1/devices/me/attributes',
37 componentProps: { 37 componentProps: {
38 placeholder: '请输入Attributes topic 筛选器', 38 placeholder: '请输入Attributes topic 筛选器',
@@ -42,22 +42,13 @@ export const MqttSchemas: FormSchema[] = [ @@ -42,22 +42,13 @@ export const MqttSchemas: FormSchema[] = [
42 { 42 {
43 field: 'desc', 43 field: 'desc',
44 component: 'InputTextArea', 44 component: 'InputTextArea',
45 - label: '描述',  
46 - defaultValue: `支持单[+]和多级[#]通配符。[+] is suitable for any topic filter level。例如:  
47 - v1/devices/+/telemetry or  
48 - +/devices/+/attributes。[#]可以替换 topic filter 本身,并且必须是 topic 的最后一个符号。例如:# or v1/devices/me/#。  
49 - `,  
50 - componentProps: {  
51 - autoSize: {  
52 - maxRows: 10,  
53 - },  
54 - },  
55 - colProps: { span: 23 }, 45 + label: '',
  46 + slot: 'descSlot',
56 }, 47 },
57 { 48 {
58 field: 'transportPayloadType', 49 field: 'transportPayloadType',
59 component: 'Select', 50 component: 'Select',
60 - label: '设备信息', 51 + label: 'MQTT 设备 Payload',
61 defaultValue: 'JSON', 52 defaultValue: 'JSON',
62 componentProps: { 53 componentProps: {
63 options: [ 54 options: [
@@ -89,7 +80,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -89,7 +80,7 @@ export const MqttSchemas: FormSchema[] = [
89 }, 80 },
90 { 81 {
91 field: 'deviceTelemetryProtoSchema', 82 field: 'deviceTelemetryProtoSchema',
92 - label: '遥测数据', 83 + label: '遥测数据 proto schema',
93 colProps: { span: 23 }, 84 colProps: { span: 23 },
94 component: 'InputTextArea', 85 component: 'InputTextArea',
95 componentProps: { 86 componentProps: {
@@ -118,7 +109,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -118,7 +109,7 @@ export const MqttSchemas: FormSchema[] = [
118 }, 109 },
119 { 110 {
120 field: 'deviceAttributesProtoSchema', 111 field: 'deviceAttributesProtoSchema',
121 - label: 'Attributes', 112 + label: 'Attributes proto schema',
122 colProps: { span: 23 }, 113 colProps: { span: 23 },
123 component: 'InputTextArea', 114 component: 'InputTextArea',
124 componentProps: { 115 componentProps: {
@@ -139,7 +130,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -139,7 +130,7 @@ export const MqttSchemas: FormSchema[] = [
139 }, 130 },
140 { 131 {
141 field: 'deviceRpcRequestProtoSchema', 132 field: 'deviceRpcRequestProtoSchema',
142 - label: 'RPC 请求 ', 133 + label: 'RPC 请求 proto schema',
143 colProps: { span: 23 }, 134 colProps: { span: 23 },
144 component: 'InputTextArea', 135 component: 'InputTextArea',
145 componentProps: { 136 componentProps: {
@@ -161,7 +152,7 @@ export const MqttSchemas: FormSchema[] = [ @@ -161,7 +152,7 @@ export const MqttSchemas: FormSchema[] = [
161 }, 152 },
162 { 153 {
163 field: 'deviceRpcResponseProtoSchema', 154 field: 'deviceRpcResponseProtoSchema',
164 - label: 'RPC 响应', 155 + label: 'RPC 响应 proto schema',
165 colProps: { span: 23 }, 156 colProps: { span: 23 },
166 component: 'InputTextArea', 157 component: 'InputTextArea',
167 componentProps: { 158 componentProps: {
@@ -9,7 +9,17 @@ @@ -9,7 +9,17 @@
9 " 9 "
10 > 10 >
11 <div style="margin-top: 1.2vh"> 11 <div style="margin-top: 1.2vh">
12 - <BasicForm :showResetButton="false" :showSubmitButton="false" @register="register" /> 12 + <BasicForm :showResetButton="false" :showSubmitButton="false" @register="register">
  13 + <template #descSlot>
  14 + <div style="width: 47rem; margin-left: 2rem">
  15 + <p>
  16 + 支持单[+]和多级[#]通配符。 [+] is suitable for any topic filter
  17 + level。例如:v1/devices/+/telemetry or +/devices/+/attributes。 [#]可以替换 topic
  18 + filter 本身,并且必须是 topic 的最后一个符号。例如:# or v1/devices/me/#。
  19 + </p>
  20 + </div>
  21 + </template>
  22 + </BasicForm>
13 </div> 23 </div>
14 </div> 24 </div>
15 </template> 25 </template>
@@ -51,7 +61,7 @@ @@ -51,7 +61,7 @@
51 }); 61 });
52 62
53 const [register, { validate, resetFields, setFieldsValue }] = useForm({ 63 const [register, { validate, resetFields, setFieldsValue }] = useForm({
54 - labelWidth: 80, 64 + labelWidth: 180,
55 schemas: MqttSchemas, 65 schemas: MqttSchemas,
56 actionColOptions: { 66 actionColOptions: {
57 span: 14, 67 span: 14,
@@ -131,7 +141,7 @@ @@ -131,7 +141,7 @@
131 }); 141 });
132 </script> 142 </script>
133 <style lang="less" scoped> 143 <style lang="less" scoped>
134 - :deep(.ant-row) {  
135 - column-gap: 33px !important;  
136 - } 144 + // :deep(.ant-row) {
  145 + // column-gap: 33px !important;
  146 + // }
137 </style> 147 </style>