forked from Gitlink/forgeplus-react
Compare commits
1 Commits
mulanoss_g
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
81b3a58f00 |
File diff suppressed because it is too large
Load Diff
|
|
@ -187,7 +187,7 @@
|
|||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"proxy": "http://localhost:3000",
|
||||
"proxy": "http://localhost:3001",
|
||||
"port": "3007",
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "7.0.0-beta.51",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState, useCallback, memo, useEffect } from 'react';
|
||||
import React, { useState, useCallback, memo } from 'react';
|
||||
import { Tooltip } from 'antd';
|
||||
|
||||
CopyTool.defaultProps = {
|
||||
|
|
@ -10,15 +10,16 @@ CopyTool.defaultProps = {
|
|||
};
|
||||
|
||||
|
||||
function CopyTool({ beforeText, afterText, className , inputId , timeOut , text }) {
|
||||
function CopyTool({ beforeText, afterText, className , inputId , timeOut }) {
|
||||
const [title, setTitle] = useState(() => {
|
||||
return beforeText;
|
||||
});
|
||||
|
||||
// 复制链接
|
||||
const copyUrl = useCallback(() => {
|
||||
const copyEle = document.querySelector(`#${inputId}`); // 获取要复制的节点
|
||||
if (!copyEle) {
|
||||
console.error(`您的CopyTool未设置正确的inputId${inputId}`);
|
||||
console.error("您的CopyTool未设置正确的inputId");
|
||||
return;
|
||||
}
|
||||
copyEle.select(); // 执行选中元素
|
||||
|
|
@ -36,17 +37,12 @@ function CopyTool({ beforeText, afterText, className , inputId , timeOut , text
|
|||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
<Tooltip
|
||||
placement="top"
|
||||
title={title}
|
||||
onVisibleChange={() => { setTitle(beforeText) }}
|
||||
>
|
||||
{text?
|
||||
<a className="color-blue" onClick={copyUrl}>{text}</a>
|
||||
:
|
||||
<i className={`iconfont icon-fuzhiicon ${className}`} style={{ color: '#466aff' }} onClick={copyUrl}></i>
|
||||
}
|
||||
<i className={`iconfont icon-fuzhiicon ${className}`} style={{ color: '#466aff' }} onClick={copyUrl}></i>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,11 +16,49 @@ function Footer(){
|
|||
var html = {__html:htmlString};
|
||||
return <div dangerouslySetInnerHTML={html}></div> ;
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<div style={{height:"543px"}}></div>
|
||||
<div className="newFooter edu-txt-center">
|
||||
{value && showhtml(value)}
|
||||
{/* <div className="footerInfos">
|
||||
<ul>
|
||||
<li>社区</li>
|
||||
<li><a href={`/`} target="_blank">网站首页</a></li>
|
||||
<li><a href={`https://www.trustie.net/agreement`} target="_blank">服务协议</a></li>
|
||||
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
|
||||
<li><a href={`https://forum.trustie.net/`} target="_blank">问吧交流</a></li>
|
||||
<li><a href={`https://www.trustie.net/cooperation`} target="_blank">合作伙伴</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>支持与服务</li>
|
||||
<li><a href={`https://forgeplus.trustie.net/docs/api`} target="_blank">API文档</a></li>
|
||||
<li><a href={`https://forum.trustie.net/forums/1168/detail`} target="_blank">帮助中心</a></li>
|
||||
<li><a href={`https://git-scm.com`} target="_blank">Git常用命令</a></li>
|
||||
<li><a href={`https://forum.trustie.net/forums/3080/detail`} target="_blank">DevOps使用文档</a></li>
|
||||
<li><a href={`https://forgeplus.trustie.net/projects/jasder/forgeplus/tree/master/CHANGELOG.md`} target="_blank">日志更新</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>合作伙伴</li>
|
||||
<li><a href={`http://www.sei.pku.edu.cn`} target="_blank">北京大学</a></li>
|
||||
<li><a href={`http://scse.buaa.edu.cn`} target="_blank">北京航空航天大学</a></li>
|
||||
<li><a href={`https://www.nju.edu.cn`} target="_blank">南京大学</a></li>
|
||||
<li><a href={`https://www.xtu.edu.cn`} target="_blank">湘潭大学</a></li>
|
||||
<li><a href={`http://www.iscas.ac.cn`} target="_blank">ISCAS</a></li>
|
||||
<li><a href={`https://www.ucloud.cn`} target="_blank">UCloud优刻得</a></li>
|
||||
<li><a href={`http://www.inforbus.com`} target="_blank">中创软件</a></li>
|
||||
<li><a href={`https://www.inspur.com`} target="_blank">浪潮集团</a></li>
|
||||
<li><a href={`http://www.copu.org.cn`} target="_blank">中国开源软件推进联盟</a></li>
|
||||
<li><a href={`https://www.sjtu.edu.cn`} target="_blank">上海交通大学</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>合作伙伴</li>
|
||||
<li><span>热线:</span></li>
|
||||
<li><span>QQ群:1071514693</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p className="footerCopy">© Copyright 2007~2021 国防科技大学Trustie团队 & IntelliDE <a href="https://beian.miit.gov.cn">湘ICP备 17009477号</a></p> */}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 Badge from "./sub/Badge";
|
||||
/**
|
||||
* projectDetail.type:0是托管项目,1是镜像项目,2是同步镜像项目(为2时不支持在线创建、在线上传、在线修改、在线删除、创建合并请求等功能)
|
||||
*/
|
||||
|
|
@ -63,7 +64,6 @@ function CoderDepot(props){
|
|||
const [ desc , setDesc ] = useState(undefined);
|
||||
const [ website , setWebsite ] = useState(undefined);
|
||||
const [ lesson_url , setLessonUrl ] = useState(undefined);
|
||||
const [ sonar_url , setSonarUrl ] = useState(undefined);
|
||||
const [ readme , setReadme ] = useState(undefined);
|
||||
const [ defaultBranch , setDefaultBranch ] = useState(undefined);
|
||||
const [ editReadme , setEditReadme ] = useState(false);
|
||||
|
|
@ -81,6 +81,12 @@ function CoderDepot(props){
|
|||
const distribution = details && details.type != 2 && (details.permission === "Admin" || details.permission === "Owner" || details.permission === "Manager");
|
||||
const { bannerList } = props;
|
||||
|
||||
|
||||
// test data
|
||||
const badges = {badge:[{ "login": "many_stars", "image_url": "https://www.gitlink.org.cn/system/lets/letter_avatars/2/J/236_194_58/120.png", "description": "test description1"}, {"login": "many_stars", "image_url": "https://www.gitlink.org.cn/system/lets/letter_avatars/2/X/181_166_38/120.png", "description": "test description2"}], total_count: 3}
|
||||
console.log(badges.badge)
|
||||
console.log(badges.total_count)
|
||||
|
||||
useEffect(()=>{
|
||||
if(bannerList && bannerList.length>0){
|
||||
let a = bannerList.filter(i=>i.menu_name === "pulls");
|
||||
|
|
@ -101,7 +107,6 @@ function CoderDepot(props){
|
|||
setDesc(details.description);
|
||||
setWebsite(details.website);
|
||||
setLessonUrl(details.lesson_url);
|
||||
setSonarUrl(details.sonar_url);
|
||||
setDefaultBranch(details.default_branch);
|
||||
setInviteCode(details.invite_code);
|
||||
}
|
||||
|
|
@ -140,7 +145,7 @@ function CoderDepot(props){
|
|||
if(result && result.data){
|
||||
const release = {
|
||||
"list":result.data.releases,
|
||||
"total_count":result.data.releases ? result.data.releases.length :0
|
||||
"total_count":result.data.releases.length
|
||||
}
|
||||
setReleaseVersions(release);
|
||||
}
|
||||
|
|
@ -336,7 +341,6 @@ function CoderDepot(props){
|
|||
setDesc(result.data.description);
|
||||
setWebsite(result.data.website);
|
||||
setLessonUrl(result.data.lesson_url);
|
||||
setSonarUrl(result.data.sonar_url);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -349,6 +353,7 @@ function CoderDepot(props){
|
|||
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
||||
|
||||
return(
|
||||
|
||||
<WhiteBack>
|
||||
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>
|
||||
<Spin spinning={isSpin}>
|
||||
|
|
@ -372,7 +377,8 @@ function CoderDepot(props){
|
|||
</React.Fragment>
|
||||
}
|
||||
<div style={{minHeight:"500px"}}>
|
||||
{
|
||||
{
|
||||
|
||||
projectDetail &&
|
||||
<Box className="Panels">
|
||||
<LongWidth>
|
||||
|
|
@ -553,6 +559,19 @@ function CoderDepot(props){
|
|||
<Invite code={inviteCode}/>
|
||||
</div>
|
||||
}
|
||||
{/*{*/}
|
||||
{/* inviteCode &&*/}
|
||||
{/* <div>*/}
|
||||
{/* <Badge code={inviteCode}/>*/}
|
||||
{/* </div>*/}
|
||||
{/*}*/}
|
||||
|
||||
{/* 徽章 */}
|
||||
{
|
||||
badges && badges.total_count >0 &&
|
||||
<Badge badges={badges} owner={owner} />
|
||||
}
|
||||
|
||||
{
|
||||
lesson_url &&
|
||||
<div>
|
||||
|
|
@ -561,26 +580,6 @@ function CoderDepot(props){
|
|||
<a href={lesson_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline",wordBreak:"break-all"}}>{lesson_url}</a>
|
||||
</div>
|
||||
}
|
||||
{/* {
|
||||
|
||||
<div>
|
||||
<Divider />
|
||||
<p className="font-16 color-ooo">质量分析</p>
|
||||
{
|
||||
sonar_url ?
|
||||
<a href={sonar_url} target="_blank" className="color-grey-6" style={{textDecoration:"underline",wordBreak:"break-all"}}>{sonar_url}</a>
|
||||
:
|
||||
<span>
|
||||
<span>暂时还没有检测结果</span>
|
||||
{
|
||||
projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" ?
|
||||
<Link to={`/${owner}/${projectsId}/settings/webhooks/new`} className="color-blue ml20">去检测</Link>
|
||||
:""
|
||||
}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
} */}
|
||||
{/* 发布 */}
|
||||
{
|
||||
releaseVersions &&
|
||||
|
|
|
|||
|
|
@ -69,11 +69,7 @@ const MergeIndexDetail = Loadable({
|
|||
loader: () => import('../Merge/merge'),
|
||||
loading: Loading,
|
||||
})
|
||||
// 代码质量分析
|
||||
const Sonar = Loadable({
|
||||
loader: () => import('../Sonar/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
const CreateMerge = Loadable({
|
||||
loader: () => import('../Merge/CreateMerge'),
|
||||
loading: Loading,
|
||||
|
|
@ -171,8 +167,6 @@ function checkPathname(projectsId, owner, pathname) {
|
|||
name = "source"
|
||||
} else if (url.indexOf(`/wiki`) > -1) {
|
||||
name = "wiki"
|
||||
} else if (url.indexOf(`/sonar`) > -1) {
|
||||
name = "sonar"
|
||||
}
|
||||
}
|
||||
return name;
|
||||
|
|
@ -778,11 +772,6 @@ class Detail extends Component {
|
|||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/:owner/:projectsId/sonar"
|
||||
render={
|
||||
(props) => (<Sonar {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/:owner/:projectsId/following"
|
||||
render={
|
||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
|
|
|
|||
|
|
@ -200,6 +200,26 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.attrBadge{
|
||||
padding-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 2px;
|
||||
a{
|
||||
margin: 0px 17px 10px 0px;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
&:nth-child(5n){
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.progress{
|
||||
display: flex;
|
||||
border-radius: 2px;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@
|
|||
li{
|
||||
text-align: center;
|
||||
padding:0px;
|
||||
margin-right: 35px;
|
||||
margin-right: 40px;
|
||||
display: flex;
|
||||
& > a{
|
||||
position: relative;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { AlignCenter , FlexAJ } from '/home/gitlink/forgeplus/public/react/forgeplus-react/src/forge/Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Popover , Spin , Button } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import '/home/gitlink/forgeplus/public/react/forgeplus-react/src/forge/Component/Component.scss';
|
||||
|
||||
|
||||
|
||||
|
||||
// projectDetail && projectDetail.contributors && projectDetail.contributors.total_count >0 &&
|
||||
// <Badge contributors={projectDetail.contributors} owner={owner} projectsId={projectsId} />?
|
||||
|
||||
function Badge({badges,owner}){
|
||||
const [ list , setList ]= useState(undefined);
|
||||
const [ total , setTotal ]= useState(0);
|
||||
const [ menu , setMenu ] = useState("");
|
||||
const [ login , setLogin ] = useState(undefined);
|
||||
const [ badge , setBadge ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
if(badges && badges.total_count>0){
|
||||
setTotal(badges.total_count);
|
||||
setList(badges.badge);
|
||||
}
|
||||
},[badges])
|
||||
|
||||
useEffect(()=>{
|
||||
setMenusFunc(badge);
|
||||
},[badge])
|
||||
|
||||
|
||||
function setMenusFunc(data){
|
||||
if(data){
|
||||
let ele = (
|
||||
<AlignCenter>
|
||||
<Link to={`/${data.login}`}><img src={data.image_url} alt="" className="radius" width="38px" height="38px"/></Link>
|
||||
<div className="ml10">
|
||||
<Link to={`/${data.login}`}>{data.name}</Link>
|
||||
{ data.description && <span className="leftline">{data.description}</span> }
|
||||
</div>
|
||||
</AlignCenter>
|
||||
)
|
||||
setMenu(ele);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setVisibleFunc(flag,l,index){
|
||||
if(l !== badge){
|
||||
setBadge(l);
|
||||
}
|
||||
var lx = list.concat();
|
||||
lx.map(i=>i.visible =false);
|
||||
if(flag){
|
||||
lx[index].visible = flag;
|
||||
}
|
||||
lx.splice();
|
||||
setList(lx);
|
||||
}
|
||||
|
||||
// {
|
||||
// "list": [
|
||||
// {
|
||||
// "login": "many_stars",
|
||||
// "image_url": "User",
|
||||
// "description": "test description"
|
||||
// },
|
||||
// {
|
||||
// "login": "many_stars",
|
||||
// "image_url": "User",
|
||||
// "description": "test description"
|
||||
// }
|
||||
// ],
|
||||
// "total_count": 2
|
||||
// }
|
||||
return(
|
||||
<div className="halfs">
|
||||
<Link to={`/${owner}/badge`} className="font-16 color-ooo hoverA">
|
||||
<span>徽章</span>
|
||||
{ badges && badges.total_count > 0 && <span className="infoCount">{badges.total_count}</span>}
|
||||
</Link>
|
||||
|
||||
<div className="attrBadge" onMouseLeave={()=>setVisibleFunc(false)}>
|
||||
{
|
||||
total > 0 ?
|
||||
list.map((item,key)=>{
|
||||
return(
|
||||
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
||||
<Link key={key} to={`/${item.login}`}>
|
||||
<img src={item.image_url} alt="" onMouseOver={()=>setVisibleFunc(true,item,key)}/>
|
||||
</Link>
|
||||
</Popover>
|
||||
)
|
||||
})
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
//{getImageUrl(`/${item.image_url}`)}
|
||||
export default Badge;
|
||||
|
|
@ -128,12 +128,6 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
|||
)
|
||||
})
|
||||
}
|
||||
<li className={pathname==="sonar" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/${owner}/${projectsId}/sonar`, state }}>
|
||||
<i className={"iconfont icon-banbenicon color-grey-3 mr5 font-14"}></i>
|
||||
<span>代码质量分析</span>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
:
|
||||
<Skeleton paragraph={false} active={true}/>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ function turnbar(str){
|
|||
}
|
||||
return str;
|
||||
}
|
||||
const port = window.location.port;
|
||||
const hostname = window.location.hostname;
|
||||
class MergeItem extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -168,17 +166,24 @@ class MergeItem extends Component {
|
|||
)}
|
||||
</li>
|
||||
<li>{item.version || "--"}</li>
|
||||
|
||||
<li>
|
||||
<div className="flex1 df" style={{ justifyContent: "center" }}>
|
||||
{item.journals_count ?
|
||||
<div
|
||||
className="flex1 df"
|
||||
style={{ justifyContent: "center" }}
|
||||
>
|
||||
{item.journals_count ? (
|
||||
<Link
|
||||
className="mr5 color-grey-8"
|
||||
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}`}
|
||||
>
|
||||
<i className="iconfont icon-huifu1 font-15 mr5 ver-middle"></i>{item.journals_count}
|
||||
</Link>:""
|
||||
}
|
||||
{user_admin_or_developer && item.pull_request_status === 0 &&
|
||||
<i className="iconfont icon-huifu1 font-15 mr5 ver-middle"></i>
|
||||
{item.journals_count}
|
||||
</Link>
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
{user_admin_or_developer && item.pull_request_status === 0 ? (
|
||||
<div
|
||||
className="milepostleft"
|
||||
style={{
|
||||
|
|
@ -189,7 +194,7 @@ class MergeItem extends Component {
|
|||
: "none",
|
||||
}}
|
||||
>
|
||||
<div className="grid-item color-grey-9">
|
||||
<div className="grid-item mr15 color-grey-9">
|
||||
<Link
|
||||
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/edit`}
|
||||
className="color-grey-9"
|
||||
|
|
@ -198,10 +203,11 @@ class MergeItem extends Component {
|
|||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
) : (
|
||||
""
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
<li style={{width:"50px",textAlign:"left"}}><a className="color-blue" target="_blank" href={`http://106.75.189.31:5000/result?SrcPR=${port ? `${hostname}:${port}`:`https://${hostname}`}/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}>查重</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -382,7 +382,6 @@ class merge extends Component {
|
|||
</span>
|
||||
</Dropdown>
|
||||
</li>
|
||||
<li style={{width:"50px"}}></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style={{minHeight:"470px"}}>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
button {
|
||||
color: #333333;
|
||||
background: #FAFBFC;
|
||||
border: 1px solid #D0D0D0;
|
||||
border-radius: 4px;
|
||||
height: 32px;
|
||||
}
|
||||
button:hover {
|
||||
background: #F3F4F6;
|
||||
}
|
||||
button:active {
|
||||
background: #EBECF0;
|
||||
}
|
||||
|
||||
.deleteBut{
|
||||
color: #DF0002;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@
|
|||
background: #FAFCFF;
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
border: 1px solid rgba(42, 97, 255, 0.23);
|
||||
padding:5px 20px;
|
||||
height: 50px;
|
||||
padding:0px 20px;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -167,19 +168,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.checkModalStyle{
|
||||
.ant-modal-header{
|
||||
padding:8px 20px;
|
||||
.ant-modal-title{
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.ant-modal-close{
|
||||
top:0px!important;
|
||||
}
|
||||
input{
|
||||
width: 222px;
|
||||
border:none;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ import axios from 'axios';
|
|||
import PushHistory from './sub/PushHistory';
|
||||
import DeleteBox from '../../Component/DeleteModal/Index';
|
||||
import './Index.scss';
|
||||
import CheckModal from './sub/CheckModal';
|
||||
|
||||
// ,"issue_assign","issue_label","issue_milestone","issue_comment","issue_only","fork",
|
||||
//"pull_request_milestone","pull_request_sync","pull_request_comment","repository","pull_request_label"
|
||||
|
|
@ -22,10 +21,6 @@ function New({ form , match , showNotification , history }) {
|
|||
const [ data , setData ] = useState(undefined);
|
||||
const [ eventFlag , setEventFlag ] = useState(false);
|
||||
|
||||
const [ checkVisible , setCheckVisible ] = useState(false);
|
||||
const [ checkContent , setCheckContent ] = useState(1);
|
||||
|
||||
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||
const { id , owner , projectsId } = match.params;
|
||||
|
||||
|
|
@ -174,18 +169,8 @@ function New({ form , match , showNotification , history }) {
|
|||
lineHeight: '30px',
|
||||
};
|
||||
|
||||
function OpenCheckModal(params) {
|
||||
setCheckContent(params);
|
||||
setCheckVisible(true);
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="newPanel">
|
||||
<CheckModal
|
||||
visible={checkVisible}
|
||||
content={checkContent}
|
||||
onCancel={()=>setCheckVisible(false)}
|
||||
/>
|
||||
<DeleteBox
|
||||
visible={visible}
|
||||
onCancel={()=>setVisible(false)}
|
||||
|
|
@ -200,12 +185,7 @@ function New({ form , match , showNotification , history }) {
|
|||
<span>{id ? "更新" : "添加"}Webhook</span>
|
||||
</Banner>
|
||||
<div>
|
||||
<p className="deschead mg">
|
||||
<span>当webhook被触发时,我们将向以下URL发送通知,包括已选择事件的详细信息。更多信息可查阅
|
||||
<a className="color-blue hoverLine" target="_blank" href="https://forum.trustie.net/forums/3408/detail">webhooks指南</a>。
|
||||
<br/><a className="color-blue" onClick={()=>OpenCheckModal(1)}>开源敏感词检测服务设置</a>、<a className="color-blue" onClick={()=>OpenCheckModal(2)}>PR审阅推荐服务设置</a>
|
||||
</span>
|
||||
</p>
|
||||
<p className="deschead mg"><span>当webhook被触发时,我们将向以下URL发送通知,包括已选择事件的详细信息。更多信息可查阅<a className="color-blue hoverLine" target="_blank" href="https://forum.trustie.net/forums/3408/detail">webhooks指南</a>。</span></p>
|
||||
<Form>
|
||||
<input type="password" style={{display:"none"}} />
|
||||
<Form.Item label="目标URL" colon={false}>
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Modal } from 'antd';
|
||||
import CopyTool from '../../../Component/CopyTool';
|
||||
|
||||
function CheckModal({visible,content,onCancel}) {
|
||||
|
||||
const [ type ,setType ] = useState(content);
|
||||
useEffect(()=>{
|
||||
setType(content);
|
||||
},[content])
|
||||
|
||||
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
footer={null}
|
||||
title="提示"
|
||||
width="480px"
|
||||
onCancel={onCancel}
|
||||
closable={true}
|
||||
className="checkModalStyle"
|
||||
>
|
||||
<div>
|
||||
{
|
||||
type===1?
|
||||
<div>
|
||||
<p style={{fontWeight:"500"}}>如需使用开源敏感词检测云功能,请复制以下内容至指定的输入框中:</p>
|
||||
<p>目标URL:<input type="text" id="copy_input_check" value={"https://api.learnerhub.net/mulan"} />
|
||||
<CopyTool afterText="复制成功" inputId="copy_input_check" timeOut={true} text={"复制"}/>
|
||||
</p>
|
||||
<p>webhook密钥:默认,无须密钥</p>
|
||||
<p>触发webhook:选中自定义事件,勾选 推送,创建,合并请求</p>
|
||||
<p>分支过滤: 默认,无须修改</p>
|
||||
</div>
|
||||
:
|
||||
<div>
|
||||
<p style={{fontWeight:"500"}}>如需使用PR审阅推荐云功能,请复制以下内容至指定的输入框中:</p>
|
||||
<p>目标URL:
|
||||
<input type="text" id="copy_input_check" style={{width:"160px"}} value={"http://117.50.99.180:80"} />
|
||||
<CopyTool afterText="复制成功" inputId="copy_input_check" timeOut={true} text={"复制"}/>
|
||||
</p>
|
||||
<p>webhook密钥:默认,无须密钥</p>
|
||||
<p>触发webhook:选中自定义事件,勾选 合并请求</p>
|
||||
<p>分支过滤: 默认,无须修改</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default CheckModal;
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Table , Pagination } from 'antd';
|
||||
import { Base64 } from 'js-base64';
|
||||
import moment from 'moment'
|
||||
import axios from 'axios';
|
||||
import Nodata from '../Nodata';
|
||||
import './Index.scss';
|
||||
import RecommedModal from './sub/RecommedModal';
|
||||
|
||||
const limit = 15;
|
||||
|
||||
function Index(props) {
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
const [ data , setData ] = useState(undefined);
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
const [ content ,setContent ] = useState(undefined);
|
||||
const { owner , projectsId } = props.match.params;
|
||||
|
||||
|
||||
useEffect(()=>{
|
||||
getInit();
|
||||
},[page])
|
||||
|
||||
function getInit() {
|
||||
// MLh8klm46f_ceshi ${owner}_${projectsId}
|
||||
const url = `https://sonar.learnerhub.net/api/issues/search?componentKeys=${owner}_${projectsId}&s=FILE_LINE&resolved=false&types=BUG&ps=${limit}&facets=owaspTop10%2CsansTop25%2Cseverities%2CsonarsourceSecurity%2Ctypes&additionalFields=_all&timeZone=Asia%2FShanghai&p=${page}`
|
||||
axios.get(url,{
|
||||
headers:{Authorization:`Basic ${Base64.encode('ecae161ce05add6121c6263f843c76d79fcd953c:')}`}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setData(result.data.issues);
|
||||
setTotal(result.data.total);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '文件',
|
||||
dataIndex: 'component',
|
||||
key: 'component',
|
||||
width:"15%",
|
||||
render:(v,l,i)=>{
|
||||
const name = l.component && l.component.split(":")[1];
|
||||
return(
|
||||
<span>{name}</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '所在起始行',
|
||||
dataIndex: 'startLine',
|
||||
key: 'startLine',
|
||||
align:"center",
|
||||
width:"9%",
|
||||
render:(v,l,i)=>{
|
||||
return(
|
||||
<span>{l.textRange && l.textRange.startLine}</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '所在结束行',
|
||||
dataIndex: 'endLine',
|
||||
key: 'endLine',
|
||||
align:"center",
|
||||
width:"9%",
|
||||
render:(v,l,i)=>{
|
||||
return(
|
||||
<span>{l.textRange && l.textRange.endLine}</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: '错误类型',
|
||||
// dataIndex: 'type',
|
||||
// align:"center",
|
||||
// key: 'type',
|
||||
// width:"8%",
|
||||
// },
|
||||
{
|
||||
title: '问题信息',
|
||||
dataIndex: 'message',
|
||||
key: 'message',
|
||||
width:"40%"
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'creationDate',
|
||||
key: 'creationDate',
|
||||
align:"center",
|
||||
render:(v,l,i)=>{
|
||||
return(
|
||||
<span>{l.creationDate && moment(l.creationDate).format('YYYY-MM-DD HH:mm:ss')}</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '问题修复推荐',
|
||||
dataIndex: 'recommend',
|
||||
key: 'recommend',
|
||||
align:"center",
|
||||
render:(v,l,i)=>{
|
||||
return(
|
||||
<a className="color-blue" onClick={()=>receiveRecommend(l)}>获取推荐</a>
|
||||
)
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
function receiveRecommend(l){
|
||||
// 完整的测试地址 : http://ng.learnerhub.net/mulan/repair
|
||||
// 上线改成 https://api.learnerhub.net/mulan/repair
|
||||
const url = `https://api.learnerhub.net/mulan/repair`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
data:l
|
||||
}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setContent(result.data.data && result.data.data.content);
|
||||
setVisible(true);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
return(
|
||||
<div className="main" style={{padding:"0px"}}>
|
||||
<RecommedModal visible={visible} content={content} onCancel={()=>setVisible(false)}/>
|
||||
{
|
||||
total > 0 ?
|
||||
<div style={{minHeight:"300px"}}>
|
||||
<p style={{padding:"12px 20px"}}>一共存在{total}个问题</p>
|
||||
<Table className="sonarTable" dataSource={data} columns={columns} pagination={false}/>
|
||||
</div>
|
||||
:
|
||||
<Nodata _html="代码质量非常优秀,没有检测到问题存在!" />
|
||||
}
|
||||
{
|
||||
total > limit &&
|
||||
<div style={{padding:"15px",textAlign:"center"}}>
|
||||
<Pagination pageSize={limit} current={page} total={total} onChange={(p)=>setPage(p)}/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Index
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
.sonarTable{
|
||||
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
|
||||
padding:10px 12px;
|
||||
}
|
||||
}
|
||||
.recommendbox{
|
||||
.ant-modal-body{
|
||||
padding:0px;
|
||||
padding-bottom: 20px;
|
||||
div{
|
||||
height: 620px;
|
||||
overflow-y: auto;
|
||||
padding:20px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
import { Modal } from 'antd';
|
||||
import React from 'react';
|
||||
import '../Index.scss';
|
||||
|
||||
function RecommedModal({content,visible,onCancel}){
|
||||
return(
|
||||
<Modal
|
||||
visible={visible}
|
||||
footer={null}
|
||||
width="1000px"
|
||||
closable={true}
|
||||
onCancel={onCancel}
|
||||
title="推荐内容"
|
||||
centered={true}
|
||||
className="recommendbox"
|
||||
>
|
||||
<div>
|
||||
<pre style={{whiteSpace: "pre-line"}}>{content}</pre>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
export default RecommedModal;
|
||||
|
|
@ -239,4 +239,59 @@ ul.ant-menu.menuStyle{
|
|||
content:"";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.attrBadge{
|
||||
padding-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 2px;
|
||||
a{
|
||||
margin: 0px 17px 10px 0px;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
&:nth-child(5n){
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.attrBadge{
|
||||
padding-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 2px;
|
||||
a{
|
||||
margin: 0px 17px 10px 0px;
|
||||
img{
|
||||
border-radius: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
&:nth-child(5n){
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.infoCount{
|
||||
display: inline-block;
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
background-color:rgba(153, 153, 153, 0.13);;
|
||||
color:#666;
|
||||
border-radius: 12px;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Button, Spin , Menu } from "antd";
|
||||
import { Button, Spin , Menu, Popover } from "antd";
|
||||
import FocusButton from "../UsersList/focus_button";
|
||||
|
||||
import axios from "axios";
|
||||
|
|
@ -13,6 +13,10 @@ import './Index.scss';
|
|||
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import Badge from "../Main/sub/Badge";
|
||||
|
||||
//test data
|
||||
const badges = {badge:[{ "login": "many_stars", "image_url": "https://testforgeplus.trustie.net//system/lets/letter_avatars/2/G/178_217_57/120.png", "description": "test description1"}, {"login": "many_stars", "image_url": "https://testforgeplus.trustie.net//images/avatars/User/36480?t=1686645429", "description": "test description2"}], total_count: 3}
|
||||
|
||||
const UpdateInfo = Loadable({
|
||||
loader: () => import("./Material/Index"),
|
||||
|
|
@ -70,6 +74,7 @@ class Infos extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
renderPath=(pathname)=>{
|
||||
const { username } = this.props.match.params;
|
||||
if(pathname === `/${username}`){
|
||||
|
|
@ -130,7 +135,9 @@ class Infos extends Component {
|
|||
this.setState({
|
||||
user: result.data,
|
||||
isSpin: false,
|
||||
undo_events:e
|
||||
undo_events:e,
|
||||
//测试数据
|
||||
badges : {badge:[1, 2, 3], total_count: 3}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
@ -194,7 +201,7 @@ class Infos extends Component {
|
|||
render() {
|
||||
const { current_user } = this.props;
|
||||
const { username } = this.props.match.params;
|
||||
const { user, isSpin, route_type , undo_events , menuKey } = this.state;
|
||||
const { user, isSpin, route_type , undo_events , menuKey} = this.state;
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Spin spinning={isSpin}>
|
||||
|
|
@ -275,7 +282,35 @@ class Infos extends Component {
|
|||
</div>
|
||||
:""
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{
|
||||
badges && badges.total_count >0 &&
|
||||
<Badge badges={badges} />
|
||||
}
|
||||
{/*{*/}
|
||||
{/* badges && badges.total_count >0 &&*/}
|
||||
{/* <div className="list-l-Menu text-center">*/}
|
||||
{/* {*/}
|
||||
{/* badges.total_count > 0 ? owner={owner} projectsId={projectsId} */}
|
||||
{/* badges.badge.map((item,key)=>{*/}
|
||||
{/* return(*/}
|
||||
{/* <Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">*/}
|
||||
{/* <div>*/}
|
||||
{/* <span>{item}</span>*/}
|
||||
{/* <img src={getImageUrl(`/${item.image_url}`)} />*/}
|
||||
{/* </div>*/}
|
||||
{/* </Popover>*/}
|
||||
{/* )*/}
|
||||
{/* })*/}
|
||||
{/* :""*/}
|
||||
{/* }*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/*}*/}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="list-right">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { notification } from 'antd';
|
|||
|
||||
import axios from 'axios';
|
||||
import educoderLogo from './educoder.png';
|
||||
import mulanLogo from './img/mulan.png';
|
||||
|
||||
import './LoginDialog.css';
|
||||
import { broadcastChannelPostMessage } from 'educoder'
|
||||
|
|
@ -562,14 +561,8 @@ class LoginDialog extends Component {
|
|||
</span>
|
||||
<span className="fr">
|
||||
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.lost_password}`)} className="mr3 color-grey-9">找回密码</a>
|
||||
{
|
||||
settings && settings.common && settings.common.register ?
|
||||
<React.Fragment>
|
||||
<em className="vertical-line"></em>
|
||||
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册</a>
|
||||
</React.Fragment>
|
||||
:""
|
||||
}
|
||||
<em className="vertical-line"></em>
|
||||
<a onClick={(url) => this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册</a>
|
||||
</span>
|
||||
</p>
|
||||
{
|
||||
|
|
@ -580,7 +573,7 @@ class LoginDialog extends Component {
|
|||
{settings.third_party.map((item,key)=>{
|
||||
return(
|
||||
<a href={`${item.url}`}>
|
||||
<img src={item.name === "mulan" ? mulanLogo : ""} width="46px" alt={`${item.name}登录`} />
|
||||
<img src={item.name === "educoder" ? educoderLogo : ""} width="46px" alt={`${item.name}登录`} />
|
||||
</a>
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
Loading…
Reference in New Issue