This commit is contained in:
caishi 2020-09-07 15:02:25 +08:00
parent 2f09ca4315
commit 6944406c49
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
import React , { useEffect , useState } from 'react';
import { Button ,Spin , Pagination , Link } from 'antd';
import { Button ,Spin , Pagination } from 'antd';
import { Link } from 'react-router-dom';
import Nodata from '../Nodata';
import axios from 'axios';
@ -42,7 +43,7 @@ function CIList(props){
<ul className="CIList">
{list.map((item,key)=>{
return(
<li>
<li key={key}>
<span>
<Link to={`/projects/${item.author && item.author.login}/${item.identifier}`}>{item.name}</Link>
{ item.open_devops ?

View File

@ -10,6 +10,7 @@ function CIdispose(props){
const [ step , setStep ] = useState(0);
const [ visible, setVisible ] = useState(false);
const [ bindVisible, setBindVisible ] = useState(false);
const [ ci_certification, setCi_certification ] = useState(false);
const [ btnLoading , setBtnLoading ] = useState(false);
@ -36,6 +37,7 @@ function CIdispose(props){
if(result && result.data){
setCIData(result.data.cloud_account);
setStep(result.data.step);
setCi_certification(result.data.ci_certification);
}
}).catch(error=>{
console.log(error);
@ -139,12 +141,12 @@ function CIdispose(props){
<span>CI服务器地址</span>
{CIData && step >= 1 && <span className="ml10">{CIData.ip}</span>}
{ step === 0 && <span className="ml10 authTag red">未绑定</span> }
{ step === 1 && <span className="ml10 authTag red">未认证</span> }
{ step === 2 && <span className="ml10 authTag green">已认证</span> }
{ !ci_certification && <span className="ml10 authTag red">未认证</span> }
{ ci_certification && <span className="ml10 authTag green">已认证</span> }
</AlignCenter>
<AlignCenter>
{ step === 0 && <Button type={'primary'} onClick={()=>setBindVisible(true)} >马上绑定</Button> }
{ step === 1 && <Button type={'primary'} style={{color:"#fff"}} href={CIData && CIData.redirect_url} target="_blank">马上认证</Button> }
{ ci_certification && <Button type={'primary'} style={{color:"#fff"}} href={CIData && CIData.redirect_url} target="_blank">马上认证</Button> }
{ step >= 1 && <Button type={'danger'} className="ml20" onClick={()=>setVisible(true)}>解除绑定</Button> }
</AlignCenter>
</div>