diff --git a/public/locales/en-US/dashboard.json b/public/locales/en-US/dashboard.json index 5fcdb87..93e2445 100644 --- a/public/locales/en-US/dashboard.json +++ b/public/locales/en-US/dashboard.json @@ -382,7 +382,7 @@ "createQiniuBucket": "Go to <0>Qiniu dashboard to create a storage bucket.。", "enterQiniuBucket": "Enter the \"bucket name\" you just created:", "qiniuBucketName": "Bucket name", - "bucketTypeDes": "Select the type of bucket you just created. We recommend selecting \"Private bucket\" for higher security, private bucket does not support \"Get Source Link\" feature.", + "bucketTypeDes": "Select the type of bucket you just created. We recommend selecting \"Private bucket\" for higher security.", "privateBucket": "Private bucket", "publicBucket": "Public bucket", "bucketCDNDes": "Fill in the CDN-accelerated domain name you have bound for the storage bucket.", @@ -552,7 +552,10 @@ "chunkSizeBytesDes": "Size of chunk for resumable uploads. Only supported in partial storage policy.", "placeHolderWithSize": "Use placeholder before uploading", "placeHolderWithSizeDes": "Whether to create a placeholder file before uploading .Only supported in partial storage policy.", - "saveChanges": "Save changes" + "saveChanges": "Save changes", + "s3EndpointPathStyle": "Select the format of the S3 Endpoint address, or if you don't know what to select, just leave to the default. Some third-party S3-compatible storage policies may require this option to work. When turned on, we will force to use of path-like format addresses, such as <0>http://s3.amazonaws.com/BUCKET/KEY.", + "usePathEndpoint": "Force path style", + "useHostnameEndpoint": "Use host name if possible" }, "node": { "#": "#", diff --git a/public/locales/zh-CN/dashboard.json b/public/locales/zh-CN/dashboard.json index a54c2ad..c372bc3 100644 --- a/public/locales/zh-CN/dashboard.json +++ b/public/locales/zh-CN/dashboard.json @@ -382,7 +382,7 @@ "createQiniuBucket": "前往 <0>七牛控制面板 创建对象存储资源。", "enterQiniuBucket": "在下方填写您在七牛创建存储空间时指定的“存储空间名称”:", "qiniuBucketName": "存储空间名称", - "bucketTypeDes": "在下方选择您创建的空间类型,推荐选择“私有空间”以获得更高的安全性,私有空间无法开启“获取直链”功能。", + "bucketTypeDes": "在下方选择您创建的空间类型,推荐选择“私有空间”以获得更高的安全性。", "privateBucket": "私有", "publicBucket": "公有", "bucketCDNDes": "填写您为存储空间绑定的 CDN 加速域名。", @@ -552,7 +552,10 @@ "chunkSizeBytesDes": "分片上传时单个分片的大小,仅部分存储策略支持", "placeHolderWithSize": "上传前预支用户存储", "placeHolderWithSizeDes": "是否在上传会话创建时就对用户存储进行预支,仅部分存储策略支持", - "saveChanges": "保存更改" + "saveChanges": "保存更改", + "s3EndpointPathStyle": "选择 S3 Endpoint 地址的格式,如果您不知道该选什么,保持默认即可。某些第三方 S3 兼容存储策略可能需要更改此选项。开启后,将会强制使用路径格式地址,比如 <0>http://s3.amazonaws.com/BUCKET/KEY。", + "usePathEndpoint": "强制路径格式", + "useHostnameEndpoint": "主机名优先" }, "node": { "#": "#", diff --git a/src/component/Admin/Policy/EditPolicy.js b/src/component/Admin/Policy/EditPolicy.js index bfa37ec..0deb6ab 100644 --- a/src/component/Admin/Policy/EditPolicy.js +++ b/src/component/Admin/Policy/EditPolicy.js @@ -65,6 +65,10 @@ export default function EditPolicyPreload() { .data.OptionsSerialized.placeholder_with_size ? "true" : "false"; + response.data.OptionsSerialized.s3_path_style = response.data + .OptionsSerialized.s3_path_style + ? "true" + : "false"; response.data.OptionsSerialized.file_type = response.data .OptionsSerialized.file_type diff --git a/src/component/Admin/Policy/Guid/EditPro.js b/src/component/Admin/Policy/Guid/EditPro.js index 723aa08..c528f8f 100644 --- a/src/component/Admin/Policy/Guid/EditPro.js +++ b/src/component/Admin/Policy/Guid/EditPro.js @@ -70,9 +70,10 @@ export default function EditPro(props) { ); policyCopy.OptionsSerialized.placeholder_with_size = policyCopy.OptionsSerialized.placeholder_with_size === "true"; - policyCopy.OptionsSerialized.file_type = policyCopy.OptionsSerialized.file_type.split( - "," - ); + policyCopy.OptionsSerialized.s3_path_style = + policyCopy.OptionsSerialized.s3_path_style === "true"; + policyCopy.OptionsSerialized.file_type = + policyCopy.OptionsSerialized.file_type.split(","); if ( policyCopy.OptionsSerialized.file_type.length === 1 && policyCopy.OptionsSerialized.file_type[0] === "" @@ -640,6 +641,42 @@ export default function EditPro(props) { {t("odOnly")} + + + {t("usePathEndpoint")} + + + + + + } + label={t("yes")} + /> + + } + label={t("no")} + /> + + + + {t("s3Only")} +