From 6ec4a9285368a362c70e418ed6e6cb78b9fc6f7c Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Fri, 12 Jul 2024 23:46:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 6 + pnpm-lock.yaml | 40 +- src/assets/images/favorites.png | Bin 0 -> 5597 bytes src/assets/styles/index.less | 73 ++- src/components/Main/Bucket/index.module.less | 4 +- .../Main/File/components/FileUpload.tsx | 115 +++- src/components/Main/File/index.module.less | 95 ++- src/components/Main/File/index.tsx | 121 +++- .../Main/Settings/components/AliSettings.tsx | 452 +++++++------- .../Main/Settings/components/AwsSettings.tsx | 524 ++++++++-------- .../Settings/components/BaiduSettings.tsx | 582 +++++++++--------- .../Settings/components/HuaweiSettings.tsx | 488 +++++++-------- .../Main/Settings/components/JdSettings.tsx | 492 +++++++-------- .../Settings/components/JinshanSettings.tsx | 560 ++++++++--------- .../Settings/components/MinioSettings.tsx | 454 +++++++------- .../Settings/components/PinanSettings.tsx | 454 +++++++------- .../Settings/components/QingyunSettings.tsx | 512 +++++++-------- .../Settings/components/QiniuSettings.tsx | 454 +++++++------- .../Settings/components/TencentSettings.tsx | 434 ++++++------- .../Settings/components/UcloudSettings.tsx | 488 +++++++-------- .../Main/Settings/components/UpSettings.tsx | 454 +++++++------- .../Settings/components/WangyiSettings.tsx | 488 +++++++-------- src/components/Main/Settings/index.tsx | 2 +- .../Share/components/ShareAdd/ShareAdd.tsx | 74 ++- .../components/ShareDetail/ShareDetail.tsx | 103 +++- .../components/Comment/index.module.less | 0 .../ShareDetail/components/Comment/index.tsx | 60 ++ .../Share/components/ShareList/ShareList.tsx | 98 ++- .../components/ShareList/index.module.less | 1 + src/components/Main/Share/index.module.less | 21 +- src/components/Main/Share/index.tsx | 117 ++-- .../Main/User/MyFavorites/index.module.less | 0 .../Main/User/MyFavorites/index.tsx | 131 ++++ src/constant/random-color.ts | 24 + src/constant/stroage-icon.ts | 2 + .../modules/main/user/myFavorites/index.ts | 11 + src/router/routes.tsx | 6 + src/store/modules/file.ts | 134 ++-- src/views/Main/index.tsx | 74 ++- src/views/Main/settings.tsx | 5 + 40 files changed, 4396 insertions(+), 3757 deletions(-) create mode 100644 src/assets/images/favorites.png create mode 100644 src/components/Main/Share/components/ShareDetail/components/Comment/index.module.less create mode 100644 src/components/Main/Share/components/ShareDetail/components/Comment/index.tsx create mode 100644 src/components/Main/User/MyFavorites/index.module.less create mode 100644 src/components/Main/User/MyFavorites/index.tsx create mode 100644 src/constant/random-color.ts create mode 100644 src/router/modules/main/user/myFavorites/index.ts 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 0000000000000000000000000000000000000000..05e10557a53f76058721ab330ba51d1957feb4b8 GIT binary patch literal 5597 zcmV<36(Z`1P)Px~mq|oHRCr$Pok5QsM-hOl_idseMZ!WLa`Q&w0RI7r&4n`u&e(h65?hM@z}gqg zEt1V4QY3c05ho;)LoVUswTwtk*z!7xL4w_gKo-SB4iK@y@9m)OdGC4ly_whDRn^lq zGd0rcIe9%jJyrd^>Z-2pHlUYEKqb&90i&|XFM;AFY(fDWVBkC$*l;Z>;0OTjz}S6) zd9D1^t6d2wAnnS#?E5$1A{e+Zg`xz)cUfT8U>}~sHHF0|EWYm*5I$LYYjR)!Y|pKP z_m0K_`v7pwTmt*4S3(IWAPI##tGc)e+fX>G5oRsI+oYg`%L-Le0YQl^?55&%*noA| z0f5c0JJ6-BnoDpEeYf7&C;Ywl`Q~}|Yr>o6Hr2uXx zsM=TMK8#^YA@PYR{Cfo?TvkCPGr}=zpF$F(sjxx{NSK_0N=UV4dz*VN|c&Zu0%j%ENM5%z#Tp8Fkufo=qN7Tuzxm;z`P*;lj=NfsD6J_VQR3q9Jz}hfZQl67-bG_zXYKtf0AD?h zZ1GZYwIUG`R6rtxH4W`jCkCUf$K=7Dik7NG(XEULWL!!`5dF|6JD znOczuol%P_AQ2K|2)RaEkMY6YZBt31H;>)~b9^_V)eS|}iUi3}0SOWlkM)4aPWklU zt<5zk&Mw{MvLXRMpMFN$^P)q>{5F*QZk4WoL+}qhWT_4r1 zF)>d*0(1X*K+C;FqKACm8hchi0SQnjgY}3Gtxg{9t(`keLK^{A;bm`V&0|eWfc%V zAS-{#13JJfv71cKCI)?Vs}=D{i2l6-vO9X};j%Y>aj>Y{hcc-)hQUxT#W(=_tgTAh%zKBmkao;N-Q+Z{x9@F*aacWy#n#C6Z zP%8ouzBd!60wva!V=EtS>%s1eM6O|xs8?#6)PgV_fD^lwk5wFYV$iE}u4TDuMbv`W z&PGlvLCl&{CkB0xu=yebw<3eLAY|Xej#DGH5uJ7HWY%N$04^&s@XZ|*5bA;`g!Ndp z-rQ#yV!qd9xiQkJFFR;JIIIU|H6GW*pjZ8BMZ6;N6&N-kRO^8pesH9f_!K*jXz50C zp`xlSH&{T(8M`hF6@LzS=z4RKRx39%F3a7AF>DR(Fwj8)!U6{}1RA?ykOLGpU&Nl~ zJBC|Bf@DyDOnr_WsO)u%?tlpEk!oVl_YRC!#GX=h1OV4y0{cS%rMG}g55csj#h!Nu zVV=S!;0NxdUSd5A+F~P6OgB!U*h9%m8cf19yBf z_Yul2%NnJ`ni0uDqLMYdLy{hX(hq0$2Bh!{J@BU z*0-^iMwr!U9S~90AVPoBqS31b?R^rg$9$;8wdyclc9c7^S)C++%&kGyL6&I^!j*;` zT8Xh9l{XbK)C!kDd;|ZSR9mHhdtP)94tB_x^fkI-_X1098E-xTViG3k@ zl2N9NjBLdodec=ns*XDxy#qFHYhc&PQNl_z# zK@oSB`TB*B12<)g!QU!3D3GnG+B!Rip@R^ zrMSAS`TXG6eE#7F@WrDi@bABr%MKh-;*w2$uY6|9)n!2FhsXFDfd4*$HK+q&yuQA% z24!l!0)bFh0Y`;_BV&iLNALavo_=w>_Q`u+cd)dzW(U#i`7M>9))_#AIOfT%f$RA9 zb~Y3QN-sj(TLtH{gAd`!gYnv5-+SU#ecAv=8;jk-nmxB7X8~!;_n0M<&3uD|E6x;z zupW`MR0W*E22TF`t8;6gymuc;D_*V(Y8#%Z6`2E)$a=J54b&oJ?cV7gz5ot<`umg7 zpWZm0f@7bX&g#q#G@ZR2!v@Y}Rm3?3pR~_d1XFAj1#GC(?2}s0zFz>RFy?6e-p^lx zFFyP!YdVyTXjK5YO{|>tz!f+7=0d6FJSYe~>*0xB$1ZC7=O3P!KmPJN@bq6VlAmIS zSrtGEbcM*(c6AY?zE8ZNWvn*_OMoq1#x8Ym<9EA#&N>_hw_vGf!xm*m+EyodaS>WB zdSf;TFf9n%F9D%!;>=(@a_Aq!Qp*drt=haX!YPRNCC_JgG*sa#0fC*pqk$ z2*p9CrHDV+yEw$0CQ&`9r;RbkcfmqJxk^AN=Ytbg-Z|gn;oc4uaFOy7dap{LP6GV^ zB*8i1+FeuvRswv0P@Ht452F5ucIH$P;D}_EL#%SsH|*L5(gdLblB#=Xz2^RP@)~;% zKu|}K&D7Vm9YD0(bwmPoqwWu`&>Cx}FsAb$He=F8vT)ZdvFo++0F{_aCkSJtrDa1U zz%d764+eUcYC>Nqg$nm}VF$ucrD!=B65#MXrf+h!nu}#OhPz69MHD1zMTk<@+vgJC zh+NGoGnc@mSPv2niL)Z3(d`bdU)HWENCKR2xZ&01O1k?rnsvz3Nfi=79cKtlVTGd< znCru5m)z3Ay^DHKNQTfe1-v6W9F+vz)VrGCAXy*bQ||>ROqkQNd`&e?kJi8++Rqfz<~xtA?a`D%>8DP;2;5_kmT-4{d>MNILLsA zfb4Q zK~u{l!@&xOl;M_U0Cxux>2RCwL?MyaIkUHjW53+ymq3SdSILDX%)9CVNupa3mP9jvvtv;$zl)<-)Az;4p5SKAWkC>*T;l4Q6Qxud*h0JlxWv*&S~)6vlSB*Uuevyu<7 zst-#r+=^Pds~N!UL&CVz`eNgg!_le*NjTh!f<$NA+k+%w#HtlIvH+4~xE0}#*yn5b zw*^Sj`5mpnkqr$PNfI zBvDqxK3fkEO#?{+>yZTx5rD8k5*hZj&sB##4Ipd#KjEx68ysQ)VT5GMT!!5k?Wh%r zk(R$KYvd|&BM*P;;!CtT58`WHanl_|ji2o{uxnn0E#Gsh-|PC37-{*-vJI~Uz#+vmPt0 z)#X|IkI0B5?;D)0ExI$MYz&JPK?qkT4w!M*-pKX5@JgL^cFZ%R3UqaQg{`5(@i%?fokNUp)>hTwhAeEV^x;I15tTbh%h|h=sXO!qqS@M$`?zxc9Gvb=J`r z;YSYr%oR6E1cZ`mf|`ZZghjrtWgfi==J+nHLZlx_duUgNSd>XZ00ksPFNvtr!eJpH zUSc9y5-kWmf`y$Ve7Ls*1zaR5Rd2Ur_9q{K&FCdvf+ATG0ck&irGSw7^Wx2Yie!lb zBwGYaXVG~9=}{z079cm^A{f{~Y6}&?vd_{GFH+(Sw{a|*!p>*$zKO6fFEIxT<)CY- zJ9n1?=cM-~k|oQ6P$F1J$4*1M2>|I)Buf?`v`rgOp+Q|um;jI-MY5y;q7f|q{+gx6 zzC^Ob0HP7BEd4myL;I4GB?l0VU?uCUIV$FG)Fni+%LO9~(w!Ajp> zTYo|yB3V)ZK|APxTt%o!is^ajLnJFZAS4IfnsLN=AZ~c2s|eE*0sv%3o#10~ykNHh zA#4$&XA^RCAAcQWKmgDS;ry-hm&gxDt_YT(Wwve~sgvnuYxeWpcb(>n7rq7X!Z-a| z6kLMCQOAxFIK+}4kO4-pob!74cJK~_#kubRy!3r=pB)2+1CX4NED3<%BUnfWJ;yRz zw*>Y0ceGsxtyQs*Z2Sm{=fCj@eC^v~=|?tnJ(48>5PSp+neEwT1S{5B1P==eI0Arc zFoAv8EcdyXj7FQrnDYe`n}%|nc5oy71-l-}$_hxIBUoG(!`}sA--2Q;xzG9KQu&`7 zZA;h?kL;*tjAV5e5JChiWr)`~+(++_hf)DxEEd^^F>IOFoMkx+%KG{RfZ{5mPL^B9 zfMkqh_<^wx9 zIsgY73w2zDG2E&HWwJinY12nxanzCiCRMJv0ckyg#ktJZ9K8+pPxMv5mUZM8L2-c! zfbBM-U@U+jSB+A2lN%6p1Pg0&IU-oeB2!dtHs8Mw1>7>1VK;|=(&b22Hb6)bEQ*7E z@YXigVa@1(bD@(h;zf4U2|g!9c*6q(k)+rIFoGgpZUVI^c2W$x$be*uWaR^dauy-s z*CZ-}B_%RN`3YQgZ%xFj^wIdk!W@AN?68_5zHS22LIjILp%lfmdT)&*&kYKTqn;s> zl@Aa~7B3;9;S2G0A~KbNo=WOUHR5GK;Rp*WAdyNdG61qFf+Z$0WrsawXWfJXHd6Ql z9#z#k^3<>}OC(DzNHArntw!qr5#oT?c1kM^cW!(ENgQV{C=018q+!>|V_5s(O0a@! z3o0PN@0eO07X^VoOCyQpzX&SZAFSVUi>vY{m+jn0%N!r zH9R~s1O7T}z;m#j1(bz|*L>Jj6!rktjXL?TSP#PFFhys10ihkaX5TxgvylP<6zNv) zZOF2vRPX!~JM3zEanv;8RZU%K@=sWt^HNAbx~9mp7H;keW9lQGYCC&WZPx14Lgg8^ zCkA85KgsFHFD%xoF4SVN9M4{Mkbu}vxvI{Z`ocN2Ij_dZRH{a0bL308 zKU>k5K>j&q(aWxs`6BuunOk4;csu+su(h}Zw#|k*%WQuj8hnB_+rsp$Xn&LGxdH&8 ztSaP^0#`lA$Q0M(mxf-sB3|4tlu@qPEy&bYpqwtntqx3mS;og94Ry;3Y{V=7kTayY z%Vjb}uVxLA0Z3P^NP@@|t{3_5$`ns>c{z(@NcCbQDAT6sBCZ z)D?eYvkt990wNR=u@1PukA;<(JMuYlyy}}M0uI|WF+NCDPE0fGVZEcNREHdJ+KWEB zTZAJo%ugO_6s7keN`(N>U$# z+`s0|JZ4jgj>*4sfXqQD9Z9?E#|8KQ?7z#nT={8-PHWQ?>{GZ?w}CUcr)ULsRjADx rK0jSzFq3`xY2|PAP{7AsmH+<%{3X&Rw_cGG00000NkvXXu0mjfsSG@k literal 0 HcmV?d00001 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 = () => { <>
- + + + + +
@@ -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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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 ( - <> - - - - - }> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - trigger.parentElement!} - /> - - - - - - - - - - -
-
- - ); - }; - 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={() => [ - , - ]} - /> - - - ); -}; - -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 ( + <> + + + + + }> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + trigger.parentElement!} + /> + + + + + + + + + + +
+
+ + ); + }; + 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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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={() => [ - , - ]} - /> - - - ); -}; - -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={() => [ + , + ]} + /> + +
+ + ); +}; + +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 = () => { <>
-
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 = () => { <>
-
); 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 ( + <> +
+ + + + + + + + + + + + + + + + + + }, + { 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 ( <>
- +
- - +
- + 文件分享圈} bordered={false} boxShadow={false}> { navigate("/main/share/list/1"); }} cover={ example }> + {/**/} - {" "} - landaiqing - - {" "} - 1024 - {" "} - 999 + + {" "} + + landaiqing + - - - - { - navigate("/main/share/list/1"); - }} - cover={ - example - }> - - - {" "} - landaiqing - {" "} - 1024 - {" "} - 999 + + {" "} + + 1024 + + + + {" "} + + 999 + +
- { + } + 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", + }, ], }, ],