forked from Gitlink/forgeplus-react
url
This commit is contained in:
parent
e65a1debc5
commit
ea77a13b6f
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue