fix: hide fields of minio storage provider (#2115)

* feat: hide field of minio storage provider

* feat: hide field of domain in minio storage provider
This commit is contained in:
UsherFall
2023-07-23 14:40:30 +08:00
committed by GitHub
parent a9d4978a0f
commit 7d7ca10481
2 changed files with 15 additions and 13 deletions

View File

@ -23,7 +23,7 @@ func GetStorageProvider(providerType string, clientId string, clientSecret strin
case "AWS S3": case "AWS S3":
return NewAwsS3StorageProvider(clientId, clientSecret, region, bucket, endpoint) return NewAwsS3StorageProvider(clientId, clientSecret, region, bucket, endpoint)
case "MinIO": case "MinIO":
return NewMinIOS3StorageProvider(clientId, clientSecret, region, bucket, endpoint) return NewMinIOS3StorageProvider(clientId, clientSecret, "_", bucket, endpoint)
case "Aliyun OSS": case "Aliyun OSS":
return NewAliyunOssStorageProvider(clientId, clientSecret, region, bucket, endpoint) return NewAliyunOssStorageProvider(clientId, clientSecret, region, bucket, endpoint)
case "Tencent Cloud COS": case "Tencent Cloud COS":

View File

@ -628,7 +628,7 @@ class ProviderEditPage extends React.Component {
</Col> </Col>
</Row> </Row>
)} )}
{["Local File System"].includes(this.state.provider.type) ? null : ( {["Local File System", "MinIO"].includes(this.state.provider.type) ? null : (
<Row style={{marginTop: "20px"}} > <Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={2}> <Col style={{marginTop: "5px"}} span={2}>
{Setting.getLabel(i18next.t("provider:Endpoint (Intranet)"), i18next.t("provider:Region endpoint for Intranet"))} : {Setting.getLabel(i18next.t("provider:Endpoint (Intranet)"), i18next.t("provider:Region endpoint for Intranet"))} :
@ -662,17 +662,19 @@ class ProviderEditPage extends React.Component {
}} /> }} />
</Col> </Col>
</Row> </Row>
<Row style={{marginTop: "20px"}} > {["MinIO"].includes(this.state.provider.type) ? null : (
<Col style={{marginTop: "5px"}} span={2}> <Row style={{marginTop: "20px"}} >
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} : <Col style={{marginTop: "5px"}} span={2}>
</Col> {Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :
<Col span={22} > </Col>
<Input value={this.state.provider.domain} disabled={this.state.provider.type === "Local File System"} onChange={e => { <Col span={22} >
this.updateProviderField("domain", e.target.value); <Input value={this.state.provider.domain} disabled={this.state.provider.type === "Local File System"} onChange={e => {
}} /> this.updateProviderField("domain", e.target.value);
</Col> }} />
</Row> </Col>
{["AWS S3", "MinIO", "Tencent Cloud COS"].includes(this.state.provider.type) ? ( </Row>
)}
{["AWS S3", "Tencent Cloud COS"].includes(this.state.provider.type) ? (
<Row style={{marginTop: "20px"}} > <Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={2}> <Col style={{marginTop: "5px"}} span={2}>
{Setting.getLabel(i18next.t("provider:Region ID"), i18next.t("provider:Region ID - Tooltip"))} : {Setting.getLabel(i18next.t("provider:Region ID"), i18next.t("provider:Region ID - Tooltip"))} :