Add phone provider.

This commit is contained in:
Yang Luo
2021-05-15 13:43:21 +08:00
parent 08779b607d
commit 43db2de8d8
6 changed files with 105 additions and 56 deletions

View File

@ -79,7 +79,10 @@ class ProviderEditPage extends React.Component {
);
} else {
return (
[]
[
{id: 'aliyun', name: 'Aliyun'},
{id: 'tencent', name: 'Tencent Cloud'},
]
);
}
}
@ -160,26 +163,65 @@ class ProviderEditPage extends React.Component {
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Host")}:
</Col>
<Col span={22} >
<Input prefix={<LinkOutlined/>} value={this.state.provider.host} onChange={e => {
this.updateProviderField('host', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Port")}:
</Col>
<Col span={22} >
<InputNumber value={this.state.provider.port} onChange={value => {
this.updateProviderField('port', value);
}} />
</Col>
</Row>
{
this.state.provider.category === "Email" ? (
<React.Fragment>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Host")}:
</Col>
<Col span={22} >
<Input prefix={<LinkOutlined/>} value={this.state.provider.host} onChange={e => {
this.updateProviderField('host', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Port")}:
</Col>
<Col span={22} >
<InputNumber value={this.state.provider.port} onChange={value => {
this.updateProviderField('port', value);
}} />
</Col>
</Row>
</React.Fragment>
) : this.state.provider.category === "Phone" ? (
<React.Fragment>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Region ID")}:
</Col>
<Col span={22} >
<Input value={this.state.provider.regionId} onChange={e => {
this.updateProviderField('regionId', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Sign Name")}:
</Col>
<Col span={22} >
<Input value={this.state.provider.signName} onChange={e => {
this.updateProviderField('signName', e.target.value);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Template Code")}:
</Col>
<Col span={22} >
<Input value={this.state.provider.templateCode} onChange={e => {
this.updateProviderField('templateCode', e.target.value);
}} />
</Col>
</Row>
</React.Fragment>
) : null
}
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={2}>
{i18next.t("provider:Provider URL")}:

View File

@ -83,6 +83,11 @@
"Type": "Type",
"Client ID": "Client ID",
"Client secret": "Client secret",
"Host": "Host",
"Port": "Port",
"Region ID": "Region ID",
"Sign Name": "Sign Name",
"Template Code": "Template Code",
"Provider URL": "Provider URL",
"Edit Provider": "Edit Provider"
},

View File

@ -83,6 +83,11 @@
"Type": "类型",
"Client ID": "Client ID",
"Client secret": "Client secret",
"Host": "主机",
"Port": "端口号",
"Region ID": "地域ID",
"Sign Name": "签名名称",
"Template Code": "模板CODE",
"Provider URL": "提供商URL",
"Edit Provider": "修改提供商"
},