forked from Gitlink/forgeplus-react
Merge branch 'gitlink_server' of https://git.trustie.net/Gitlink/forgeplus-react into gitlink_server
This commit is contained in:
commit
6904116a3a
10
src/App.js
10
src/App.js
|
@ -3,7 +3,6 @@ import './App.css';
|
||||||
import { ConfigProvider } from 'antd'
|
import { ConfigProvider } from 'antd'
|
||||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||||
import {
|
import {
|
||||||
// BrowserRouter as Router,
|
|
||||||
Route,
|
Route,
|
||||||
Switch
|
Switch
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
|
@ -79,10 +78,7 @@ const OrganizeIndex = Loadable({
|
||||||
loader: () => import('./forge/Team/Index'),
|
loader: () => import('./forge/Team/Index'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
const EducoderLogin = Loadable({
|
|
||||||
loader: () => import('./modules/login/EducoderLogin'),
|
|
||||||
loading: Loading,
|
|
||||||
})
|
|
||||||
const Search = Loadable({
|
const Search = Loadable({
|
||||||
loader: () => import('./modules/search/'),
|
loader: () => import('./modules/search/'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -278,8 +274,7 @@ class App extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { mygetHelmetapi, pathType} = this.state;
|
const { pathType } = this.state;
|
||||||
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConfigProvider locale={zhCN}>
|
<ConfigProvider locale={zhCN}>
|
||||||
|
@ -426,7 +421,6 @@ class App extends Component {
|
||||||
|
|
||||||
<Route component={Shixunnopage} />
|
<Route component={Shixunnopage} />
|
||||||
</Switch>
|
</Switch>
|
||||||
{/* </Router> */}
|
|
||||||
</MuiThemeProvider>
|
</MuiThemeProvider>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|
|
@ -7,10 +7,10 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
|
||||||
const [ key , setKey ] = useState("HTTP");
|
const [ key , setKey ] = useState("HTTP");
|
||||||
return (
|
return (
|
||||||
<div className="downMenu">
|
<div className="downMenu">
|
||||||
<div style={{borderBottom:"1px solid #eee"}}>
|
<div>
|
||||||
<Menu className="urlMenu" selectedKeys={[key]} mode={"horizontal"}>
|
<Menu className="urlMenu" selectedKeys={[key]} mode={"horizontal"}>
|
||||||
<Menu.Item key="HTTP" onClick={(e)=>{setKey(e.key)}}>HTTP</Menu.Item>
|
<Menu.Item key="HTTP" onClick={(e)=>{setKey(e.key)}}>HTTP</Menu.Item>
|
||||||
<Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>
|
{ssh_url && <Menu.Item key="SSH" onClick={(e)=>{setKey(e.key)}}>SSH</Menu.Item>}
|
||||||
</Menu>
|
</Menu>
|
||||||
<div className="gitAddressClone">
|
<div className="gitAddressClone">
|
||||||
<input type="text" id="copy_rep_content" value={key==="HTTP" ? http_url:ssh_url} />
|
<input type="text" id="copy_rep_content" value={key==="HTTP" ? http_url:ssh_url} />
|
||||||
|
@ -18,8 +18,8 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Menu className="edu-txt-center">
|
<Menu className="edu-txt-center">
|
||||||
<Menu.Item><a href={zip_url}>下载 ZIP</a></Menu.Item>
|
{zip_url && <Menu.Item style={{borderTop:"1px solid #eee"}}><a href={zip_url}>下载 ZIP</a></Menu.Item>}
|
||||||
<Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>
|
{tar_url && <Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>}
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import './Component.scss';
|
||||||
import { getUser } from '../GetData/getData';
|
import { getUser } from '../GetData/getData';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
function Contributors({contributors,owner,projectsId,currentLogin}){
|
function Contributors({owner,projectsId,currentLogin}){
|
||||||
const [ menuList ,setMenuList ]= useState([]);
|
const [ menuList ,setMenuList ]= useState([]);
|
||||||
const [ list , setList ]= useState(undefined);
|
const [ list , setList ]= useState(undefined);
|
||||||
const [ total , setTotal ]= useState(0);
|
const [ total , setTotal ]= useState(0);
|
||||||
|
@ -16,11 +16,18 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
|
||||||
const [ isSpin , setIsSpin ] = useState(false);
|
const [ isSpin , setIsSpin ] = useState(false);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(contributors && contributors.total_count>0){
|
getData();
|
||||||
setTotal(contributors.total_count);
|
},[])
|
||||||
setList(contributors.list);
|
|
||||||
|
function getData(){
|
||||||
|
const url = `/${owner}/${projectsId}/contributors.json`;
|
||||||
|
axios.get(url).then(result=>{
|
||||||
|
if(result){
|
||||||
|
setTotal(result.data.total_count);
|
||||||
|
setList(result.data.list);
|
||||||
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
},[contributors])
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(login){
|
if(login){
|
||||||
|
@ -148,15 +155,15 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
|
||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
total > 0 ?
|
||||||
<div className="halfs">
|
<div className="halfs">
|
||||||
<Link to={`/${owner}/${projectsId}/contribute`} className="font-16 color-ooo hoverA">
|
<Link to={`/${owner}/${projectsId}/contribute`} className="font-16 color-ooo hoverA">
|
||||||
<span>贡献者</span>
|
<span>贡献者</span>
|
||||||
{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}
|
{ total > 0 && <span className="infoCount">{total}</span>}
|
||||||
</Link>
|
</Link>
|
||||||
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
|
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
|
||||||
{
|
{
|
||||||
total > 0 ?
|
list && list.length>0 && list.map((item,key)=>{
|
||||||
list.map((item,key)=>{
|
|
||||||
return(
|
return(
|
||||||
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
||||||
<Link key={key} to={`/${item.login}`}>
|
<Link key={key} to={`/${item.login}`}>
|
||||||
|
@ -165,10 +172,9 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
|
||||||
</Popover>
|
</Popover>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
:""
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>:""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default Contributors;
|
export default Contributors;
|
|
@ -1,10 +1,21 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { FlexAJ } from '../Component/layout';
|
import { FlexAJ } from '../Component/layout';
|
||||||
|
import { Divider } from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
function LanguagePower({languages}){
|
function LanguagePower({owner,projectsId}){
|
||||||
const [ array , setArray ] = useState(undefined);
|
const [ array , setArray ] = useState(undefined);
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
getData();
|
||||||
|
},[])
|
||||||
|
|
||||||
|
function getData(){
|
||||||
|
const url = `/${owner}/${projectsId}/languages.json`;
|
||||||
|
axios.get(url).then(result=>{
|
||||||
|
if(result){
|
||||||
|
let languages = result.data;
|
||||||
if(languages){
|
if(languages){
|
||||||
let arr = [];
|
let arr = [];
|
||||||
Object.keys(languages).map((item,key)=>{
|
Object.keys(languages).map((item,key)=>{
|
||||||
|
@ -12,7 +23,19 @@ function LanguagePower({languages}){
|
||||||
})
|
})
|
||||||
setArray(arr);
|
setArray(arr);
|
||||||
}
|
}
|
||||||
},[languages])
|
}
|
||||||
|
}).catch(error=>{})
|
||||||
|
}
|
||||||
|
|
||||||
|
// useEffect(()=>{
|
||||||
|
// if(languages){
|
||||||
|
// let arr = [];
|
||||||
|
// Object.keys(languages).map((item,key)=>{
|
||||||
|
// arr.push({name:item,percent:languages[item],color:getColor()});
|
||||||
|
// })
|
||||||
|
// setArray(arr);
|
||||||
|
// }
|
||||||
|
// },[languages])
|
||||||
|
|
||||||
function getColor(){
|
function getColor(){
|
||||||
let str = "#";
|
let str = "#";
|
||||||
|
@ -24,7 +47,9 @@ function LanguagePower({languages}){
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
return(
|
return(
|
||||||
|
(array && array.length > 0) ?
|
||||||
<div>
|
<div>
|
||||||
|
<Divider />
|
||||||
<p className="font-16 color-ooo aboutSubTitle">开发语言</p>
|
<p className="font-16 color-ooo aboutSubTitle">开发语言</p>
|
||||||
<div className="progress">
|
<div className="progress">
|
||||||
{
|
{
|
||||||
|
@ -47,8 +72,7 @@ function LanguagePower({languages}){
|
||||||
}
|
}
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
}
|
}
|
||||||
|
</div>:""
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default LanguagePower;
|
export default LanguagePower;
|
|
@ -17,7 +17,6 @@ import './header.scss';
|
||||||
import NoticeContent from './NoticeContent';
|
import NoticeContent from './NoticeContent';
|
||||||
import MainLogo from './img/logo.png';
|
import MainLogo from './img/logo.png';
|
||||||
// TODO 这部分脚本从公共脚本中直接调用
|
// TODO 这部分脚本从公共脚本中直接调用
|
||||||
let old_url;
|
|
||||||
|
|
||||||
window._header_componentHandler = null;
|
window._header_componentHandler = null;
|
||||||
// 非trustie链接则新开页跳转
|
// 非trustie链接则新开页跳转
|
||||||
|
@ -279,82 +278,6 @@ class NewHeader extends Component {
|
||||||
settings,
|
settings,
|
||||||
visible,
|
visible,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
/*用户名称 用户头像url*/
|
|
||||||
// let activeIndex = false;
|
|
||||||
// let activeForums = false;
|
|
||||||
// let activeShixuns = false;
|
|
||||||
// let activePaths = false;
|
|
||||||
// let coursestype = false;
|
|
||||||
// let activePackages = false;
|
|
||||||
// let activeMoopCases = false;
|
|
||||||
// let activeCompetitions = false;
|
|
||||||
|
|
||||||
// if (match.path === '/forums') {
|
|
||||||
// activeForums = true;
|
|
||||||
// } else if (match.path.startsWith('/shixuns')) {
|
|
||||||
// activeShixuns = true;
|
|
||||||
// } else if (match.path.startsWith('/paths')) {
|
|
||||||
// activePaths = true;
|
|
||||||
// } else if (match.path.startsWith('/courses')) {
|
|
||||||
// coursestype = true;
|
|
||||||
// } else if (match.path.startsWith('/crowdsourcing')) {
|
|
||||||
// activePackages = true;
|
|
||||||
// } else if (match.path.startsWith('/moop_cases')) {
|
|
||||||
// activeMoopCases = true;
|
|
||||||
// } else if (match.path.startsWith('/competitions')) {
|
|
||||||
// activeCompetitions = true;
|
|
||||||
// } else {
|
|
||||||
// activeIndex = true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// let headtypes = '/';
|
|
||||||
// if (settings) {
|
|
||||||
// if (settings.navbar) {
|
|
||||||
// if (settings.navbar.length > 0) {
|
|
||||||
// if (match.path === '/') {
|
|
||||||
// if (headtypesonClickbool === false) {
|
|
||||||
// headtypes = undefined;
|
|
||||||
// } else {
|
|
||||||
// headtypes = headtypess;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// for (var i = 0; i < settings.navbar.length; i++) {
|
|
||||||
// if (match.path === settings.navbar[i].link) {
|
|
||||||
// headtypes = settings.navbar[i].link;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// let shixuntype = false;
|
|
||||||
// let pathstype = false;
|
|
||||||
// let coursestypes = false;
|
|
||||||
// if (this.props && this.props.mygetHelmetapi != null) {
|
|
||||||
// let shixun = "/shixuns";
|
|
||||||
// let paths = "/paths";
|
|
||||||
// let courses = "/courses";
|
|
||||||
// this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => {
|
|
||||||
// var reg = RegExp(item.link);
|
|
||||||
// if (shixun.match(reg)) {
|
|
||||||
// if (item.hidden === true) {
|
|
||||||
// shixuntype = true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (paths.match(reg)) {
|
|
||||||
// if (item.hidden === true) {
|
|
||||||
// pathstype = true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (courses.match(reg)) {
|
|
||||||
// if (item.hidden === true) {
|
|
||||||
// coursestypes = true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
let search_url = settings && settings.common && settings.common.search;
|
let search_url = settings && settings.common && settings.common.search;
|
||||||
return (
|
return (
|
||||||
<div className={publicNav ? `newHeaders publicNav`:`newHeaders`} id="nHeader">
|
<div className={publicNav ? `newHeaders publicNav`:`newHeaders`} id="nHeader">
|
||||||
|
@ -447,7 +370,6 @@ class NewHeader extends Component {
|
||||||
>
|
>
|
||||||
<Link to={"/settings/notice"} className="message-icon">
|
<Link to={"/settings/notice"} className="message-icon">
|
||||||
{current_user && <Badge count={current_user.message_unread_total}>
|
{current_user && <Badge count={current_user.message_unread_total}>
|
||||||
{/* <i className="iconfont icon-xiaoxilingdang ml15 mr15"></i> */}
|
|
||||||
<img src={require(`./img/ring.png`)} alt="" width="16px" className="ml15 mr15"/>
|
<img src={require(`./img/ring.png`)} alt="" width="16px" className="ml15 mr15"/>
|
||||||
</Badge>}
|
</Badge>}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -319,9 +319,9 @@ function CoderDepot(props){
|
||||||
const downloadMenu = (
|
const downloadMenu = (
|
||||||
<CloneAddress
|
<CloneAddress
|
||||||
http_url={projectDetail && projectDetail.clone_url}
|
http_url={projectDetail && projectDetail.clone_url}
|
||||||
ssh_url = {projectDetail && projectDetail.ssh_url}
|
ssh_url = {(projectDetail && props && props.platform) && projectDetail.ssh_url}
|
||||||
zip_url={zip_url}
|
zip_url={(props && props.platform) && zip_url}
|
||||||
tar_url={tar_url}
|
tar_url={(props && props.platform) && tar_url}
|
||||||
showNotification={props.showNotification}/>
|
showNotification={props.showNotification}/>
|
||||||
)
|
)
|
||||||
// 确认修改简介、website、实践课程链接
|
// 确认修改简介、website、实践课程链接
|
||||||
|
@ -582,17 +582,9 @@ function CoderDepot(props){
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
{/* 贡献者 */}
|
{/* 贡献者 */}
|
||||||
{
|
<Contributors owner={owner} projectsId={projectsId} />
|
||||||
projectDetail && projectDetail.contributors && projectDetail.contributors.total_count >0 &&
|
|
||||||
<Contributors contributors={projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
|
||||||
}
|
|
||||||
{/* 语言 */}
|
{/* 语言 */}
|
||||||
{ projectDetail && projectDetail.languages &&
|
<LanguagePower owner={owner} projectsId={projectsId}/>
|
||||||
<React.Fragment>
|
|
||||||
<Divider />
|
|
||||||
<LanguagePower languages={projectDetail.languages}/>
|
|
||||||
</React.Fragment>
|
|
||||||
}
|
|
||||||
</Gap>
|
</Gap>
|
||||||
</ShortWidth>
|
</ShortWidth>
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ class CoderRootCommit extends Component{
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
const { projectDetail, commit_class , defaultBranch , platform } = this.props;
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
const { projectsId , owner , branchName } = this.props.match.params;
|
||||||
let branch = returnbar(branchName || defaultBranch);
|
let branch = returnbar(branchName || defaultBranch);
|
||||||
return(
|
return(
|
||||||
|
@ -159,7 +159,16 @@ class CoderRootCommit extends Component{
|
||||||
<div className="commitList-item f-wrap-between">
|
<div className="commitList-item f-wrap-between">
|
||||||
<div>
|
<div>
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="font-14 color-grey-3 font-bd"><RenderHtml value={item.message}/></Link></div>
|
<div className="commitDesc">
|
||||||
|
{
|
||||||
|
platform ?
|
||||||
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="font-14 color-grey-3 font-bd">
|
||||||
|
<RenderHtml value={item.message}/>
|
||||||
|
</Link>
|
||||||
|
:
|
||||||
|
<RenderHtml value={item.message}/>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15 pb5">
|
<p className="f-wrap-alignCenter mt15 pb5">
|
||||||
<User
|
<User
|
||||||
|
@ -176,7 +185,12 @@ class CoderRootCommit extends Component{
|
||||||
<div>
|
<div>
|
||||||
<span className="treecopy-cont shadow">
|
<span className="treecopy-cont shadow">
|
||||||
<img src={Tree} alt="sha" width={"16px"}/>
|
<img src={Tree} alt="sha" width={"16px"}/>
|
||||||
|
{
|
||||||
|
platform ?
|
||||||
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
|
:
|
||||||
|
<span style={{color:"#466AFF",cursor:"default"}}>{truncateCommitId(`${item.sha}`)}</span>
|
||||||
|
}
|
||||||
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
|
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
|
||||||
</span>
|
</span>
|
||||||
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
||||||
|
|
|
@ -4,18 +4,21 @@ import SubBanner from './SubBanner';
|
||||||
import SubUnitBanner from './SubUnitBanner';
|
import SubUnitBanner from './SubUnitBanner';
|
||||||
import Icon from '../img/index/icon.png';
|
import Icon from '../img/index/icon.png';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Spin } from 'antd';
|
import { Spin , Input } from 'antd';
|
||||||
import SubList from './SubList';
|
import SubList from './SubList';
|
||||||
import more from '../img/index/more.png';
|
import more from '../img/index/more.png';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { getImageUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
import Nodata from '../../Nodata';
|
import Nodata from '../../Nodata';
|
||||||
|
|
||||||
|
const { Search } = Input;
|
||||||
|
|
||||||
const LIMIT = 20;
|
const LIMIT = 20;
|
||||||
function Index() {
|
function Index() {
|
||||||
|
|
||||||
const [ cateList , setCateList ] = useState(undefined);
|
const [ cateList , setCateList ] = useState(undefined);
|
||||||
const [ projectsList , setProjectsList ] = useState(undefined);
|
const [ projectsList , setProjectsList ] = useState(undefined);
|
||||||
|
const [ search , setSearch ] = useState(undefined);
|
||||||
const [ cateID, setCateID ] = useState(undefined);
|
const [ cateID, setCateID ] = useState(undefined);
|
||||||
const [ isSpin, setIsSpin ] = useState(true);
|
const [ isSpin, setIsSpin ] = useState(true);
|
||||||
|
|
||||||
|
@ -37,13 +40,14 @@ function Index() {
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProject() {
|
function getProject(searchValue) {
|
||||||
const url = `/projects.json`;
|
const url = `/projects.json`;
|
||||||
axios.get(url,{
|
axios.get(url,{
|
||||||
params:{
|
params:{
|
||||||
pinned:"d",
|
pinned:"d",
|
||||||
category_id:cateID,
|
category_id:cateID,
|
||||||
limit:LIMIT
|
limit:LIMIT,
|
||||||
|
search:searchValue
|
||||||
}
|
}
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
|
@ -53,6 +57,15 @@ function Index() {
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeSearchValue(e){
|
||||||
|
setSearch(e.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchFun(value){
|
||||||
|
setIsSpin(true);
|
||||||
|
getProject(value);
|
||||||
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<SubBanner />
|
<SubBanner />
|
||||||
|
@ -74,6 +87,18 @@ function Index() {
|
||||||
<div className="leftLists">
|
<div className="leftLists">
|
||||||
<div className="leftTitles">
|
<div className="leftTitles">
|
||||||
<span>开源项目</span>
|
<span>开源项目</span>
|
||||||
|
|
||||||
|
<Search
|
||||||
|
placeholder="输入项目名称关键字进行搜索"
|
||||||
|
enterButton="搜索"
|
||||||
|
size="middle"
|
||||||
|
onSearch={searchFun}
|
||||||
|
className="list-r-Search"
|
||||||
|
value={search}
|
||||||
|
onChange={changeSearchValue}
|
||||||
|
style={{width:"300px"}}
|
||||||
|
allowClear={true}
|
||||||
|
/>
|
||||||
<Link to={`/explore/all`} target="_blank">更多<i className="iconfont icon-triangle font-12"></i></Link>
|
<Link to={`/explore/all`} target="_blank">更多<i className="iconfont icon-triangle font-12"></i></Link>
|
||||||
</div>
|
</div>
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
|
@ -85,7 +110,14 @@ function Index() {
|
||||||
projectsList.map((i,k)=>{
|
projectsList.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li>
|
||||||
|
{
|
||||||
|
i.platform === "educoder" ?
|
||||||
|
<a href="javascript:void(0)" style={{cursor:"default"}}>
|
||||||
|
<img className="p-r-photo" alt="" src={i.author && i.author.image_url} ></img>
|
||||||
|
</a>
|
||||||
|
:
|
||||||
<Link to={`/${i.author && i.author.login}`} target="_blank"><img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /></Link>
|
<Link to={`/${i.author && i.author.login}`} target="_blank"><img src={getImageUrl(`/${i.author && i.author.image_url}`)} alt="" /></Link>
|
||||||
|
}
|
||||||
<div className="itemTitle">
|
<div className="itemTitle">
|
||||||
<div className="item-title-infos">
|
<div className="item-title-infos">
|
||||||
<Link to={`/${i.author && i.author.login}/${i.identifier}`} target="_blank" className="infotitle task-hide">{i.author && i.author.name}/{i.name}</Link>
|
<Link to={`/${i.author && i.author.login}/${i.identifier}`} target="_blank" className="infotitle task-hide">{i.author && i.author.name}/{i.name}</Link>
|
||||||
|
|
|
@ -350,7 +350,15 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid rgba(153, 153, 153, 0.16);
|
border-bottom: 1px solid rgba(153, 153, 153, 0.16);
|
||||||
padding:0px 20px;
|
padding:0px 20px;
|
||||||
span{
|
.ant-btn-primary{
|
||||||
|
background-color: #466AFF;
|
||||||
|
border-color: #466AFF;
|
||||||
|
&:hover,&:active{
|
||||||
|
background-color: rgba(70,106,255,0.8);
|
||||||
|
border-color: rgba(70,106,255,0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&>span{
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React , { useState } from 'react';
|
import React , { useState } from 'react';
|
||||||
import { Anchor , Input } from 'antd';
|
import { Anchor , Input } from 'antd';
|
||||||
import './sub.scss';
|
import './sub.scss';
|
||||||
import { useEffect } from 'react';
|
|
||||||
|
|
||||||
const { Link } = Anchor;
|
const { Link } = Anchor;
|
||||||
|
|
||||||
|
@ -40,7 +39,7 @@ function ReadmeCatelogue({ menuList , hash }) {
|
||||||
{
|
{
|
||||||
menu.map((item,key)=>{
|
menu.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<div style={{paddingLeft:`${item.level *10}px`}} className={goHref===item.href?"items active":"items"}>
|
<div style={{paddingLeft:`${item.level *15}px`}} className={goHref===item.href?"items active":"items"}>
|
||||||
<Link href={`#${item.text}`} title={item.text} />
|
<Link href={`#${item.text}`} title={item.text} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,10 +34,17 @@
|
||||||
padding:15px;
|
padding:15px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
.ant-anchor{
|
||||||
|
padding-left: 0px!important;
|
||||||
|
.ant-anchor-ink::before{
|
||||||
|
width: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.ant-anchor-wrapper{
|
.ant-anchor-wrapper{
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
padding:5px 15px;
|
padding:5px 0px;
|
||||||
max-height: 255px!important;
|
max-height: 255px!important;
|
||||||
|
padding-left: 0px!important;
|
||||||
.items{
|
.items{
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Badge, Button, Checkbox, Menu, Pagination } from 'antd';
|
import { Badge, Checkbox, Menu, Pagination } from 'antd';
|
||||||
import DelModal from '../../../Component/ModalFun';
|
import DelModal from '../../../Component/ModalFun';
|
||||||
import NoneData from '../../../Nodata.js';
|
import NoneData from '../../../Nodata.js';
|
||||||
import { noticeSourceType } from '../../../common/static';
|
import { noticeSourceType } from '../../../common/static';
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
import '../manager/Index.scss'
|
import '../manager/Index.scss';
|
||||||
|
import { getImageUrl } from 'educoder';
|
||||||
|
|
||||||
|
|
||||||
function MyNotice(props) {
|
function MyNotice(props) {
|
||||||
let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
|
let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
|
||||||
|
@ -227,7 +228,7 @@ function MyNotice(props) {
|
||||||
<div className={`mynotice-content vertical-center-style ${isBatchDelete?'batchDel':''}`} key={item.id}>
|
<div className={`mynotice-content vertical-center-style ${isBatchDelete?'batchDel':''}`} key={item.id}>
|
||||||
<div className="mynotice-cont vertical-center-style">
|
<div className="mynotice-cont vertical-center-style">
|
||||||
<Checkbox value={item.id} className={isBatchDelete ? 'visible-checkbox' : 'invisible-checkbox'} onChange={onChange} checked={item.checkedBatch}></Checkbox>
|
<Checkbox value={item.id} className={isBatchDelete ? 'visible-checkbox' : 'invisible-checkbox'} onChange={onChange} checked={item.checkedBatch}></Checkbox>
|
||||||
{item.sender && <img src={`https://testforgeplus.trustie.net//${item.sender.image_url}`} className="currentImg" onClick={()=>{window.open(`/${item.sender && item.sender.login}`);}}/>}
|
{item.sender && <img alt="" src={getImageUrl(`/${item.sender.image_url}`)} className="currentImg" onClick={()=>{window.open(`/${item.sender && item.sender.login}`);}}/>}
|
||||||
<div className={`atme-notice-text stretch-style ${item.notification_url && 'highlightSpan'}`} onClick={() => {turnToMess(item)}}>
|
<div className={`atme-notice-text stretch-style ${item.notification_url && 'highlightSpan'}`} onClick={() => {turnToMess(item)}}>
|
||||||
{item.status === 1 ? <Badge color="#FA2020"/> : <span className="system-notice-blank"></span>}
|
{item.status === 1 ? <Badge color="#FA2020"/> : <span className="system-notice-blank"></span>}
|
||||||
{item.sender && <span className="atme-length" dangerouslySetInnerHTML={{__html: item.content}}></span>}
|
{item.sender && <span className="atme-length" dangerouslySetInnerHTML={{__html: item.content}}></span>}
|
||||||
|
|
|
@ -109,7 +109,7 @@ ul,ol,dl{
|
||||||
width: 49rem;
|
width: 49rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
&:hover{
|
& a:hover{
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
& .markdown-body{
|
& .markdown-body{
|
||||||
color: #466AFF;
|
color: #466AFF;
|
||||||
|
|
|
@ -139,7 +139,6 @@ const GlobalSearch = ({ location, showNotification, history }) => {
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<Tabs defaultActiveKey="1" onChange={changeTab}>
|
<Tabs defaultActiveKey="1" onChange={changeTab}>
|
||||||
<TabPane tab={`项目(${totalType1})`} key={1}>
|
<TabPane tab={`项目(${totalType1})`} key={1}>
|
||||||
<div className="search-content">
|
<div className="search-content">
|
||||||
|
@ -150,13 +149,13 @@ const GlobalSearch = ({ location, showNotification, history }) => {
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
dataList.length ?
|
dataList.length ?
|
||||||
<Pagination
|
<div className="pb20"><Pagination
|
||||||
showQuickJumper={dataList.length > size}
|
showQuickJumper={dataList.length > size}
|
||||||
onChange={(page) => { setPage(page) }}
|
onChange={(page) => { setPage(page) }}
|
||||||
current={page}
|
current={page}
|
||||||
total={total}
|
total={total}
|
||||||
showTotal={total => `共 ${total} 条`}
|
showTotal={total => `共 ${total} 条`}
|
||||||
/>
|
/></div>
|
||||||
: <Nodata _html="暂无数据" className="no-data-box" />
|
: <Nodata _html="暂无数据" className="no-data-box" />
|
||||||
}
|
}
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
@ -170,13 +169,13 @@ const GlobalSearch = ({ location, showNotification, history }) => {
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
dataList.length ?
|
dataList.length ?
|
||||||
<Pagination
|
<div className="pb20"><Pagination
|
||||||
showQuickJumper={dataList.length > size}
|
showQuickJumper={dataList.length > size}
|
||||||
onChange={(page) => { setPage(page) }}
|
onChange={(page) => { setPage(page) }}
|
||||||
current={page}
|
current={page}
|
||||||
total={total}
|
total={total}
|
||||||
showTotal={total => `共 ${total} 条`}
|
showTotal={total => `共 ${total} 条`}
|
||||||
/> : <Nodata _html="暂无数据" />
|
/></div> : <Nodata _html="暂无数据" />
|
||||||
}
|
}
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
||||||
|
@ -227,13 +226,13 @@ const GlobalSearch = ({ location, showNotification, history }) => {
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
dataList.length ?
|
dataList.length ?
|
||||||
<Pagination
|
<div className="pb20"><Pagination
|
||||||
showQuickJumper={dataList.length > size}
|
showQuickJumper={dataList.length > size}
|
||||||
onChange={(page) => { setPage(page) }}
|
onChange={(page) => { setPage(page) }}
|
||||||
current={page}
|
current={page}
|
||||||
total={total}
|
total={total}
|
||||||
showTotal={total => `共 ${total} 条`}
|
showTotal={total => `共 ${total} 条`}
|
||||||
/> : <Nodata _html="暂无数据" />
|
/></div> : <Nodata _html="暂无数据" />
|
||||||
}
|
}
|
||||||
</TabPane>
|
</TabPane>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
Loading…
Reference in New Issue