新建项目路由
This commit is contained in:
parent
2add7911dc
commit
d0ccc92cc6
|
@ -49,6 +49,12 @@ class Index extends Component {
|
||||||
<ProjectNew {...this.props} {...props} />
|
<ProjectNew {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
|
<Route
|
||||||
|
path="/projects/new"
|
||||||
|
render={(props) => (
|
||||||
|
<ProjectNew {...this.props} {...props} />
|
||||||
|
)}
|
||||||
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId"
|
path="/projects/:owner/:projectsId"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
|
|
@ -164,7 +164,7 @@ class Index extends Component {
|
||||||
const { projectsType } = this.props.match.params;
|
const { projectsType } = this.props.match.params;
|
||||||
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
||||||
const decoderPass = Base64.encode(values.password);
|
const decoderPass = Base64.encode(values.password);
|
||||||
const url = projectsType === "deposit" ? "/projects.json" : "/projects/migrate.json";
|
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
...values,
|
...values,
|
||||||
auth_password:decoderPass,
|
auth_password:decoderPass,
|
||||||
|
@ -179,7 +179,7 @@ class Index extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: false
|
isSpin: false
|
||||||
})
|
})
|
||||||
this.props.showNotification(`${projectsType === "deposit" ? "托管" : "镜像"}项目创建成功!`);
|
this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
|
||||||
this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`);
|
this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ class Index extends Component {
|
||||||
return (
|
return (
|
||||||
<div className="main back-white">
|
<div className="main back-white">
|
||||||
<div className="newPanel">
|
<div className="newPanel">
|
||||||
<div className="newPanel_title">创建{projectsType === "deposit" ? "托管" : "镜像"}项目</div>
|
<div className="newPanel_title">创建{projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目</div>
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<Form>
|
<Form>
|
||||||
<div className="newPanel_content">
|
<div className="newPanel_content">
|
||||||
|
@ -303,7 +303,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="镜像版本库地址"
|
label="镜像版本库地址"
|
||||||
|
@ -321,7 +321,7 @@ class Index extends Component {
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i></p>
|
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i></p>
|
||||||
{
|
{
|
||||||
|
@ -428,7 +428,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{
|
{
|
||||||
projectsType === "deposit" &&
|
(projectsType === "deposit" || !projectsType) &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label=".gitignore"
|
label=".gitignore"
|
||||||
|
@ -482,7 +482,7 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item >
|
</Form.Item >
|
||||||
{
|
{
|
||||||
projectsType !== "deposit" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="迁移类型:"
|
label="迁移类型:"
|
||||||
style={{ margin: "0px" }}
|
style={{ margin: "0px" }}
|
||||||
|
|
Loading…
Reference in New Issue