From e3d8f926ac225f6c238ca3068a9fcafa370895af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 10 May 2024 11:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E6=94=AF=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=BC=B9=E6=A1=86=E5=A2=9E=E5=8A=A0=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reposyncer/component/addTaskModal.jsx | 29 ++++++++++++++++--- src/forge/Server/reposyncer/index.scss | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/forge/Server/reposyncer/component/addTaskModal.jsx b/src/forge/Server/reposyncer/component/addTaskModal.jsx index c67fa6e9..f19ae634 100644 --- a/src/forge/Server/reposyncer/component/addTaskModal.jsx +++ b/src/forge/Server/reposyncer/component/addTaskModal.jsx @@ -1,16 +1,30 @@ import React, {useEffect, useState} from 'react'; import { Button, Modal, Input, Select, message, Form } from 'antd'; import axios from 'axios'; -import { synchronizeTips } from './editStore'; +import { confirmInfo1, confirmInfo2, synchronizeTips } from './editStore'; import gitHub from '../../img/github.png'; import gitee from '../../img/gitee.png'; +import '../index.scss'; function DeleteBox({owner, projectsId, visible, setVisible, branchList, reload, form, sync_repositories_unique=[]}) { - const { getFieldDecorator, validateFields , resetFields } = form; + const { getFieldDecorator, validateFields , resetFields, getFieldsValue } = form; // 选择仓库类型 const [platform, setPlatform] = useState(); // 已添加的仓库类型 const repoTypes = sync_repositories_unique.map(item=>{return item.type}) + const {type, external_branch_name, gitlink_branch_name, first_sync_direction} = getFieldsValue(); + const showConfrimContent = external_branch_name && gitlink_branch_name && first_sync_direction; + const externalRepoBySelected = type && sync_repositories_unique.filter(item=>item.type.includes(type))[0] + const externalRepoInfo = { + address: externalRepoBySelected && externalRepoBySelected.external_repo_address, + branchName: external_branch_name, + type + } + const gitlinkRepoInfo = { + address: `${window.location.origin}/${owner}/${projectsId}.git`, + branchName: gitlink_branch_name, + type: "gitlink" + } useEffect(()=>{ if(repoTypes.length === 1){ @@ -49,8 +63,8 @@ function DeleteBox({owner, projectsId, visible, setVisible, branchList, reload, visible={visible} onCancel={()=>{setVisible(false)}} footer={
} - width={550} - className="cancelBound" + width={650} + className="reposyncerModal" >
{repoTypes.length > 1 && @@ -98,6 +112,13 @@ function DeleteBox({owner, projectsId, visible, setVisible, branchList, reload, {synchronizeTips(platform)} + {showConfrimContent &&
+ {confirmInfo1()} + {confirmInfo2({ + mainBranch: first_sync_direction === "1" ? gitlinkRepoInfo : externalRepoInfo, + branch: first_sync_direction === "1" ? externalRepoInfo : gitlinkRepoInfo + })} +
} ) } diff --git a/src/forge/Server/reposyncer/index.scss b/src/forge/Server/reposyncer/index.scss index 9516cafc..a026467c 100644 --- a/src/forge/Server/reposyncer/index.scss +++ b/src/forge/Server/reposyncer/index.scss @@ -233,7 +233,7 @@ } .reposyncerModal{ .ant-modal-header{ - // padding: 5px 24px; + padding: 5px 24px; background: rgba(70,106,255,0.09); .ant-modal-title{ font-weight: normal !important;