This commit is contained in:
caishi 2021-02-01 16:53:33 +08:00
parent e65a1debc5
commit ea77a13b6f
2 changed files with 11 additions and 7 deletions

View File

@ -65,7 +65,7 @@ function Dispose(props){
} }
},[owner,projectsId]) },[owner,projectsId])
// 线 // /线
function addNew(pipeline_name,id,branch,event){ function addNew(pipeline_name,id,branch,event){
setVisible(true); setVisible(true);
setUpdateInfo(undefined); setUpdateInfo(undefined);
@ -79,17 +79,21 @@ function Dispose(props){
function onOk(pipeline_name,updateId,branch,event){ function onOk(pipeline_name,updateId,branch,event){
if(pipeline_name){ if(pipeline_name){
let eventStr = ""; let eventStr = "";
for(var i = 0;i<event.length;i++){ if(event.indexOf(",")>-1){
eventStr +=event[i]+","; for(var i = 0;i<event.length;i++){
eventStr +=event[i]+",";
}
eventStr = eventStr.substring(0,eventStr.length-1);
}else{
eventStr = event;
} }
let s = eventStr.substring(0,eventStr.length-1);
if(!updateId){ if(!updateId){
// //
const url = `/ci/pipelines.json`; const url = `/ci/pipelines.json`;
axios.post(url,{ axios.post(url,{
pipeline_name, pipeline_name,
file_name:".trustie-pipeline.yml", file_name:".trustie-pipeline.yml",
repo:projectsId,branch,event:s,owner repo:projectsId,branch,event:eventStr,owner
}).then(result=>{ }).then(result=>{
setVisible(false); setVisible(false);
if(result && result.data){ if(result && result.data){
@ -103,7 +107,7 @@ function Dispose(props){
// //
const url = `/ci/pipelines/${updateId}.json`; const url = `/ci/pipelines/${updateId}.json`;
axios.put(url,{ axios.put(url,{
pipeline_name,repo:projectsId,branch,event:s,owner pipeline_name,repo:projectsId,branch,event:eventStr,owner
}).then(result=>{ }).then(result=>{
if(result && result.data){ if(result && result.data){
setVisible(false); setVisible(false);

View File

@ -32,7 +32,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
ellipsis:true, ellipsis:true,
render:(value,item)=>{ render:(value,item)=>{
return( return(
<Link to={`/projects/${owner}/${projectsId}?url=${value}`} className="color-blue">{value}</Link> <Link to={`/projects/${owner}/${projectsId}/branch/${item.branch}?url=${value}`} className="color-blue">{value}</Link>
) )
} }
}, },