代码溯源fork仓库不可用

This commit is contained in:
谢思 2022-08-08 15:22:28 +08:00
parent 5fbac9d61c
commit 6ffb2d19f3
2 changed files with 15 additions and 9 deletions

View File

@ -6,7 +6,7 @@ function Main(props){
const { owner , projectsId } = props.match.params;
const [ has_trace_user , setHas_trace_user ] = useState(false);
const { current_user , resetUserInfo } = props;
const { current_user , resetUserInfo, projectDetail, showNotification } = props;
useEffect(()=>{
if(current_user){
@ -23,6 +23,8 @@ function Main(props){
function openDetail(){
if(!has_trace_user){
setVisible(true);
}else if(projectDetail && projectDetail.forked_from_project_id){
showNotification("fork仓库暂不支持代码溯源服务敬请谅解。");
}else{
props.history.push(`/${owner}/${projectsId}/server/1`);
}

View File

@ -9,7 +9,7 @@ function Data(props) {
const [detectionVisible, setDetectionVisible] = useState(false);
const [dataSource, setDataSource] = useState(undefined);
const [page, setPage] = useState(1);
const [spining, setSpining] = useState(true);
const [spining, setSpining] = useState(false);
const [relayCount, setRelayCount] = useState(5);
const [repeatId, setRepeatId] = useState(undefined);
const [repeatBranch, setRepeatBranch] = useState(undefined);
@ -18,7 +18,7 @@ function Data(props) {
const [viewBase, setViewBase] = useState('https://cjntest.trustie.net/');
const { owner, projectsId } = props.match.params;
const { current_user, isManager } = props;
const { isManager, projectDetail, history } = props;
const limit = 15;
@ -37,7 +37,6 @@ function Data(props) {
}
}).then(result => {
if (result) {
if (Array.isArray(result.data.data)) {
setDataSource(result.data.data);
setRelayCount(result.data.left_tasks_count);
@ -47,21 +46,26 @@ function Data(props) {
if (item.detect_status === "detecting" || item.detect_status === "waiting" || (item.detect_status=="detected"&& item.is_reported=="0")) {
setTimeout(Init, 2000);
break;
}
}
}
} else {
result && result.data.message && props.showNotification(result.data.message);
}
setSpining(false);
}else{
setSpining(false);
}
}).catch(error => { })
}
useEffect(() => {
setSpining(true);
Init();
}, [])
if(projectDetail && projectDetail.forked_from_project_id){
history.go(-1);
}else{
setSpining(true);
Init();
}
}, [projectDetail])
useEffect(() => {
window.addEventListener("message", iframeHeight, false);