新建项目:版本库地址和仓库名称同步
This commit is contained in:
parent
9b042c0113
commit
ab2787d2bc
|
|
@ -216,6 +216,21 @@ class Index extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
ChangeAddr=(e)=>{
|
||||
let value = e.target.value;
|
||||
if(value.indexOf("/") > -1){
|
||||
let arr = value.split("/");
|
||||
let first = arr[arr.length-1];
|
||||
if(first.indexOf(".git") > -1){
|
||||
let second = first.split('.')[0];
|
||||
if(!second)return;
|
||||
this.props.form.setFieldsValue({
|
||||
repository_name:second
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
// 项目类型:deposit-托管项目,mirror-镜像项目
|
||||
|
|
@ -262,7 +277,7 @@ class Index extends Component {
|
|||
required: true, message: '请填写镜像版本库地址'
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="输入需要同步到本项目的镜像版本库地址" />
|
||||
<Input placeholder="输入需要同步到本项目的镜像版本库地址" onChange={this.ChangeAddr} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<p className="formTip color-orange">示例:https://github.com/facebook/reack.git</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue