跳转地址

This commit is contained in:
黄心宇 2025-03-28 14:31:13 +08:00
parent 0b81808835
commit 74c6b76adb
2 changed files with 12 additions and 5 deletions

View File

@ -14,6 +14,10 @@ function CardDevops(props) {
const [list, setList] = useState([])
const [ visible , setVisible ] = useState(false);
let settings = JSON.parse(localStorage.chromesetting);
let pipelineUrl = settings && settings.common.pipeline;
useEffect(() => {
const { author, name } = project || {}
document.title = `流水线-${author && author.name}/${name}`;
@ -66,7 +70,7 @@ function CardDevops(props) {
runPipeline( owner, projectsId, { ref: item.branch, workflow: item.file_name.split('/').pop() }).then(res => {
if(res && res.status === 0) {
message.success('运行成功!')
window.open(`http://localhost:8000/devops/${owner}/${projectsId}/${item.id}`)
window.open(`${ pipelineUrl }/devops/${owner}/${projectsId}/${item.id}`)
}
})
}
@ -112,7 +116,7 @@ function CardDevops(props) {
<div className="cardContent">
<div onClick={()=>{
// window.location.href = `${mygetHelmetapi && mygetHelmetapi.common.zone}/${owner}/pipeline/${e.id}`
window.open(`http://localhost:8000/devops/${owner}/${projectsId}/${e.id}`)
window.open(`${ pipelineUrl }/devops/${owner}/${projectsId}/${e.id}`)
}}>
<div className="cartHead">
<div className={e.pipeline_type === 1 ? "f36" : ''}>{listType[e.pipeline_type]}</div>
@ -132,7 +136,7 @@ function CardDevops(props) {
<div className="cartBottom" >
<div className="leftButton">
<img src={ require('../../../images/devOps/start.png') } alt="" onClick={ () => run(e) }/>
<img src={ require('../../../images/devOps/edit.png') } alt="" onClick={ () => window.open(`http://localhost:8000/devops/${owner}/${projectsId}/${e.id}/edit`) }/>
<img src={ require('../../../images/devOps/edit.png') } alt="" onClick={ () => window.open(`${ pipelineUrl }/devops/${owner}/${projectsId}/${e.id}/edit`) }/>
<img src={ require('../../../images/devOps/delete.png') } alt="" onClick={ () => delPipelineFunc(e.id) }/>
</div>
<div className="rightButton">

View File

@ -26,12 +26,15 @@ const New =({
const { getFieldDecorator } = form;
const {owner, projectsId} = match.params;
const [ loading, setLoading ] = useState(false);
// const [ loading, setLoading ] = useState(false);
const [ pipelineType, setPipelineType ] = useState(pipType.code);
const [ branchList, setBranchList] = useState([]);
const [ templateList, setTemplateList ] = useState([]);
const [ templateSelected, setTemplateSelected ] = useState(-1);
let settings = JSON.parse(localStorage.chromesetting);
let pipelineUrl = settings && settings.common.pipeline;
useEffect(() => {
if(open){
getTemplates();
@ -69,7 +72,7 @@ const New =({
if(res.id){
form.resetFields();
onOk()
window.open(`http://localhost:8000/devops/${owner}/${projectsId}/${res.id}/edit`)
window.open(`${ pipelineUrl }/devops/${owner}/${projectsId}/${res.id}/edit`)
}
})
}