Skip to content

Commit

Permalink
清理无用文件
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Mar 11, 2020
1 parent cef4dbd commit 220a080
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 1,847 deletions.
11 changes: 0 additions & 11 deletions src/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Dashboard from "./component/Admin/Dashboard";
import {useHistory} from "react-router";
import Auth from "./middleware/Auth";
import {Route, Switch} from "react-router-dom";
import PageLoading from "./component/Placeholder/PageLoading";
import {ThemeProvider} from "@material-ui/styles";
import createMuiTheme from "@material-ui/core/styles/createMuiTheme";
import { zhCN } from '@material-ui/core/locale';
Expand All @@ -15,7 +14,6 @@ import SiteInformation from "./component/Admin/Setting/SiteInformation"
import Access from "./component/Admin/Setting/Access"
import Mail from "./component/Admin/Setting/Mail"
import UploadDownload from "./component/Admin/Setting/UploadDownload"
import VAS from "./component/Admin/Setting/VAS"
import Theme from "./component/Admin/Setting/Theme"
import Aria2 from "./component/Admin/Setting/Aria2"
import ImageSetting from "./component/Admin/Setting/Image"
Expand All @@ -30,7 +28,6 @@ import UserForm from "./component/Admin/User/UserForm"
import EditUserPreload from "./component/Admin/User/EditUser"
import File from "./component/Admin/File/File"
import Share from "./component/Admin/Share/Share"
import Order from "./component/Admin/Order/Order"
import Download from "./component/Admin/Task/Download"
import Task from "./component/Admin/Task/Task"

Expand Down Expand Up @@ -104,10 +101,6 @@ export default function Admin() {
<UploadDownload/>
</Route>

<Route path={`${path}/vas`}>
<VAS/>
</Route>

<Route path={`${path}/theme`}>
<Theme/>
</Route>
Expand Down Expand Up @@ -164,10 +157,6 @@ export default function Admin() {
<Share/>
</Route>

<Route path={`${path}/order`} exact>
<Order/>
</Route>

<Route path={`${path}/download`} exact>
<Download/>
</Route>
Expand Down
10 changes: 0 additions & 10 deletions src/component/Admin/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ const items = [
path: "upload",
icon: <SettingsEthernet />
},
{
title: "增值服务",
path: "vas",
icon: <AttachMoney />
},
{
title: "外观",
path: "theme",
Expand Down Expand Up @@ -244,11 +239,6 @@ const items = [
icon: <Share />,
path: "share"
},
{
title: "订单",
icon: <ShoppingCart />,
path: "order"
},
{
title: "持久任务",
icon: <Assignment />,
Expand Down
5 changes: 1 addition & 4 deletions src/component/Admin/Group/EditGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default function EditGroupPreload( ) {
"archive_task",
"one_time_download",
"share_download",
"share_free",
"aria2"
].forEach(v => {
if (response.data.OptionsSerialized[v] !== undefined){
Expand All @@ -51,9 +50,7 @@ export default function EditGroupPreload( ) {
response.data.OptionsSerialized[v] = response.data.OptionsSerialized[v].toString();
}
});
response.data.PolicyList = response.data.PolicyList.map(v=>{
return v.toString();
});
response.data.PolicyList = response.data.PolicyList[0];

// JSON转换
if(response.data.OptionsSerialized.aria2_options === undefined){
Expand Down
58 changes: 4 additions & 54 deletions src/component/Admin/Group/GroupForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function GroupForm(props) {
ShareEnabled: "true", // 转换类型
WebDAVEnabled: "true", // 转换类型
SpeedLimit: "0", // 转换类型
PolicyList: ["1"], // 转换类型,至少选择一个
PolicyList: 1, // 转换类型,至少选择一个
OptionsSerialized: {
// 批量转换类型
share_download: "true",
Expand Down Expand Up @@ -152,7 +152,6 @@ export default function GroupForm(props) {
"archive_task",
"one_time_download",
"share_download",
"share_free",
"aria2"
].forEach(v => {
if (groupCopy.OptionsSerialized[v] !== undefined){
Expand All @@ -172,15 +171,7 @@ export default function GroupForm(props) {
groupCopy.OptionsSerialized[v] = parseInt(groupCopy.OptionsSerialized[v]);
}
});
groupCopy.PolicyList = groupCopy.PolicyList.map(v=>{
return parseInt(v)
});

if (groupCopy.PolicyList.length < 1 && groupCopy.ID !== 3){
ToggleSnackbar("top", "right", "至少要为用户组选择一个存储策略", "warning");
return;
}

groupCopy.PolicyList = [parseInt(groupCopy.PolicyList)];
// JSON转换
try {
groupCopy.OptionsSerialized.aria2_options = JSON.parse(groupCopy.OptionsSerialized.aria2_options);
Expand Down Expand Up @@ -237,45 +228,26 @@ export default function GroupForm(props) {
<div className={classes.form}>
<FormControl fullWidth>
<InputLabel htmlFor="component-helper">
可用存储策略
存储策略
</InputLabel>
<Select
labelId="demo-mutiple-chip-label"
id="demo-mutiple-chip"
multiple
value={group.PolicyList}
onChange={handleChange("PolicyList")}
input={<Input id="select-multiple-chip" />}
renderValue={selected => (
<div className={classes.chips}>
{selected.map(value => (
<Chip
style={{ margin: 2 }}
key={value}
size={"small"}
label={policies[value]}
className={classes.chip}
/>
))}
</div>
)}
>
{Object.keys(policies).map(pid => (
<MenuItem
key={pid}
value={pid}
style={getStyles(
pid,
group.PolicyList,
theme
)}
>
{policies[pid]}
</MenuItem>
))}
</Select>
<FormHelperText id="component-helper-text">
指定用户组可用的存储策略,可多选,用户可在选定范围内自由切换存储策略
指定用户组的存储策略
</FormHelperText>
</FormControl>
</div>
Expand Down Expand Up @@ -360,28 +332,6 @@ export default function GroupForm(props) {
</FormControl>
</div>

<div className={classes.form}>
<FormControl fullWidth>
<FormControlLabel
control={
<Switch
checked={
group.OptionsSerialized
.share_free === "true"
}
onChange={handleOptionCheckChange(
"share_free"
)}
/>
}
label="免积分下载分享"
/>
<FormHelperText id="component-helper-text">
开启后,用户可以免费下载需付积分的分享
</FormHelperText>
</FormControl>
</div>

{group.ID !== 3 && <div className={classes.form}>
<FormControl fullWidth>
<FormControlLabel
Expand Down
Loading

0 comments on commit 220a080

Please sign in to comment.