소스 검색

fix: merge

Next wzy
hear 3 년 전
부모
커밋
77dc050fcb

+ 0 - 3
docker/nginx.conf

@@ -36,6 +36,3 @@ server {
         client_max_body_size    500m;
     }
 }
-# http {
-#     server_tokens off;
-# }

+ 23 - 5
src/components/SearchComponent/index.tsx

@@ -24,7 +24,7 @@ import {
   SaveOutlined,
   SearchOutlined,
 } from '@ant-design/icons';
-import { Button, Card, Dropdown, Empty, Menu, Popover, Typography } from 'antd';
+import { Button, Card, Dropdown, Empty, Menu, Popconfirm, Popover, Typography } from 'antd';
 import { useEffect, useMemo, useRef, useState } from 'react';
 import type { ProColumns } from '@jetlinks/pro-table';
 import type { EnumData } from '@/utils/typings';
@@ -503,10 +503,28 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
     <Menu className={styles.history}>
       {history.length > 0 ? (
         history.map((item: SearchHistory) => (
-          <Menu.Item onClick={() => handleHistory(item)} key={item.id || randomString(9)}>
+          <Menu.Item key={item.id || randomString(9)}>
             <div className={styles.list}>
-              <Typography.Text ellipsis={{ tooltip: item.name }}>{item.name}</Typography.Text>
-              <DeleteOutlined
+              <Typography.Text
+                ellipsis={{ tooltip: item.name }}
+                onClick={() => handleHistory(item)}
+              >
+                {item.name}
+              </Typography.Text>
+              <Popconfirm
+                title="确定删除嘛"
+                onConfirm={async () => {
+                  const response = await service.history.remove(`${target}-search`, item.key);
+                  if (response.status === 200) {
+                    onlyMessage('操作成功');
+                    const temp = history.filter((h: any) => h.key !== item.key);
+                    setHistory(temp);
+                  }
+                }}
+              >
+                <DeleteOutlined />
+              </Popconfirm>
+              {/* <DeleteOutlined
                 onClick={async (e) => {
                   e?.stopPropagation();
                   const response = await service.history.remove(`${target}-search`, item.key);
@@ -516,7 +534,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
                     setHistory(temp);
                   }
                 }}
-              />
+              /> */}
             </div>
           </Menu.Item>
         ))

+ 10 - 8
src/pages/link/Certificate/index.tsx

@@ -102,14 +102,16 @@ const Certificate = () => {
           popConfirm={{
             title: '确认删除?',
             onConfirm: async () => {
-              await service.remove(record.id);
-              onlyMessage(
-                intl.formatMessage({
-                  id: 'pages.data.option.success',
-                  defaultMessage: '操作成功!',
-                }),
-              );
-              actionRef.current?.reload();
+              const res: any = await service.remove(record.id);
+              if (res.status === 200) {
+                onlyMessage(
+                  intl.formatMessage({
+                    id: 'pages.data.option.success',
+                    defaultMessage: '操作成功!',
+                  }),
+                );
+                actionRef.current?.reload();
+              }
             },
           }}
           tooltip={{

+ 1 - 0
src/pages/notice/Config/Debug/index.tsx

@@ -153,6 +153,7 @@ const Debug = observer(() => {
         title: '通知模版',
         type: 'string',
         'x-decorator': 'FormItem',
+        required: true,
         'x-component': 'Select',
         'x-reactions': '{{useAsyncDataSource(getTemplate)}}',
       },

+ 70 - 2
src/pages/notice/Config/Detail/index.tsx

@@ -194,6 +194,12 @@ const Detail = observer(() => {
                 'x-component-props': {
                   placeholder: '请输入corpId',
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               corpSecret: {
                 title: 'corpSecret',
@@ -211,6 +217,12 @@ const Detail = observer(() => {
                     },
                   },
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               appId: {
                 title: 'appID',
@@ -269,6 +281,12 @@ const Detail = observer(() => {
                     },
                   },
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               appSecret: {
                 title: 'AppSecret',
@@ -278,6 +296,12 @@ const Detail = observer(() => {
                 'x-component-props': {
                   placeholder: '请输入AppSecret',
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
                 'x-reactions': {
                   dependencies: ['provider'],
                   fulfill: {
@@ -295,6 +319,12 @@ const Detail = observer(() => {
                 'x-component-props': {
                   placeholder: '请输入webhook',
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
                 'x-reactions': {
                   dependencies: ['provider'],
                   fulfill: {
@@ -319,6 +349,12 @@ const Detail = observer(() => {
                 },
                 'x-component': 'Input',
                 'x-decorator': 'FormItem',
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               accessKeyId: {
                 title: 'AccessKeyId',
@@ -328,6 +364,12 @@ const Detail = observer(() => {
                 },
                 'x-component': 'Input',
                 'x-decorator': 'FormItem',
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               secret: {
                 title: 'Secret',
@@ -337,6 +379,12 @@ const Detail = observer(() => {
                 },
                 'x-component': 'Input',
                 'x-decorator': 'FormItem',
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
             },
           },
@@ -482,6 +530,12 @@ const Detail = observer(() => {
                 },
                 'x-component': 'Input',
                 'x-decorator': 'FormItem',
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               headers: {
                 title: '请求头',
@@ -502,8 +556,15 @@ const Detail = observer(() => {
                       properties: {
                         key: {
                           type: 'string',
-                          // 'x-decorator': 'Editable',
+                          'x-decorator': 'FormItem',
                           'x-component': 'Input',
+                          required: true,
+                          'x-validator': [
+                            {
+                              max: 64,
+                              message: '最多可输入64个字符',
+                            },
+                          ],
                         },
                       },
                     },
@@ -514,8 +575,15 @@ const Detail = observer(() => {
                       properties: {
                         value: {
                           type: 'string',
-                          // 'x-decorator': 'Editable',
+                          'x-decorator': 'FormItem',
                           'x-component': 'Input',
+                          required: true,
+                          'x-validator': [
+                            {
+                              max: 64,
+                              message: '最多可输入64个字符',
+                            },
+                          ],
                         },
                       },
                     },

+ 55 - 1
src/pages/notice/Template/Detail/index.tsx

@@ -566,6 +566,12 @@ const Detail = observer(() => {
                     'x-component-props': {
                       placeholder: '请输入AgentID',
                     },
+                    'x-validator': [
+                      {
+                        max: 64,
+                        message: '最多可输入64个字符',
+                      },
+                    ],
                   },
                   layout: {
                     type: 'void',
@@ -610,7 +616,7 @@ const Detail = observer(() => {
                         '本企业微信的标签ID列表,最多支持100个,如果不填写该字段,将在使用此模版发送通知时进行指定',
                     },
                     'x-component-props': {
-                      placeholder: '请输入标签推送,多个标签用,号分隔',
+                      placeholder: '请选择标签推送,多个标签用,号分隔',
                     },
                   },
                 },
@@ -753,6 +759,12 @@ const Detail = observer(() => {
                       tooltip: '服务号消息模版标题',
                     },
                     'x-disabled': true,
+                    'x-validator': [
+                      {
+                        max: 64,
+                        message: '最多可输入64个字符',
+                      },
+                    ],
                   },
                 },
                 'x-reactions': {
@@ -784,6 +796,12 @@ const Detail = observer(() => {
                     'x-component-props': {
                       placeholder: '请输入AgentID',
                     },
+                    'x-validator': [
+                      {
+                        max: 64,
+                        message: '最多可输入64个字符',
+                      },
+                    ],
                   },
                   layout: {
                     type: 'void',
@@ -975,6 +993,12 @@ const Detail = observer(() => {
                         'x-component-props': {
                           placeholder: '请输入被叫号码',
                         },
+                        'x-validator': [
+                          {
+                            max: 64,
+                            message: '最多可输入64个字符',
+                          },
+                        ],
                       },
                     },
                   },
@@ -988,6 +1012,12 @@ const Detail = observer(() => {
                     'x-component-props': {
                       placeholder: '请输入被叫显号',
                     },
+                    'x-validator': [
+                      {
+                        max: 64,
+                        message: '最多可输入64个字符',
+                      },
+                    ],
                   },
                   PlayTimes: {
                     title: '播放次数',
@@ -1093,6 +1123,12 @@ const Detail = observer(() => {
                 'x-component-props': {
                   placeholder: '请输入标题',
                 },
+                'x-validator': [
+                  {
+                    max: 64,
+                    message: '最多可输入64个字符',
+                  },
+                ],
               },
               sendTo: {
                 'x-component': 'Select',
@@ -1249,6 +1285,12 @@ const Detail = observer(() => {
           rows: 5,
           placeholder: '变量格式:${name};\n 示例:尊敬的${name},${time}有设备触发告警,请注意处理',
         },
+        'x-validator': [
+          {
+            max: 500,
+            message: '最多可输入500个字符',
+          },
+        ],
       },
       variableDefinitions: {
         type: 'array',
@@ -1291,6 +1333,12 @@ const Detail = observer(() => {
                   'x-decorator': 'FormItem',
                   required: true,
                   'x-component': 'Input',
+                  'x-validator': [
+                    {
+                      max: 64,
+                      message: '最多可输入64个字符',
+                    },
+                  ],
                 },
               },
             },
@@ -1355,6 +1403,12 @@ const Detail = observer(() => {
         'x-component-props': {
           rows: 4,
         },
+        'x-validator': [
+          {
+            max: 200,
+            message: '最多可输入200个字符',
+          },
+        ],
         // 'x-decorator-props': {
         //   style: {
         //     zIndex: 998,