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