From 755796939fe0c294db5aba055e734ae56ae3f588 Mon Sep 17 00:00:00 2001 From: TS Date: Tue, 5 May 2020 18:53:42 -0700 Subject: [PATCH] =?UTF-8?q?Fix:=20=E6=B7=BB=E5=8A=A0Eslint=20config,=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=89=80=E6=9C=89=E7=9A=84eslint=20error=20?= =?UTF-8?q?=E5=92=8C=20warning=20(#20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: 添加Eslint config, 修正所有的eslint error 和 warning。添加husky pre-commit 和 pre-push 钩子 * Fix: Disable react-hooks/exhaustive-deps eslint * Fix: 添加修复react-hooks/rules-of-hooks --- .eslintrc.yaml | 28 + .huskyrc | 1 + config/webpack.config.js | 1 - package.json | 21 +- src/Admin.js | 2 +- src/component/Admin/Common/DomainInput.js | 4 +- src/component/Admin/Common/SizeInput.js | 14 +- src/component/Admin/Dashboard.js | 45 +- src/component/Admin/Dialogs/AddGroupk.js | 31 +- src/component/Admin/Dialogs/AddPack.js | 2 +- src/component/Admin/Dialogs/AddPolicy.js | 23 +- src/component/Admin/Dialogs/AddRedeem.js | 29 +- src/component/Admin/Dialogs/CreateTheme.js | 28 +- src/component/Admin/Dialogs/FileFilter.js | 20 +- src/component/Admin/Dialogs/MagicVar.js | 23 +- src/component/Admin/Dialogs/ShareFilter.js | 24 +- src/component/Admin/Dialogs/UserFilter.js | 20 +- src/component/Admin/File/File.js | 89 ++- src/component/Admin/File/Import.js | 45 +- src/component/Admin/Group/Group.js | 100 ++- src/component/Admin/Group/GroupForm.js | 66 +- src/component/Admin/Index.js | 67 +- src/component/Admin/Policy/AddPolicy.js | 17 +- src/component/Admin/Policy/EditPolicy.js | 25 +- src/component/Admin/Policy/Guid/COSGuide.js | 60 +- src/component/Admin/Policy/Guid/EditPro.js | 131 ++-- src/component/Admin/Policy/Guid/LocalGuide.js | 54 +- src/component/Admin/Policy/Guid/OSSGuide.js | 53 +- .../Admin/Policy/Guid/OneDriveGuide.js | 57 +- src/component/Admin/Policy/Guid/QiniuGuide.js | 57 +- .../Admin/Policy/Guid/RemoteGuide.js | 58 +- src/component/Admin/Policy/Guid/UpyunGuide.js | 54 +- src/component/Admin/Policy/Policy.js | 96 ++- src/component/Admin/Setting/Access.js | 27 +- src/component/Admin/Setting/Aria2.js | 25 +- src/component/Admin/Setting/Image.js | 20 +- src/component/Admin/Setting/Mail.js | 30 +- .../Admin/Setting/SiteInformation.js | 21 +- src/component/Admin/Setting/Theme.js | 44 +- src/component/Admin/Setting/UploadDownload.js | 24 +- src/component/Admin/Share/Share.js | 78 +-- src/component/Admin/Task/Download.js | 154 ++--- src/component/Admin/Task/Task.js | 79 +-- src/component/Admin/User/User.js | 92 ++- src/component/Admin/User/UserForm.js | 39 +- src/component/Common/ICPFooter.js | 15 +- src/component/Common/Snackbar.js | 4 +- src/component/Dial/AutoHidden.js | 2 +- src/component/Download/Download.js | 13 +- src/component/Download/DownloadingCard.js | 60 +- src/component/Download/FinishedCard.js | 15 +- src/component/FileManager/ContextMenu.js | 66 +- src/component/FileManager/DnD/Preview.js | 2 +- src/component/FileManager/Explorer.js | 52 +- src/component/FileManager/FileIcon.js | 26 +- src/component/FileManager/FileManager.js | 25 +- src/component/FileManager/ImgPreview.js | 4 +- src/component/FileManager/ImgPreview_old.js | 4 +- src/component/FileManager/Modals.js | 19 +- .../FileManager/Navigator/DropDown.js | 1 + .../FileManager/Navigator/Navigator.js | 5 +- src/component/FileManager/ObjectIcon.js | 2 +- src/component/FileManager/PathSelector.js | 2 - src/component/FileManager/SmallIcon.js | 6 +- src/component/FileManager/TableRow.js | 2 +- src/component/Login/LoginForm.js | 4 +- src/component/Login/Register.js | 5 +- src/component/Login/Reset.js | 4 +- src/component/Login/ResetForm.js | 2 +- src/component/Login/ResetPwdForm.js | 2 +- src/component/Modals/Compress.js | 3 +- src/component/Modals/Copy.js | 2 +- src/component/Modals/CreateShare.js | 10 +- src/component/Modals/Decompress.js | 3 +- src/component/Modals/Loading.js | 2 +- src/component/Modals/SelectFile.js | 2 +- src/component/Navbar/DarkModeSwitcher.js | 4 +- src/component/Navbar/FileTags.js | 7 +- src/component/Navbar/Navbar.js | 15 +- src/component/Navbar/SearchBar.js | 2 +- src/component/Navbar/SideDrawer.js | 8 +- src/component/Navbar/StorageBar.js | 5 +- src/component/Navbar/UserAvatarPopover.js | 7 +- src/component/Placeholder/ErrorBoundary.js | 4 +- src/component/Setting/Authn.js | 4 +- src/component/Setting/Profile.js | 2 +- src/component/Setting/Tasks.js | 2 +- src/component/Setting/UserSetting.js | 20 +- src/component/Setting/WebDAV.js | 4 +- src/component/Share/LockedFile.js | 2 +- src/component/Share/MyShare.js | 6 +- src/component/Share/SearchResult.js | 26 +- src/component/Share/SharePreload.js | 1 - src/component/Share/SharedFile.js | 7 +- src/component/Share/SharedFolder.js | 3 +- src/component/Upload/FileList.js | 2 - src/component/Upload/UploadIcon.js | 2 +- src/component/Upload/Uploader.js | 8 +- src/component/Viewer/Code.js | 11 +- src/component/Viewer/Doc.js | 4 +- src/component/Viewer/PDF.js | 4 +- src/component/Viewer/Text.js | 4 +- src/component/Viewer/Video.js | 2 +- src/index.js | 1 - src/loader/index.js | 6 +- src/loader/utils.js | 2 +- src/reducers/explorer.js | 26 +- src/reducers/index.js | 1 + yarn.lock | 631 ++++++++++++++++-- 109 files changed, 1742 insertions(+), 1433 deletions(-) create mode 100644 .eslintrc.yaml create mode 100644 .huskyrc diff --git a/.eslintrc.yaml b/.eslintrc.yaml new file mode 100644 index 0000000..fd02379 --- /dev/null +++ b/.eslintrc.yaml @@ -0,0 +1,28 @@ +extends: + - eslint:recommended + - plugin:react/recommended +plugins: + - react + - react-hooks +parser: babel-eslint +parserOptions: + sourceType: module + ecmaVersion: 2020 + ecmaFeatures: + jsx: true +env: + es6: true + browser: true + node: true + jest: true + +settings: + react: + version: detect +ignorePatterns: + - node_modules +rules: + react/prop-types: 0 + react-hooks/rules-of-hooks: "error" + # TODO: 修改添加deps后出现的死循环 + react-hooks/exhaustive-deps: 0 \ No newline at end of file diff --git a/.huskyrc b/.huskyrc new file mode 100644 index 0000000..ecd1535 --- /dev/null +++ b/.huskyrc @@ -0,0 +1 @@ +export PATH="/usr/local/bin:$PATH" diff --git a/config/webpack.config.js b/config/webpack.config.js index 4ac213c..53a397f 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -362,7 +362,6 @@ module.exports = function(webpackEnv) { formatter: require.resolve('react-dev-utils/eslintFormatter'), eslintPath: require.resolve('eslint'), resolvePluginsRelativeTo: __dirname, - }, loader: require.resolve('eslint-loader'), }, diff --git a/package.json b/package.json index 53b05ec..2cc125f 100644 --- a/package.json +++ b/package.json @@ -23,19 +23,19 @@ "css-loader": "2.1.1", "dotenv": "6.2.0", "dotenv-expand": "5.1.0", - "eslint": "^6.1.0", + "eslint": "^6.8.0", "eslint-config-react-app": "^5.0.2", "eslint-loader": "3.0.2", "eslint-plugin-flowtype": "3.13.0", "eslint-plugin-import": "2.18.2", "eslint-plugin-jsx-a11y": "6.2.3", - "eslint-plugin-react": "7.14.3", - "eslint-plugin-react-hooks": "^1.6.1", + "eslint-plugin-react": "^7.19.0", "file-loader": "3.0.1", "for-editor": "^0.3.5", "fs-extra": "7.0.1", "html-webpack-plugin": "4.0.0-beta.5", "http-proxy-middleware": "^0.20.0", + "husky": "^4.2.5", "identity-obj-proxy": "3.0.0", "is-wsl": "^1.1.0", "jest": "24.9.0", @@ -92,10 +92,9 @@ "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", - "test": "node scripts/test.js" - }, - "eslintConfig": { - "extends": "react-app" + "test": "node scripts/test.js", + "eslint": "eslint src/** --fix", + "postinstall": "node node_modules/husky/lib/installer/bin install" }, "browserslist": { "production": [ @@ -163,6 +162,12 @@ ] }, "devDependencies": { - "copy-webpack-plugin": "^5.1.1" + "copy-webpack-plugin": "^5.1.1", + "eslint-plugin-react-hooks": "^4.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "npm run eslint" + } } } diff --git a/src/Admin.js b/src/Admin.js index 9b98d84..7942488 100644 --- a/src/Admin.js +++ b/src/Admin.js @@ -1,4 +1,4 @@ -import React, { Suspense, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import { CssBaseline, makeStyles } from "@material-ui/core"; import AlertBar from "./component/Common/Snackbar"; import Dashboard from "./component/Admin/Dashboard"; diff --git a/src/component/Admin/Common/DomainInput.js b/src/component/Admin/Common/DomainInput.js index bfa706a..280707d 100644 --- a/src/component/Admin/Common/DomainInput.js +++ b/src/component/Admin/Common/DomainInput.js @@ -1,12 +1,10 @@ -import React, {useCallback, useEffect, useState} from "react"; +import React, {useEffect, useState} from "react"; import FormControl from "@material-ui/core/FormControl"; import InputLabel from "@material-ui/core/InputLabel"; import Input from "@material-ui/core/Input"; import InputAdornment from "@material-ui/core/InputAdornment"; import Select from "@material-ui/core/Select"; import MenuItem from "@material-ui/core/MenuItem"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; import FormHelperText from "@material-ui/core/FormHelperText"; export default function DomainInput({onChange,value,required,label}){ diff --git a/src/component/Admin/Common/SizeInput.js b/src/component/Admin/Common/SizeInput.js index 38ecae5..8ec578e 100644 --- a/src/component/Admin/Common/SizeInput.js +++ b/src/component/Admin/Common/SizeInput.js @@ -1,12 +1,12 @@ -import React, {useCallback, useEffect, useState} from "react"; import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; import Input from "@material-ui/core/Input"; import InputAdornment from "@material-ui/core/InputAdornment"; -import Select from "@material-ui/core/Select"; +import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; +import Select from "@material-ui/core/Select"; +import React, { useCallback, useState, useRef } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from "../../../actions"; const unitTransform = (v)=>{ if(v<1024){ @@ -34,13 +34,13 @@ export default function SizeInput({onChange,min,value,required,label,max,suffix} const [unit,setUnit] = useState(1); - let first = true; + let first = useRef(true); const transform = useCallback(()=>{ let res = unitTransform(value); if(first && value !== 0){ setUnit(res[1]); - first = false; + first.current = false; } return res; },[value]); diff --git a/src/component/Admin/Dashboard.js b/src/component/Admin/Dashboard.js index 1e1538b..cc09320 100644 --- a/src/component/Admin/Dashboard.js +++ b/src/component/Admin/Dashboard.js @@ -1,40 +1,30 @@ -import React, { useCallback, useEffect, useState } from "react"; -import clsx from "clsx"; -import { lighten, makeStyles, useTheme } from "@material-ui/core/styles"; -import Drawer from "@material-ui/core/Drawer"; +import { withStyles } from "@material-ui/core"; import AppBar from "@material-ui/core/AppBar"; -import Toolbar from "@material-ui/core/Toolbar"; -import List from "@material-ui/core/List"; -import Typography from "@material-ui/core/Typography"; import Divider from "@material-ui/core/Divider"; +import Drawer from "@material-ui/core/Drawer"; +import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; +import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; +import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; import IconButton from "@material-ui/core/IconButton"; -import MenuIcon from "@material-ui/icons/Menu"; -import ChevronLeftIcon from "@material-ui/icons/ChevronLeft"; -import ChevronRightIcon from "@material-ui/icons/ChevronRight"; +import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemIcon from "@material-ui/core/ListItemIcon"; import ListItemText from "@material-ui/core/ListItemText"; -import UserAvatar from "../Navbar/UserAvatar"; -import { - Contacts, - Home, - Language, - Settings, - Mail, - SettingsEthernet, - AttachMoney, - Palette, - CloudDownload, Image, Storage, Group, Person, InsertDriveFile, Share, ShoppingCart, Assignment, ListAlt -} from "@material-ui/icons"; -import { withStyles } from "@material-ui/core"; -import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; -import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; -import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; +import { lighten, makeStyles, useTheme } from "@material-ui/core/styles"; +import Toolbar from "@material-ui/core/Toolbar"; +import Typography from "@material-ui/core/Typography"; +import { Assignment, CloudDownload, Contacts, Group, Home, Image, InsertDriveFile, Language, ListAlt, Mail, Palette, Person, Settings, SettingsEthernet, Share, Storage } from "@material-ui/icons"; +import ChevronLeftIcon from "@material-ui/icons/ChevronLeft"; +import ChevronRightIcon from "@material-ui/icons/ChevronRight"; +import MenuIcon from "@material-ui/icons/Menu"; +import clsx from "clsx"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; import { useHistory, useLocation } from "react-router"; import { useRouteMatch } from "react-router-dom"; -import { useDispatch } from "react-redux"; import { changeSubTitle } from "../../actions"; import pathHelper from "../../utils/page"; +import UserAvatar from "../Navbar/UserAvatar"; const ExpansionPanel = withStyles({ root: { @@ -367,6 +357,7 @@ export default function Dashboard({ content }) { } return ( { diff --git a/src/component/Admin/Dialogs/AddGroupk.js b/src/component/Admin/Dialogs/AddGroupk.js index c14f5a6..fb0c2d4 100644 --- a/src/component/Admin/Dialogs/AddGroupk.js +++ b/src/component/Admin/Dialogs/AddGroupk.js @@ -1,23 +1,22 @@ -import React, { useEffect, useState } from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogTitle from "@material-ui/core/DialogTitle"; import FormControl from "@material-ui/core/FormControl"; -import SizeInput from "../Common/SizeInput"; -import { makeStyles } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Switch from "@material-ui/core/Switch"; import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Switch from "@material-ui/core/Switch"; +import React, { useEffect, useState } from "react"; +import API from "../../../middleware/Api"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ formContainer: { margin: "8px 0 8px 0" } @@ -42,7 +41,7 @@ export default function AddGroup({ open, onClose, onSubmit }) { .then(response => { setGroups(response.data); }) - .catch(error => {}); + .catch(() => {}); } // eslint-disable-next-line }, [open]); diff --git a/src/component/Admin/Dialogs/AddPack.js b/src/component/Admin/Dialogs/AddPack.js index e084b85..0217158 100644 --- a/src/component/Admin/Dialogs/AddPack.js +++ b/src/component/Admin/Dialogs/AddPack.js @@ -12,7 +12,7 @@ import FormControl from "@material-ui/core/FormControl"; import SizeInput from "../Common/SizeInput"; import {makeStyles} from "@material-ui/core/styles"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ formContainer: { margin:"8px 0 8px 0", diff --git a/src/component/Admin/Dialogs/AddPolicy.js b/src/component/Admin/Dialogs/AddPolicy.js index c8bb86e..799615f 100644 --- a/src/component/Admin/Dialogs/AddPolicy.js +++ b/src/component/Admin/Dialogs/AddPolicy.js @@ -1,18 +1,17 @@ -import React from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import Typography from "@material-ui/core/Typography"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; -import Dialog from "@material-ui/core/Dialog"; -import Grid from "@material-ui/core/Grid"; import Card from "@material-ui/core/Card"; import CardActionArea from "@material-ui/core/CardActionArea"; -import {makeStyles} from "@material-ui/core/styles"; -import CardMedia from "@material-ui/core/CardMedia"; import CardContent from "@material-ui/core/CardContent"; -import {useHistory, useLocation} from "react-router"; +import CardMedia from "@material-ui/core/CardMedia"; +import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogTitle from "@material-ui/core/DialogTitle"; +import Grid from "@material-ui/core/Grid"; +import { makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React from "react"; +import { useHistory } from "react-router"; const useStyles = makeStyles(theme => ({ cardContainer:{ @@ -91,7 +90,7 @@ export default function AddPolicy({open, onClose }) { {policies.map(v=>( - + { diff --git a/src/component/Admin/Dialogs/AddRedeem.js b/src/component/Admin/Dialogs/AddRedeem.js index 3f44c09..dad6aab 100644 --- a/src/component/Admin/Dialogs/AddRedeem.js +++ b/src/component/Admin/Dialogs/AddRedeem.js @@ -1,23 +1,22 @@ -import React, {useCallback, useState} from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogTitle from "@material-ui/core/DialogTitle"; import FormControl from "@material-ui/core/FormControl"; -import SizeInput from "../Common/SizeInput"; -import {makeStyles} from "@material-ui/core/styles"; -import Select from "@material-ui/core/Select"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from "../../../actions"; import API from "../../../middleware/Api"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ formContainer: { margin:"8px 0 8px 0", @@ -124,7 +123,7 @@ export default function AddRedeem({ open, onClose,products ,onSuccess}) { }} > {products.map(v=>( - {v.name} + {v.name} ))} 积分 diff --git a/src/component/Admin/Dialogs/CreateTheme.js b/src/component/Admin/Dialogs/CreateTheme.js index 91728dc..f4ed7b4 100644 --- a/src/component/Admin/Dialogs/CreateTheme.js +++ b/src/component/Admin/Dialogs/CreateTheme.js @@ -1,19 +1,19 @@ -import React, { useCallback, useEffect, useState } from "react"; -import DialogContent from "@material-ui/core/DialogContent"; -import { CompactPicker } from "react-color"; -import Typography from "@material-ui/core/Typography"; -import DialogActions from "@material-ui/core/DialogActions"; +import AppBar from "@material-ui/core/AppBar"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import Fab from "@material-ui/core/Fab"; import Grid from "@material-ui/core/Grid"; -import TextField from "@material-ui/core/TextField"; -import { createMuiTheme, makeStyles } from "@material-ui/core/styles"; -import AppBar from "@material-ui/core/AppBar"; -import Toolbar from "@material-ui/core/Toolbar"; import IconButton from "@material-ui/core/IconButton"; +import { createMuiTheme, makeStyles } from "@material-ui/core/styles"; +import TextField from "@material-ui/core/TextField"; +import Toolbar from "@material-ui/core/Toolbar"; +import Typography from "@material-ui/core/Typography"; import { Add, Menu } from "@material-ui/icons"; import { ThemeProvider } from "@material-ui/styles"; -import Fab from "@material-ui/core/Fab"; +import React, { useCallback, useState } from "react"; +import { CompactPicker } from "react-color"; const useStyles = makeStyles(theme => ({ picker: { @@ -121,7 +121,7 @@ export default function CreateTheme({ open, onClose,onSubmit }) { "#9c27b0" ]} color={theme.palette.primary.main} - onChangeComplete={(c, e) => { + onChangeComplete={(c) => { setTheme({ ...theme, palette: { @@ -197,7 +197,7 @@ export default function CreateTheme({ open, onClose,onSubmit }) { "#d500f9" ]} color={theme.palette.secondary.main} - onChangeComplete={(c, e) => { + onChangeComplete={(c) => { setTheme({ ...theme, palette: { @@ -235,7 +235,7 @@ export default function CreateTheme({ open, onClose,onSubmit }) {
{ + onChangeComplete={(c) => { setTheme({ ...theme, palette: { @@ -273,7 +273,7 @@ export default function CreateTheme({ open, onClose,onSubmit }) {
{ + onChangeComplete={(c) => { setTheme({ ...theme, palette: { diff --git a/src/component/Admin/Dialogs/FileFilter.js b/src/component/Admin/Dialogs/FileFilter.js index a5c4017..eb53dbb 100644 --- a/src/component/Admin/Dialogs/FileFilter.js +++ b/src/component/Admin/Dialogs/FileFilter.js @@ -1,19 +1,17 @@ -import React, {useCallback, useEffect, useState} from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import Typography from "@material-ui/core/Typography"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogTitle from "@material-ui/core/DialogTitle"; import FormControl from "@material-ui/core/FormControl"; import InputLabel from "@material-ui/core/InputLabel"; -import Select from "@material-ui/core/Select"; import MenuItem from "@material-ui/core/MenuItem"; -import API from "../../../middleware/Api"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; +import Select from "@material-ui/core/Select"; import TextField from "@material-ui/core/TextField"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; export default function FileFilter({setFilter,setSearch,open, onClose }) { const [input,setInput] = useState({ @@ -49,7 +47,7 @@ export default function FileFilter({setFilter,setSearch,open, onClose }) { }); },[]) - const submit = e => { + const submit = () => { let res = {}; Object.keys(input).forEach(v=>{ if(input[v] !== "all" && input[v] !== ""){ diff --git a/src/component/Admin/Dialogs/MagicVar.js b/src/component/Admin/Dialogs/MagicVar.js index 31d1dfe..178055d 100644 --- a/src/component/Admin/Dialogs/MagicVar.js +++ b/src/component/Admin/Dialogs/MagicVar.js @@ -1,26 +1,17 @@ -import React from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import Typography from "@material-ui/core/Typography"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; -import TableBody from "@material-ui/core/TableBody"; -import TableContainer from "@material-ui/core/TableContainer"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogTitle from "@material-ui/core/DialogTitle"; import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import {makeStyles} from "@material-ui/core/styles"; - -const useStyles = makeStyles(theme => ({ - -})); +import React from "react"; export default function MagicVar({isFile, open, onClose, isSlave }) { - const classes = useStyles(); - return ( - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const handleChange = name => event => { setInput({...input,[name]:event.target.value}) } - const submit = e => { + const submit = () => { let res = {}; Object.keys(input).forEach(v=>{ if(input[v] !== "all" && input[v] !== ""){ diff --git a/src/component/Admin/Dialogs/UserFilter.js b/src/component/Admin/Dialogs/UserFilter.js index 64e9bdd..0fc2252 100644 --- a/src/component/Admin/Dialogs/UserFilter.js +++ b/src/component/Admin/Dialogs/UserFilter.js @@ -1,19 +1,17 @@ -import React, {useCallback, useEffect, useState} from "react"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import Typography from "@material-ui/core/Typography"; -import DialogActions from "@material-ui/core/DialogActions"; import Button from "@material-ui/core/Button"; import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogTitle from "@material-ui/core/DialogTitle"; import FormControl from "@material-ui/core/FormControl"; import InputLabel from "@material-ui/core/InputLabel"; -import Select from "@material-ui/core/Select"; import MenuItem from "@material-ui/core/MenuItem"; -import API from "../../../middleware/Api"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; +import Select from "@material-ui/core/Select"; import TextField from "@material-ui/core/TextField"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; export default function UserFilter({setFilter,setSearch,open, onClose }) { const [input,setInput] = useState({ @@ -44,7 +42,7 @@ export default function UserFilter({setFilter,setSearch,open, onClose }) { }); },[]) - const submit = e => { + const submit = () => { let res = {}; Object.keys(input).forEach(v=>{ if(input[v] !== "all"){ diff --git a/src/component/Admin/File/File.js b/src/component/Admin/File/File.js index fff96fd..a9e8c84 100644 --- a/src/component/Admin/File/File.js +++ b/src/component/Admin/File/File.js @@ -1,36 +1,29 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; -import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import { sizeToString } from "../../../utils"; -import TableBody from "@material-ui/core/TableBody"; -import { policyTypeMap } from "../../../config"; -import TablePagination from "@material-ui/core/TablePagination"; -import AddPolicy from "../Dialogs/AddPolicy"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import { useHistory, useLocation } from "react-router"; -import IconButton from "@material-ui/core/IconButton"; -import { Block, Delete, DeleteForever, Edit, FilterList } from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Popover from "@material-ui/core/Popover"; -import Menu from "@material-ui/core/Menu"; -import Checkbox from "@material-ui/core/Checkbox"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; import { lighten } from "@material-ui/core"; -import Link from "@material-ui/core/Link"; -import TableSortLabel from "@material-ui/core/TableSortLabel"; -import UserFilter from "../Dialogs/UserFilter"; import Badge from "@material-ui/core/Badge"; +import Button from "@material-ui/core/Button"; +import Checkbox from "@material-ui/core/Checkbox"; +import IconButton from "@material-ui/core/IconButton"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import TableSortLabel from "@material-ui/core/TableSortLabel"; +import Toolbar from "@material-ui/core/Toolbar"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import { Delete, DeleteForever, FilterList } from "@material-ui/icons"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; +import { sizeToString } from "../../../utils"; import FileFilter from "../Dialogs/FileFilter"; const useStyles = makeStyles(theme => ({ @@ -78,10 +71,6 @@ const useStyles = makeStyles(theme => ({ } })); -function useQuery() { - return new URLSearchParams(useLocation().search); -} - export default function File() { const classes = useStyles(); const [files, setFiles] = useState([]); @@ -97,12 +86,14 @@ export default function File() { const [loading,setLoading] = useState(false); let history = useHistory(); + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); - useEffect(() => { - loadList(); - }, [page, pageSize, orderBy, filter, search]); - - const loadList = () => { + const loadList = useCallback(() => { API.post("/admin/file/list", { page: page, page_size: pageSize, @@ -119,12 +110,16 @@ export default function File() { .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }); - }; + }, []); + + useEffect(() => { + loadList(); + }, [page, pageSize, orderBy, filter, search]); const deletePolicy = id => { setLoading(true); API.post("/admin/file/delete",{id:[id]}) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "删除任务将在后台执行", "success"); }) @@ -135,10 +130,10 @@ export default function File() { }); }; - const deleteBatch =force => e =>{ + const deleteBatch =force => () =>{ setLoading(true); API.post("/admin/file/delete",{id:selected,force:force}) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "删除任务将在后台执行", "success"); }) @@ -148,12 +143,6 @@ export default function File() { setLoading(false); }); } - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); const handleSelectAllClick = event => { if (event.target.checked) { diff --git a/src/component/Admin/File/Import.js b/src/component/Admin/File/Import.js index b809cad..7e7cded 100644 --- a/src/component/Admin/File/Import.js +++ b/src/component/Admin/File/Import.js @@ -1,29 +1,29 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; +import { Dialog } from "@material-ui/core"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Alert from "@material-ui/lab/Alert"; +import Chip from "@material-ui/core/Chip"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogTitle from "@material-ui/core/DialogTitle"; import Fade from "@material-ui/core/Fade"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputAdornment from "@material-ui/core/InputAdornment"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import InputAdornment from "@material-ui/core/InputAdornment"; -import Chip from "@material-ui/core/Chip"; -import { Dialog } from "@material-ui/core"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import PathSelector from "../../FileManager/PathSelector"; -import DialogActions from "@material-ui/core/DialogActions"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; import Switch from "@material-ui/core/Switch"; +import Typography from "@material-ui/core/Typography"; +import Alert from "@material-ui/lab/Alert"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; +import PathSelector from "../../FileManager/PathSelector"; const useStyles = makeStyles(theme => ({ root: { @@ -116,7 +116,7 @@ export default function Import() { dst: options.dst, recursive: options.recursive }) - .then(response => { + .then(() => { setLoading(false); history.push("/admin/file"); ToggleSnackbar( @@ -187,7 +187,7 @@ export default function Import() { folder.path === "/" ? folder.path + folder.name : folder.path + "/" + folder.name; - setter(path == "//" ? "/" : path); + setter(path === "//" ? "/" : path); }; const openPathSelector = isSrcSelect => { @@ -355,6 +355,7 @@ export default function Import() { > {users.map(u => ( selectUser(u) } diff --git a/src/component/Admin/Group/Group.js b/src/component/Admin/Group/Group.js index a69cee5..0f99407 100644 --- a/src/component/Admin/Group/Group.js +++ b/src/component/Admin/Group/Group.js @@ -1,28 +1,22 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import { sizeToString } from "../../../utils"; -import TableBody from "@material-ui/core/TableBody"; -import { policyTypeMap } from "../../../config"; -import TablePagination from "@material-ui/core/TablePagination"; -import AddPolicy from "../Dialogs/AddPolicy"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import {useHistory, useLocation} from "react-router"; import IconButton from "@material-ui/core/IconButton"; -import {Delete, Edit} from "@material-ui/icons"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; import Tooltip from "@material-ui/core/Tooltip"; -import Popover from "@material-ui/core/Popover"; -import Menu from "@material-ui/core/Menu"; +import { Delete, Edit } from "@material-ui/icons"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory, useLocation } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; +import { sizeToString } from "../../../utils"; const useStyles = makeStyles(theme => ({ root: { @@ -78,30 +72,40 @@ function useQuery() { export default function Group() { const classes = useStyles(); - const [loading, setLoading] = useState(false); - const [tab, setTab] = useState(0); const [groups, setGroups] = useState([]); const [statics, setStatics] = useState([]); const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); - const [addDialog, setAddDialog] = useState(false); - const [anchorEl, setAnchorEl] = React.useState(null); - const [editID, setEditID] = React.useState(0); const [policies, setPolicies] = React.useState({}); let location = useLocation(); let history = useHistory(); let query = useQuery(); - const handleClick = event => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); + const loadList = useCallback(() => { + API.post("/admin/group/list", { + page: page, + page_size: pageSize, + order_by: "id desc", + }) + .then(response => { + setGroups(response.data.items); + setStatics(response.data.statics); + setTotal(response.data.total); + setPolicies(response.data.policies); + }) + .catch(error => { + ToggleSnackbar("top", "right", error.message, "error"); + }); + }, []); useEffect(()=>{ if(query.get("code") === "0"){ @@ -116,26 +120,9 @@ export default function Group() { loadList(); }, [page, pageSize]); - const loadList = () => { - API.post("/admin/group/list", { - page: page, - page_size: pageSize, - order_by: "id desc", - }) - .then(response => { - setGroups(response.data.items); - setStatics(response.data.statics); - setTotal(response.data.total); - setPolicies(response.data.policies); - }) - .catch(error => { - ToggleSnackbar("top", "right", error.message, "error"); - }); - }; - const deletePolicy = (id) =>{ API.delete("/admin/group/" + id,) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "用户组已删除", "success"); }) @@ -144,15 +131,6 @@ export default function Group() { }); } - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - - const open = Boolean(anchorEl); - return (
diff --git a/src/component/Admin/Group/GroupForm.js b/src/component/Admin/Group/GroupForm.js index 8e41ddd..6bc8dde 100644 --- a/src/component/Admin/Group/GroupForm.js +++ b/src/component/Admin/Group/GroupForm.js @@ -1,22 +1,21 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Chip from "@material-ui/core/Chip"; -import SizeInput from "../Common/SizeInput"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Switch from "@material-ui/core/Switch"; import Collapse from "@material-ui/core/Collapse"; -import {useHistory} from "react-router"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Switch from "@material-ui/core/Switch"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; +import SizeInput from "../Common/SizeInput"; const useStyles = makeStyles(theme => ({ root: { @@ -37,14 +36,14 @@ const useStyles = makeStyles(theme => ({ } })); -function getStyles(name, personName, theme) { - return { - fontWeight: - personName.indexOf(name) === -1 - ? theme.typography.fontWeightRegular - : theme.typography.fontWeightMedium - }; -} +// function getStyles(name, personName, theme) { +// return { +// fontWeight: +// personName.indexOf(name) === -1 +// ? theme.typography.fontWeightRegular +// : theme.typography.fontWeightMedium +// }; +// } export default function GroupForm(props) { const classes = useStyles(); @@ -71,9 +70,15 @@ export default function GroupForm(props) { ); const [policies, setPolicies] = useState({}); - const theme = useTheme(); let history = useHistory(); + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); + useEffect(() => { API.post("/admin/policy/list", { page: 1, @@ -129,13 +134,6 @@ export default function GroupForm(props) { }); }; - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const submit = e => { e.preventDefault(); let groupCopy = { @@ -184,7 +182,7 @@ export default function GroupForm(props) { API.post("/admin/group", { group: groupCopy }) - .then(response => { + .then(() => { history.push("/admin/group"); ToggleSnackbar("top", "right", "用户组已"+ (props.group ? "保存" : "添加"), "success"); }) diff --git a/src/component/Admin/Index.js b/src/component/Admin/Index.js index de708e1..a814fca 100644 --- a/src/component/Admin/Index.js +++ b/src/component/Admin/Index.js @@ -1,50 +1,32 @@ -import React, { useCallback, useEffect, useState } from "react"; -import Grid from "@material-ui/core/Grid"; -import Paper from "@material-ui/core/Paper"; -import { - LineChart, - Line, - XAxis, - YAxis, - CartesianGrid, - Tooltip, - Legend -} from "recharts"; -import ResponsiveContainer from "recharts/lib/component/ResponsiveContainer"; -import { makeStyles } from "@material-ui/core/styles"; -import pathHelper from "../../utils/page"; -import API from "../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../actions"; -import Typography from "@material-ui/core/Typography"; +import Avatar from "@material-ui/core/Avatar"; +import Button from "@material-ui/core/Button"; +import Chip from "@material-ui/core/Chip"; +import { blue, green, red, yellow } from "@material-ui/core/colors"; +import Dialog from "@material-ui/core/Dialog"; +import DialogActions from "@material-ui/core/DialogActions"; +import DialogContent from "@material-ui/core/DialogContent"; +import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogTitle from "@material-ui/core/DialogTitle"; import Divider from "@material-ui/core/Divider"; +import Grid from "@material-ui/core/Grid"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import ListItemAvatar from "@material-ui/core/ListItemAvatar"; -import Avatar from "@material-ui/core/Avatar"; -import { - FileCopy, - Forum, - GitHub, - Home, - Launch, - Lock, - People, - Public, - Telegram -} from "@material-ui/icons"; -import ListItemText from "@material-ui/core/ListItemText"; import ListItemIcon from "@material-ui/core/ListItemIcon"; -import { blue, green, red, yellow } from "@material-ui/core/colors"; +import ListItemText from "@material-ui/core/ListItemText"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import { FileCopy, Forum, GitHub, Home, Launch, Lock, People, Public, Telegram } from "@material-ui/icons"; import axios from "axios"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { CartesianGrid, Legend, Line, LineChart, Tooltip, XAxis, YAxis } from "recharts"; +import ResponsiveContainer from "recharts/lib/component/ResponsiveContainer"; import TimeAgo from "timeago-react"; -import Chip from "@material-ui/core/Chip"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import Dialog from "@material-ui/core/Dialog"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogContentText from "@material-ui/core/DialogContentText"; -import DialogActions from "@material-ui/core/DialogActions"; -import Button from "@material-ui/core/Button"; +import { toggleSnackbar } from "../../actions"; +import API from "../../middleware/Api"; +import pathHelper from "../../utils/page"; const useStyles = makeStyles(theme => ({ paper: { @@ -124,7 +106,7 @@ export default function Index() { value:window.location.origin, }], }) - .then(response => { + .then(() => { setSiteURL(window.location.origin); ToggleSnackbar("top", "right", "设置已更改", "success"); }) @@ -303,6 +285,7 @@ export default function Index() {
cloudreve @@ -385,7 +368,7 @@ export default function Index() { - {news && news.map((v, k) => ( + {news && news.map((v) => ( <> window.open("https://forum.cloudreve.org/d/" + v.id)} diff --git a/src/component/Admin/Policy/AddPolicy.js b/src/component/Admin/Policy/AddPolicy.js index 0dcc951..9730451 100644 --- a/src/component/Admin/Policy/AddPolicy.js +++ b/src/component/Admin/Policy/AddPolicy.js @@ -1,14 +1,14 @@ -import React, {useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; import Paper from "@material-ui/core/Paper"; -import {useParams} from "react-router"; -import LocalGuide from "./Guid/LocalGuide"; -import RemoteGuide from "./Guid/RemoteGuide"; -import QiniuGuide from "./Guid/QiniuGuide"; -import OSSGuide from "./Guid/OSSGuide"; -import UpyunGuide from "./Guid/UpyunGuide"; +import { makeStyles } from "@material-ui/core/styles"; +import React from "react"; +import { useParams } from "react-router"; import COSGuide from "./Guid/COSGuide"; +import LocalGuide from "./Guid/LocalGuide"; import OneDriveGuide from "./Guid/OneDriveGuide"; +import OSSGuide from "./Guid/OSSGuide"; +import QiniuGuide from "./Guid/QiniuGuide"; +import RemoteGuide from "./Guid/RemoteGuide"; +import UpyunGuide from "./Guid/UpyunGuide"; const useStyles = makeStyles(theme => ({ root: { @@ -25,7 +25,6 @@ const useStyles = makeStyles(theme => ({ export default function AddPolicyParent( ) { const classes = useStyles(); - const [loading, setLoading] = useState(false); let { type } = useParams(); diff --git a/src/component/Admin/Policy/EditPolicy.js b/src/component/Admin/Policy/EditPolicy.js index 2041210..3877132 100644 --- a/src/component/Admin/Policy/EditPolicy.js +++ b/src/component/Admin/Policy/EditPolicy.js @@ -1,18 +1,18 @@ -import React, {useCallback, useEffect, useState} from "react"; -import { makeStyles } from "@material-ui/core/styles"; import Paper from "@material-ui/core/Paper"; -import {useParams} from "react-router"; -import LocalGuide from "./Guid/LocalGuide"; -import RemoteGuide from "./Guid/RemoteGuide"; -import QiniuGuide from "./Guid/QiniuGuide"; -import OSSGuide from "./Guid/OSSGuide"; -import UpyunGuide from "./Guid/UpyunGuide"; -import COSGuide from "./Guid/COSGuide"; -import OneDriveGuide from "./Guid/OneDriveGuide"; +import { makeStyles } from "@material-ui/core/styles"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useParams } from "react-router"; +import { toggleSnackbar } from "../../../actions"; import API from "../../../middleware/Api"; -import {useDispatch} from "react-redux"; -import {toggleSnackbar} from "../../../actions"; +import COSGuide from "./Guid/COSGuide"; import EditPro from "./Guid/EditPro"; +import LocalGuide from "./Guid/LocalGuide"; +import OneDriveGuide from "./Guid/OneDriveGuide"; +import OSSGuide from "./Guid/OSSGuide"; +import QiniuGuide from "./Guid/QiniuGuide"; +import RemoteGuide from "./Guid/RemoteGuide"; +import UpyunGuide from "./Guid/UpyunGuide"; const useStyles = makeStyles(theme => ({ root: { @@ -29,7 +29,6 @@ const useStyles = makeStyles(theme => ({ export default function EditPolicyPreload( ) { const classes = useStyles(); - const [loading, setLoading] = useState(false); const [type,setType] = useState(""); const [policy,setPolicy] = useState({}); diff --git a/src/component/Admin/Policy/Guid/COSGuide.js b/src/component/Admin/Policy/Guid/COSGuide.js index 8c876c7..4e1ae71 100644 --- a/src/component/Admin/Policy/Guid/COSGuide.js +++ b/src/component/Admin/Policy/Guid/COSGuide.js @@ -1,30 +1,28 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import MenuItem from "@material-ui/core/MenuItem"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Select from "@material-ui/core/Select"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; +import { getNumber } from "../../../../utils"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {getNumber, randomStr} from "../../../../utils"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormHelperText from "@material-ui/core/FormHelperText"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -219,7 +217,7 @@ export default function COSGuide(props) { API.post("/admin/policy/cors", { id: policyID }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "跨域策略已添加", "success"); setActiveStep(5); }) @@ -238,7 +236,7 @@ export default function COSGuide(props) { id: policyID, region:region, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "回调云函数已添加", "success"); setActiveStep(6); }) @@ -569,8 +567,10 @@ export default function COSGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -602,8 +602,10 @@ export default function COSGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/EditPro.js b/src/component/Admin/Policy/Guid/EditPro.js index 1228e15..732c76c 100644 --- a/src/component/Admin/Policy/Guid/EditPro.js +++ b/src/component/Admin/Policy/Guid/EditPro.js @@ -1,81 +1,68 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; -import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; -import DomainInput from "../../Common/DomainInput"; -import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; -import TableContainer from "@material-ui/core/TableContainer"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import TableBody from "@material-ui/core/TableBody"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from '../../../../actions'; +import API from "../../../../middleware/Api"; -const useStyles = makeStyles(theme => ({ - stepContent: { - padding: "16px 32px 16px 32px" - }, - form: { - maxWidth: 400, - marginTop: 20 - }, - formContainer: { - [theme.breakpoints.up("md")]: { - padding: "0px 24px 0 24px" - } - }, - subStepContainer: { - display: "flex", - marginBottom: 20, - padding: 10, - transition: theme.transitions.create("background-color", { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen - }), - "&:focus-within": { - backgroundColor: theme.palette.background.default - } - }, - stepNumber: { - width: 20, - height: 20, - backgroundColor: lighten(theme.palette.secondary.light, 0.2), - color: theme.palette.secondary.contrastText, - textAlign: "center", - borderRadius: " 50%" - }, - stepNumberContainer: { - marginRight: 10 - }, - stepFooter: { - marginTop: 32 - }, - button: { - marginRight: theme.spacing(1) - } -})); + +// const useStyles = makeStyles(theme => ({ +// stepContent: { +// padding: "16px 32px 16px 32px" +// }, +// form: { +// maxWidth: 400, +// marginTop: 20 +// }, +// formContainer: { +// [theme.breakpoints.up("md")]: { +// padding: "0px 24px 0 24px" +// } +// }, +// subStepContainer: { +// display: "flex", +// marginBottom: 20, +// padding: 10, +// transition: theme.transitions.create("background-color", { +// easing: theme.transitions.easing.sharp, +// duration: theme.transitions.duration.leavingScreen +// }), +// "&:focus-within": { +// backgroundColor: theme.palette.background.default +// } +// }, +// stepNumber: { +// width: 20, +// height: 20, +// backgroundColor: lighten(theme.palette.secondary.light, 0.2), +// color: theme.palette.secondary.contrastText, +// textAlign: "center", +// borderRadius: " 50%" +// }, +// stepNumberContainer: { +// marginRight: 10 +// }, +// stepFooter: { +// marginTop: 32 +// }, +// button: { +// marginRight: theme.spacing(1) +// } +// })); export default function EditPro(props) { - const classes = useStyles(); - const history = useHistory(); - - const [loading, setLoading] = useState(false); + const [, setLoading] = useState(false); const [policy, setPolicy] = useState(props.policy); const handleChange = name => event => { @@ -128,7 +115,7 @@ export default function EditPro(props) { API.post("/admin/policy", { policy: policyCopy }) - .then(response => { + .then(() => { ToggleSnackbar( "top", "right", diff --git a/src/component/Admin/Policy/Guid/LocalGuide.js b/src/component/Admin/Policy/Guid/LocalGuide.js index e0128fd..4ce2ee6 100644 --- a/src/component/Admin/Policy/Guid/LocalGuide.js +++ b/src/component/Admin/Policy/Guid/LocalGuide.js @@ -1,25 +1,25 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -90,7 +90,7 @@ export default function LocalGuide(props) { const [activeStep, setActiveStep] = useState(0); const [loading, setLoading] = useState(false); - const [skipped, setSkipped] = React.useState(new Set()); + const [skipped] = React.useState(new Set()); const [magicVar, setMagicVar] = useState(""); const [useCDN, setUseCDN] = useState("false"); const [policy, setPolicy] = useState( @@ -148,7 +148,7 @@ export default function LocalGuide(props) { API.post("/admin/policy/test/path", { path: policy.DirNameRule }) - .then(response => { + .then(() => { setActiveStep(1); }) .catch(error => { @@ -190,7 +190,7 @@ export default function LocalGuide(props) { API.post("/admin/policy", { policy: policyCopy }) - .then(response => { + .then(() => { ToggleSnackbar( "top", "right", @@ -249,8 +249,10 @@ export default function LocalGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -282,8 +284,10 @@ export default function LocalGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/OSSGuide.js b/src/component/Admin/Policy/Guid/OSSGuide.js index 3e27076..abf3cb8 100644 --- a/src/component/Admin/Policy/Guid/OSSGuide.js +++ b/src/component/Admin/Policy/Guid/OSSGuide.js @@ -1,27 +1,26 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; +import { getNumber } from "../../../../utils"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {getNumber, randomStr} from "../../../../utils"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -211,7 +210,7 @@ export default function OSSGuide(props) { API.post("/admin/policy/cors", { id: policyID }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "跨域策略已添加", "success"); setActiveStep(5); }) @@ -546,8 +545,10 @@ export default function OSSGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -579,8 +580,10 @@ export default function OSSGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/OneDriveGuide.js b/src/component/Admin/Policy/Guid/OneDriveGuide.js index 1e109f5..231cc31 100644 --- a/src/component/Admin/Policy/Guid/OneDriveGuide.js +++ b/src/component/Admin/Policy/Guid/OneDriveGuide.js @@ -1,28 +1,25 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; -import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; -import DomainInput from "../../Common/DomainInput"; -import SizeInput from "../../Common/SizeInput"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; import { useHistory } from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {getNumber, randomStr} from "../../../../utils"; +import { toggleSnackbar } from "../../../../actions"; +import API from "../../../../middleware/Api"; +import SizeInput from "../../Common/SizeInput"; import AlertDialog from "../../Dialogs/Alert"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -108,7 +105,7 @@ export default function OneDriveGuide(props) { const [activeStep, setActiveStep] = useState(0); const [loading, setLoading] = useState(false); - const [skipped, setSkipped] = React.useState(new Set()); + const [skipped,] = React.useState(new Set()); const [magicVar, setMagicVar] = useState(""); const [policy, setPolicy] = useState(props.policy ? props.policy @@ -185,7 +182,7 @@ export default function OneDriveGuide(props) { }); },[]); - const statOAuth = e =>{ + const statOAuth = () =>{ setLoading(true); API.get("/admin/policy/" + policyID + "/oauth", ) .then(response => { @@ -475,8 +472,10 @@ export default function OneDriveGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -508,8 +507,10 @@ export default function OneDriveGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/QiniuGuide.js b/src/component/Admin/Policy/Guid/QiniuGuide.js index 8f5f610..0e591af 100644 --- a/src/component/Admin/Policy/Guid/QiniuGuide.js +++ b/src/component/Admin/Policy/Guid/QiniuGuide.js @@ -1,27 +1,26 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; +import { getNumber } from "../../../../utils"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {getNumber, randomStr} from "../../../../utils"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -96,9 +95,9 @@ export default function RemoteGuide(props) { const [activeStep, setActiveStep] = useState(0); const [loading, setLoading] = useState(false); - const [skipped, setSkipped] = React.useState(new Set()); + const [skipped,] = React.useState(new Set()); const [magicVar, setMagicVar] = useState(""); - const [useCDN, setUseCDN] = useState("false"); + // const [useCDN, setUseCDN] = useState("false"); const [policy, setPolicy] = useState(props.policy?props.policy:{ Type: "qiniu", Name: "", @@ -171,7 +170,7 @@ export default function RemoteGuide(props) { API.post("/admin/policy", { policy: policyCopy }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "存储策略已"+ (props.policy ? "保存" : "添加"), "success"); setActiveStep(5); }) @@ -395,8 +394,10 @@ export default function RemoteGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -428,8 +429,10 @@ export default function RemoteGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/RemoteGuide.js b/src/component/Admin/Policy/Guid/RemoteGuide.js index e891a3d..ac729fd 100644 --- a/src/component/Admin/Policy/Guid/RemoteGuide.js +++ b/src/component/Admin/Policy/Guid/RemoteGuide.js @@ -1,27 +1,27 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import Alert from "@material-ui/lab/Alert"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; +import { randomStr } from "../../../../utils"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import {useHistory} from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {randomStr} from "../../../../utils"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -117,7 +117,7 @@ export default function RemoteGuide(props) { const [activeStep, setActiveStep] = useState(0); const [loading, setLoading] = useState(false); - const [skipped, setSkipped] = React.useState(new Set()); + const [skipped,] = React.useState(new Set()); const [magicVar,setMagicVar] = useState(""); const [useCDN,setUseCDN] = useState("false"); const [policy, setPolicy] = useState(props.policy?props.policy:{ @@ -173,7 +173,7 @@ export default function RemoteGuide(props) { server: policy.Server, secret:policy.SecretKey, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "通信正常", "success"); }) .catch(error => { @@ -209,7 +209,7 @@ export default function RemoteGuide(props) { API.post("/admin/policy", { policy: policyCopy }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "存储策略已" + (props.policy ? "保存" : "添加"), "success"); setActiveStep(5); }) @@ -422,8 +422,10 @@ export default function RemoteGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -455,8 +457,10 @@ export default function RemoteGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Guid/UpyunGuide.js b/src/component/Admin/Policy/Guid/UpyunGuide.js index 7e3baa7..85eb41d 100644 --- a/src/component/Admin/Policy/Guid/UpyunGuide.js +++ b/src/component/Admin/Policy/Guid/UpyunGuide.js @@ -1,27 +1,25 @@ -import { lighten, makeStyles } from "@material-ui/core/styles"; -import React, { useCallback, useEffect, useState } from "react"; -import Stepper from "@material-ui/core/Stepper"; -import StepLabel from "@material-ui/core/StepLabel"; -import Step from "@material-ui/core/Step"; -import Typography from "@material-ui/core/Typography"; -import { useDispatch } from "react-redux"; -import { changeSubTitle, toggleSnackbar } from "../../../../actions"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Input from "@material-ui/core/Input"; -import RadioGroup from "@material-ui/core/RadioGroup"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Radio from "@material-ui/core/Radio"; -import Collapse from "@material-ui/core/Collapse"; import Button from "@material-ui/core/Button"; +import Collapse from "@material-ui/core/Collapse"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import Radio from "@material-ui/core/Radio"; +import RadioGroup from "@material-ui/core/RadioGroup"; +import Step from "@material-ui/core/Step"; +import StepLabel from "@material-ui/core/StepLabel"; +import Stepper from "@material-ui/core/Stepper"; +import { lighten, makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../../actions"; import API from "../../../../middleware/Api"; -import MagicVar from "../../Dialogs/MagicVar"; import DomainInput from "../../Common/DomainInput"; import SizeInput from "../../Common/SizeInput"; -import { useHistory } from "react-router"; -import Alert from "@material-ui/lab/Alert"; -import {getNumber, randomStr} from "../../../../utils"; +import MagicVar from "../../Dialogs/MagicVar"; const useStyles = makeStyles(theme => ({ stepContent: { @@ -96,7 +94,7 @@ export default function UpyunGuide(props) { const [activeStep, setActiveStep] = useState(0); const [loading, setLoading] = useState(false); - const [skipped, setSkipped] = React.useState(new Set()); + const [skipped,] = React.useState(new Set()); const [magicVar, setMagicVar] = useState(""); const [policy, setPolicy] = useState(props.policy?props.policy:{ Type: "upyun", @@ -170,7 +168,7 @@ export default function UpyunGuide(props) { API.post("/admin/policy", { policy: policyCopy }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "存储策略已"+ (props.policy ? "保存" : "添加"), "success"); setActiveStep(5); }) @@ -427,8 +425,10 @@ export default function UpyunGuide(props) { 可用魔法变量可参考{" "} setMagicVar("path")} + onClick={(e) => { + e.preventDefault() + setMagicVar("path") + }} > 路径魔法变量列表 {" "} @@ -460,8 +460,10 @@ export default function UpyunGuide(props) { 可用魔法变量可参考{" "} setMagicVar("file")} + onClick={(e) => { + e.preventDefault() + setMagicVar("file") + }} > 文件名魔法变量列表 {" "} diff --git a/src/component/Admin/Policy/Policy.js b/src/component/Admin/Policy/Policy.js index bde6b83..30ff706 100644 --- a/src/component/Admin/Policy/Policy.js +++ b/src/component/Admin/Policy/Policy.js @@ -1,28 +1,27 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import { sizeToString } from "../../../utils"; -import TableBody from "@material-ui/core/TableBody"; -import { policyTypeMap } from "../../../config"; -import TablePagination from "@material-ui/core/TablePagination"; -import AddPolicy from "../Dialogs/AddPolicy"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import {useHistory, useLocation} from "react-router"; import IconButton from "@material-ui/core/IconButton"; -import {Delete, Edit} from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Popover from "@material-ui/core/Popover"; import Menu from "@material-ui/core/Menu"; +import MenuItem from "@material-ui/core/MenuItem"; +import Paper from "@material-ui/core/Paper"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import Tooltip from "@material-ui/core/Tooltip"; +import { Delete, Edit } from "@material-ui/icons"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory, useLocation } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import { policyTypeMap } from "../../../config"; +import API from "../../../middleware/Api"; +import { sizeToString } from "../../../utils"; +import AddPolicy from "../Dialogs/AddPolicy"; const useStyles = makeStyles(theme => ({ root: { @@ -78,8 +77,8 @@ function useQuery() { export default function Policy() { const classes = useStyles(); - const [loading, setLoading] = useState(false); - const [tab, setTab] = useState(0); + // const [loading, setLoading] = useState(false); + // const [tab, setTab] = useState(0); const [policies, setPolicies] = useState([]); const [statics, setStatics] = useState([]); const [page, setPage] = useState(1); @@ -102,6 +101,12 @@ export default function Policy() { setAnchorEl(null); }; + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); useEffect(()=>{ if(query.get("code") === "0"){ @@ -112,30 +117,30 @@ export default function Policy() { },[location]) + const loadList = useCallback(() => { + API.post("/admin/policy/list", { + page: page, + page_size: pageSize, + order_by: "id desc", + conditions: filter === "all" ? {} : { type: filter } + }) + .then(response => { + setPolicies(response.data.items); + setStatics(response.data.statics); + setTotal(response.data.total); + }) + .catch(error => { + ToggleSnackbar("top", "right", error.message, "error"); + }); + }, []); + useEffect(() => { loadList(); }, [page, pageSize,filter]); - const loadList = () => { - API.post("/admin/policy/list", { - page: page, - page_size: pageSize, - order_by: "id desc", - conditions: filter === "all" ? {} : { type: filter } - }) - .then(response => { - setPolicies(response.data.items); - setStatics(response.data.statics); - setTotal(response.data.total); - }) - .catch(error => { - ToggleSnackbar("top", "right", error.message, "error"); - }); - }; - const deletePolicy = (id) =>{ API.delete("/admin/policy/" + id,) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "存储策略已删除", "success"); }) @@ -144,13 +149,6 @@ export default function Policy() { }); } - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const open = Boolean(anchorEl); return ( diff --git a/src/component/Admin/Setting/Access.js b/src/component/Admin/Setting/Access.js index 63f8571..cf88df3 100644 --- a/src/component/Admin/Setting/Access.js +++ b/src/component/Admin/Setting/Access.js @@ -1,20 +1,19 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Switch from "@material-ui/core/Switch"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Switch from "@material-ui/core/Switch"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; +import API from "../../../middleware/Api"; import AlertDialog from "../Dialogs/Alert"; -import Alert from "@material-ui/lab/Alert"; const useStyles = makeStyles(theme => ({ root: { @@ -116,7 +115,7 @@ export default function Access() { API.patch("/admin/setting", { options: option }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); }) .catch(error => { diff --git a/src/component/Admin/Setting/Aria2.js b/src/component/Admin/Setting/Aria2.js index 0f2ce07..3d09f53 100644 --- a/src/component/Admin/Setting/Aria2.js +++ b/src/component/Admin/Setting/Aria2.js @@ -1,19 +1,16 @@ -import React, { useCallback, useEffect, useState } from "react"; +import Button from "@material-ui/core/Button"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import Alert from "@material-ui/lab/Alert"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Alert from "@material-ui/lab/Alert"; -import Link from "@material-ui/core/Link"; -import Box from "@material-ui/core/Box"; +import API from "../../../middleware/Api"; const useStyles = makeStyles(theme => ({ root: { @@ -75,7 +72,7 @@ export default function Aria2() { const reload = () => { API.get("/admin/reload/aria2") - .then(response => {}) + .then(() => {}) .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }) @@ -111,7 +108,7 @@ export default function Aria2() { API.patch("/admin/setting",{ options:option, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); reload(); }) diff --git a/src/component/Admin/Setting/Image.js b/src/component/Admin/Setting/Image.js index bf27917..2b6a4dd 100644 --- a/src/component/Admin/Setting/Image.js +++ b/src/component/Admin/Setting/Image.js @@ -1,16 +1,16 @@ -import React, { useCallback, useEffect, useState } from "react"; +import Button from "@material-ui/core/Button"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; +import API from "../../../middleware/Api"; import SizeInput from "../Common/SizeInput"; const useStyles = makeStyles(theme => ({ @@ -91,7 +91,7 @@ export default function ImageSetting() { API.patch("/admin/setting",{ options:option, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); }) .catch(error => { diff --git a/src/component/Admin/Setting/Mail.js b/src/component/Admin/Setting/Mail.js index 26a4cc6..94f51c9 100644 --- a/src/component/Admin/Setting/Mail.js +++ b/src/component/Admin/Setting/Mail.js @@ -1,20 +1,20 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; import Dialog from "@material-ui/core/Dialog"; -import DialogTitle from "@material-ui/core/DialogTitle"; +import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogContentText from "@material-ui/core/DialogContentText"; +import DialogTitle from "@material-ui/core/DialogTitle"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; -import DialogActions from "@material-ui/core/DialogActions"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; const useStyles = makeStyles(theme => ({ root: { @@ -88,7 +88,7 @@ export default function Mail() { API.post("/admin/mailTest", { to: tesInput }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "测试邮件已发送", "success"); }) .catch(error => { @@ -101,7 +101,7 @@ export default function Mail() { const reload = () => { API.get("/admin/reload/email") - .then(response => {}) + .then(() => {}) .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }) @@ -121,7 +121,7 @@ export default function Mail() { API.patch("/admin/setting", { options: option }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); reload(); }) diff --git a/src/component/Admin/Setting/SiteInformation.js b/src/component/Admin/Setting/SiteInformation.js index 883b144..88539ae 100644 --- a/src/component/Admin/Setting/SiteInformation.js +++ b/src/component/Admin/Setting/SiteInformation.js @@ -1,17 +1,16 @@ -import React, { useCallback, useEffect, useState } from "react"; +import Button from "@material-ui/core/Button"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; -import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import Alert from "@material-ui/lab/Alert"; +import API from "../../../middleware/Api"; const useStyles = makeStyles(theme => ({ root: { @@ -89,7 +88,7 @@ export default function SiteInformation() { API.patch("/admin/setting",{ options:option, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); }) .catch(error => { diff --git a/src/component/Admin/Setting/Theme.js b/src/component/Admin/Setting/Theme.js index 8b58265..150fc81 100644 --- a/src/component/Admin/Setting/Theme.js +++ b/src/component/Admin/Setting/Theme.js @@ -1,26 +1,26 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import IconButton from "@material-ui/core/IconButton"; +import InputLabel from "@material-ui/core/InputLabel"; +import Link from "@material-ui/core/Link"; +import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableHead from "@material-ui/core/TableHead"; +import TableRow from "@material-ui/core/TableRow"; +import TextField from "@material-ui/core/TextField"; +import Typography from "@material-ui/core/Typography"; +import { Delete } from "@material-ui/icons"; +import Alert from "@material-ui/lab/Alert"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import TableHead from "@material-ui/core/TableHead"; -import Table from "@material-ui/core/Table"; -import TableCell from "@material-ui/core/TableCell"; -import TableRow from "@material-ui/core/TableRow"; -import TableBody from "@material-ui/core/TableBody"; -import { Delete } from "@material-ui/icons"; -import IconButton from "@material-ui/core/IconButton"; -import TextField from "@material-ui/core/TextField"; +import API from "../../../middleware/Api"; import CreateTheme from "../Dialogs/CreateTheme"; -import Alert from "@material-ui/lab/Alert"; -import Link from "@material-ui/core/Link"; -import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import FormHelperText from "@material-ui/core/FormHelperText"; const useStyles = makeStyles(theme => ({ root: { @@ -103,7 +103,7 @@ export default function Theme() { let res = JSON.parse(options.themes); let themeString = {}; - Object.keys(res).map(k => { + Object.keys(res).forEach(k => { themeString[k] = JSON.stringify(res[k]); }); @@ -151,7 +151,7 @@ export default function Theme() { API.patch("/admin/setting", { options: option }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); }) .catch(error => { @@ -243,7 +243,7 @@ export default function Theme() { !('secondary' in res.palette) || !('main' in res.palette.secondary) ){ - throw "error"; + throw e } setTheme({ ...theme, diff --git a/src/component/Admin/Setting/UploadDownload.js b/src/component/Admin/Setting/UploadDownload.js index e80ee62..6e04540 100644 --- a/src/component/Admin/Setting/UploadDownload.js +++ b/src/component/Admin/Setting/UploadDownload.js @@ -1,19 +1,17 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; +import FormControl from "@material-ui/core/FormControl"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; +import { makeStyles } from "@material-ui/core/styles"; +import Switch from "@material-ui/core/Switch"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; +import API from "../../../middleware/Api"; import SizeInput from "../Common/SizeInput"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Switch from "@material-ui/core/Switch"; const useStyles = makeStyles(theme => ({ root: { @@ -106,7 +104,7 @@ export default function UploadDownload() { API.patch("/admin/setting",{ options:option, }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "设置已更改", "success"); }) .catch(error => { diff --git a/src/component/Admin/Share/Share.js b/src/component/Admin/Share/Share.js index aa981d8..d2c52c3 100644 --- a/src/component/Admin/Share/Share.js +++ b/src/component/Admin/Share/Share.js @@ -1,28 +1,27 @@ +import { lighten } from "@material-ui/core"; +import Badge from "@material-ui/core/Badge"; +import Button from "@material-ui/core/Button"; +import Checkbox from "@material-ui/core/Checkbox"; +import IconButton from "@material-ui/core/IconButton"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import TableSortLabel from "@material-ui/core/TableSortLabel"; +import Toolbar from "@material-ui/core/Toolbar"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import { Delete, FilterList } from "@material-ui/icons"; import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; -import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import TableBody from "@material-ui/core/TableBody"; -import TablePagination from "@material-ui/core/TablePagination"; -import { useLocation } from "react-router"; -import IconButton from "@material-ui/core/IconButton"; -import { Delete, FilterList } from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Checkbox from "@material-ui/core/Checkbox"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; -import { lighten } from "@material-ui/core"; -import Link from "@material-ui/core/Link"; -import TableSortLabel from "@material-ui/core/TableSortLabel"; -import Badge from "@material-ui/core/Badge"; +import API from "../../../middleware/Api"; import ShareFilter from "../Dialogs/ShareFilter"; const useStyles = makeStyles(theme => ({ @@ -69,10 +68,6 @@ const useStyles = makeStyles(theme => ({ } })); -function useQuery() { - return new URLSearchParams(useLocation().search); -} - export default function Share() { const classes = useStyles(); const [shares, setShares] = useState([]); @@ -88,11 +83,13 @@ export default function Share() { const [selected, setSelected] = useState([]); const [loading, setLoading] = useState(false); - useEffect(() => { - loadList(); - }, [page, pageSize, orderBy, filter, search]); - - const loadList = () => { + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); + const loadList = useCallback(() => { API.post("/admin/share/list", { page: page, page_size: pageSize, @@ -110,12 +107,16 @@ export default function Share() { .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }); - }; + }, []); + + useEffect(() => { + loadList(); + }, [page, pageSize, orderBy, filter, search]); const deletePolicy = id => { setLoading(true); API.post("/admin/share/delete", { id: [id] }) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "分享已删除", "success"); }) @@ -127,10 +128,10 @@ export default function Share() { }); }; - const deleteBatch = e => { + const deleteBatch = () => { setLoading(true); API.post("/admin/share/delete", { id: selected }) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "分享已删除", "success"); }) @@ -142,13 +143,6 @@ export default function Share() { }); }; - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const handleSelectAllClick = event => { if (event.target.checked) { const newSelecteds = shares.map(n => n.ID); diff --git a/src/component/Admin/Task/Download.js b/src/component/Admin/Task/Download.js index 95da366..37f037a 100644 --- a/src/component/Admin/Task/Download.js +++ b/src/component/Admin/Task/Download.js @@ -1,30 +1,28 @@ +import { lighten } from "@material-ui/core"; +import Button from "@material-ui/core/Button"; +import Checkbox from "@material-ui/core/Checkbox"; +import IconButton from "@material-ui/core/IconButton"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import TableSortLabel from "@material-ui/core/TableSortLabel"; +import Toolbar from "@material-ui/core/Toolbar"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import { Delete } from "@material-ui/icons"; import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; -import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import TableBody from "@material-ui/core/TableBody"; -import TablePagination from "@material-ui/core/TablePagination"; -import { useLocation } from "react-router"; -import IconButton from "@material-ui/core/IconButton"; -import { Delete, FilterList } from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Checkbox from "@material-ui/core/Checkbox"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; -import { lighten } from "@material-ui/core"; -import Link from "@material-ui/core/Link"; -import TableSortLabel from "@material-ui/core/TableSortLabel"; -import Badge from "@material-ui/core/Badge"; +import API from "../../../middleware/Api"; +import { sizeToString } from "../../../utils"; import ShareFilter from "../Dialogs/ShareFilter"; -import {sizeToString} from "../../../utils"; const useStyles = makeStyles(theme => ({ root: { @@ -70,10 +68,6 @@ const useStyles = makeStyles(theme => ({ } })); -function useQuery() { - return new URLSearchParams(useLocation().search); -} - export default function Download() { const classes = useStyles(); const [downloads, setDownloads] = useState([]); @@ -88,59 +82,6 @@ export default function Download() { const [selected, setSelected] = useState([]); const [loading, setLoading] = useState(false); - useEffect(() => { - loadList(); - }, [page, pageSize, orderBy, filter, search]); - - const loadList = () => { - API.post("/admin/download/list", { - page: page, - page_size: pageSize, - order_by: orderBy.join(" "), - conditions: filter, - searches: search - }) - .then(response => { - setUsers(response.data.users); - setDownloads(response.data.items); - setTotal(response.data.total); - setSelected([]); - }) - .catch(error => { - ToggleSnackbar("top", "right", error.message, "error"); - }); - }; - - const deletePolicy = id => { - setLoading(true); - API.post("/admin/download/delete", { id: [id] }) - .then(response => { - loadList(); - ToggleSnackbar("top", "right", "任务已删除", "success"); - }) - .catch(error => { - ToggleSnackbar("top", "right", error.message, "error"); - }) - .then(() => { - setLoading(false); - }); - }; - - const deleteBatch = e => { - setLoading(true); - API.post("/admin/download/delete", { id: selected }) - .then(response => { - loadList(); - ToggleSnackbar("top", "right", "任务已删除", "success"); - }) - .catch(error => { - ToggleSnackbar("top", "right", error.message, "error"); - }) - .then(() => { - setLoading(false); - }); - }; - const dispatch = useDispatch(); const ToggleSnackbar = useCallback( (vertical, horizontal, msg, color) => @@ -148,6 +89,59 @@ export default function Download() { [dispatch] ); + const loadList = useCallback(() => { + API.post("/admin/download/list", { + page: page, + page_size: pageSize, + order_by: orderBy.join(" "), + conditions: filter, + searches: search + }) + .then(response => { + setUsers(response.data.users); + setDownloads(response.data.items); + setTotal(response.data.total); + setSelected([]); + }) + .catch(error => { + ToggleSnackbar("top", "right", error.message, "error"); + }); + }, []); + + useEffect(() => { + loadList(); + }, [page, pageSize, orderBy, filter, search]); + + const deletePolicy = id => { + setLoading(true); + API.post("/admin/download/delete", { id: [id] }) + .then(() => { + loadList(); + ToggleSnackbar("top", "right", "任务已删除", "success"); + }) + .catch(error => { + ToggleSnackbar("top", "right", error.message, "error"); + }) + .then(() => { + setLoading(false); + }); + }; + + const deleteBatch = () => { + setLoading(true); + API.post("/admin/download/delete", { id: selected }) + .then(() => { + loadList(); + ToggleSnackbar("top", "right", "任务已删除", "success"); + }) + .catch(error => { + ToggleSnackbar("top", "right", error.message, "error"); + }) + .then(() => { + setLoading(false); + }); + }; + const handleSelectAllClick = event => { if (event.target.checked) { const newSelecteds = downloads.map(n => n.ID); diff --git a/src/component/Admin/Task/Task.js b/src/component/Admin/Task/Task.js index 2fd9c05..022abe1 100644 --- a/src/component/Admin/Task/Task.js +++ b/src/component/Admin/Task/Task.js @@ -1,31 +1,28 @@ +import { lighten } from "@material-ui/core"; +import Button from "@material-ui/core/Button"; +import Checkbox from "@material-ui/core/Checkbox"; +import IconButton from "@material-ui/core/IconButton"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import TableSortLabel from "@material-ui/core/TableSortLabel"; +import Toolbar from "@material-ui/core/Toolbar"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import { Delete } from "@material-ui/icons"; import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; import { useDispatch } from "react-redux"; import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; -import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import TableBody from "@material-ui/core/TableBody"; -import TablePagination from "@material-ui/core/TablePagination"; -import { useLocation } from "react-router"; -import IconButton from "@material-ui/core/IconButton"; -import { Delete, FilterList } from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Checkbox from "@material-ui/core/Checkbox"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; -import { lighten } from "@material-ui/core"; -import Link from "@material-ui/core/Link"; -import TableSortLabel from "@material-ui/core/TableSortLabel"; -import Badge from "@material-ui/core/Badge"; +import { getTaskProgress, getTaskStatus, getTaskType } from "../../../config"; +import API from "../../../middleware/Api"; import ShareFilter from "../Dialogs/ShareFilter"; -import {sizeToString} from "../../../utils"; -import {getTaskProgress, getTaskStatus, getTaskType} from "../../../config"; const useStyles = makeStyles(theme => ({ root: { @@ -71,10 +68,6 @@ const useStyles = makeStyles(theme => ({ } })); -function useQuery() { - return new URLSearchParams(useLocation().search); -} - export default function Task() { const classes = useStyles(); const [tasks, setTasks] = useState([]); @@ -89,11 +82,14 @@ export default function Task() { const [selected, setSelected] = useState([]); const [loading, setLoading] = useState(false); - useEffect(() => { - loadList(); - }, [page, pageSize, orderBy, filter, search]); + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); - const loadList = () => { + const loadList = useCallback(() => { API.post("/admin/task/list", { page: page, page_size: pageSize, @@ -110,12 +106,16 @@ export default function Task() { .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }); - }; + }, []); + + useEffect(() => { + loadList(); + }, [page, pageSize, orderBy, filter, search]); const deletePolicy = id => { setLoading(true); API.post("/admin/task/delete", { id: [id] }) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "任务已删除", "success"); }) @@ -127,10 +127,10 @@ export default function Task() { }); }; - const deleteBatch = e => { + const deleteBatch = () => { setLoading(true); API.post("/admin/task/delete", { id: selected }) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "任务已删除", "success"); }) @@ -142,13 +142,6 @@ export default function Task() { }); }; - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const handleSelectAllClick = event => { if (event.target.checked) { const newSelecteds = tasks.map(n => n.ID); diff --git a/src/component/Admin/User/User.js b/src/component/Admin/User/User.js index c2be9e9..524f360 100644 --- a/src/component/Admin/User/User.js +++ b/src/component/Admin/User/User.js @@ -1,36 +1,30 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Paper from "@material-ui/core/Paper"; -import Button from "@material-ui/core/Button"; -import TableContainer from "@material-ui/core/TableContainer"; -import Table from "@material-ui/core/Table"; -import TableHead from "@material-ui/core/TableHead"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import { sizeToString } from "../../../utils"; -import TableBody from "@material-ui/core/TableBody"; -import { policyTypeMap } from "../../../config"; -import TablePagination from "@material-ui/core/TablePagination"; -import AddPolicy from "../Dialogs/AddPolicy"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import { useHistory, useLocation } from "react-router"; -import IconButton from "@material-ui/core/IconButton"; -import {Block, Delete, Edit, FilterList} from "@material-ui/icons"; -import Tooltip from "@material-ui/core/Tooltip"; -import Popover from "@material-ui/core/Popover"; -import Menu from "@material-ui/core/Menu"; -import Checkbox from "@material-ui/core/Checkbox"; -import Toolbar from "@material-ui/core/Toolbar"; -import Typography from "@material-ui/core/Typography"; import { lighten } from "@material-ui/core"; -import Link from "@material-ui/core/Link"; -import TableSortLabel from "@material-ui/core/TableSortLabel"; -import UserFilter from "../Dialogs/UserFilter"; import Badge from "@material-ui/core/Badge"; +import Button from "@material-ui/core/Button"; +import Checkbox from "@material-ui/core/Checkbox"; +import IconButton from "@material-ui/core/IconButton"; +import Link from "@material-ui/core/Link"; +import Paper from "@material-ui/core/Paper"; +import { makeStyles, useTheme } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TablePagination from "@material-ui/core/TablePagination"; +import TableRow from "@material-ui/core/TableRow"; +import TableSortLabel from "@material-ui/core/TableSortLabel"; +import Toolbar from "@material-ui/core/Toolbar"; +import Tooltip from "@material-ui/core/Tooltip"; +import Typography from "@material-ui/core/Typography"; +import { Block, Delete, Edit, FilterList } from "@material-ui/icons"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; +import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; +import { sizeToString } from "../../../utils"; +import UserFilter from "../Dialogs/UserFilter"; const useStyles = makeStyles(theme => ({ root: { @@ -76,10 +70,6 @@ const useStyles = makeStyles(theme => ({ } })); -function useQuery() { - return new URLSearchParams(useLocation().search); -} - export default function Group() { const classes = useStyles(); const [users, setUsers] = useState([]); @@ -93,16 +83,17 @@ export default function Group() { const [selected, setSelected] = useState([]); const [loading,setLoading] = useState(false); - let location = useLocation(); let history = useHistory(); - let query = useQuery(); let theme = useTheme(); - useEffect(() => { - loadList(); - }, [page, pageSize, orderBy, filter, search]); + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); - const loadList = () => { + const loadList = useCallback(() => { API.post("/admin/user/list", { page: page, page_size: pageSize, @@ -118,12 +109,16 @@ export default function Group() { .catch(error => { ToggleSnackbar("top", "right", error.message, "error"); }); - }; + }, []); + + useEffect(() => { + loadList(); + }, [page, pageSize, orderBy, filter, search]); const deletePolicy = id => { setLoading(true); API.post("/admin/user/delete",{id:[id]}) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "用户已删除", "success"); }) @@ -134,10 +129,10 @@ export default function Group() { }); }; - const deleteBatch = e =>{ + const deleteBatch = () =>{ setLoading(true); API.post("/admin/user/delete",{id:selected}) - .then(response => { + .then(() => { loadList(); ToggleSnackbar("top", "right", "用户已删除", "success"); }) @@ -167,13 +162,6 @@ export default function Group() { }); } - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const handleSelectAllClick = event => { if (event.target.checked) { const newSelecteds = users.map(n => n.ID); diff --git a/src/component/Admin/User/UserForm.js b/src/component/Admin/User/UserForm.js index 3091273..dce71fc 100644 --- a/src/component/Admin/User/UserForm.js +++ b/src/component/Admin/User/UserForm.js @@ -1,17 +1,17 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; -import Typography from "@material-ui/core/Typography"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Input from "@material-ui/core/Input"; -import FormHelperText from "@material-ui/core/FormHelperText"; import Button from "@material-ui/core/Button"; -import API from "../../../middleware/Api"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../../actions"; -import Select from "@material-ui/core/Select"; +import FormControl from "@material-ui/core/FormControl"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import Input from "@material-ui/core/Input"; +import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; +import Select from "@material-ui/core/Select"; +import { makeStyles } from "@material-ui/core/styles"; +import Typography from "@material-ui/core/Typography"; +import React, { useCallback, useEffect, useState } from "react"; +import { useDispatch } from "react-redux"; import { useHistory } from "react-router"; +import { toggleSnackbar } from "../../../actions"; +import API from "../../../middleware/Api"; const useStyles = makeStyles(theme => ({ root: { @@ -48,9 +48,15 @@ export default function UserForm(props) { ); const [groups, setGroups] = useState([]); - const theme = useTheme(); let history = useHistory(); + const dispatch = useDispatch(); + const ToggleSnackbar = useCallback( + (vertical, horizontal, msg, color) => + dispatch(toggleSnackbar(vertical, horizontal, msg, color)), + [dispatch] + ); + useEffect(() => { API.get("/admin/groups") .then(response => { @@ -68,13 +74,6 @@ export default function UserForm(props) { }); }; - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const submit = e => { e.preventDefault(); let userCopy = {...user}; @@ -89,7 +88,7 @@ export default function UserForm(props) { user: userCopy, password:userCopy.Password, }) - .then(response => { + .then(() => { history.push("/admin/user"); ToggleSnackbar("top", "right", "用户已"+ (props.user ? "保存" : "添加"), "success"); }) diff --git a/src/component/Common/ICPFooter.js b/src/component/Common/ICPFooter.js index b30de13..e5e9b2e 100644 --- a/src/component/Common/ICPFooter.js +++ b/src/component/Common/ICPFooter.js @@ -1,15 +1,10 @@ -import React, { useEffect, useState } from "react" -import { useSelector } from "react-redux" +import { Link, makeStyles, useMediaQuery, useTheme } from "@material-ui/core"; +import React, { useEffect, useState } from "react"; +import { useSelector } from "react-redux"; import { useLocation } from "react-router"; -import { - makeStyles, - Link, - useTheme, - useMediaQuery, -} from "@material-ui/core" -import pageHelper from '../../utils/page' +import pageHelper from '../../utils/page'; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ icp: { padding: '8px 24px', textAlign: 'right', diff --git a/src/component/Common/Snackbar.js b/src/component/Common/Snackbar.js index fbdabb5..b4fb928 100644 --- a/src/component/Common/Snackbar.js +++ b/src/component/Common/Snackbar.js @@ -20,7 +20,7 @@ const mapStateToProps = state => { } } -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = () => { return { } } @@ -107,7 +107,7 @@ class SnackbarCompoment extends Component { open:false, } - componentWillReceiveProps = (nextProps)=>{ + UNSAFE_componentWillReceiveProps = (nextProps)=>{ if(nextProps.snackbar.toggle !== this.props.snackbar.toggle){ this.setState({open:true}); } diff --git a/src/component/Dial/AutoHidden.js b/src/component/Dial/AutoHidden.js index f5d0114..9d176dd 100644 --- a/src/component/Dial/AutoHidden.js +++ b/src/component/Dial/AutoHidden.js @@ -38,6 +38,6 @@ function AutoHidden ({ children, enable }){ {children} ) -}; +} export default AutoHidden \ No newline at end of file diff --git a/src/component/Download/Download.js b/src/component/Download/Download.js index 9ccded0..8bccb3e 100644 --- a/src/component/Download/Download.js +++ b/src/component/Download/Download.js @@ -1,14 +1,9 @@ +import { Button, IconButton, Typography, withStyles } from "@material-ui/core"; +import RefreshIcon from "@material-ui/icons/Refresh"; import React, { Component } from "react"; import { connect } from "react-redux"; -import RefreshIcon from "@material-ui/icons/Refresh"; import { toggleSnackbar } from "../../actions"; import API from "../../middleware/Api"; -import { - withStyles, - Typography, - Button, - IconButton -} from "@material-ui/core"; import DownloadingCard from "./DownloadingCard"; import FinishedCard from "./FinishedCard"; @@ -60,7 +55,7 @@ const styles = theme => ({ marginTop:theme.spacing(2), } }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; @@ -131,7 +126,7 @@ class DownloadComponent extends Component { continue: response.data.length >= 10 }); }) - .catch(error => { + .catch(() => { this.props.toggleSnackbar("top", "right", "加载失败", "error"); this.setState({ loading: false diff --git a/src/component/Download/DownloadingCard.js b/src/component/Download/DownloadingCard.js index 5edb2eb..b434f94 100644 --- a/src/component/Download/DownloadingCard.js +++ b/src/component/Download/DownloadingCard.js @@ -1,37 +1,27 @@ -import React, { useCallback, useEffect } from "react"; -import { - Card, - CardContent, - darken, - IconButton, - lighten, - LinearProgress, - makeStyles, - Typography, - useTheme -} from "@material-ui/core"; -import { useDispatch } from "react-redux"; -import { toggleSnackbar } from "../../actions"; -import { hex2bin, sizeToString } from "../../utils"; -import PermMediaIcon from "@material-ui/icons/PermMedia"; -import TypeIcon from "../FileManager/TypeIcon"; -import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; -import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; -import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; -import withStyles from "@material-ui/core/styles/withStyles"; -import Divider from "@material-ui/core/Divider"; -import { ExpandMore, HighlightOff } from "@material-ui/icons"; -import classNames from "classnames"; -import TableRow from "@material-ui/core/TableRow"; -import TableCell from "@material-ui/core/TableCell"; -import TableBody from "@material-ui/core/TableBody"; -import Table from "@material-ui/core/Table"; +import { Card, CardContent, darken, IconButton, lighten, LinearProgress, makeStyles, Typography, useTheme } from "@material-ui/core"; import Badge from "@material-ui/core/Badge"; -import Tooltip from "@material-ui/core/Tooltip"; -import API from "../../middleware/Api"; import Button from "@material-ui/core/Button"; +import Divider from "@material-ui/core/Divider"; +import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; +import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; +import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; import Grid from "@material-ui/core/Grid"; +import withStyles from "@material-ui/core/styles/withStyles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableRow from "@material-ui/core/TableRow"; +import Tooltip from "@material-ui/core/Tooltip"; +import { ExpandMore, HighlightOff } from "@material-ui/icons"; +import PermMediaIcon from "@material-ui/icons/PermMedia"; +import classNames from "classnames"; +import React, { useCallback, useEffect } from "react"; +import { useDispatch } from "react-redux"; import TimeAgo from "timeago-react"; +import { toggleSnackbar } from "../../actions"; +import API from "../../middleware/Api"; +import { hex2bin, sizeToString } from "../../utils"; +import TypeIcon from "../FileManager/TypeIcon"; import SelectFileDialog from "../Modals/SelectFile"; const ExpansionPanel = withStyles({ @@ -235,7 +225,7 @@ export default function DownloadingCard(props) { API.put("/aria2/select/" + task.info.gid, { indexes: newIndex }) - .then(response => { + .then(() => { setTask({ ...task, info: { @@ -282,10 +272,10 @@ export default function DownloadingCard(props) { // eslint-disable-next-line }, [task, classes]); - const cancel = e => { + const cancel = () => { setLoading(true); API.delete("/aria2/task/" + task.info.gid, ) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "任务已取消,状态会在稍后更新", "success"); }) .catch(error => { @@ -301,7 +291,7 @@ export default function DownloadingCard(props) { API.put("/aria2/select/" + task.info.gid, { indexes: fileIndex }) - .then(response => { + .then(() => { ToggleSnackbar("top", "right", "操作成功,状态会在稍后更新", "success"); setSelectDialogOpen(false); }) @@ -392,7 +382,7 @@ export default function DownloadingCard(props) {
- {activeFiles().map((value, key) => { + {activeFiles().map((value) => { return ( (event, newExpanded) => { + const handleChange = () => (event, newExpanded) => { setExpanded(!!newExpanded); }; - const dispatch = useDispatch(); - const ToggleSnackbar = useCallback( - (vertical, horizontal, msg, color) => - dispatch(toggleSnackbar(vertical, horizontal, msg, color)), - [dispatch] - ); - const getPercent = (completed, total) => { - if (total == 0) { + if (total === 0) { return 0; } return (completed / total) * 100; @@ -306,7 +297,7 @@ export default function FinishedCard(props) {
- {activeFiles().map((value, key) => { + {activeFiles().map((value) => { return ( ({ +const styles = () => ({ propover: { minWidth: "200px!important" }, diff --git a/src/component/FileManager/DnD/Preview.js b/src/component/FileManager/DnD/Preview.js index d1b0e9a..92e92c1 100644 --- a/src/component/FileManager/DnD/Preview.js +++ b/src/component/FileManager/DnD/Preview.js @@ -4,7 +4,7 @@ import FileIcon from "../FileIcon"; import { useSelector } from "react-redux"; import { makeStyles } from "@material-ui/core"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ dragging:{ width:"200px", }, diff --git a/src/component/FileManager/Explorer.js b/src/component/FileManager/Explorer.js index 5aff8ea..226db7e 100644 --- a/src/component/FileManager/Explorer.js +++ b/src/component/FileManager/Explorer.js @@ -1,37 +1,19 @@ -import React, { Component } from "react"; -import PropTypes from "prop-types"; -import { connect } from "react-redux"; -import { - navitateTo, - changeContextMenu, - navitateUp, - setSelectedTarget, - openRemoveDialog, - changeSortMethod, -} from "../../actions/index"; -import ObjectIcon from "./ObjectIcon"; -import ContextMenu from "./ContextMenu"; -import EmptyIcon from "@material-ui/icons/Unarchive"; -import SadIcon from "@material-ui/icons/SentimentVeryDissatisfied"; -import classNames from "classnames"; -import ImgPreivew from "./ImgPreview"; -import pathHelper from "../../utils/page"; -import { isMac } from "../../utils" -import { withRouter } from "react-router-dom"; -import { - Table, - TableBody, - TableCell, - TableHead, - TableRow, - withStyles, - Typography, - Grid, - CircularProgress, - Paper, -} from "@material-ui/core"; -import { GlobalHotKeys, configure } from "react-hotkeys"; +import { CircularProgress, Grid, Paper, Table, TableBody, TableCell, TableHead, TableRow, Typography, withStyles } from "@material-ui/core"; import TableSortLabel from "@material-ui/core/TableSortLabel"; +import SadIcon from "@material-ui/icons/SentimentVeryDissatisfied"; +import EmptyIcon from "@material-ui/icons/Unarchive"; +import classNames from "classnames"; +import PropTypes from "prop-types"; +import React, { Component } from "react"; +import { configure, GlobalHotKeys } from "react-hotkeys"; +import { connect } from "react-redux"; +import { withRouter } from "react-router-dom"; +import { changeContextMenu, changeSortMethod, navitateTo, navitateUp, openRemoveDialog, setSelectedTarget } from "../../actions/index"; +import { isMac } from "../../utils"; +import pathHelper from "../../utils/page"; +import ContextMenu from "./ContextMenu"; +import ImgPreivew from "./ImgPreview"; +import ObjectIcon from "./ObjectIcon"; const styles = theme => ({ paper: { @@ -220,7 +202,7 @@ class ExplorerCompoment extends Component { } }; - componentDidUpdate(prevProps, prevState, snapshot) { + componentDidUpdate() { this.away = 0; } @@ -407,6 +389,7 @@ class ExplorerCompoment extends Component { {this.props.dirList.map( (value, index) => ( ( ({ container: { @@ -123,7 +117,7 @@ const mapStateToProps = state => { }; }; -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = () => { return {}; }; diff --git a/src/component/FileManager/FileManager.js b/src/component/FileManager/FileManager.js index f6dc4e7..a177383 100644 --- a/src/component/FileManager/FileManager.js +++ b/src/component/FileManager/FileManager.js @@ -1,22 +1,14 @@ import React, { Component } from 'react' - -import Navigator from "./Navigator/Navigator" import { DndProvider } from 'react-dnd' import HTML5Backend from 'react-dnd-html5-backend' +import { connect } from "react-redux" +import { withRouter } from "react-router-dom" +import { changeSubTitle, closeAllModals, navitateTo, setSelectedTarget, toggleSnackbar } from "../../actions" +import pathHelper from "../../utils/page" import DragLayer from "./DnD/DragLayer" import Explorer from "./Explorer" import Modals from "./Modals" -import {decode} from "../../utils/index" -import { withStyles } from '@material-ui/core'; -import {connect} from "react-redux"; -import { - changeSubTitle, closeAllModals, navitateTo, setSelectedTarget, toggleSnackbar, -} from "../../actions"; -import {withRouter} from "react-router-dom"; -import pathHelper from "../../utils/page"; -const styles = theme => ({ - -}) +import Navigator from "./Navigator/Navigator" const mapStateToProps = ()=>{ @@ -43,15 +35,10 @@ const mapDispatchToProps = dispatch => { }; class FileManager extends Component { - constructor(props){ super(props); this.image = React.createRef(); } - - componentWillMount() { - } - componentWillUnmount() { this.props.setSelectedTarget([]); this.props.closeAllModals(); @@ -83,4 +70,4 @@ FileManager.propTypes = { export default connect( mapStateToProps, mapDispatchToProps -)(withStyles(styles)(withRouter(FileManager))); \ No newline at end of file +)((withRouter(FileManager))); \ No newline at end of file diff --git a/src/component/FileManager/ImgPreview.js b/src/component/FileManager/ImgPreview.js index 2c0c3db..6d5d7e9 100644 --- a/src/component/FileManager/ImgPreview.js +++ b/src/component/FileManager/ImgPreview.js @@ -10,7 +10,7 @@ import {withRouter} from "react-router"; import {PhotoSlider} from "react-photo-view"; import 'react-photo-view/dist/index.css'; -const styles = theme => ({}); +const styles = () => ({}); const mapStateToProps = state => { return { @@ -34,7 +34,7 @@ class ImagPreviewComponent extends Component { isOpen: false }; - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { let items = []; let firstOne = 0; if (nextProps.first !== null) { diff --git a/src/component/FileManager/ImgPreview_old.js b/src/component/FileManager/ImgPreview_old.js index 2eee09a..8661095 100644 --- a/src/component/FileManager/ImgPreview_old.js +++ b/src/component/FileManager/ImgPreview_old.js @@ -10,7 +10,7 @@ import "react-image-lightbox/style.css"; import pathHelper from "../../utils/page"; import {withRouter} from "react-router"; -const styles = theme => ({}); +const styles = () => ({}); const mapStateToProps = state => { return { @@ -34,7 +34,7 @@ class ImgPreviewCompoment extends Component { isOpen: false }; - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { let items = []; let firstOne = 0; if (nextProps.first !== null) { diff --git a/src/component/FileManager/Modals.js b/src/component/FileManager/Modals.js index 8f97b93..641bc6e 100644 --- a/src/component/FileManager/Modals.js +++ b/src/component/FileManager/Modals.js @@ -27,7 +27,6 @@ import CopyDialog from "../Modals/Copy"; import CreatShare from "../Modals/CreateShare"; import { withRouter } from "react-router-dom"; import pathHelper from "../../utils/page"; -import Auth from "../../middleware/Auth"; import DecompressDialog from "../Modals/Decompress"; import CompressDialog from "../Modals/Compress"; @@ -112,7 +111,7 @@ class ModalsCompoment extends Component { newNameSuffix = ""; downloaded = false; - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { if (this.props.dndSignale !== nextProps.dndSignale) { this.dragMove(nextProps.dndSource, nextProps.dndTarget); return; @@ -330,7 +329,7 @@ class ModalsCompoment extends Component { ? "/" : this.state.selectedPath }) - .then(response => { + .then(() => { this.onClose(); this.props.refreshFileList(); this.props.setModalsLoading(false); @@ -401,10 +400,10 @@ class ModalsCompoment extends Component { // 检查重名 if ( - this.props.dirList.findIndex((value, index) => { + this.props.dirList.findIndex((value) => { return value.name === newName; }) !== -1 || - this.props.fileList.findIndex((value, index) => { + this.props.fileList.findIndex((value) => { return value.name === newName; }) !== -1 ) { @@ -421,7 +420,7 @@ class ModalsCompoment extends Component { src: src, new_name: newName }) - .then(response => { + .then(() => { this.onClose(); this.props.refreshFileList(); this.props.setModalsLoading(false); @@ -442,7 +441,7 @@ class ModalsCompoment extends Component { e.preventDefault(); this.props.setModalsLoading(true); if ( - this.props.dirList.findIndex((value, index) => { + this.props.dirList.findIndex((value) => { return value.name === this.state.newFolderName; }) !== -1 ) { @@ -460,7 +459,7 @@ class ModalsCompoment extends Component { "/" + this.state.newFolderName }) - .then(response => { + .then(() => { this.onClose(); this.props.refreshFileList(); this.props.setModalsLoading(false); @@ -486,7 +485,7 @@ class ModalsCompoment extends Component { .post("/aria2/torrent/" + this.props.selected[0].id, { dst: this.state.selectedPath === "//" ? "/" : this.state.selectedPath }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -515,7 +514,7 @@ class ModalsCompoment extends Component { url: this.state.downloadURL, dst: this.state.selectedPath === "//" ? "/" : this.state.selectedPath }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", diff --git a/src/component/FileManager/Navigator/DropDown.js b/src/component/FileManager/Navigator/DropDown.js index 3bfeb85..2b37c97 100644 --- a/src/component/FileManager/Navigator/DropDown.js +++ b/src/component/FileManager/Navigator/DropDown.js @@ -41,6 +41,7 @@ export default function DropDown(props) { <> {props.folders.map((folder, id) => ( { + window.onpopstate = () => { var url = new URL(fixUrlHash(window.location.href)); var c = url.searchParams.get("path"); if (c !== null && c !== this.props.path) { @@ -238,7 +237,7 @@ class NavigatorComponent extends Component { this.renderPath(path); }; - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { if (this.props.keywords !== nextProps.keywords) { this.keywords = nextProps.keywords; } diff --git a/src/component/FileManager/ObjectIcon.js b/src/component/FileManager/ObjectIcon.js index 1d9b6b7..2437928 100644 --- a/src/component/FileManager/ObjectIcon.js +++ b/src/component/FileManager/ObjectIcon.js @@ -25,7 +25,7 @@ import { useHistory, useLocation } from "react-router-dom"; import Auth from "../../middleware/Auth"; import { pathBack } from "../../utils"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ container: { padding: "7px" }, diff --git a/src/component/FileManager/PathSelector.js b/src/component/FileManager/PathSelector.js index d13500b..866b41f 100644 --- a/src/component/FileManager/PathSelector.js +++ b/src/component/FileManager/PathSelector.js @@ -8,7 +8,6 @@ import classNames from 'classnames'; import { toggleSnackbar, } from "../../actions/index" -import axios from 'axios' import { MenuList, @@ -20,7 +19,6 @@ import { ListItemSecondaryAction, } from '@material-ui/core'; import API from '../../middleware/Api' -import { Api } from 'mdi-material-ui'; const mapStateToProps = state => { return { diff --git a/src/component/FileManager/SmallIcon.js b/src/component/FileManager/SmallIcon.js index 37d1a7e..fafe1ec 100644 --- a/src/component/FileManager/SmallIcon.js +++ b/src/component/FileManager/SmallIcon.js @@ -16,7 +16,7 @@ const styles = theme => ({ border: "1px solid #d0d0d0", }, backgroundColor: - theme.palette.type == "dark" + theme.palette.type === "dark" ? "#fff" : lighten(theme.palette.primary.main,0.8), }, @@ -49,7 +49,7 @@ const styles = theme => ({ color: theme.palette.text.secondary, }, folderNameSelected: { - color: theme.palette.type == "dark" ? theme.palette.background.paper : theme.palette.primary.dark, + color: theme.palette.type === "dark" ? theme.palette.background.paper : theme.palette.primary.dark, fontWeight: "500", }, folderNameNotSelected: { @@ -70,7 +70,7 @@ const mapStateToProps = state => { } } -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = () => { return { } } diff --git a/src/component/FileManager/TableRow.js b/src/component/FileManager/TableRow.js index f741fb2..5e52eb1 100644 --- a/src/component/FileManager/TableRow.js +++ b/src/component/FileManager/TableRow.js @@ -72,7 +72,7 @@ const mapStateToProps = state => { }; }; -const mapDispatchToProps = dispatch => { +const mapDispatchToProps = () => { return {}; }; diff --git a/src/component/Login/LoginForm.js b/src/component/Login/LoginForm.js index 6e26586..75dad8b 100644 --- a/src/component/Login/LoginForm.js +++ b/src/component/Login/LoginForm.js @@ -126,7 +126,7 @@ function LoginForm() { const classes = useStyles(); - const refreshCaptcha = () => { + const refreshCaptcha = useCallback(() => { API.get("/site/captcha") .then(response => { setCaptchaData(response.data); @@ -139,7 +139,7 @@ function LoginForm() { "error" ); }); - }; + }, []); useEffect(() => { setEmail(query.get("username")); diff --git a/src/component/Login/Register.js b/src/component/Login/Register.js index f5b3841..b85b8e7 100644 --- a/src/component/Login/Register.js +++ b/src/component/Login/Register.js @@ -8,7 +8,6 @@ import { import Placeholder from "../Placeholder/Captcha"; import { useHistory } from "react-router-dom"; import API from "../../middleware/Api"; -import Auth from "../../middleware/Auth"; import { Button, FormControl, @@ -118,7 +117,7 @@ function Register() { const classes = useStyles(); - const refreshCaptcha = () => { + const refreshCaptcha = useCallback(() => { API.get("/site/captcha") .then(response => { setCaptchaData(response.data); @@ -131,7 +130,7 @@ function Register() { "error" ); }); - }; + }, []); const register = e =>{ e.preventDefault(); diff --git a/src/component/Login/Reset.js b/src/component/Login/Reset.js index f1627c7..6223ad8 100644 --- a/src/component/Login/Reset.js +++ b/src/component/Login/Reset.js @@ -113,11 +113,9 @@ function Reset() { userName: input.email, captchaCode: input.captcha }) - .then(response => { + .then(() => { setLoading(false); ToggleSnackbar("top", "right", "密码重置邮件已发送,请注意查收", "success"); - - }) .catch(error => { setLoading(false); diff --git a/src/component/Login/ResetForm.js b/src/component/Login/ResetForm.js index 0e6fb9b..0ea1f99 100644 --- a/src/component/Login/ResetForm.js +++ b/src/component/Login/ResetForm.js @@ -91,7 +91,7 @@ function ResetForm() { id: query.get("id"), Password: input.password, }) - .then(response => { + .then(() => { setLoading(false); history.push("/login"); ToggleSnackbar("top", "right", "密码已重设", "success"); diff --git a/src/component/Login/ResetPwdForm.js b/src/component/Login/ResetPwdForm.js index c242457..23e3335 100644 --- a/src/component/Login/ResetPwdForm.js +++ b/src/component/Login/ResetPwdForm.js @@ -61,7 +61,7 @@ const styles = theme => ({ }, } }) -const mapStateToProps = state => { +const mapStateToProps = () => { return { } } diff --git a/src/component/Modals/Compress.js b/src/component/Modals/Compress.js index b490683..797990e 100644 --- a/src/component/Modals/Compress.js +++ b/src/component/Modals/Compress.js @@ -12,7 +12,6 @@ import { import { toggleSnackbar, setModalsLoading, - refreshFileList, } from "../../actions/index"; import PathSelector from "../FileManager/PathSelector"; import { useDispatch } from "react-redux"; @@ -93,7 +92,7 @@ export default function CompressDialog(props) { name:fileName, dst: selectedPath === "//" ? "/" : selectedPath }) - .then(response => { + .then(() => { props.onClose(); ToggleSnackbar("top", "right", "压缩任务已创建", "success"); SetModalsLoading(false); diff --git a/src/component/Modals/Copy.js b/src/component/Modals/Copy.js index 81a0a0b..2e91342 100644 --- a/src/component/Modals/Copy.js +++ b/src/component/Modals/Copy.js @@ -88,7 +88,7 @@ export default function CopyDialog(props) { }, dst: selectedPath === "//" ? "/" : selectedPath }) - .then(response => { + .then(() => { props.onClose(); RefreshFileList(); SetModalsLoading(false); diff --git a/src/component/Modals/CreateShare.js b/src/component/Modals/CreateShare.js index fbd68a2..b02768b 100644 --- a/src/component/Modals/CreateShare.js +++ b/src/component/Modals/CreateShare.js @@ -14,7 +14,7 @@ import { CircularProgress } from "@material-ui/core"; import { toggleSnackbar } from "../../actions/index"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch } from "react-redux"; import API from "../../middleware/Api"; import List from "@material-ui/core/List"; import ListItemText from "@material-ui/core/ListItemText"; @@ -23,7 +23,6 @@ import ListItemIcon from "@material-ui/core/ListItemIcon"; import LockIcon from "@material-ui/icons/Lock"; import TimerIcon from "@material-ui/icons/Timer"; import CasinoIcon from "@material-ui/icons/Casino"; -import AccountBalanceWalletIcon from "@material-ui/icons/AccountBalanceWallet"; import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction"; import Divider from "@material-ui/core/Divider"; import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; @@ -115,9 +114,6 @@ export default function CreatShare(props) { [dispatch] ); - const scoreEnabled = useSelector(state => state.siteConfig.score_enabled); - const scoreRate = useSelector(state => state.siteConfig.share_score_rate); - const [expanded, setExpanded] = React.useState(false); const [shareURL, setShareURL] = React.useState(""); const [values, setValues] = React.useState({ @@ -153,7 +149,7 @@ export default function CreatShare(props) { event.preventDefault(); }; - const randomPassword = event => { + const randomPassword = () => { setShareOption({ ...shareOption, password: true }); setValues({ ...values, @@ -169,7 +165,7 @@ export default function CreatShare(props) { setExpanded(isExpanded ? panel : false); }; - const handleCheck = prop => event => { + const handleCheck = prop => () => { if (!shareOption[prop]) { handleExpand(prop)(null, true); } diff --git a/src/component/Modals/Decompress.js b/src/component/Modals/Decompress.js index 8ba0a7a..e07002f 100644 --- a/src/component/Modals/Decompress.js +++ b/src/component/Modals/Decompress.js @@ -12,7 +12,6 @@ import { import { toggleSnackbar, setModalsLoading, - refreshFileList, } from "../../actions/index"; import PathSelector from "../FileManager/PathSelector"; import { useDispatch } from "react-redux"; @@ -72,7 +71,7 @@ export default function DecompressDialog(props) { src:filePath(props.selected[0]), dst: selectedPath === "//" ? "/" : selectedPath }) - .then(response => { + .then(() => { props.onClose(); ToggleSnackbar("top", "right", "解压缩任务已创建", "success"); SetModalsLoading(false); diff --git a/src/component/Modals/Loading.js b/src/component/Modals/Loading.js index f007f20..961ee8a 100644 --- a/src/component/Modals/Loading.js +++ b/src/component/Modals/Loading.js @@ -22,7 +22,7 @@ const useStyles = makeStyles({ } }); -export default function LoadingDialog(props) { +export default function LoadingDialog() { const classes = useStyles(); const open = useSelector( state => state.viewUpdate.modals.loading, diff --git a/src/component/Modals/SelectFile.js b/src/component/Modals/SelectFile.js index 82d8f65..32d95f4 100644 --- a/src/component/Modals/SelectFile.js +++ b/src/component/Modals/SelectFile.js @@ -53,7 +53,7 @@ export default function SelectFileDialog(props) { setFiles(filesCopy); }; - const submit = e =>{ + const submit = () =>{ let index = []; // eslint-disable-next-line files.map(v=>{ diff --git a/src/component/Navbar/DarkModeSwitcher.js b/src/component/Navbar/DarkModeSwitcher.js index 43e6764..e3edf0f 100644 --- a/src/component/Navbar/DarkModeSwitcher.js +++ b/src/component/Navbar/DarkModeSwitcher.js @@ -8,7 +8,7 @@ import Tooltip from "@material-ui/core/Tooltip"; import Auth from "../../middleware/Auth"; import classNames from "classnames"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ icon: { color: 'rgb(255, 255, 255)', opacity: "0.54", @@ -21,7 +21,7 @@ const DarkModeSwitcher = ({ position }) => { const ToggleThemeMode = useCallback(() => dispatch(toggleDaylightMode()), [ dispatch ]); - const toggleMode = e => { + const toggleMode = () => { Auth.SetPreference("theme_mode",isDayLight?"dark":"light"); ToggleThemeMode(); }; diff --git a/src/component/Navbar/FileTags.js b/src/component/Navbar/FileTags.js index ce94c7d..a901e08 100644 --- a/src/component/Navbar/FileTags.js +++ b/src/component/Navbar/FileTags.js @@ -22,7 +22,7 @@ import MuiExpansionPanel from "@material-ui/core/ExpansionPanel"; import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; import { navitateTo, searchMyFile, toggleSnackbar } from "../../actions"; -import { useDispatch, useSelector } from "react-redux"; +import { useDispatch } from "react-redux"; import Auth from "../../middleware/Auth"; import { Circle, @@ -134,7 +134,7 @@ const icons = { const AddTag = React.lazy(() => import ("../Modals/AddTag" )); -export default function FileTag(props) { +export default function FileTag() { const classes = useStyles(); let location = useLocation(); @@ -152,7 +152,6 @@ export default function FileTag(props) { dispatch ]); const NavigateTo = useCallback(k => dispatch(navitateTo(k)), [dispatch]); - const isLogin = useSelector(state => state.viewUpdate.isLogin); const ToggleSnackbar = useCallback( (vertical, horizontal, msg, color) => @@ -190,7 +189,7 @@ export default function FileTag(props) { const submitDelete = id =>{ API.delete("/tag/"+id) - .then(response => { + .then(() => { let newTags = tags.filter((v)=>{return v.id !== id}); setTags(newTags) let user = Auth.GetUser(); diff --git a/src/component/Navbar/Navbar.js b/src/component/Navbar/Navbar.js index 29c8505..b2de09e 100644 --- a/src/component/Navbar/Navbar.js +++ b/src/component/Navbar/Navbar.js @@ -4,7 +4,6 @@ import classNames from "classnames"; import { connect } from "react-redux"; import ShareIcon from "@material-ui/icons/Share"; import BackIcon from "@material-ui/icons/ArrowBack"; -import SdStorage from "@material-ui/icons/SdStorage"; import OpenIcon from "@material-ui/icons/OpenInNew"; import DownloadIcon from "@material-ui/icons/CloudDownload"; import OpenFolderIcon from "@material-ui/icons/FolderOpen"; @@ -276,25 +275,25 @@ class NavbarCompoment extends Component { this.UploaderRef = React.createRef(); } - componentWillMount() { - this.unlisten = this.props.history.listen((location, action) => { - this.setState(state => ({ mobileOpen: false })); + UNSAFE_componentWillMount() { + this.unlisten = this.props.history.listen(() => { + this.setState(() => ({ mobileOpen: false })); }); } componentWillUnmount() { this.unlisten(); } - componentDidMount = () => { + componentDidMount() { changeThemeColor( this.props.selected.length <= 1 && !(!this.props.isMultiple && this.props.withFile) ? this.props.theme.palette.primary.main : this.props.theme.palette.background.default ); - }; + } - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { if ( (this.props.selected.length <= 1 && !(!this.props.isMultiple && this.props.withFile)) !== @@ -960,7 +959,7 @@ class NavbarCompoment extends Component { open={this.state.mobileOpen} onClose={this.handleDrawerToggle} onOpen={() => - this.setState(state => ({ mobileOpen: true })) + this.setState(() => ({ mobileOpen: true })) } disableDiscovery={iOS} ModalProps={{ diff --git a/src/component/Navbar/SearchBar.js b/src/component/Navbar/SearchBar.js index f2c7131..c201b59 100644 --- a/src/component/Navbar/SearchBar.js +++ b/src/component/Navbar/SearchBar.js @@ -26,7 +26,7 @@ configure({ ignoreTags:[], }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; diff --git a/src/component/Navbar/SideDrawer.js b/src/component/Navbar/SideDrawer.js index e006094..c232d82 100644 --- a/src/component/Navbar/SideDrawer.js +++ b/src/component/Navbar/SideDrawer.js @@ -8,7 +8,8 @@ import { ListItem, ListItemIcon, ListItemText, - List + List, + Hidden, } from "@material-ui/core"; const drawerWidth = 240; const styles = theme => ({ @@ -64,12 +65,9 @@ class SideDrawer extends Component { classes={{ paper: classes.drawerPaper }} - anchor={theme.direction === "rtl" ? "right" : "left"} + anchor="left" open={this.state.mobileOpen} onClose={this.handleDrawerToggle} - classes={{ - paper: classes.drawerPaper - }} ModalProps={{ keepMounted: true // Better open performance on mobile. }} diff --git a/src/component/Navbar/StorageBar.js b/src/component/Navbar/StorageBar.js index c5f488d..1ce2198 100644 --- a/src/component/Navbar/StorageBar.js +++ b/src/component/Navbar/StorageBar.js @@ -14,7 +14,6 @@ import { Tooltip } from "@material-ui/core"; import ButtonBase from "@material-ui/core/ButtonBase"; -import Link from "@material-ui/core/Link"; import { withRouter } from "react-router"; const mapStateToProps = state => { @@ -90,7 +89,7 @@ class StorageBarCompoment extends Component { this.firstLoad = false; } - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { if ( (this.props.isLogin && this.props.refresh !== nextProps.refresh) || (this.props.isLogin !== nextProps.isLogin && nextProps.isLogin) @@ -120,7 +119,7 @@ class StorageBarCompoment extends Component { total: sizeToString(response.data.total) }); }) - .catch(error => {}); + .catch(() => {}); }; render() { diff --git a/src/component/Navbar/UserAvatarPopover.js b/src/component/Navbar/UserAvatarPopover.js index 95a911c..c8437c4 100644 --- a/src/component/Navbar/UserAvatarPopover.js +++ b/src/component/Navbar/UserAvatarPopover.js @@ -10,7 +10,6 @@ import { } from "mdi-material-ui"; import {setSessionStatus, setUserPopover, toggleSnackbar} from "../../actions"; import { withRouter } from "react-router-dom"; -import pathHelper from "../../utils/page"; import Auth from "../../middleware/Auth"; import { withStyles, @@ -43,7 +42,7 @@ const mapDispatchToProps = dispatch => { }, }; }; -const styles = theme => ({ +const styles = () => ({ avatar: { width: "30px", height: "30px" @@ -77,9 +76,9 @@ class UserAvatarPopoverCompoment extends Component { window.location.href = url; }; - sigOut = e => { + sigOut = () => { API.delete("/user/session/") - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", diff --git a/src/component/Placeholder/ErrorBoundary.js b/src/component/Placeholder/ErrorBoundary.js index 31f4895..b7b9cb1 100644 --- a/src/component/Placeholder/ErrorBoundary.js +++ b/src/component/Placeholder/ErrorBoundary.js @@ -6,12 +6,12 @@ class ErrorBoundary extends React.Component { this.state = { hasError: false }; } - static getDerivedStateFromError(error) { + static getDerivedStateFromError() { // 更新 state 使下一次渲染能够显示降级后的 UI return { hasError: true }; } - componentDidCatch(error, errorInfo) { + componentDidCatch() { // 你同样可以将错误日志上报给服务器 } diff --git a/src/component/Setting/Authn.js b/src/component/Setting/Authn.js index d7c5761..7ddf8fb 100644 --- a/src/component/Setting/Authn.js +++ b/src/component/Setting/Authn.js @@ -59,7 +59,7 @@ export default function Authn(props) { API.patch("/user/setting/authn", { id:id, }) - .then(response => { + .then(() => { ToggleSnackbar( "top", "right", @@ -187,7 +187,7 @@ export default function Authn(props) { - {props.list.map((v, i) => ( + {props.list.map((v) => ( <> ({ overflowX:"auto", } }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; diff --git a/src/component/Setting/Tasks.js b/src/component/Setting/Tasks.js index d4eec57..4d36114 100644 --- a/src/component/Setting/Tasks.js +++ b/src/component/Setting/Tasks.js @@ -47,7 +47,7 @@ const useStyles = makeStyles(theme => ({ } })); -export default function Tasks(props) { +export default function Tasks() { const [tasks, setTasks] = useState([]); const [total, setTotal] = useState(0); const [page, setPage] = useState(1); diff --git a/src/component/Setting/UserSetting.js b/src/component/Setting/UserSetting.js index 4a6b250..8d302f4 100644 --- a/src/component/Setting/UserSetting.js +++ b/src/component/Setting/UserSetting.js @@ -6,7 +6,6 @@ import DateIcon from "@material-ui/icons/DateRange"; import EmailIcon from "@material-ui/icons/Email"; import HomeIcon from "@material-ui/icons/Home"; import LinkIcon from "@material-ui/icons/Phonelink"; -import AlarmOff from "@material-ui/icons/AlarmOff"; import InputIcon from "@material-ui/icons/Input"; import SecurityIcon from "@material-ui/icons/Security"; import NickIcon from "@material-ui/icons/PermContactCalendar"; @@ -39,15 +38,12 @@ import { DialogTitle, Switch } from "@material-ui/core"; -import Backup from "@material-ui/icons/Backup"; -import SettingsInputHdmi from "@material-ui/icons/SettingsInputHdmi"; import { blue, green, yellow } from "@material-ui/core/colors"; import API from "../../middleware/Api"; import Auth from "../../middleware/Auth"; import { withRouter } from "react-router"; -import TimeAgo from "timeago-react"; import QRCode from "qrcode-react"; -import {Brightness3, Check, ConfirmationNumber, ListAlt, PermContactCalendar} from "@material-ui/icons"; +import {Brightness3, ListAlt, PermContactCalendar} from "@material-ui/icons"; import { transformTime } from "../../utils"; import Authn from "./Authn"; @@ -271,7 +267,7 @@ class UserSettingCompoment extends Component { loading: "gravatar" }); API.put("/user/setting/avatar") - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -302,7 +298,7 @@ class UserSettingCompoment extends Component { API.patch("/user/setting/nick", { nick: this.state.nick }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -338,7 +334,7 @@ class UserSettingCompoment extends Component { "Content-Type": "multipart/form-data" } }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -366,7 +362,7 @@ class UserSettingCompoment extends Component { API.patch("/user/setting/homepage", { status: !this.state.settings.homepage }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -407,7 +403,7 @@ class UserSettingCompoment extends Component { old: this.state.oldPwd, new: this.state.newPwd }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -440,7 +436,7 @@ class UserSettingCompoment extends Component { .patch("/user/setting/theme", { theme: this.state.chosenTheme }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", @@ -539,7 +535,7 @@ class UserSettingCompoment extends Component { API.patch("/user/setting/2fa", { code: this.state.authCode }) - .then(response => { + .then(() => { this.props.toggleSnackbar( "top", "right", diff --git a/src/component/Setting/WebDAV.js b/src/component/Setting/WebDAV.js index 93943b1..477eedb 100644 --- a/src/component/Setting/WebDAV.js +++ b/src/component/Setting/WebDAV.js @@ -47,7 +47,7 @@ const useStyles = makeStyles(theme => ({ } })); -export default function WebDAV(props) { +export default function WebDAV() { const [tab, setTab] = useState(0); const [create, setCreate] = useState(false); const [accounts, setAccounts] = useState([]); @@ -77,7 +77,7 @@ export default function WebDAV(props) { const deleteAccount = id => { let account = accounts[id]; API.delete("/webdav/accounts/" + account.ID) - .then(response => { + .then(() => { let accountCopy = [...accounts]; accountCopy = accountCopy.filter((v, i) => { return i !== id; diff --git a/src/component/Share/LockedFile.js b/src/component/Share/LockedFile.js index 69990e9..ed65542 100644 --- a/src/component/Share/LockedFile.js +++ b/src/component/Share/LockedFile.js @@ -40,7 +40,7 @@ const styles = theme => ({ marginRottom: "10px" } }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; diff --git a/src/component/Share/MyShare.js b/src/component/Share/MyShare.js index 3d7096b..60bf634 100644 --- a/src/component/Share/MyShare.js +++ b/src/component/Share/MyShare.js @@ -84,7 +84,7 @@ const styles = theme => ({ marginTop: 5, } }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; @@ -120,7 +120,7 @@ class MyShareCompoment extends Component { removeShare = (id) => { API .delete("/share/"+id) - .then(response => { + .then(() => { let oldList = this.state.shareList; oldList = oldList.filter(value => { return value.key !== id; @@ -208,7 +208,7 @@ class MyShareCompoment extends Component { shareList: response.data.items }); }) - .catch(error => { + .catch(() => { this.props.toggleSnackbar("top", "right", "加载失败", "error"); }); }; diff --git a/src/component/Share/SearchResult.js b/src/component/Share/SearchResult.js index ddb9a6f..783dd80 100644 --- a/src/component/Share/SearchResult.js +++ b/src/component/Share/SearchResult.js @@ -77,7 +77,7 @@ function useQuery() { return new URLSearchParams(useLocation().search); } -export default function SearchResult(props) { +export default function SearchResult() { const classes = useStyles(); const dispatch = useDispatch(); @@ -91,21 +91,12 @@ export default function SearchResult(props) { [dispatch] ); - useEffect(() => { - let keywords = query.get("keywords"); - if (keywords) { - search(keywords, page, orderBy); - } else { - ToggleSnackbar("top", "right", "请输入搜索关键词", "warning"); - } - }, [location]); - const [page, setPage] = useState(1); const [total, setTotal] = useState(0); const [shareList, setShareList] = useState([]); const [orderBy, setOrderBy] = useState("created_at DESC"); - const search = (keywords, page, orderBy) => { + const search = useCallback((keywords, page, orderBy) => { let order = orderBy.split(" "); API.get( "/share/search?page=" + @@ -129,10 +120,19 @@ export default function SearchResult(props) { setTotal(response.data.total); setShareList(response.data.items); }) - .catch(error => { + .catch(() => { ToggleSnackbar("top", "right", "加载失败", "error"); }); - }; + }, []); + + useEffect(() => { + let keywords = query.get("keywords"); + if (keywords) { + search(keywords, page, orderBy); + } else { + ToggleSnackbar("top", "right", "请输入搜索关键词", "warning"); + } + }, [location]); const handlePageChange = (event, value) => { setPage(value); diff --git a/src/component/Share/SharePreload.js b/src/component/Share/SharePreload.js index 69b97bd..78b9db1 100644 --- a/src/component/Share/SharePreload.js +++ b/src/component/Share/SharePreload.js @@ -40,7 +40,6 @@ export default function SharePreload() { } else { SetSubTitle(); } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [share,SetSubTitle,ToggleSnackbar]); useEffect(() => { diff --git a/src/component/Share/SharedFile.js b/src/component/Share/SharedFile.js index 31adcf9..fe32d4d 100644 --- a/src/component/Share/SharedFile.js +++ b/src/component/Share/SharedFile.js @@ -94,7 +94,7 @@ const styles = theme => ({ marginLeft: 8 } }); -const mapStateToProps = state => { +const mapStateToProps = () => { return {}; }; @@ -209,7 +209,7 @@ class SharedFileCompoment extends Component { callback(event); }; - download = e => { + download = () => { this.setState({ loading: true }); API.put("/share/download/" + this.props.share.key) .then(response => { @@ -231,9 +231,6 @@ class SharedFileCompoment extends Component { render() { const { classes } = this.props; - const user = Auth.GetUser(); - const isLogin = Auth.Check(); - return (
diff --git a/src/component/Share/SharedFolder.js b/src/component/Share/SharedFolder.js index edfbfa3..641f795 100644 --- a/src/component/Share/SharedFolder.js +++ b/src/component/Share/SharedFolder.js @@ -9,7 +9,6 @@ import { toggleSnackbar } from "../../actions"; import { withStyles, Typography } from "@material-ui/core"; -import Auth from "../../middleware/Auth"; import { withRouter } from "react-router-dom"; import FileManager from "../FileManager/FileManager"; import Paper from "@material-ui/core/Paper"; @@ -75,7 +74,7 @@ const mapDispatchToProps = dispatch => { class SharedFolderComponent extends Component { state = {}; - componentWillMount() { + UNSAFE_componentWillMount() { window.shareInfo = this.props.share; } diff --git a/src/component/Upload/FileList.js b/src/component/Upload/FileList.js index b48266f..78d89d0 100644 --- a/src/component/Upload/FileList.js +++ b/src/component/Upload/FileList.js @@ -15,9 +15,7 @@ import { Toolbar, IconButton, Typography, - LinearProgress, Slide, - Avatar, ListItemSecondaryAction, withWidth, DialogContent diff --git a/src/component/Upload/UploadIcon.js b/src/component/Upload/UploadIcon.js index 651ae52..69683e3 100644 --- a/src/component/Upload/UploadIcon.js +++ b/src/component/Upload/UploadIcon.js @@ -1 +1 @@ -import React from 'react' \ No newline at end of file +// import React from 'react' \ No newline at end of file diff --git a/src/component/Upload/Uploader.js b/src/component/Upload/Uploader.js index fcc2e83..698c0ca 100644 --- a/src/component/Upload/Uploader.js +++ b/src/component/Upload/Uploader.js @@ -98,7 +98,7 @@ class UploaderComponent extends Component { } }; - componentWillReceiveProps({ isScriptLoaded, isScriptLoadSucceed }) { + UNSAFE_componentWillReceiveProps({ isScriptLoaded, isScriptLoadSucceed }) { if (isScriptLoaded && !this.props.isScriptLoaded) { // load finished if (isScriptLoadSucceed) { @@ -133,7 +133,7 @@ class UploaderComponent extends Component { init: { FilesAdded: this.fileAdd, - BeforeUpload: function(up, file) {}, + BeforeUpload: function() {}, QueueChanged: up => { this.setState({ queued: up.total.queued }); }, @@ -167,12 +167,12 @@ class UploaderComponent extends Component { this.props.refreshFileList(); this.props.refreshStorage(); }, - FileUploaded: function(up, file, info) {}, + FileUploaded: function() {}, Error: (up, err, errTip) => { window.fileList["openFileList"](); window.fileList["setError"](err.file, errTip); }, - FilesRemoved: (up, files) => {} + FilesRemoved: () => {} } }); // this.fileList["openFileList"](); diff --git a/src/component/Viewer/Code.js b/src/component/Viewer/Code.js index 5a2d21e..4575fda 100644 --- a/src/component/Viewer/Code.js +++ b/src/component/Viewer/Code.js @@ -2,7 +2,7 @@ import React, { Suspense, useCallback, useEffect, useState } from "react"; import { Paper, useTheme } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; import { useLocation, useParams, useRouteMatch } from "react-router"; -import API, { getBaseURL } from "../../middleware/Api"; +import API from "../../middleware/Api"; import { useDispatch } from "react-redux"; import { changeSubTitle, toggleSnackbar } from "../../actions"; import pathHelper from "../../utils/page"; @@ -10,7 +10,6 @@ import SaveButton from "../Dial/Save"; import { codePreviewSuffix } from "../../config"; import TextLoading from "../Placeholder/TextLoading"; import FormControl from "@material-ui/core/FormControl"; -import InputLabel from "@material-ui/core/InputLabel"; import Select from "@material-ui/core/Select"; import MenuItem from "@material-ui/core/MenuItem"; import Divider from "@material-ui/core/Divider"; @@ -51,7 +50,7 @@ function useQuery() { return new URLSearchParams(useLocation().search); } -export default function CodeViewer(props) { +export default function CodeViewer() { const [content, setContent] = useState(""); const [status, setStatus] = useState(""); const [loading, setLoading] = useState(true); @@ -121,7 +120,7 @@ export default function CodeViewer(props) { const save = () => { setStatus("loading"); API.put("/file/update/" + query.get("id"), content) - .then(response => { + .then(() => { setStatus("success"); setTimeout(() => setStatus(""), 2000); }) @@ -148,8 +147,8 @@ export default function CodeViewer(props) { new Set(Object.keys(codePreviewSuffix).map(k=>{ return codePreviewSuffix[k] })) - ).map(extension => ( - + ).map((extension, index) => ( + {extension} ))} diff --git a/src/component/Viewer/Doc.js b/src/component/Viewer/Doc.js index 6c244c5..3f381a4 100644 --- a/src/component/Viewer/Doc.js +++ b/src/component/Viewer/Doc.js @@ -6,7 +6,7 @@ import {useDispatch} from "react-redux"; import {changeSubTitle, toggleSnackbar} from "../../actions"; import pathHelper from "../../utils/page"; -const useStyles = makeStyles(theme => ({ +const useStyles = makeStyles(() => ({ layout: { width: "auto", marginTop: "-48px", @@ -25,7 +25,7 @@ function useQuery() { return new URLSearchParams(useLocation().search); } -export default function DocViewer(props) { +export default function DocViewer() { let [url,setURL] = useState(""); const math = useRouteMatch(); let location = useLocation(); diff --git a/src/component/Viewer/PDF.js b/src/component/Viewer/PDF.js index 379c50b..5bd280a 100644 --- a/src/component/Viewer/PDF.js +++ b/src/component/Viewer/PDF.js @@ -1,6 +1,6 @@ import React, { useCallback, useEffect, useState } from "react"; import { Document, Page, pdfjs } from "react-pdf"; -import { Paper, useTheme } from "@material-ui/core"; +import { Paper } from "@material-ui/core"; import { makeStyles } from "@material-ui/core/styles"; import { useLocation, useParams, useRouteMatch } from "react-router"; import { getBaseURL } from "../../middleware/Api"; @@ -38,7 +38,7 @@ function useQuery() { return new URLSearchParams(useLocation().search); } -export default function PDFViewer(props) { +export default function PDFViewer() { const math = useRouteMatch(); let location = useLocation(); let query = useQuery(); diff --git a/src/component/Viewer/Text.js b/src/component/Viewer/Text.js index a50385a..b8745fe 100644 --- a/src/component/Viewer/Text.js +++ b/src/component/Viewer/Text.js @@ -41,7 +41,7 @@ function useQuery() { } -export default function TextViewer(props) { +export default function TextViewer() { const [content, setContent] = useState(""); const [status, setStatus] = useState(""); const [loading, setLoading] = useState(true); @@ -110,7 +110,7 @@ export default function TextViewer(props) { const save = ()=>{ setStatus("loading"); API.put("/file/update/" + query.get("id"),content) - .then(response => { + .then(() => { setStatus("success"); setTimeout(()=>setStatus(""),2000); }) diff --git a/src/component/Viewer/Video.js b/src/component/Viewer/Video.js index 4a90f04..e27816d 100644 --- a/src/component/Viewer/Video.js +++ b/src/component/Viewer/Video.js @@ -31,7 +31,7 @@ function useQuery() { return new URLSearchParams(useLocation().search); } -export default function VideoViewer(props) { +export default function VideoViewer() { const math = useRouteMatch(); let location = useLocation(); let query = useQuery(); diff --git a/src/index.js b/src/index.js index c352554..22c8163 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,6 @@ import App from "./App"; import cloureveApp from "./reducers"; import { UpdateSiteConfig } from "./middleware/Init"; import ErrorBoundary from "./component/Placeholder/ErrorBoundary"; -import PageLoading from "./component/Placeholder/PageLoading"; const Admin = React.lazy(() => import("./Admin")); serviceWorker.register(); diff --git a/src/loader/index.js b/src/loader/index.js index 112d754..4492dff 100644 --- a/src/loader/index.js +++ b/src/loader/index.js @@ -115,9 +115,9 @@ const uploaderLoader = () => WrappedComponent => { this._isMounted = false; } - getWrappedInstance() { - return this.refs.wrappedInstance; - } + // getWrappedInstance() { + // return this.refs.wrappedInstance; + // } render() { const props = { diff --git a/src/loader/utils.js b/src/loader/utils.js index 6ad07be..8e92890 100644 --- a/src/loader/utils.js +++ b/src/loader/utils.js @@ -1,6 +1,6 @@ export const isDefined = val => val != null export const isFunction = val => typeof val === 'function' -export const noop = _ => { } +export const noop = () => { } export const newScript = (src) => (cb) => { const scriptElem = document.createElement('script') diff --git a/src/reducers/explorer.js b/src/reducers/explorer.js index a6f04ff..a9d0b31 100644 --- a/src/reducers/explorer.js +++ b/src/reducers/explorer.js @@ -1,7 +1,7 @@ const checkSelectedProps = (state)=>{ let isMultiple,withFolder,withFile=false; isMultiple = (state.selected.length>1); - state.selected.map((value)=>{ + state.selected.forEach((value) => { if(value.type==="dir"){ withFolder = true; }else if(value.type==="file"){ @@ -34,29 +34,29 @@ const explorer = (state = [], action) => { } }); case 'SET_SELECTED_TARGET': - var newState = Object.assign({}, state, { + var newSelectedState = Object.assign({}, state, { selected: action.targets }); - var selectedProps = checkSelectedProps(newState); - return Object.assign({}, newState, { + var newSelectedProps = checkSelectedProps(newSelectedState); + return Object.assign({}, newSelectedState, { selectProps: { - isMultiple:selectedProps[0], - withFolder:selectedProps[1], - withFile:selectedProps[2], + isMultiple:newSelectedProps[0], + withFolder:newSelectedProps[1], + withFile:newSelectedProps[2], } }); case 'RMOVE_SELECTED_TARGET': var oldSelected = state.selected.concat(); oldSelected.splice(action.id,1); - var newState = Object.assign({}, state, { + var removedSelectedState = Object.assign({}, state, { selected: oldSelected, }); - var selectedProps = checkSelectedProps(newState); - return Object.assign({}, newState, { + var removedSelectedProps = checkSelectedProps(removedSelectedState); + return Object.assign({}, removedSelectedState, { selectProps: { - isMultiple:selectedProps[0], - withFolder:selectedProps[1], - withFile:selectedProps[2], + isMultiple:removedSelectedProps[0], + withFolder:removedSelectedProps[1], + withFile:removedSelectedProps[2], } }); default: diff --git a/src/reducers/index.js b/src/reducers/index.js index c3b1eb5..28ff986 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -1,3 +1,4 @@ +/* eslint-disable no-case-declarations */ import { InitSiteConfig } from "../middleware/Init"; const checkSelectedProps = (state)=>{ diff --git a/yarn.lock b/yarn.lock index 8ba9552..8640e75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -839,6 +839,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript" "^7.6.0" +"@babel/runtime-corejs3@^7.8.3": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.9.6.tgz#67aded13fffbbc2cb93247388cf84d77a4be9a71" + integrity sha512-6toWAfaALQjt3KMZQc6fABqZwUDDuWzz+cAfPhqyEnzxvdWOAkjwPNxgF8xlmo7OWLsSjaKjsskpKHRLaMArOA== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.4" + "@babel/runtime@7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.0.tgz#4fc1d642a9fd0299754e8b5de62c631cf5568205" @@ -860,6 +868,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.9.2": + version "7.9.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f" + integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" @@ -1338,6 +1353,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + "@types/dplayer@^1.25.0": version "1.25.0" resolved "https://registry.yarnpkg.com/@types/dplayer/-/dplayer-1.25.0.tgz#54b4ea84c1aa05cca4803088b74c2c3e273cac6b" @@ -1386,6 +1406,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + "@types/prop-types@*": version "15.7.3" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" @@ -1663,10 +1688,10 @@ acorn-globals@^4.1.0, acorn-globals@^4.3.0: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" - integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== +acorn-jsx@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" + integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== acorn-walk@^6.0.1: version "6.2.0" @@ -1683,10 +1708,10 @@ acorn@^6.0.1, acorn@^6.0.4, acorn@^6.2.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== -acorn@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" - integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== +acorn@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" + integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== address@1.1.2, address@^1.0.1: version "1.1.2" @@ -1766,6 +1791,11 @@ ansi-regex@^4.0.0, ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1778,6 +1808,14 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" + integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -1857,6 +1895,15 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" +array-includes@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" + integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + is-string "^1.0.5" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -2577,6 +2624,22 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" + integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -2655,6 +2718,13 @@ cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" @@ -2742,12 +2812,19 @@ color-convert@^1.9.0, color-convert@^1.9.1: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-name@^1.0.0: +color-name@^1.0.0, color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== @@ -2800,6 +2877,11 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= +compare-versions@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" + integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== + component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -2961,6 +3043,11 @@ core-js-compat@^3.1.1: browserslist "^4.6.6" semver "^6.3.0" +core-js-pure@^3.0.0: + version "3.6.5" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" + integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== + core-js@3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.2.1.tgz#cd41f38534da6cc59f7db050fe67307de9868b09" @@ -2996,6 +3083,17 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: js-yaml "^3.13.1" parse-json "^4.0.0" +cosmiconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" + integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.7.2" + create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -3787,6 +3885,11 @@ emoji-regex@^7.0.1, emoji-regex@^7.0.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -3858,7 +3961,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: +es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.15.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.15.0.tgz#8884928ec7e40a79e3c9bc812d37d10c8b24cc57" integrity sha512-bhkEqWJ2t2lMeaJDuk7okMkJWI/yqgH/EoGwpcvv0XW9RWQsRspI4wt6xuyuvMvvQE3gg/D9HXppgk21w78GyQ== @@ -3874,6 +3977,23 @@ es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0 string.prototype.trimleft "^2.1.0" string.prototype.trimright "^2.1.0" +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: + version "1.17.5" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" + integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -3883,6 +4003,15 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@^0.10.51: version "0.10.51" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.51.tgz#ed2d7d9d48a12df86e0299287e93a09ff478842f" @@ -4004,25 +4133,28 @@ eslint-plugin-jsx-a11y@6.2.3: has "^1.0.3" jsx-ast-utils "^2.2.1" -eslint-plugin-react-hooks@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" - integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA== +eslint-plugin-react-hooks@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.0.0.tgz#81196b990043cde339e25c6662aeebe32ac52d01" + integrity sha512-YKBY+kilK5wrwIdQnCF395Ya6nDro3EAMoe+2xFkmyklyhF16fH83TrQOo9zbZIDxBsXFgBbywta/0JKRNFDkw== -eslint-plugin-react@7.14.3: - version "7.14.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.3.tgz#911030dd7e98ba49e1b2208599571846a66bdf13" - integrity sha512-EzdyyBWC4Uz2hPYBiEJrKCUi2Fn+BJ9B/pJQcjw5X+x/H2Nm59S4MJIvL4O5NEE0+WbnQwEBxWY03oUk+Bc3FA== +eslint-plugin-react@^7.19.0: + version "7.19.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666" + integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ== dependencies: - array-includes "^3.0.3" + array-includes "^3.1.1" doctrine "^2.1.0" has "^1.0.3" - jsx-ast-utils "^2.1.0" - object.entries "^1.1.0" - object.fromentries "^2.0.0" - object.values "^1.1.0" + jsx-ast-utils "^2.2.3" + object.entries "^1.1.1" + object.fromentries "^2.0.2" + object.values "^1.1.1" prop-types "^15.7.2" - resolve "^1.10.1" + resolve "^1.15.1" + semver "^6.3.0" + string.prototype.matchall "^4.0.2" + xregexp "^4.3.0" eslint-scope@^4.0.3: version "4.0.3" @@ -4047,15 +4179,22 @@ eslint-utils@^1.4.2: dependencies: eslint-visitor-keys "^1.0.0" +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^6.1.0: - version "6.5.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.5.1.tgz#828e4c469697d43bb586144be152198b91e96ed6" - integrity sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A== +eslint@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -4064,19 +4203,19 @@ eslint@^6.1.0: debug "^4.0.1" doctrine "^3.0.0" eslint-scope "^5.0.0" - eslint-utils "^1.4.2" + eslint-utils "^1.4.3" eslint-visitor-keys "^1.1.0" - espree "^6.1.1" + espree "^6.1.2" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" - globals "^11.7.0" + globals "^12.1.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.4.1" + inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" @@ -4085,7 +4224,7 @@ eslint@^6.1.0: minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.2" + optionator "^0.8.3" progress "^2.0.0" regexpp "^2.0.1" semver "^6.1.2" @@ -4095,13 +4234,13 @@ eslint@^6.1.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" - integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== +espree@^6.1.2: + version "6.2.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" + integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw== dependencies: - acorn "^7.0.0" - acorn-jsx "^5.0.2" + acorn "^7.1.1" + acorn-jsx "^5.2.0" eslint-visitor-keys "^1.1.0" esprima@^3.1.3: @@ -4327,7 +4466,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= -fast-levenshtein@~2.0.4: +fast-levenshtein@~2.0.4, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= @@ -4378,6 +4517,13 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +figures@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -4468,6 +4614,21 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-versions@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" + integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== + dependencies: + semver-regex "^2.0.0" + flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -4755,11 +4916,18 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -globals@^11.1.0, globals@^11.7.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^12.1.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" + integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== + dependencies: + type-fest "^0.8.1" + globby@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -4876,11 +5044,21 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -5149,6 +5327,22 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= +husky@^4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.5.tgz#2b4f7622673a71579f901d9885ed448394b5fa36" + integrity sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ== + dependencies: + chalk "^4.0.0" + ci-info "^2.0.0" + compare-versions "^3.6.0" + cosmiconfig "^6.0.0" + find-versions "^3.2.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^4.2.0" + please-upgrade-node "^3.2.0" + slash "^3.0.0" + which-pm-runs "^1.0.0" + hyphenate-style-name@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" @@ -5235,6 +5429,14 @@ import-fresh@^3.0.0: parent-module "^1.0.0" resolve-from "^4.0.0" +import-fresh@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" + integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -5320,7 +5522,7 @@ inquirer@6.5.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^6.0.0, inquirer@^6.4.1: +inquirer@^6.0.0: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -5339,6 +5541,25 @@ inquirer@^6.0.0, inquirer@^6.4.1: strip-ansi "^5.1.0" through "^2.3.6" +inquirer@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29" + integrity sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg== + dependencies: + ansi-escapes "^4.2.1" + chalk "^3.0.0" + cli-cursor "^3.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.15" + mute-stream "0.0.8" + run-async "^2.4.0" + rxjs "^6.5.3" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + internal-ip@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" @@ -5347,6 +5568,15 @@ internal-ip@^4.2.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" +internal-slot@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" + integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== + dependencies: + es-abstract "^1.17.0-next.1" + has "^1.0.3" + side-channel "^1.0.2" + interpret@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -5440,6 +5670,11 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -5530,6 +5765,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-generator-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" @@ -5614,6 +5854,13 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" @@ -5634,6 +5881,11 @@ is-stream@^1.0.1, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -6367,7 +6619,7 @@ jss@^10.0.3: is-in-browser "^1.1.3" tiny-warning "^1.0.2" -jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: +jsx-ast-utils@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb" integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ== @@ -6375,6 +6627,14 @@ jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: array-includes "^3.0.3" object.assign "^4.1.0" +jsx-ast-utils@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f" + integrity sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA== + dependencies: + array-includes "^3.0.3" + object.assign "^4.1.0" + killable@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -6459,6 +6719,11 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" @@ -6526,6 +6791,13 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + lodash-es@^4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78" @@ -6839,7 +7111,7 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.0.0: +mimic-fn@^2.0.0, mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== @@ -7014,6 +7286,11 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + nan@^2.12.1: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" @@ -7304,6 +7581,11 @@ object-inspect@^1.6.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + object-is@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" @@ -7346,15 +7628,25 @@ object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.3" -object.fromentries@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" - integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== +object.entries@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" + integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== dependencies: - define-properties "^1.1.2" - es-abstract "^1.11.0" + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" function-bind "^1.1.1" - has "^1.0.1" + has "^1.0.3" + +object.fromentries@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" + integrity sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" object.getownpropertydescriptors@^2.0.3: version "2.0.3" @@ -7381,6 +7673,16 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" + integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -7419,6 +7721,13 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + open@^6.3.0: version "6.4.0" resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" @@ -7426,6 +7735,11 @@ open@^6.3.0: dependencies: is-wsl "^1.1.0" +opencollective-postinstall@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" + integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== + opn@^5.1.0: version "5.5.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" @@ -7449,7 +7763,7 @@ optimize-css-assets-webpack-plugin@5.0.3: cssnano "^4.1.10" last-call-webpack-plugin "^3.0.0" -optionator@^0.8.1, optionator@^0.8.2: +optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= @@ -7461,6 +7775,18 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" +optionator@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + original@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" @@ -7536,7 +7862,7 @@ p-limit@^2.0.0: dependencies: p-try "^2.0.0" -p-limit@^2.2.1: +p-limit@^2.2.0, p-limit@^2.2.1: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -7557,6 +7883,13 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" @@ -7632,6 +7965,16 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" + parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" @@ -7674,6 +8017,11 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -7720,6 +8068,11 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" @@ -7804,6 +8157,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + pkg-up@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" @@ -7811,6 +8171,13 @@ pkg-up@2.0.0: dependencies: find-up "^2.1.0" +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -9199,6 +9566,11 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + regenerator-transform@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" @@ -9226,6 +9598,14 @@ regexp.prototype.flags@^1.2.0: dependencies: define-properties "^1.1.2" +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -9401,13 +9781,20 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.12.0, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1: +resolve@1.12.0, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== dependencies: path-parse "^1.0.6" +resolve@^1.15.1: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -9416,6 +9803,14 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -9478,6 +9873,11 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -9492,6 +9892,13 @@ rxjs@^6.4.0: dependencies: tslib "^1.9.0" +rxjs@^6.5.3: + version "6.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" + integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -9597,6 +10004,16 @@ selfsigned@^1.9.1: dependencies: node-forge "0.9.0" +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + +semver-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" + integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -9741,6 +10158,14 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== +side-channel@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" + integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== + dependencies: + es-abstract "^1.17.0-next.1" + object-inspect "^1.7.0" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -10080,6 +10505,35 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +string.prototype.matchall@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz#48bb510326fb9fdeb6a33ceaa81a6ea04ef7648e" + integrity sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + has-symbols "^1.0.1" + internal-slot "^1.0.2" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.2" + +string.prototype.trimend@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" + integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trimleft@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" @@ -10088,6 +10542,15 @@ string.prototype.trimleft@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" +string.prototype.trimleft@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz#4408aa2e5d6ddd0c9a80739b087fbc067c03b3cc" + integrity sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trimstart "^1.0.0" + string.prototype.trimright@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" @@ -10096,6 +10559,23 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" +string.prototype.trimright@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz#c76f1cef30f21bbad8afeb8db1511496cfb0f2a3" + integrity sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string.prototype.trimend "^1.0.0" + +string.prototype.trimstart@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" + integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.5" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -10140,6 +10620,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -10204,6 +10691,13 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" + integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + dependencies: + has-flag "^4.0.0" + svg-parser@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.2.tgz#d134cc396fa2681dc64f518330784e98bd801ec8" @@ -10495,6 +10989,11 @@ type-fest@^0.5.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -10967,6 +11466,11 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= + which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -10981,6 +11485,11 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" @@ -11215,6 +11724,13 @@ xregexp@4.0.0: resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== +xregexp@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.3.0.tgz#7e92e73d9174a99a59743f67a4ce879a04b5ae50" + integrity sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g== + dependencies: + "@babel/runtime-corejs3" "^7.8.3" + xtend@^4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -11235,6 +11751,13 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yaml@^1.7.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.9.2.tgz#f0cfa865f003ab707663e4f04b3956957ea564ed" + integrity sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg== + dependencies: + "@babel/runtime" "^7.9.2" + yargs-parser@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8"