chore: hide fields of local file system storage provider (#2109)

* style: adjust local file system storage

* style: disable domain when use local file system
This commit is contained in:
UsherFall
2023-07-23 11:48:15 +08:00
committed by GitHub
parent 09f40bb5ce
commit a9d4978a0f

View File

@ -527,7 +527,7 @@ class ProviderEditPage extends React.Component {
) )
} }
{ {
(this.state.provider.category === "Captcha" && this.state.provider.type === "Default") || this.state.provider.category === "Web3" ? null : ( (this.state.provider.category === "Captcha" && this.state.provider.type === "Default") || (this.state.provider.category === "Web3") || (this.state.provider.category === "Storage" && this.state.provider.type === "Local File System") ? null : (
<React.Fragment> <React.Fragment>
{ {
this.state.provider.category === "AI" ? null : ( this.state.provider.category === "AI" ? null : (
@ -616,36 +616,42 @@ class ProviderEditPage extends React.Component {
} }
{this.state.provider.category === "Storage" ? ( {this.state.provider.category === "Storage" ? (
<div> <div>
<Row style={{marginTop: "20px"}} > {["Local File System"].includes(this.state.provider.type) ? null : (
<Col style={{marginTop: "5px"}} span={2}> <Row style={{marginTop: "20px"}} >
{Setting.getLabel(i18next.t("provider:Endpoint"), i18next.t("provider:Region endpoint for Internet"))} : <Col style={{marginTop: "5px"}} span={2}>
</Col> {Setting.getLabel(i18next.t("provider:Endpoint"), i18next.t("provider:Region endpoint for Internet"))} :
<Col span={22} > </Col>
<Input value={this.state.provider.endpoint} onChange={e => { <Col span={22} >
this.updateProviderField("endpoint", e.target.value); <Input value={this.state.provider.endpoint} onChange={e => {
}} /> this.updateProviderField("endpoint", e.target.value);
</Col> }} />
</Row> </Col>
<Row style={{marginTop: "20px"}} > </Row>
<Col style={{marginTop: "5px"}} span={2}> )}
{Setting.getLabel(i18next.t("provider:Endpoint (Intranet)"), i18next.t("provider:Region endpoint for Intranet"))} : {["Local File System"].includes(this.state.provider.type) ? null : (
</Col> <Row style={{marginTop: "20px"}} >
<Col span={22} > <Col style={{marginTop: "5px"}} span={2}>
<Input value={this.state.provider.intranetEndpoint} onChange={e => { {Setting.getLabel(i18next.t("provider:Endpoint (Intranet)"), i18next.t("provider:Region endpoint for Intranet"))} :
this.updateProviderField("intranetEndpoint", e.target.value); </Col>
}} /> <Col span={22} >
</Col> <Input value={this.state.provider.intranetEndpoint} onChange={e => {
</Row> this.updateProviderField("intranetEndpoint", e.target.value);
<Row style={{marginTop: "20px"}} > }} />
<Col style={{marginTop: "5px"}} span={2}> </Col>
{Setting.getLabel(i18next.t("provider:Bucket"), i18next.t("provider:Bucket - Tooltip"))} : </Row>
</Col> )}
<Col span={22} > {["Local File System"].includes(this.state.provider.type) ? null : (
<Input value={this.state.provider.bucket} onChange={e => { <Row style={{marginTop: "20px"}} >
this.updateProviderField("bucket", e.target.value); <Col style={{marginTop: "5px"}} span={2}>
}} /> {Setting.getLabel(i18next.t("provider:Bucket"), i18next.t("provider:Bucket - Tooltip"))} :
</Col> </Col>
</Row> <Col span={22} >
<Input value={this.state.provider.bucket} onChange={e => {
this.updateProviderField("bucket", e.target.value);
}} />
</Col>
</Row>
)}
<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:Path prefix"), i18next.t("provider:Path prefix - Tooltip"))} : {Setting.getLabel(i18next.t("provider:Path prefix"), i18next.t("provider:Path prefix - Tooltip"))} :
@ -661,7 +667,7 @@ class ProviderEditPage extends React.Component {
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} : {Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.provider.domain} onChange={e => { <Input value={this.state.provider.domain} disabled={this.state.provider.type === "Local File System"} onChange={e => {
this.updateProviderField("domain", e.target.value); this.updateProviderField("domain", e.target.value);
}} /> }} />
</Col> </Col>