feat(source link): support enable source link for private bucket, warning user to enable "redirected source link"

This commit is contained in:
HFO4 2022-12-16 17:16:21 +08:00
parent 329db97568
commit 559058cd74
8 changed files with 27 additions and 25 deletions

View File

@ -390,7 +390,7 @@
"qiniuCredentialDes": "Go to Personal Center - Credential Management in the Qiniu dashboard and fill in the obtained AK, SK.",
"ak": "AK",
"sk": "SK",
"cannotEnableForPrivateBucket": "This feature is not supported under private bucket.",
"cannotEnableForPrivateBucket": "If this feature is enabled for private bucket, you need to enable \"Use redirected source link\" for user groups.",
"limitMimeType": "Do you want to limit MimeTypes of file that can be uploaded?",
"mimeTypeDes": "Enter the MimeType of the allowed files, and separate multiple MimeTypes with a comma. Qiniu will detect the file content to determine the MimeType, and allow the upload if the MimeType is presented in your list.",
"mimeTypeList": "MimeTypes list",

View File

@ -390,7 +390,7 @@
"qiniuCredentialDes": "在七牛控制面板进入 个人中心 - 密钥管理,在下方填写获得到的 AK、SK。",
"ak": "AK",
"sk": "SK",
"cannotEnableForPrivateBucket": "私有空间无法开启此功能",
"cannotEnableForPrivateBucket": "私有空间开启外链功能后,还需要在用户组里设置开启“使用重定向的外链”,否则无法正常生成外链",
"limitMimeType": "是否限制上传文件 MimeType",
"mimeTypeDes": "输入允许上传的 MimeType多个请以半角逗号 , 隔开。七牛服务器会侦测文件内容以判断 MimeType再用判断值跟指定值进行匹配匹配成功则允许上传。",
"mimeTypeList": "MimeType 列表",

View File

@ -199,9 +199,8 @@ export default function COSGuide(props) {
);
policyCopy.OptionsSerialized.placeholder_with_size =
policyCopy.OptionsSerialized.placeholder_with_size === "true";
policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split(
","
);
policyCopy.OptionsSerialized.file_type =
policyCopy.OptionsSerialized.file_type.split(",");
if (
policyCopy.OptionsSerialized.file_type.length === 1 &&
policyCopy.OptionsSerialized.file_type[0] === ""
@ -778,7 +777,6 @@ export default function COSGuide(props) {
),
"warning"
);
return;
}
handleChange("IsOriginLinkEnable")(
e

View File

@ -203,9 +203,8 @@ export default function OSSGuide(props) {
);
policyCopy.OptionsSerialized.placeholder_with_size =
policyCopy.OptionsSerialized.placeholder_with_size === "true";
policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split(
","
);
policyCopy.OptionsSerialized.file_type =
policyCopy.OptionsSerialized.file_type.split(",");
if (
policyCopy.OptionsSerialized.file_type.length === 1 &&
policyCopy.OptionsSerialized.file_type[0] === ""
@ -828,7 +827,6 @@ export default function OSSGuide(props) {
),
"warning"
);
return;
}
handleChange("IsOriginLinkEnable")(
e

View File

@ -267,9 +267,8 @@ export default function OneDriveGuide(props) {
);
policyCopy.OptionsSerialized.placeholder_with_size =
policyCopy.OptionsSerialized.placeholder_with_size === "true";
policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split(
","
);
policyCopy.OptionsSerialized.file_type =
policyCopy.OptionsSerialized.file_type.split(",");
if (
policyCopy.OptionsSerialized.file_type.length === 1 &&
policyCopy.OptionsSerialized.file_type[0] === ""
@ -404,9 +403,8 @@ export default function OneDriveGuide(props) {
ns={"dashboard"}
i18nKey={"policy.createAadAppDes3"}
values={{
url:
policy.OptionsSerialized
.od_redirect,
url: policy.OptionsSerialized
.od_redirect,
}}
components={[
<code key={0} />,
@ -832,6 +830,19 @@ export default function OneDriveGuide(props) {
required
value={policy.IsOriginLinkEnable}
onChange={(e) => {
if (
policy.IsPrivate === "true" &&
e.target.value === "true"
) {
ToggleSnackbar(
"top",
"right",
t(
"cannotEnableForPrivateBucket"
),
"warning"
);
}
handleChange("IsOriginLinkEnable")(
e
);

View File

@ -171,9 +171,8 @@ export default function RemoteGuide(props) {
);
policyCopy.OptionsSerialized.placeholder_with_size =
policyCopy.OptionsSerialized.placeholder_with_size === "true";
policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split(
","
);
policyCopy.OptionsSerialized.file_type =
policyCopy.OptionsSerialized.file_type.split(",");
if (
policyCopy.OptionsSerialized.file_type.length === 1 &&
policyCopy.OptionsSerialized.file_type[0] === ""
@ -572,7 +571,6 @@ export default function RemoteGuide(props) {
),
"warning"
);
return;
}
handleChange("IsOriginLinkEnable")(
e

View File

@ -808,7 +808,6 @@ export default function S3Guide(props) {
),
"warning"
);
return;
}
handleChange("IsOriginLinkEnable")(
e

View File

@ -166,9 +166,8 @@ export default function UpyunGuide(props) {
);
policyCopy.OptionsSerialized.placeholder_with_size =
policyCopy.OptionsSerialized.placeholder_with_size === "true";
policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split(
","
);
policyCopy.OptionsSerialized.file_type =
policyCopy.OptionsSerialized.file_type.split(",");
if (
policyCopy.OptionsSerialized.file_type.length === 1 &&
policyCopy.OptionsSerialized.file_type[0] === ""
@ -598,7 +597,6 @@ export default function UpyunGuide(props) {
),
"warning"
);
return;
}
handleChange("IsOriginLinkEnable")(
e