导入项目失败后不删除项目,显示提示内容

This commit is contained in:
caishi 2024-06-05 16:37:38 +08:00
parent 34cf34e62e
commit 3e3bb42b3e
3 changed files with 38 additions and 34 deletions

View File

@ -26,13 +26,13 @@ import CheckProfile from '../Component/ProfileModal/Profile';
import RenderHtml from '../../components/render-html';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import ProjectPortrait from '../Component/projectPortrait';
const CoderRootFileDetail = Loadable({
loader: () => import("./CoderRootFileDetail"),
loading: Loading,
});
import ProjectPortrait from '../Component/projectPortrait';
/**
* projectDetail.type:0是托管项目1是镜像项目2是同步镜像项目(为2时不支持在线创建在线上传在线修改在线删除创建合并请求等功能)
* project.open_portrait: 是否开启项目画像展示
@ -40,7 +40,6 @@ import ProjectPortrait from '../Component/projectPortrait';
function CoderDepot(props){
// const [ projectDetail , setProjectDetail ]= useState(undefined);
let { platform , mirror_status , bannerList , projectDetail, projectEntries, projectReadMe, project } = props ;
projectDetail = props.defaultDetail || projectDetail || {}
const [ inviteCode , setInviteCode ] = useState(projectDetail.invite_code || undefined);
@ -435,6 +434,10 @@ function CoderDepot(props){
</React.Fragment>
}
<div style={{minHeight:"500px"}}>
{
mirror_status === 2 &&
<div className='importFailTip'>导入项目失败请前往 <Link className='color-blue' to={`/${owner}/${projectsId}/settings`}>仓库设置</Link> 删除本项目后重新导入</div>
}
{
projectDetail && mirror_status === 0 &&
<div className="Panels Box">

View File

@ -277,50 +277,44 @@ class Detail extends Component {
open_devops: data.open_devops,
platform: data.platform && data.platform !== 'educoder'
})
if(data.status === -1){
this.toMirrorFunc();
}else{
if (data.type !== 0 && data.mirror_status === 1) {
console.log("--------start channel --------");
this.setState({
firstSync: true,
secondSync: false,
mirror_status:1
})
// 是镜像项目,且未完成迁移
this.canvasChannel();
} else if (data.mirror_status === 2) {
this.toMirrorFunc();
if (data.type !== 0 && data.mirror_status === 1) {
console.log("--------start channel --------");
this.setState({
firstSync: true,
secondSync: false,
mirror_status:1
})
// 是镜像项目,且未完成迁移
this.canvasChannel();
} else {
this.setState({
firstSync: false,
secondSync: false,
mirror_status:data.mirror_status ? data.mirror_status : 0
})
this.getBanner(this.props.projectMenu)
let projectdata
if (this.props.defaultDetail) {
projectdata = this.props.defaultDetail
} else {
this.setState({
firstSync: false,
secondSync: false,
mirror_status:0
mirror_status:data.mirror_status ? data.mirror_status : 0
})
this.getBanner(this.props.projectMenu)
let projectdata
if (this.props.defaultDetail) {
projectdata = this.props.defaultDetail
} else {
this.setState({
firstSync: false,
secondSync: false,
mirror_status:0
})
this.getBanner(this.props.projectMenu)
let projectdata
if (this.props.defaultDetail) {
projectdata = this.props.defaultDetail
} else {
const res = await getProjectDetailFunc(owner, projectsId, !window.location.host);
if (res.status === 200) {
projectdata = res.data
}
}
if (projectdata) {
this.getDetail(projectdata)
const res = await getProjectDetailFunc(owner, projectsId, !window.location.host);
if (res.status === 200) {
projectdata = res.data
}
}
if (projectdata) {
this.getDetail(projectdata)
}
}
}
}

View File

@ -557,4 +557,11 @@
color:#4c5b76;
background-color: rgba(175, 183, 194, 0.16);
}
.importFailTip{
height: 100%;
line-height: 500px;
text-align: center;
font-size: 19px;
color: #333;
}