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

View File

@ -32,7 +32,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
ellipsis:true,
render:(value,item)=>{
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>
)
}
},