mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
添加webdav代理下载流量选项
This commit is contained in:
parent
807cc21f66
commit
9bd797e285
|
|
@ -457,6 +457,8 @@
|
|||
"action": "Action",
|
||||
"readonlyOn": "Turn on readonly",
|
||||
"readonlyOff": "Turn off readonly",
|
||||
"useProxyOn": "Turn on reverse proxy",
|
||||
"useProxyOff": "Turn off reverse proxy",
|
||||
"delete": "Delete",
|
||||
"listEmpty": "No records.",
|
||||
"createNewAccount": "Create new account",
|
||||
|
|
|
|||
|
|
@ -700,6 +700,8 @@
|
|||
"allowDownloadShareDes": "If disabled, user cannot download shared files.",
|
||||
"allowWabDAV": "WebDAV",
|
||||
"allowWabDAVDes": "If disabled, users cannot connect to the storage via the WebDAV protocol",
|
||||
"allowWabDAVProxy": "WebDAV Proxy",
|
||||
"allowWabDAVProxyDes": "If enabled, users can configure the WebDAV to proxy traffic when downloading files",
|
||||
"disableMultipleDownload": "Disable multiple download requests",
|
||||
"disableMultipleDownloadDes": "Valid only for local storage policies. When disabled, users cannot use the multi-threaded download tool.",
|
||||
"allowRemoteDownload": "Remote download",
|
||||
|
|
|
|||
|
|
@ -457,6 +457,8 @@
|
|||
"action": "操作",
|
||||
"readonlyOn": "开启只读",
|
||||
"readonlyOff": "关闭只读",
|
||||
"useProxyOn": "开启反代",
|
||||
"useProxyOff": "关闭反代",
|
||||
"delete": "删除",
|
||||
"listEmpty": "没有记录",
|
||||
"createNewAccount": "创建新账号",
|
||||
|
|
|
|||
|
|
@ -700,6 +700,8 @@
|
|||
"allowDownloadShareDes": "关闭后,用户无法下载别人创建的文件分享",
|
||||
"allowWabDAV": "WebDAV",
|
||||
"allowWabDAVDes": "关闭后,用户无法通过 WebDAV 协议连接至网盘",
|
||||
"allowWabDAVProxy": "WebDAV 代理",
|
||||
"allowWabDAVProxyDes": "启用后, 用户可以配置 WebDAV 代理下载文件的流量",
|
||||
"disableMultipleDownload": "禁止多次下载请求",
|
||||
"disableMultipleDownloadDes": "只针对本机存储策略有效。开启后,用户无法使用多线程下载工具。",
|
||||
"allowRemoteDownload": "离线下载",
|
||||
|
|
|
|||
|
|
@ -457,6 +457,8 @@
|
|||
"action": "操作",
|
||||
"readonlyOn": "開啓只讀",
|
||||
"readonlyOff": "關閉只讀",
|
||||
"useProxyOn": "開啓反代",
|
||||
"useProxyOff": "關閉反代",
|
||||
"delete": "刪除",
|
||||
"listEmpty": "沒有記錄",
|
||||
"createNewAccount": "創建新帳號",
|
||||
|
|
|
|||
|
|
@ -700,6 +700,8 @@
|
|||
"allowDownloadShareDes": "關閉後,用戶無法下載別人創建的文件分享",
|
||||
"allowWabDAV": "WebDAV",
|
||||
"allowWabDAVDes": "關閉後,用戶無法通過 WebDAV 協議連接至網路硬碟",
|
||||
"allowWabDAVProxy": "WebDAV 代理",
|
||||
"allowWabDAVProxyDes": "啓用後, 用戶可以配置 WebDAV 代理下載文件的流量",
|
||||
"disableMultipleDownload": "禁止多次下載請求",
|
||||
"disableMultipleDownloadDes": "只針對本機儲存策略有效。開啟後,用戶無法使用多執行緒下載工具。",
|
||||
"allowRemoteDownload": "離線下載",
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ export default function EditGroupPreload() {
|
|||
"archive_task",
|
||||
"one_time_download",
|
||||
"share_download",
|
||||
"webdav_proxy",
|
||||
"aria2",
|
||||
"redirected_source",
|
||||
"advance_delete"
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ export default function GroupForm(props) {
|
|||
"archive_task",
|
||||
"one_time_download",
|
||||
"share_download",
|
||||
"webdav_proxy",
|
||||
"aria2",
|
||||
"redirected_source",
|
||||
"advance_delete"
|
||||
|
|
@ -409,6 +410,30 @@ export default function GroupForm(props) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{group.ID !== 3 && group.WebDAVEnabled === "true" && (
|
||||
<div className={classes.form}>
|
||||
<FormControl fullWidth>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={
|
||||
group.OptionsSerialized.webdav_proxy ===
|
||||
"true"
|
||||
}
|
||||
onChange={handleOptionCheckChange(
|
||||
"webdav_proxy"
|
||||
)}
|
||||
/>
|
||||
}
|
||||
label={t("allowWabDAVProxy")}
|
||||
/>
|
||||
<FormHelperText id="component-helper-text">
|
||||
{t("allowWabDAVProxyDes")}
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={classes.form}>
|
||||
<FormControl fullWidth>
|
||||
<FormControlLabel
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import Alert from "@material-ui/lab/Alert";
|
|||
import Auth from "../../middleware/Auth";
|
||||
import API from "../../middleware/Api";
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
import { Delete } from "@material-ui/icons";
|
||||
import { Cloud, CloudOff, Delete } from "@material-ui/icons";
|
||||
import CreateWebDAVAccount from "../Modals/CreateWebDAVAccount";
|
||||
import TimeAgo from "timeago-react";
|
||||
import Link from "@material-ui/core/Link";
|
||||
|
|
@ -130,6 +130,22 @@ export default function WebDAV() {
|
|||
});
|
||||
};
|
||||
|
||||
const toggleAccountUseProxy = (id) => {
|
||||
const account = accounts[id];
|
||||
API.patch("/webdav/accounts", {
|
||||
id: account.ID,
|
||||
use_proxy: !account.UseProxy,
|
||||
})
|
||||
.then((response) => {
|
||||
account.UseProxy = response.data.use_proxy;
|
||||
const accountCopy = [...accounts];
|
||||
setAccounts(accountCopy);
|
||||
})
|
||||
.catch((error) => {
|
||||
ToggleSnackbar("top", "right", error.message, "error");
|
||||
});
|
||||
};
|
||||
|
||||
const addAccount = (account) => {
|
||||
setCreate(false);
|
||||
API.post("/webdav/accounts", {
|
||||
|
|
@ -290,6 +306,45 @@ export default function WebDAV() {
|
|||
/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
{user.group.allowWebDAVProxy && (<Tooltip
|
||||
placement="top"
|
||||
title={
|
||||
row.UseProxy
|
||||
? t(
|
||||
"setting.useProxyOff"
|
||||
)
|
||||
: t(
|
||||
"setting.useProxyOn"
|
||||
)
|
||||
}
|
||||
onClick={() =>
|
||||
toggleAccountUseProxy(
|
||||
id
|
||||
)
|
||||
}
|
||||
>
|
||||
<IconButton>
|
||||
<ToggleIcon
|
||||
on={
|
||||
row.UseProxy
|
||||
}
|
||||
onIcon={
|
||||
<CloudOff
|
||||
fontSize={
|
||||
"small"
|
||||
}
|
||||
/>
|
||||
}
|
||||
offIcon={
|
||||
<Cloud
|
||||
fontSize={
|
||||
"small"
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</IconButton>
|
||||
</Tooltip>)}
|
||||
<Tooltip
|
||||
placement="top"
|
||||
title={t(
|
||||
|
|
|
|||
Loading…
Reference in New Issue