From 2da499799d6ea5386fdaa099f3832c4a8cdde7ca Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Tue, 19 Apr 2022 16:14:53 +0800 Subject: [PATCH] feat: add new settings form in dashboard --- src/component/Admin/Index.js | 7 +- src/component/Admin/Setting/Captcha.js | 87 +++++++- src/component/Admin/Setting/Image.js | 202 ++++++++++++++---- src/component/Admin/Setting/UploadDownload.js | 45 ++-- 4 files changed, 288 insertions(+), 53 deletions(-) diff --git a/src/component/Admin/Index.js b/src/component/Admin/Index.js index 91a328b..988c859 100644 --- a/src/component/Admin/Index.js +++ b/src/component/Admin/Index.js @@ -182,7 +182,12 @@ export default function Index() { setNewsUsers(res); }) .catch((error) => { - ToggleSnackbar("top", "right", error.message, "error"); + ToggleSnackbar( + "top", + "right", + "Cloudreve 公告加载失败", + "warning" + ); }); }, []); diff --git a/src/component/Admin/Setting/Captcha.js b/src/component/Admin/Setting/Captcha.js index 72212ae..abb39db 100644 --- a/src/component/Admin/Setting/Captcha.js +++ b/src/component/Admin/Setting/Captcha.js @@ -12,6 +12,8 @@ import MenuItem from "@material-ui/core/MenuItem"; import Input from "@material-ui/core/Input"; import Link from "@material-ui/core/Link"; import { toggleSnackbar } from "../../../redux/explorer"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Switch from "@material-ui/core/Switch"; const useStyles = makeStyles((theme) => ({ root: { @@ -40,7 +42,14 @@ export default function Captcha() { captcha_height: "1", captcha_width: "1", captcha_mode: "3", - captcha_CaptchaLen: "", + captcha_CaptchaLen: "6", + captcha_ComplexOfNoiseText: "0", + captcha_ComplexOfNoiseDot: "0", + captcha_IsShowHollowLine: "0", + captcha_IsShowNoiseDot: "0", + captcha_IsShowNoiseText: "0", + captcha_IsShowSlimeLine: "0", + captcha_IsShowSineLine: "0", captcha_ReCaptchaKey: "", captcha_ReCaptchaSecret: "", captcha_TCaptcha_CaptchaAppId: "", @@ -100,6 +109,14 @@ export default function Captcha() { }); }; + const handleCheckChange = (name) => (event) => { + const value = event.target.checked ? "1" : "0"; + setOptions({ + ...options, + [name]: value, + }); + }; + return (