From 7d7ca104819ef95eeb46ec14a8cd7f55f6fe287a Mon Sep 17 00:00:00 2001 From: UsherFall <98513748+UsherFall@users.noreply.github.com> Date: Sun, 23 Jul 2023 14:40:30 +0800 Subject: [PATCH] fix: hide fields of minio storage provider (#2115) * feat: hide field of minio storage provider * feat: hide field of domain in minio storage provider --- storage/storage.go | 2 +- web/src/ProviderEditPage.js | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/storage/storage.go b/storage/storage.go index b5832827..38018b1d 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -23,7 +23,7 @@ func GetStorageProvider(providerType string, clientId string, clientSecret strin case "AWS S3": return NewAwsS3StorageProvider(clientId, clientSecret, region, bucket, endpoint) case "MinIO": - return NewMinIOS3StorageProvider(clientId, clientSecret, region, bucket, endpoint) + return NewMinIOS3StorageProvider(clientId, clientSecret, "_", bucket, endpoint) case "Aliyun OSS": return NewAliyunOssStorageProvider(clientId, clientSecret, region, bucket, endpoint) case "Tencent Cloud COS": diff --git a/web/src/ProviderEditPage.js b/web/src/ProviderEditPage.js index 35ec3981..c4c12cf3 100644 --- a/web/src/ProviderEditPage.js +++ b/web/src/ProviderEditPage.js @@ -628,7 +628,7 @@ class ProviderEditPage extends React.Component { )} - {["Local File System"].includes(this.state.provider.type) ? null : ( + {["Local File System", "MinIO"].includes(this.state.provider.type) ? null : ( {Setting.getLabel(i18next.t("provider:Endpoint (Intranet)"), i18next.t("provider:Region endpoint for Intranet"))} : @@ -662,17 +662,19 @@ class ProviderEditPage extends React.Component { }} /> - - - {Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} : - - - { - this.updateProviderField("domain", e.target.value); - }} /> - - - {["AWS S3", "MinIO", "Tencent Cloud COS"].includes(this.state.provider.type) ? ( + {["MinIO"].includes(this.state.provider.type) ? null : ( + + + {Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} : + + + { + this.updateProviderField("domain", e.target.value); + }} /> + + + )} + {["AWS S3", "Tencent Cloud COS"].includes(this.state.provider.type) ? ( {Setting.getLabel(i18next.t("provider:Region ID"), i18next.t("provider:Region ID - Tooltip"))} :