educoder项目添加只读标识

This commit is contained in:
caishi 2021-12-09 17:31:34 +08:00
parent 4db125545f
commit 56c8f7fa82
5 changed files with 58 additions and 25 deletions

View File

@ -3945,6 +3945,10 @@ html>body #ajax-indicator {
margin-left: 10px;
color: #2FC25B;
}
.privateTag.red{
color: #FF6832;
border:1px solid #FF6832;
}
.head-nav {
text-align: center;
height: 58px;

View File

@ -23,6 +23,7 @@ import Nodata from '../Nodata';
import Invite from './sub/Invite';
import CheckProfile from '../Component/ProfileModal/Profile';
import RenderHtml from '../../components/render-html';
import { Base64 } from 'js-base64';
/**
* projectDetail.type:0是托管项目1是镜像项目2是同步镜像项目(为2时不支持在线创建在线上传在线修改在线删除创建合并请求等功能)
*/
@ -352,7 +353,7 @@ function CoderDepot(props){
const { current_user } = props;
const baseOper = current_user && current_user.login && issuesFlag;
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag;
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag && props.platform;
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
return(
@ -402,7 +403,7 @@ function CoderDepot(props){
<span>分支<span className="color-grey-6">{branchName || defaultBranch}</span></span>
}
</div>
{
{
treeValuePath && treeValuePath.length > 0 ?
<Path
identifier={projectDetail && projectDetail.identifier}
@ -414,18 +415,35 @@ function CoderDepot(props){
:
<React.Fragment>
<AlignCenter className="mr20">
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
<i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches_count}</span>
</Link>
{
props.platform ?
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
<i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches_count}</span>
</Link>
:
<span>
<i className="iconfont icon-master_icon font-16 color-grey-6"></i>
<span className="ml3 color-grey-6">分支</span>
<span className="ml3">{projectDetail && projectDetail.branches_count}</span>
</span>
}
</AlignCenter>
<AlignCenter className="mr20">
{
props.platform ?
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags_count}</span>
</Link>
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags_count}</span>
</Link>:
<span>
<i className="iconfont icon-biaoqianicon font-16 color-grey-6"></i>
<span className="ml3 color-grey-6">标签</span>
<span className="ml3">{projectDetail && projectDetail.tags_count}</span>
</span>
}
</AlignCenter>
</React.Fragment>
}
@ -577,7 +595,7 @@ function CoderDepot(props){
}
{/* 发布 */}
{
releaseVersions &&
releaseVersions && props.platform &&
<React.Fragment>
<Divider />
<Releases

View File

@ -507,6 +507,7 @@ class Detail extends Component {
<Link to={`/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>
</div>
{projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
{ !platform && <span className="privateTag red mt6">只读</span> }
</AlignTop>
<div className="mt8">
{

View File

@ -67,16 +67,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li>:""
}
{
item.menu_name === "versions" &&
<li className={pathname === "wiki" ? "active" : ""}>
<Link to={{ pathname: `/${owner}/${projectsId}/wiki`, state }}>
<i className={"iconfont icon-a-wikiicon1 color-grey-3 mr5 font-14"}></i>
<span>维基(Wiki)</span>
</Link>
</li>
}
{
item.menu_name === "wiki" && platform ?
item.menu_name === "devops" ?
<li className={pathname==="devops" ? "active" : ""}>
{/* <Link to={{ pathname: `/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}> */}
<Link to={{ pathname: `/${owner}/${projectsId}/devops`, state:{...state,open_devops} }}>
@ -97,7 +88,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li>
} */}
{
item.menu_name === "devops" &&
item.menu_name === "versions" &&
<li className={pathname==="milestones" ? "active" : ""}>
<Link to={{ pathname: `/${owner}/${projectsId}/milestones`, state }}>
<i className={pathname==="milestones" ? "iconfont icon-lichengbeiicon color-grey-3 mr5 font-14":"iconfont icon-lichengbeiicon color-grey-6 font-14 mr5"}></i>
@ -106,6 +97,15 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</Link>
</li>
}
{
item.menu_name === "wiki" &&
<li className={pathname === "wiki" ? "active" : ""}>
<Link to={{ pathname: `/${owner}/${projectsId}/wiki`, state }}>
<i className={"iconfont icon-a-wikiicon1 color-grey-3 mr5 font-14"}></i>
<span>维基(Wiki)</span>
</Link>
</li>
}
{
item.menu_name === "activity" &&
<li className={pathname==="activity" ? "active" : ""}>
@ -116,7 +116,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li>
}
{
item.menu_name === "settings" &&
item.menu_name === "settings" && platform &&
<li className={pathname === "settings" ? "active" : ""}>
<Link to={`/${owner}/${projectsId}/settings`}>
<i className={url && url.indexOf("/settings") > 0 ? "iconfont icon-cangkushezhiicon color-grey-3 mr5 font-14":"iconfont icon-cangkushezhiicon color-grey-6 font-14 mr5"}></i>

View File

@ -5,11 +5,21 @@ import { Link } from 'react-router-dom';
import { getImageUrl } from 'educoder';
import { Dropdown , Menu , Spin } from 'antd';
import './Index.scss';
import { Base64 } from 'js-base64';
import Tree from '../img/tree.png';
import Axios from 'axios';
function turnbar(str){
// const s = '!@/:"<>|%$¥';
// for(var i=0;i<s.length;i++){
// let s1 = s[i];
// if(str.indexOf(s1) > -1){
// return Base64.encode(str);
// }else{
// continue;
// }
// }
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
@ -91,7 +101,7 @@ function Index(props) {
<div className="treeabout">
{
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
<Link to={`/${owner}/${projectsId}/compare/master...${i.name}`} className="btn-83">+ 合并请求</Link>
<Link to={`/${owner}/${projectsId}/compare/master...${turnbar(i.name)}`} className="btn-83">+ 合并请求</Link>
}
<Dropdown overlay={menu(i.zip_url,i.tar_url)} trigger={['click']} placement="bottomRight">
<a className="btn-83 ml15">下载<i className="iconfont icon-sanjiaoxing-down font-14"></i></a>