diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 932b9d22..7db7d6bb 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -3,6 +3,7 @@ import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ import { Dropdown , Menu , Divider , Spin } from 'antd'; import { getImageUrl } from "educoder"; import { Link } from 'react-router-dom'; +import CloneAddress from '../Branch/CloneAddress'; import SelectBranch from '../Branch/Select'; import User from '../Component/User'; @@ -142,8 +143,8 @@ function CoderDepot(props){ // 文件相关的下拉项 const fileMenu =( - 上传文件 - 新建文件 + urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件 + urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件 ) @@ -186,11 +187,26 @@ function CoderDepot(props){ setHide(!hide); } + function urlLink(link){ + if(props.checkIfLogin()===false){ + props.showLoginDialog() + return false; + } + props.history.push(link); + } + const downloadMenu = ( - - ZIP - TAR.GZ - +
+
+ +
+ + 下载 ZIP + 下载 TAR.GZ + +
) return( @@ -250,8 +266,8 @@ function CoderDepot(props){
- + 合并请求 - + 任务 + urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务
{ type === "dir" && 文件} 下载 diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 525f71d3..e144a33d 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -269,4 +269,8 @@ i{ color: #d9d9d9; } +} +.downMenu{ + box-shadow: 0px 0px 9px rgba(134, 134, 134,0.4); + background-color: #fff; } \ No newline at end of file