diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 9b86464..3ce81c0 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -44,6 +44,12 @@ module.exports = {
"@typescript-eslint/explicit-function-return-type": 0, // 禁止函数必须要定义返回类型
"react/display-name": "off",
"@typescript-eslint/no-explicit-any": ["off"],
+ "@typescript-eslint/no-var-requires": ["off"],
+ "@typescript-eslint/no-use-before-define": ["off"],
+ "@typescript-eslint/no-empty-function": ["off"],
+ "@typescript-eslint/no-empty-interface": ["off"],
+ "@typescript-eslint/no-unused-vars": ["off"],
+ "@typescript-eslint/no-non-null-assertion": ["off"],
"no-control-regex": "off",
"no-eval": 0
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0719a84..4e72bee 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,6 +11,9 @@ dependencies:
'@ant-design/pro-components':
specifier: ^2.7.10
version: 2.7.10(antd@5.19.1)(rc-field-form@1.44.0)(react-dom@18.3.1)(react@18.3.1)
+ '@ant-design/pro-provider':
+ specifier: ^2.14.7
+ version: 2.14.7(antd@5.19.1)(react-dom@18.3.1)(react@18.3.1)
'@ant-design/use-emotion-css':
specifier: ^1.0.4
version: 1.0.4(antd@5.19.1)(react-dom@18.3.1)(react@18.3.1)
@@ -191,23 +194,6 @@ packages:
'@ctrl/tinycolor': 3.6.1
dev: false
- /@ant-design/cssinjs@1.20.0(react-dom@18.3.1)(react@18.3.1):
- resolution: {integrity: sha512-uG3iWzJxgNkADdZmc6W0Ci3iQAUOvLMcM8SnnmWq3r6JeocACft4ChnY/YWvI2Y+rG/68QBla/O+udke1yH3vg==}
- peerDependencies:
- react: '>=16.0.0'
- react-dom: '>=16.0.0'
- dependencies:
- '@babel/runtime': 7.24.6
- '@emotion/hash': 0.8.0
- '@emotion/unitless': 0.7.5
- classnames: 2.5.1
- csstype: 3.1.3
- rc-util: 5.41.0(react-dom@18.3.1)(react@18.3.1)
- react: 18.3.1
- react-dom: 18.3.1(react@18.3.1)
- stylis: 4.3.2
- dev: false
-
/@ant-design/cssinjs@1.21.0(react-dom@18.3.1)(react@18.3.1):
resolution: {integrity: sha512-gIilraPl+9EoKdYxnupxjHB/Q6IHNRjEXszKbDxZdsgv4sAZ9pjkCq8yanDWNvyfjp4leir2OVAJm0vxwKK8YA==}
peerDependencies:
@@ -425,11 +411,11 @@ packages:
react: '>=17.0.0'
react-dom: '>=17.0.0'
dependencies:
- '@ant-design/cssinjs': 1.20.0(react-dom@18.3.1)(react@18.3.1)
- '@babel/runtime': 7.24.6
+ '@ant-design/cssinjs': 1.21.0(react-dom@18.3.1)(react@18.3.1)
+ '@babel/runtime': 7.24.7
'@ctrl/tinycolor': 3.6.1
antd: 5.19.1(react-dom@18.3.1)(react@18.3.1)
- rc-util: 5.41.0(react-dom@18.3.1)(react@18.3.1)
+ rc-util: 5.43.0(react-dom@18.3.1)(react@18.3.1)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
swr: 2.2.5(react@18.3.1)
@@ -2493,7 +2479,7 @@ packages:
resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==}
dependencies:
'@babel/helper-module-imports': 7.24.6
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
'@emotion/hash': 0.9.1
'@emotion/memoize': 0.8.1
'@emotion/serialize': 1.1.4
@@ -4315,7 +4301,7 @@ packages:
resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
engines: {node: '>=10', npm: '>=6'}
dependencies:
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
cosmiconfig: 7.1.0
resolve: 1.22.8
dev: false
@@ -5869,7 +5855,7 @@ packages:
/i18next@23.11.5:
resolution: {integrity: sha512-41pvpVbW9rhZPk5xjCX2TPJi2861LEig/YRhUkY+1FQ2IQPS0bKUDYnEqY8XPPbB48h1uIwLnP9iiEfuSl20CA==}
dependencies:
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
dev: false
/iconv-lite@0.6.3:
@@ -7838,9 +7824,9 @@ packages:
react: '>=16.9.0'
react-dom: '>=16.9.0'
dependencies:
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
classnames: 2.5.1
- rc-util: 5.41.0(react-dom@18.3.1)(react@18.3.1)
+ rc-util: 5.43.0(react-dom@18.3.1)(react@18.3.1)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
resize-observer-polyfill: 1.5.1
@@ -8056,7 +8042,7 @@ packages:
react: '>=16.9.0'
react-dom: '>=16.9.0'
dependencies:
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
react-is: 18.3.1
@@ -8229,7 +8215,7 @@ packages:
/regenerator-transform@0.15.2:
resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==}
dependencies:
- '@babel/runtime': 7.24.6
+ '@babel/runtime': 7.24.7
dev: false
/regexp.prototype.flags@1.5.2:
diff --git a/src/assets/images/favorites.png b/src/assets/images/favorites.png
new file mode 100644
index 0000000..05e1055
Binary files /dev/null and b/src/assets/images/favorites.png differ
diff --git a/src/assets/styles/index.less b/src/assets/styles/index.less
index b6517be..d58d3a6 100644
--- a/src/assets/styles/index.less
+++ b/src/assets/styles/index.less
@@ -1,33 +1,40 @@
-/*定义滚动条宽高及背景,宽高分别对应横竖滚动条的尺寸*/
-// 滚动条整体部分
-&::-webkit-scrollbar {
- width: 6px;
- height: 8px;
-}
-
-// 滚动条的轨道的两端按钮,允许通过点击微调小方块的位置。
-&::-webkit-scrollbar-button {
- visibility: hidden;
-}
-
-// 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条)
-&::-webkit-scrollbar-thumb {
- background: rgba(144, 147, 153, 0.3);
- cursor: pointer;
- border-radius: 4px;
-}
-
-// 边角,即两个滚动条的交汇处
-&::-webkit-scrollbar-corner {
- visibility: hidden;
-}
-
-// 两个滚动条的交汇处上用于通过拖动调整元素大小的小控件
-&::-webkit-resizer {
- visibility: hidden;
-}
-
-body {
- background-image: url("@/assets/images/background.png");
- background-size: cover;
-}
+/*定义滚动条宽高及背景,宽高分别对应横竖滚动条的尺寸*/
+// 滚动条整体部分
+&::-webkit-scrollbar {
+ width: 6px;
+ height: 8px;
+}
+
+// 滚动条的轨道的两端按钮,允许通过点击微调小方块的位置。
+&::-webkit-scrollbar-button {
+ visibility: hidden;
+}
+
+// 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条)
+&::-webkit-scrollbar-thumb {
+ background: rgba(144, 147, 153, 0.3);
+ cursor: pointer;
+ border-radius: 4px;
+}
+
+// 边角,即两个滚动条的交汇处
+&::-webkit-scrollbar-corner {
+ visibility: hidden;
+}
+
+// 两个滚动条的交汇处上用于通过拖动调整元素大小的小控件
+&::-webkit-resizer {
+ visibility: hidden;
+}
+
+body {
+ background-image: url("@/assets/images/background.png");
+ background-size: cover;
+}
+
+.ant-pro-page-container-children-container-no-header {
+ padding-block-start: 10px !important;
+}
+ .ant-pro-page-container-children-container {
+ padding-inline: 10px !important;
+ }
diff --git a/src/components/Main/Bucket/index.module.less b/src/components/Main/Bucket/index.module.less
index 0d1d495..85e986e 100644
--- a/src/components/Main/Bucket/index.module.less
+++ b/src/components/Main/Bucket/index.module.less
@@ -14,8 +14,8 @@
}
.div_checkCardArea{
- height: 65vh;
- max-height: 65vh;
+ height: 68vh;
+ max-height: 68vh;
overflow-y:scroll;
overflow-x: hidden;
}
diff --git a/src/components/Main/File/components/FileUpload.tsx b/src/components/Main/File/components/FileUpload.tsx
index 1c4839d..ad95a24 100644
--- a/src/components/Main/File/components/FileUpload.tsx
+++ b/src/components/Main/File/components/FileUpload.tsx
@@ -1,13 +1,17 @@
/** @format */
import React from "react";
-import { message, Upload } from "antd";
-import { InboxOutlined } from "@ant-design/icons";
+import { Avatar, Card, Flex, Input, message, Select, Upload } from "antd";
+import { CloudUploadOutlined } from "@ant-design/icons";
+import { ProCard } from "@ant-design/pro-components";
+import selectOptions from "@/components/Main/Settings/settings.ts";
+import StorageIcon from "@/constant/stroage-icon.ts";
const { Dragger } = Upload;
const props: any = {
name: "file",
multiple: true,
+ directory: true,
action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload",
onChange(info) {
const { status } = info.file;
@@ -27,13 +31,106 @@ const props: any = {
const FileUpload: React.FC = () => {
return (
<>
-
-
-
-
- 单击或拖动文件到此区域进行上传
- 支持单次或批量上传。
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 单击或拖动文件到此区域进行上传
+ 支持单次或批量上传。
+
+
>
);
};
diff --git a/src/components/Main/File/index.module.less b/src/components/Main/File/index.module.less
index a8edd9f..562f86e 100644
--- a/src/components/Main/File/index.module.less
+++ b/src/components/Main/File/index.module.less
@@ -1,48 +1,47 @@
-.file_main {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
-
- .file_content_left {
- width: 25%;
- display: flex;
- flex-direction: column;
- }
-
- .file_content_right {
- width: 73%;
- height: 75vh;
-
- .file_right_content {
- display: flex;
- flex-wrap: wrap;
- flex-direction: row;
- margin-top: 20px;
-
- .file_card:hover {
- background-color: rgba(16, 15, 15, 0.08);
- }
-
-
-
- }
-
- .file_right_header {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- }
-}
-
-.file_name {
- width: 65px;
- text-align: center;
- font-size: 12px;
- margin-top: 5px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- display: inline-block;
- -o-text-overflow: ellipsis;
-}
+.file_main {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+
+ .file_content_left {
+ width: 25%;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .file_content_right {
+ width: 73%;
+ height: 75vh;
+
+ .file_right_content {
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ margin-top: 10px;
+
+ .file_card:hover {
+ background-color: rgba(16, 15, 15, 0.08);
+ }
+
+
+
+ }
+
+ .file_right_header {
+ display: flex;
+ flex-direction: column;
+ }
+ }
+}
+
+.file_name {
+ width: 65px;
+ text-align: center;
+ font-size: 12px;
+ margin-top: 5px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: inline-block;
+ -o-text-overflow: ellipsis;
+}
diff --git a/src/components/Main/File/index.tsx b/src/components/Main/File/index.tsx
index 6dbf236..801dd2e 100644
--- a/src/components/Main/File/index.tsx
+++ b/src/components/Main/File/index.tsx
@@ -4,12 +4,13 @@ import { CheckCard, ProCard } from "@ant-design/pro-components";
import styles from "./index.module.less";
import {
Avatar,
- Breadcrumb,
Button,
Card,
Divider,
Dropdown,
+ Flex,
FloatButton,
+ Input,
message,
Modal,
Select,
@@ -18,7 +19,20 @@ import {
import ali from "@/assets/icons/aliyun.svg";
import bucket from "@/assets/icons/bucket.svg";
import tencent from "@/assets/icons/tencent.svg";
-import { CloudUploadOutlined, EllipsisOutlined, LeftOutlined } from "@ant-design/icons";
+import {
+ CloudUploadOutlined,
+ CopyOutlined,
+ DeleteOutlined,
+ DownloadOutlined,
+ EllipsisOutlined,
+ EyeOutlined,
+ LeftOutlined,
+ QrcodeOutlined,
+ RedoOutlined,
+ ScissorOutlined,
+ SearchOutlined,
+ SnippetsOutlined,
+} from "@ant-design/icons";
import standard_dir from "@/assets/icons/standard_directory.svg";
import useStore from "@/utils/store/useStore.tsx";
import { observer } from "mobx-react";
@@ -103,11 +117,16 @@ const File: FunctionComponent = () => {
<>
-
+
- }
- onClick={() => {
- setFiles(dataList);
- store.clearFilePath();
- }}
- />
-
+
+
+ }
+ onClick={() => {
+ setFiles(dataList);
+ store.clearFilePath();
+ }}
+ />
+ }
+ />
+
+
+
+
+
+ } />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
+ }
+ />
+
+
@@ -259,9 +348,7 @@ const File: FunctionComponent = () => {
{
- store.setFilePath({
- title: file.name,
- });
+ store.setFilePath(file.name);
setFiles(fileList);
}}>
[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessKeySecret",
- tooltip: "access key secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const AliSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddAliOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="阿里云OSS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default AliSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { useRef, useState } from "react";
+
+type AliOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ accessKeyId: string;
+ accessKeySecret: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: AliOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ endpoint: "https://oss.aliyuncs.com",
+ accessKeyId: "LTAI5tG3",
+ accessKeySecret: "G3",
+ createdTime: "2024-06-28 10:51:59",
+ updatedTime: "2024-06-29 10:51:59",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessKeySecret",
+ tooltip: "access key secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: any, record: any, _, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const AliSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddAliOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="阿里云OSS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default AliSettings;
diff --git a/src/components/Main/Settings/components/AwsSettings.tsx b/src/components/Main/Settings/components/AwsSettings.tsx
index 9c5912b..5c4638d 100644
--- a/src/components/Main/Settings/components/AwsSettings.tsx
+++ b/src/components/Main/Settings/components/AwsSettings.tsx
@@ -1,261 +1,263 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- accessKeyId: string;
- secretAccessKey: string;
- region: string;
- mode: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "https://oss.aliyuncs.com",
- accessKeyId: "LTAI5tG3",
- secretAccessKey: "G3",
- region: "2024-06-28 10:51:59",
- mode: "2024-06-29 10:51:59",
- createdTime: "2024-06-28 10:51:59",
- updatedTime: "2024-06-29 10:51:59",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucket",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretAccessKey",
- tooltip: "secret access key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "地区",
- dataIndex: "region",
- tooltip: "region",
- ellipsis: true,
- },
- {
- disable: true,
- title: "模式",
- dataIndex: "mode",
- tooltip: "mode",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const AwsSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddAwsOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="亚马逊S3配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default AwsSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type AwsOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ accessKeyId: string;
+ secretAccessKey: string;
+ region: string;
+ mode: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: AwsOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "https://oss.aliyuncs.com",
+ accessKeyId: "LTAI5tG3",
+ secretAccessKey: "G3",
+ region: "2024-06-28 10:51:59",
+ mode: "2024-06-29 10:51:59",
+ createdTime: "2024-06-28 10:51:59",
+ updatedTime: "2024-06-29 10:51:59",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucket",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretAccessKey",
+ tooltip: "secret access key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "地区",
+ dataIndex: "region",
+ tooltip: "region",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "模式",
+ dataIndex: "mode",
+ tooltip: "mode",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ render: (text: ReactNode, record: AwsOssConfigItem, _, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const AwsSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddAwsOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="亚马逊S3配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default AwsSettings;
diff --git a/src/components/Main/Settings/components/BaiduSettings.tsx b/src/components/Main/Settings/components/BaiduSettings.tsx
index 72da2be..b18c45c 100644
--- a/src/components/Main/Settings/components/BaiduSettings.tsx
+++ b/src/components/Main/Settings/components/BaiduSettings.tsx
@@ -1,290 +1,292 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, DatePicker, Drawer, Form, Input, Row, Select, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- endpoint: string;
- accessKeyId: string;
- accessKeySecret: string;
- created_time: string;
- updated_time: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- endpoint: "https://oss.aliyuncs.com",
- accessKeyId: "LTAI5tG3",
- accessKeySecret: "G3",
- created_time: "2022-01-01",
- updated_time: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessKeySecret",
- tooltip: "access key secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "date",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updateTime",
- valueType: "date",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const BaiduSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddBaiduOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="百度云BOS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default BaiduSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, DatePicker, Drawer, Form, Input, Row, Select, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type BaiduOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ accessKeyId: string;
+ accessKeySecret: string;
+ created_time: string;
+ updated_time: string;
+ status: string;
+};
+const data: BaiduOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ endpoint: "https://oss.aliyuncs.com",
+ accessKeyId: "LTAI5tG3",
+ accessKeySecret: "G3",
+ created_time: "2022-01-01",
+ updated_time: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessKeySecret",
+ tooltip: "access key secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "date",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updateTime",
+ valueType: "date",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ render: (text: ReactNode, record: BaiduOssConfigItem, _, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const BaiduSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddBaiduOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="百度云BOS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default BaiduSettings;
diff --git a/src/components/Main/Settings/components/HuaweiSettings.tsx b/src/components/Main/Settings/components/HuaweiSettings.tsx
index c9de753..853b9eb 100644
--- a/src/components/Main/Settings/components/HuaweiSettings.tsx
+++ b/src/components/Main/Settings/components/HuaweiSettings.tsx
@@ -1,242 +1,246 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- endpoint: string;
- accessKey: string;
- secretKey: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "666",
- endpoint: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- secretKey: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKey",
- tooltip: "access key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretKey",
- tooltip: "secret key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const HuawaiSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddHuaweiOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="华为云OBS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default HuawaiSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type HuaweiOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ endpoint: string;
+ accessKey: string;
+ secretKey: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: HuaweiOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "666",
+ endpoint: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ secretKey: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKey",
+ tooltip: "access key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretKey",
+ tooltip: "secret key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: HuaweiOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const HuawaiSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddHuaweiOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="华为云OBS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default HuawaiSettings;
diff --git a/src/components/Main/Settings/components/JdSettings.tsx b/src/components/Main/Settings/components/JdSettings.tsx
index 95fb54f..cfbe8d8 100644
--- a/src/components/Main/Settings/components/JdSettings.tsx
+++ b/src/components/Main/Settings/components/JdSettings.tsx
@@ -1,244 +1,248 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: number;
- endpoint: string;
- accessKey: string;
- secretKey: string;
- region: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: 666,
- endpoint: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- secretKey: "G3",
- region: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKey",
- tooltip: "access key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretKey",
- tooltip: "secret key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "地区",
- dataIndex: "region",
- tooltip: "region",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const JdSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddJdOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="京东云OSS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default JdSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type JdOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: number;
+ endpoint: string;
+ accessKey: string;
+ secretKey: string;
+ region: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: JdOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: 666,
+ endpoint: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ secretKey: "G3",
+ region: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKey",
+ tooltip: "access key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretKey",
+ tooltip: "secret key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "地区",
+ dataIndex: "region",
+ tooltip: "region",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: JdOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const JdSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddJdOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="京东云OSS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default JdSettings;
diff --git a/src/components/Main/Settings/components/JinshanSettings.tsx b/src/components/Main/Settings/components/JinshanSettings.tsx
index fa5d582..b7394c6 100644
--- a/src/components/Main/Settings/components/JinshanSettings.tsx
+++ b/src/components/Main/Settings/components/JinshanSettings.tsx
@@ -1,278 +1,282 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- endpoint: string;
- bucketName: string;
- accessKeyId: string;
- accessKeySecret: string;
- region: string;
- securityToken: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "6666",
- endpoint: "https://oss.aliyuncs.com",
- accessKeyId: "LTAI5tG3",
- accessKeySecret: "G3",
- region: "G3",
- securityToken: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessKeySecret",
- tooltip: "access key secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "地区",
- dataIndex: "region",
- tooltip: "region",
- ellipsis: true,
- },
- {
- disable: true,
- title: "令牌",
- dataIndex: "securityToken",
- tooltip: "security token",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const JinshanSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddJinshanOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="金山OBS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default JinshanSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type JinshanOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ bucketName: string;
+ accessKeyId: string;
+ accessKeySecret: string;
+ region: string;
+ securityToken: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: JinshanOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "6666",
+ endpoint: "https://oss.aliyuncs.com",
+ accessKeyId: "LTAI5tG3",
+ accessKeySecret: "G3",
+ region: "G3",
+ securityToken: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessKeySecret",
+ tooltip: "access key secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "地区",
+ dataIndex: "region",
+ tooltip: "region",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "令牌",
+ dataIndex: "securityToken",
+ tooltip: "security token",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: JinshanOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const JinshanSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddJinshanOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="金山OBS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default JinshanSettings;
diff --git a/src/components/Main/Settings/components/MinioSettings.tsx b/src/components/Main/Settings/components/MinioSettings.tsx
index caaf9d9..2f09912 100644
--- a/src/components/Main/Settings/components/MinioSettings.tsx
+++ b/src/components/Main/Settings/components/MinioSettings.tsx
@@ -1,225 +1,229 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- endpoint: string;
- accessKey: string;
- secretKey: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- endpoint: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- secretKey: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKey",
- tooltip: "access key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretKey",
- tooltip: "secret key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const MinioSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddMinioOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="MinIO配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default MinioSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type MinioOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ accessKey: string;
+ secretKey: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: MinioOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ endpoint: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ secretKey: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKey",
+ tooltip: "access key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretKey",
+ tooltip: "secret key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: MinioOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const MinioSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddMinioOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="MinIO配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default MinioSettings;
diff --git a/src/components/Main/Settings/components/PinanSettings.tsx b/src/components/Main/Settings/components/PinanSettings.tsx
index 5439b44..3594694 100644
--- a/src/components/Main/Settings/components/PinanSettings.tsx
+++ b/src/components/Main/Settings/components/PinanSettings.tsx
@@ -1,225 +1,229 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- endpoint: string;
- accessKeyId: string;
- accessKeySecret: string;
- created_time: string;
- updated_time: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- endpoint: "https://oss.aliyuncs.com",
- accessKeyId: "LTAI5tG3",
- accessKeySecret: "G3",
- created_time: "2022-01-01",
- updated_time: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessKeySecret",
- tooltip: "access key secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updateTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const PinanSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddPinanOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="平安云OSS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default PinanSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type PinanOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ accessKeyId: string;
+ accessKeySecret: string;
+ created_time: string;
+ updated_time: string;
+ status: string;
+};
+const data: PinanOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ endpoint: "https://oss.aliyuncs.com",
+ accessKeyId: "LTAI5tG3",
+ accessKeySecret: "G3",
+ created_time: "2022-01-01",
+ updated_time: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessKeySecret",
+ tooltip: "access key secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updateTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: PinanOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const PinanSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddPinanOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="平安云OSS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default PinanSettings;
diff --git a/src/components/Main/Settings/components/QingyunSettings.tsx b/src/components/Main/Settings/components/QingyunSettings.tsx
index 9bb2ab8..ca2a7ce 100644
--- a/src/components/Main/Settings/components/QingyunSettings.tsx
+++ b/src/components/Main/Settings/components/QingyunSettings.tsx
@@ -1,254 +1,258 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- zone: string;
- endpoint: string;
- accessKey: string;
- bucketName: string;
- accessSecret: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "1",
- zone: "1",
- endpoint: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- accessSecret: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "地区",
- dataIndex: "zone",
- tooltip: "zone",
- ellipsis: true,
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKey",
- tooltip: "access Key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessSecret",
- tooltip: "access Secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const QingyunSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddQingyunOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="青云OSS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default QingyunSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type QingyunOssConfigItem = {
+ id: number;
+ userId: number;
+ zone: string;
+ endpoint: string;
+ accessKey: string;
+ bucketName: string;
+ accessSecret: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: QingyunOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "1",
+ zone: "1",
+ endpoint: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ accessSecret: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "地区",
+ dataIndex: "zone",
+ tooltip: "zone",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKey",
+ tooltip: "access Key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessSecret",
+ tooltip: "access Secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: QingyunOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const QingyunSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddQingyunOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="青云OSS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default QingyunSettings;
diff --git a/src/components/Main/Settings/components/QiniuSettings.tsx b/src/components/Main/Settings/components/QiniuSettings.tsx
index ca6457e..b63e9f6 100644
--- a/src/components/Main/Settings/components/QiniuSettings.tsx
+++ b/src/components/Main/Settings/components/QiniuSettings.tsx
@@ -1,225 +1,229 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- accessKey: string;
- secretKey: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- secretKey: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKeyId",
- tooltip: "access key id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "accessKeySecret",
- tooltip: "access key secret",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const QiniuSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddQiniuOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="七牛Kodo配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default QiniuSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type QiniuOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ accessKey: string;
+ secretKey: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: QiniuOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ secretKey: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKeyId",
+ tooltip: "access key id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "accessKeySecret",
+ tooltip: "access key secret",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: QiniuOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const QiniuSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddQiniuOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="七牛Kodo配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default QiniuSettings;
diff --git a/src/components/Main/Settings/components/TencentSettings.tsx b/src/components/Main/Settings/components/TencentSettings.tsx
index 9e08e8a..d401523 100644
--- a/src/components/Main/Settings/components/TencentSettings.tsx
+++ b/src/components/Main/Settings/components/TencentSettings.tsx
@@ -1,215 +1,219 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- secretId: string;
- secretKey: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "https://oss.aliyuncs.com",
- secretId: "LTAI5tG3",
- secretKey: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "secretId",
- tooltip: "secret Id",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretKey",
- tooltip: "secret Key",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const TencentSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddTencentOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="腾讯云COS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default TencentSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type TencentOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ secretId: string;
+ secretKey: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: TencentOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "https://oss.aliyuncs.com",
+ secretId: "LTAI5tG3",
+ secretKey: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "secretId",
+ tooltip: "secret Id",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretKey",
+ tooltip: "secret Key",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: TencentOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const TencentSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddTencentOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="腾讯云COS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default TencentSettings;
diff --git a/src/components/Main/Settings/components/UcloudSettings.tsx b/src/components/Main/Settings/components/UcloudSettings.tsx
index 54c0837..9bf6971 100644
--- a/src/components/Main/Settings/components/UcloudSettings.tsx
+++ b/src/components/Main/Settings/components/UcloudSettings.tsx
@@ -1,242 +1,246 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- publicKey: string;
- privateKey: string;
- customHost: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "https://oss.aliyuncs.com",
- publicKey: "LTAI5tG3",
- privateKey: "G3",
- customHost: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "公钥",
- dataIndex: "publicKey",
- tooltip: "publicKey",
- ellipsis: true,
- },
- {
- disable: true,
- title: "私钥",
- dataIndex: "privateKey",
- tooltip: "privateKey",
- ellipsis: true,
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "customHost",
- tooltip: "customHost",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const UcloudSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddUcloudOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="UCloud US3配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default UcloudSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type UcloudOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ publicKey: string;
+ privateKey: string;
+ customHost: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: UcloudOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "https://oss.aliyuncs.com",
+ publicKey: "LTAI5tG3",
+ privateKey: "G3",
+ customHost: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "公钥",
+ dataIndex: "publicKey",
+ tooltip: "publicKey",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "私钥",
+ dataIndex: "privateKey",
+ tooltip: "privateKey",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "customHost",
+ tooltip: "customHost",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: UcloudOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const UcloudSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddUcloudOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="UCloud US3配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default UcloudSettings;
diff --git a/src/components/Main/Settings/components/UpSettings.tsx b/src/components/Main/Settings/components/UpSettings.tsx
index d14f091..1623ee5 100644
--- a/src/components/Main/Settings/components/UpSettings.tsx
+++ b/src/components/Main/Settings/components/UpSettings.tsx
@@ -1,225 +1,229 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- bucketName: string;
- userName: string;
- password: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- bucketName: "https://oss.aliyuncs.com",
- userName: "LTAI5tG3",
- password: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "用户名",
- dataIndex: "userName",
- tooltip: "userName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密码",
- dataIndex: "password",
- tooltip: "password",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const UpSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddUpOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="又拍云USS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default UpSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type UpOssConfigItem = {
+ id: number;
+ userId: number;
+ bucketName: string;
+ userName: string;
+ password: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: UpOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ bucketName: "https://oss.aliyuncs.com",
+ userName: "LTAI5tG3",
+ password: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "用户名",
+ dataIndex: "userName",
+ tooltip: "userName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密码",
+ dataIndex: "password",
+ tooltip: "password",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: UpOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const UpSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddUpOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="又拍云USS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default UpSettings;
diff --git a/src/components/Main/Settings/components/WangyiSettings.tsx b/src/components/Main/Settings/components/WangyiSettings.tsx
index 548d573..5a25fd2 100644
--- a/src/components/Main/Settings/components/WangyiSettings.tsx
+++ b/src/components/Main/Settings/components/WangyiSettings.tsx
@@ -1,242 +1,246 @@
-/** @format */
-import { PlusOutlined } from "@ant-design/icons";
-import type { ActionType, ProColumns } from "@ant-design/pro-components";
-import { ProTable, TableDropdown } from "@ant-design/pro-components";
-import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
-import React, { useRef, useState } from "react";
-
-type AliOssConfigItem = {
- id: number;
- userId: number;
- endpoint: string;
- bucketName: string;
- accessKey: string;
- secretKey: string;
- createdTime: string;
- updatedTime: string;
- status: string;
-};
-const data: AliOssConfigItem[] = [
- {
- id: 1,
- userId: 1,
- endpoint: "https://oss.aliyuncs.com",
- bucketName: "https://oss.aliyuncs.com",
- accessKey: "LTAI5tG3",
- secretKey: "G3",
- createdTime: "2022-01-01",
- updatedTime: "2022-01-01",
- status: "正常",
- },
-];
-
-const columns: ProColumns[] = [
- {
- dataIndex: "index",
- valueType: "indexBorder",
- width: 48,
- },
- {
- title: "ID",
- dataIndex: "id",
- copyable: true,
- ellipsis: true,
- tooltip: "Id",
- },
- {
- disable: true,
- title: "服务地址",
- dataIndex: "endpoint",
- tooltip: "endpoint",
- ellipsis: true,
- },
- {
- disable: true,
- title: "存储桶",
- dataIndex: "bucketName",
- tooltip: "bucketName",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥ID",
- dataIndex: "accessKey",
- tooltip: "accessKey",
- ellipsis: true,
- },
- {
- disable: true,
- title: "密钥值",
- dataIndex: "secretKey",
- tooltip: "secretKey",
- ellipsis: true,
- },
- {
- disable: true,
- title: "状态",
- dataIndex: "status",
- search: true,
- },
- {
- title: "创建时间",
- dataIndex: "createdTime",
- valueType: "dateTime",
- sorter: true,
- hideInSearch: true,
- },
- {
- title: "更新时间",
- dataIndex: "updatedTime",
- valueType: "dateTime",
- sorter: true,
- },
- {
- title: "操作",
- valueType: "option",
- key: "option",
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- render: (text, record, _, action) => [
- {
- action?.startEditable?.(record.id);
- }}>
- 编辑
- ,
-
- 查看
- ,
- action?.reload()}
- menus={[
- { key: "copy", name: "复制" },
- { key: "delete", name: "删除" },
- ]}
- />,
- ],
- },
-];
-
-const WangyiSettings: React.FC = () => {
- const actionRef = useRef();
- const [open, setOpen] = useState(false);
- const showDrawer = () => {
- setOpen(true);
- };
-
- const onClose = () => {
- setOpen(false);
- };
- const AddWangyiOssConfigDrawer = () => {
- return (
- <>
-
-
-
-
- }>
-
-
- >
- );
- };
- return (
- <>
-
- columns={columns}
- dataSource={data}
- actionRef={actionRef}
- cardBordered={true}
- editable={{
- type: "multiple",
- }}
- columnsState={{
- persistenceKey: "pro-table-singe-demos",
- persistenceType: "localStorage",
- defaultValue: {
- option: { fixed: "right", disable: true },
- },
- }}
- rowKey="id"
- search={false}
- options={{
- setting: {
- listsHeight: 400,
- },
- }}
- pagination={{
- pageSize: 5,
- }}
- dateFormatter="string"
- headerTitle="阿里云OSS配置"
- bordered={false}
- toolBarRender={() => [
- }
- onClick={() => {
- showDrawer();
- }}
- type="primary">
- 新建
- ,
- ]}
- />
-
- >
- );
-};
-
-export default WangyiSettings;
+/** @format */
+import { PlusOutlined } from "@ant-design/icons";
+import type { ActionType, ProColumns } from "@ant-design/pro-components";
+import { ProTable, TableDropdown } from "@ant-design/pro-components";
+import { Button, Col, Drawer, Form, Input, Row, Space } from "antd";
+import React, { ReactNode, useRef, useState } from "react";
+
+type WangyiOssConfigItem = {
+ id: number;
+ userId: number;
+ endpoint: string;
+ bucketName: string;
+ accessKey: string;
+ secretKey: string;
+ createdTime: string;
+ updatedTime: string;
+ status: string;
+};
+const data: WangyiOssConfigItem[] = [
+ {
+ id: 1,
+ userId: 1,
+ endpoint: "https://oss.aliyuncs.com",
+ bucketName: "https://oss.aliyuncs.com",
+ accessKey: "LTAI5tG3",
+ secretKey: "G3",
+ createdTime: "2022-01-01",
+ updatedTime: "2022-01-01",
+ status: "正常",
+ },
+];
+
+const columns: ProColumns[] = [
+ {
+ dataIndex: "index",
+ valueType: "indexBorder",
+ width: 48,
+ },
+ {
+ title: "ID",
+ dataIndex: "id",
+ copyable: true,
+ ellipsis: true,
+ tooltip: "Id",
+ },
+ {
+ disable: true,
+ title: "服务地址",
+ dataIndex: "endpoint",
+ tooltip: "endpoint",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "存储桶",
+ dataIndex: "bucketName",
+ tooltip: "bucketName",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥ID",
+ dataIndex: "accessKey",
+ tooltip: "accessKey",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "密钥值",
+ dataIndex: "secretKey",
+ tooltip: "secretKey",
+ ellipsis: true,
+ },
+ {
+ disable: true,
+ title: "状态",
+ dataIndex: "status",
+ search: true,
+ },
+ {
+ title: "创建时间",
+ dataIndex: "createdTime",
+ valueType: "dateTime",
+ sorter: true,
+ hideInSearch: true,
+ },
+ {
+ title: "更新时间",
+ dataIndex: "updatedTime",
+ valueType: "dateTime",
+ sorter: true,
+ },
+ {
+ title: "操作",
+ valueType: "option",
+ key: "option",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (text: ReactNode, record: WangyiOssConfigItem, _: number, action: any) => [
+ {
+ action?.startEditable?.(record.id);
+ }}>
+ 编辑
+ ,
+
+ 查看
+ ,
+ action?.reload()}
+ menus={[
+ { key: "copy", name: "复制" },
+ { key: "delete", name: "删除" },
+ ]}
+ />,
+ ],
+ },
+];
+
+const WangyiSettings: React.FC = () => {
+ const actionRef = useRef();
+ const [open, setOpen] = useState(false);
+ const showDrawer = () => {
+ setOpen(true);
+ };
+
+ const onClose = () => {
+ setOpen(false);
+ };
+ const AddWangyiOssConfigDrawer = () => {
+ return (
+ <>
+
+
+
+
+ }>
+
+
+ >
+ );
+ };
+ return (
+ <>
+
+
+ columns={columns}
+ dataSource={data}
+ actionRef={actionRef}
+ cardBordered={true}
+ editable={{
+ type: "multiple",
+ }}
+ columnsState={{
+ persistenceKey: "pro-table-singe-demos",
+ persistenceType: "localStorage",
+ defaultValue: {
+ option: { fixed: "right", disable: true },
+ },
+ }}
+ rowKey="id"
+ search={false}
+ options={{
+ setting: {
+ listsHeight: 400,
+ },
+ }}
+ pagination={
+ {
+ pageSize: 5,
+ } as any
+ }
+ dateFormatter="string"
+ headerTitle="阿里云OSS配置"
+ bordered={false}
+ toolBarRender={() => [
+ }
+ onClick={() => {
+ showDrawer();
+ }}
+ type="primary">
+ 新建
+ ,
+ ]}
+ />
+
+
+ >
+ );
+};
+
+export default WangyiSettings;
diff --git a/src/components/Main/Settings/index.tsx b/src/components/Main/Settings/index.tsx
index 32b81e5..2e75613 100644
--- a/src/components/Main/Settings/index.tsx
+++ b/src/components/Main/Settings/index.tsx
@@ -58,7 +58,7 @@ export default () => {
{location.pathname === "/main/setting" || location.pathname === "/main/setting/" ? (
<>
-
+
>
) : (
<>
diff --git a/src/components/Main/Share/components/ShareAdd/ShareAdd.tsx b/src/components/Main/Share/components/ShareAdd/ShareAdd.tsx
index 9efc83a..ece6148 100644
--- a/src/components/Main/Share/components/ShareAdd/ShareAdd.tsx
+++ b/src/components/Main/Share/components/ShareAdd/ShareAdd.tsx
@@ -6,7 +6,7 @@ import { useNavigate } from "react-router-dom";
import "aieditor/dist/style.css";
import styles from "./index.module.less";
import { ProCard } from "@ant-design/pro-components";
-import { Button, Card, Form, FormListFieldData, FormProps, Input, Select } from "antd";
+import { Button, Card, Flex, Form, FormListFieldData, FormProps, Input, Select } from "antd";
import { CloseOutlined, LeftOutlined, MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
import selectOptions from "@/components/Main/Settings/settings.ts";
@@ -34,7 +34,7 @@ const ShareAdd: React.FunctionComponent = () => {
content: value.getHtml(),
});
},
- });
+ } as any);
return () => {
aiEditor.destroy();
};
@@ -44,38 +44,66 @@ const ShareAdd: React.FunctionComponent = () => {
<>
- }
- onClick={() => {
- navigate("/main/share/list/1");
- }}
- />
+
+ }
+ onClick={() => {
+ navigate("/main/share/list/1");
+ }}
+ />
+
+ 新增分享
+
+
+ 标题
+ >
+ }
name="title"
id={"title"}
rules={[{ required: true, message: "请输入标题" }]}>
+ 图标
+ >
+ }
id={"icon"}
name="icon"
rules={[{ required: true, message: "请输入图标" }]}>
+ 摘要
+ >
+ }
id={"description"}
name="description"
rules={[{ required: true, message: "请输入摘要" }]}>
-
+
+ 介绍
+ >
+ }
+ name="content"
+ id={"content"}>
{
if (tags.length >= 3) {
setIsDisabled(true);
return Promise.reject(
- new Error("最多只能添加五个标签"),
+ new Error("最多只能添加三个标签"),
);
}
},
@@ -102,7 +130,11 @@ const ShareAdd: React.FunctionComponent = () => {
<>
{fields.map((field: FormListFieldData, index: number) => (
+ {"标签" + (index + 1)}
+ >
+ }
key={index}
id={"tags"}>
{
))}
diff --git a/src/components/Main/Share/components/ShareDetail/ShareDetail.tsx b/src/components/Main/Share/components/ShareDetail/ShareDetail.tsx
index 249c4f5..327d057 100644
--- a/src/components/Main/Share/components/ShareDetail/ShareDetail.tsx
+++ b/src/components/Main/Share/components/ShareDetail/ShareDetail.tsx
@@ -1,10 +1,16 @@
/** @format */
import React from "react";
-import { Avatar, Button, Card, Divider, Flex, Tooltip } from "antd";
+import { Avatar, Button, Card, Divider, Flex, Tag, Tooltip } from "antd";
import {
+ CommentOutlined,
ExportOutlined,
+ EyeOutlined,
+ HeartOutlined,
InfoCircleOutlined,
LeftOutlined,
+ LikeOutlined,
+ StarOutlined,
+ TagsOutlined,
WarningOutlined,
} from "@ant-design/icons";
import { useNavigate } from "react-router-dom";
@@ -13,7 +19,8 @@ import { ProCard } from "@ant-design/pro-components";
import styles from "./index.module.less";
import logo from "@/assets/icons/baiduyun.svg";
import { Typography } from "antd";
-
+import Comment from "@/components/Main/Share/components/ShareDetail/components/Comment";
+import getRandomColor from "@/constant/random-color.ts";
const { Paragraph } = Typography;
const ShareDetail: React.FunctionComponent = () => {
const navigate = useNavigate();
@@ -21,19 +28,69 @@ const ShareDetail: React.FunctionComponent = () => {
<>
- }
- onClick={() => {
- navigate("/main/share/list/1");
- }}
- />
+
+ }
+ onClick={() => {
+ navigate("/main/share/list/1");
+ }}
+ />
+
+ 办公软件分享
+
+
+
+
+
+ landaiqing
+
+
+
+
+
+ 1024
+
+
+
+
+
+ 1024
+
+
+
+ {" "}
+
+ 1024
+
+
+
+
-
- 资源描述
-
+ 资源描述
@@ -124,8 +181,30 @@ const ShareDetail: React.FunctionComponent = () => {
+
+
+
+
+
+ 测试标签
+
+
+ 测试标签
+
+
+ 测试标签
+
+
+
+
+
+
+
+
>
);
diff --git a/src/components/Main/Share/components/ShareDetail/components/Comment/index.module.less b/src/components/Main/Share/components/ShareDetail/components/Comment/index.module.less
new file mode 100644
index 0000000..e69de29
diff --git a/src/components/Main/Share/components/ShareDetail/components/Comment/index.tsx b/src/components/Main/Share/components/ShareDetail/components/Comment/index.tsx
new file mode 100644
index 0000000..2ca3e2d
--- /dev/null
+++ b/src/components/Main/Share/components/ShareDetail/components/Comment/index.tsx
@@ -0,0 +1,60 @@
+/** @format */
+import { ProCard } from "@ant-design/pro-components";
+import { Avatar, Button, Flex, Input, Segmented } from "antd";
+import logo from "@/assets/icons/gitee.svg";
+import {
+ BarsOutlined,
+ FireOutlined,
+ PictureOutlined,
+ SendOutlined,
+ SmileOutlined,
+} from "@ant-design/icons";
+const Comment = () => {
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ } type={"primary"}>
+ 发表
+
+
+
+
+
+ },
+ { label: "最热", value: "Kanban", icon: },
+ ]}
+ />
+
+
+
+ >
+ );
+};
+export default Comment;
diff --git a/src/components/Main/Share/components/ShareList/ShareList.tsx b/src/components/Main/Share/components/ShareList/ShareList.tsx
index 3d58d06..69ca4ee 100644
--- a/src/components/Main/Share/components/ShareList/ShareList.tsx
+++ b/src/components/Main/Share/components/ShareList/ShareList.tsx
@@ -1,13 +1,18 @@
/** @format */
import { ProCard } from "@ant-design/pro-components";
-import { Avatar, Button, Divider, Flex, List, Skeleton, Tag } from "antd";
+import { Avatar, Button, Divider, Flex, Input, List, Skeleton, Tag } from "antd";
import { useEffect, useState } from "react";
import styles from "./index.module.less";
-import Search from "antd/es/input/Search";
import InfiniteScroll from "react-infinite-scroll-component";
import { useNavigate } from "react-router-dom";
-import { CommentOutlined, EyeOutlined, HeartOutlined, LeftOutlined } from "@ant-design/icons";
+import {
+ CommentOutlined,
+ EyeOutlined,
+ HeartOutlined,
+ LeftOutlined,
+ ShareAltOutlined,
+} from "@ant-design/icons";
import logo from "@/assets/icons/aliyun.svg";
interface DataType {
gender: string;
@@ -51,7 +56,7 @@ export default () => {
return (
<>
-
+
-
+
{
scrollableTarget="scrollableDiv">
+ 分享列表
+ >
+ }
renderItem={(item) => (
{
vertical={false}
align={"center"}
justify={"space-between"}
- style={{ width: "250px" }}>
-
-
- landaiqing
-
-
-
- 1024
-
-
-
- 1024
-
- {" "}
-
- 1024
-
+ style={{ width: "25%" }}>
+
+
+
+ landaiqing
+
+
+
+
+
+ 1024
+
+
+
+
+
+ 1024
+
+
+
+ {" "}
+
+ 1024
+
+
>
diff --git a/src/components/Main/Share/components/ShareList/index.module.less b/src/components/Main/Share/components/ShareList/index.module.less
index 709256b..61c59f6 100644
--- a/src/components/Main/Share/components/ShareList/index.module.less
+++ b/src/components/Main/Share/components/ShareList/index.module.less
@@ -1,6 +1,7 @@
.share_list_main{
display: flex;
flex-direction: column;
+ min-height: 83vh;
.share_list_header{
display: flex;
flex-direction: row;
diff --git a/src/components/Main/Share/index.module.less b/src/components/Main/Share/index.module.less
index 92c5c46..48f8a6b 100644
--- a/src/components/Main/Share/index.module.less
+++ b/src/components/Main/Share/index.module.less
@@ -1,10 +1,11 @@
-.share_main{
- display: flex;
- flex-direction: column;
- .share_header{
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
-}
+.share_main{
+ min-height: 83vh;
+ display: flex;
+ flex-direction: column;
+ .share_header{
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ }
+}
diff --git a/src/components/Main/Share/index.tsx b/src/components/Main/Share/index.tsx
index ed76e9d..f8baf3b 100644
--- a/src/components/Main/Share/index.tsx
+++ b/src/components/Main/Share/index.tsx
@@ -2,14 +2,15 @@
import { FunctionComponent, useState } from "react";
import { ProCard } from "@ant-design/pro-components";
import styles from "./index.module.less";
-import { Avatar, Button, Card, Drawer, Flex, Form, Image, Input, Space } from "antd";
+import { Avatar, Button, Card, Drawer, Flex, FloatButton, Form, Image, Input, Space } from "antd";
-import Search from "antd/es/input/Search";
-import Meta from "antd/es/card/Meta";
import { useNavigate } from "react-router-dom";
-import background from "@/assets/images/background.png";
import TextArea from "antd/es/input/TextArea";
-import { EyeOutlined, UnorderedListOutlined } from "@ant-design/icons";
+import { EyeOutlined, PlusOutlined, UnorderedListOutlined } from "@ant-design/icons";
+import pic from "@/assets/images/background.png";
+import pic2 from "@/assets/images/setting.png";
+
+import Meta from "antd/es/card/Meta";
const MainShare: FunctionComponent = () => {
const navigate = useNavigate();
const [open, setOpen] = useState(false);
@@ -23,91 +24,90 @@ const MainShare: FunctionComponent = () => {
return (
<>
-
{
+ }
+ onClick={() => setOpen(true)}
+ />
>
);
};
diff --git a/src/components/Main/User/MyFavorites/index.module.less b/src/components/Main/User/MyFavorites/index.module.less
new file mode 100644
index 0000000..e69de29
diff --git a/src/components/Main/User/MyFavorites/index.tsx b/src/components/Main/User/MyFavorites/index.tsx
new file mode 100644
index 0000000..238b074
--- /dev/null
+++ b/src/components/Main/User/MyFavorites/index.tsx
@@ -0,0 +1,131 @@
+/** @format */
+
+import { ProCard } from "@ant-design/pro-components";
+import { Avatar, Divider, Flex, List, Skeleton, Tag } from "antd";
+import { useEffect, useState } from "react";
+import InfiniteScroll from "react-infinite-scroll-component";
+import { useNavigate } from "react-router-dom";
+import { CommentOutlined, EyeOutlined, HeartOutlined } from "@ant-design/icons";
+import logo from "@/assets/icons/aliyun.svg";
+interface DataType {
+ gender: string;
+ name: {
+ title: string;
+ first: string;
+ last: string;
+ };
+ email: string;
+ picture: {
+ large: string;
+ medium: string;
+ thumbnail: string;
+ };
+ nat: string;
+}
+
+export default () => {
+ const navigate = useNavigate();
+ const [loading, setLoading] = useState(false);
+ const [data, setData] = useState([]);
+ const loadMoreData = () => {
+ if (loading) {
+ return;
+ }
+ setLoading(true);
+ fetch("https://randomuser.me/api/?results=10&inc=name,gender,email,nat,picture&noinfo")
+ .then((res) => res.json())
+ .then((body) => {
+ setData([...data, ...body.results]);
+ setLoading(false);
+ })
+ .catch(() => {
+ setLoading(false);
+ });
+ };
+
+ useEffect(() => {
+ loadMoreData();
+ }, []);
+ return (
+ <>
+
+
+ }
+ endMessage={It is all, nothing more 🤐}
+ scrollableTarget="scrollableDiv">
+ (
+
+ }
+ title={
+ <>
+ {
+ navigate("/main/share/detail/1");
+ }}>
+ {item.name.last}
+
+
+ IDM
+
+ >
+ }
+ description={
+ <>
+
+ {item.email}
+
+
+
+ landaiqing
+
+
+
+ 1024
+
+
+
+ 1024
+
+ {" "}
+
+ 1024
+
+
+
+ >
+ }
+ />
+ {/*Content
*/}
+
+ )}
+ />
+
+
+
+ >
+ );
+};
diff --git a/src/constant/random-color.ts b/src/constant/random-color.ts
new file mode 100644
index 0000000..2a53845
--- /dev/null
+++ b/src/constant/random-color.ts
@@ -0,0 +1,24 @@
+/** @format */
+
+const RandomColor: any = [
+ "processing",
+ "success",
+ "error",
+ "warning",
+ "magenta",
+ "blue",
+ "geekblue",
+ "purple",
+ "#f50",
+ "#2db7f5",
+ "#87d068",
+ "#108ee9",
+ "red",
+ "volcano",
+ "orange",
+ "gold",
+ "lime",
+ "green",
+];
+const getRandomColor = () => RandomColor[Math.floor(Math.random() * RandomColor.length)];
+export default getRandomColor;
diff --git a/src/constant/stroage-icon.ts b/src/constant/stroage-icon.ts
index 6777808..28a11b9 100644
--- a/src/constant/stroage-icon.ts
+++ b/src/constant/stroage-icon.ts
@@ -14,6 +14,7 @@ import pinanyun from "@/assets/icons/pinanyun.svg";
import qingyun from "@/assets/icons/qingyun.svg";
import ucloud from "@/assets/icons/ucloud.svg";
import jinshan from "@/assets/icons/jinshan.svg";
+import bucket from "@/assets/icons/bucket.svg";
const StorageIcon: any = {
ali: aliyun,
@@ -30,5 +31,6 @@ const StorageIcon: any = {
qingyun: qingyun,
ucloud: ucloud,
jinshan: jinshan,
+ bucket:bucket,
};
export default StorageIcon;
diff --git a/src/router/modules/main/user/myFavorites/index.ts b/src/router/modules/main/user/myFavorites/index.ts
new file mode 100644
index 0000000..dfcb23d
--- /dev/null
+++ b/src/router/modules/main/user/myFavorites/index.ts
@@ -0,0 +1,11 @@
+/** @format */
+
+import { lazy } from "react";
+
+const MyFavorites = lazy(
+ () =>
+ new Promise((resolve: any) => {
+ resolve(import("@/components/Main/User/MyFavorites/index.tsx"));
+ }),
+);
+export default MyFavorites;
diff --git a/src/router/routes.tsx b/src/router/routes.tsx
index eb8bb24..76a1737 100644
--- a/src/router/routes.tsx
+++ b/src/router/routes.tsx
@@ -48,6 +48,7 @@ import upBucket from "@/router/modules/main/bucket/createBuckets/up.ts";
import wangyiBucket from "@/router/modules/main/bucket/createBuckets/wangyi.ts";
import ShareAdd from "@/router/modules/main/share/modules/shareAdd.tsx";
import MyShare from "@/router/modules/main/user/myShare";
+import MyFavorites from "@/router/modules/main/user/myFavorites";
const routes: RouteObject[] = [
{
@@ -161,6 +162,11 @@ const routes: RouteObject[] = [
path: "/main/user/myshare",
Component: MyShare,
},
+ {
+ path: "/main/user/favorites",
+ Component: MyFavorites,
+ },
+
{
path: "/main/share",
Component: MainShare,
diff --git a/src/store/modules/file.ts b/src/store/modules/file.ts
index 889cd5b..e4d8b3c 100644
--- a/src/store/modules/file.ts
+++ b/src/store/modules/file.ts
@@ -1,69 +1,65 @@
-/** @format */
-
-import { action, makeObservable, observable } from "mobx";
-import { isHydrated, makePersistable } from "mobx-persist-store";
-import { handleLocalforage } from "@/utils/localforage";
-
-export class useFileStore {
- filePath: [any] = [
- {
- title: "/ root",
- },
- ];
-
- constructor() {
- makeObservable(this, {
- filePath: observable,
- setFilePath: action,
- getFilePath: action,
- clearFilePath: action,
- getFilePathSecondLast: action,
- isHydrated: action,
- });
- makePersistable(
- this,
- {
- // 在构造函数内使用 makePersistable
- name: "file", // 保存的name,用于在storage中的名称标识,只要不和storage中其他名称重复就可以
- properties: ["filePath"], // 要保存的字段,这些字段会被保存在name对应的storage中,注意:不写在这里面的字段将不会被保存,刷新页面也将丢失:get字段例外。get数据会在数据返回后再自动计算
- storage: handleLocalforage, // 保存的位置:可以是localStorage,sessionstorage
- removeOnExpiration: true, //如果 expireIn 具有值且已过期,则在调用 getItem 时将自动删除存储中的数据。默认值为 true。
- stringify: false, //如果为 true,则数据在传递给 setItem 之前将是 JSON.stringify。默认值为 true。
- expireIn: 2592000000, // 一个以毫秒为单位的值,用于确定 getItem 何时不应检索存储中的数据。默认情况下永不过期。
- debugMode: false, // 如果为 true,将为多个 mobx-persist-store 项调用 console.info。默认值为 false。
- },
- {
- delay: 0, // 允许您设置一个 delay 选项来限制 write 函数的调用次数。默认情况下没有延迟。
- fireImmediately: false, // 确定是应立即保留存储数据,还是等到存储中的属性发生更改。 false 默认情况下。
- },
- ).then(
- action(() => {
- // persist 完成的回调,在这里可以执行一些拿到数据后需要执行的操作,如果在页面上要判断是否完成persist,使用 isHydrated
- // console.log(persistStore)
- }),
- );
- }
- // 获取文件路径
- getFilePath() {
- return this.filePath ? this.filePath : [];
- }
- // 设置文件路径
- setFilePath(path: any) {
- this.filePath.push(path);
- }
- // 删除文件路径最后一个
- clearFilePath() {
- if (this.filePath.length === 1) {
- return;
- }
- this.filePath.pop();
- }
- // 获取文件路径倒数第二个
- getFilePathSecondLast() {
- return this.filePath.slice(0, -1).pop();
- }
-
- isHydrated() {
- return isHydrated(this);
- }
-}
+/** @format */
+
+import { action, makeObservable, observable } from "mobx";
+import { isHydrated, makePersistable } from "mobx-persist-store";
+import { handleLocalforage } from "@/utils/localforage";
+
+export class useFileStore {
+ filePath: [any] = ["/root"];
+
+ constructor() {
+ makeObservable(this, {
+ filePath: observable,
+ setFilePath: action,
+ getFilePath: action,
+ clearFilePath: action,
+ getFilePathSecondLast: action,
+ isHydrated: action,
+ });
+ makePersistable(
+ this,
+ {
+ // 在构造函数内使用 makePersistable
+ name: "file", // 保存的name,用于在storage中的名称标识,只要不和storage中其他名称重复就可以
+ properties: ["filePath"], // 要保存的字段,这些字段会被保存在name对应的storage中,注意:不写在这里面的字段将不会被保存,刷新页面也将丢失:get字段例外。get数据会在数据返回后再自动计算
+ storage: handleLocalforage, // 保存的位置:可以是localStorage,sessionstorage
+ removeOnExpiration: true, //如果 expireIn 具有值且已过期,则在调用 getItem 时将自动删除存储中的数据。默认值为 true。
+ stringify: false, //如果为 true,则数据在传递给 setItem 之前将是 JSON.stringify。默认值为 true。
+ expireIn: 2592000000, // 一个以毫秒为单位的值,用于确定 getItem 何时不应检索存储中的数据。默认情况下永不过期。
+ debugMode: false, // 如果为 true,将为多个 mobx-persist-store 项调用 console.info。默认值为 false。
+ },
+ {
+ delay: 0, // 允许您设置一个 delay 选项来限制 write 函数的调用次数。默认情况下没有延迟。
+ fireImmediately: false, // 确定是应立即保留存储数据,还是等到存储中的属性发生更改。 false 默认情况下。
+ },
+ ).then(
+ action(() => {
+ // persist 完成的回调,在这里可以执行一些拿到数据后需要执行的操作,如果在页面上要判断是否完成persist,使用 isHydrated
+ // console.log(persistStore)
+ }),
+ );
+ }
+ // 获取文件路径
+ getFilePath() {
+ return this.filePath ? this.filePath : [];
+ }
+ // 设置文件路径
+ setFilePath(path: any) {
+ this.filePath.push(path);
+ }
+ // 删除文件路径最后一个
+ clearFilePath() {
+ if (this.filePath.length === 1) {
+ return;
+ }
+ this.filePath.pop();
+ }
+ // 获取文件路径倒数第二个
+ getFilePathSecondLast() {
+ return this.filePath.slice(0, -1).pop();
+ }
+
+ isHydrated() {
+ return isHydrated(this);
+ }
+}
diff --git a/src/views/Main/index.tsx b/src/views/Main/index.tsx
index 4ded12b..0d7c582 100644
--- a/src/views/Main/index.tsx
+++ b/src/views/Main/index.tsx
@@ -6,12 +6,7 @@ import {
LogoutOutlined,
QuestionCircleFilled,
} from "@ant-design/icons";
-import {
- DefaultFooter,
- PageContainer,
- ProCard,
- ProLayout,
-} from "@ant-design/pro-components";
+import { DefaultFooter, PageContainer, ProCard, ProLayout } from "@ant-design/pro-components";
import { Link, Outlet, useLocation } from "react-router-dom";
import logo from "@/assets/images/logo.png";
import { Suspense } from "react";
@@ -28,8 +23,9 @@ export default function Layout() {
height: "100vh",
}}>
{
- return (
- ,
- label: "退出登录",
- },
- ],
- }}>
- {dom}
-
- );
- },
- }}
+ avatarProps={
+ {
+ src: "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
+ title: "七妮妮",
+ size: "large",
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-expect-error
+ render: (props, dom) => {
+ return (
+ ,
+ label: "退出登录",
+ onClick: () => {
+ console.log("推出");
+ },
+ },
+ ],
+ }}>
+ {dom}
+
+ );
+ },
+ } as any
+ }
actionsRender={(props: any) => {
// eslint-disable-next-line react/prop-types
if (props.isMobile) return [];
@@ -99,15 +100,20 @@ export default function Layout() {
)}>
-
+
diff --git a/src/views/Main/settings.tsx b/src/views/Main/settings.tsx
index fb227eb..c122968 100644
--- a/src/views/Main/settings.tsx
+++ b/src/views/Main/settings.tsx
@@ -73,6 +73,11 @@ export default {
name: "我的分享",
icon: "https://pic.imgdb.cn/item/668f8e5fd9c307b7e9f079bf.png",
},
+ {
+ path: "main/user/favorites",
+ name: "我的收藏",
+ icon: "https://pic.imgdb.cn/item/6690e7c0d9c307b7e9738f02.png",
+ },
],
},
],