forked from Gitlink/forgeplus-react
非管理员访问引擎tab显示无权限
This commit is contained in:
parent
40e88d95d8
commit
b50bcef4d8
|
@ -25,7 +25,7 @@ if (isDev) {
|
|||
}
|
||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
|
||||
}
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, {useEffect} from 'react';
|
||||
import { WhiteBack } from '../Component/layout';
|
||||
import './ops.scss';
|
||||
|
||||
import devops from '../Images/devops.png';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import Loadable from 'react-loadable';
|
||||
import Loading from '../../Loading';
|
||||
|
@ -32,8 +32,7 @@ const Params = Loadable({
|
|||
})
|
||||
|
||||
export default ((props)=>{
|
||||
console.log('props', props);
|
||||
const {jianmu_devops} = props;
|
||||
const {jianmu_devops, isManager} = props;
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener("message", iframeHeight, false);
|
||||
|
@ -44,7 +43,6 @@ export default ((props)=>{
|
|||
|
||||
|
||||
function iframeHeight(e){
|
||||
console.log('e',e&&typeof(e.data), e);
|
||||
if (e && e.data && typeof(e.data) === "string") {
|
||||
let myHeight = JSON.parse(e.data);
|
||||
if (document.querySelector("#devopsIframe")) {
|
||||
|
@ -65,9 +63,16 @@ export default ((props)=>{
|
|||
}
|
||||
|
||||
return(
|
||||
<WhiteBack className="opsPanel main">
|
||||
<WhiteBack className={`opsPanel ${isManager ? 'main' : ''}`}>
|
||||
{/* 嵌入devops */}
|
||||
{jianmu_devops && <iframe title={`devopsIframe`} src={`https://ci-v3.test.jianmuhub.com/oauth2/authorize?code=${jianmu_devops}`} id={`devopsIframe`} frameBorder="0" name={`devopsIframe`} width="100%" onLoad={iframeLoad} height={'auto'}></iframe>}
|
||||
{jianmu_devops && isManager && <iframe title={`devopsIframe`} src={`https://ci-v3.test.jianmuhub.com/oauth2/authorize?code=${jianmu_devops}`} id={`devopsIframe`} frameBorder="0" name={`devopsIframe`} width="100%" onLoad={iframeLoad} height={'auto'}></iframe>}
|
||||
{!isManager && <div className='nullJurisdictionBox'>
|
||||
<div className='jurTil font-16'>引擎配置</div>
|
||||
<div className='jurCont mt25'>
|
||||
<img src={devops} alt="" width={110}/>
|
||||
<div className='font-18 mt30'>暂无权限,仅仓库管理员可访问</div>
|
||||
</div>
|
||||
</div>}
|
||||
{/* 旧引擎页面 */}
|
||||
{/* <Switch {...props}>
|
||||
<Route path="/:owner/:projectsId/devops/params"
|
||||
|
|
|
@ -522,4 +522,22 @@
|
|||
border:1px solid #999;
|
||||
color:#999 ;
|
||||
}
|
||||
}
|
||||
.nullJurisdictionBox{
|
||||
color:#333333;
|
||||
.jurTil{
|
||||
width:1200px;
|
||||
padding: 15px 16px;
|
||||
background-color:#fafcff;
|
||||
border:1px solid rgba(42, 97, 255, 0.23);
|
||||
border-radius:3px 3px 0px 0px;
|
||||
}
|
||||
.jurCont{
|
||||
width:1200px;
|
||||
height:317px;
|
||||
padding-top: 45px;
|
||||
background-color:#fafcff;
|
||||
border-radius:4px 4px 0px 0px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -85,7 +85,7 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur
|
|||
}
|
||||
{/* 引擎仅对当前仓库管理员可见 */}
|
||||
{
|
||||
item.menu_name === "devops" && isManager ?
|
||||
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} }}>
|
||||
|
|
Loading…
Reference in New Issue