dev_forge
Jasder 5 years ago
commit 8548508150

@ -495,9 +495,6 @@ class App extends Component {
};
render() {
let{mygetHelmetapi}=this.state;
// console.log("appappapp");
// console.log(mygetHelmetapi);
return (
<Provider store={store}>
<ConfigProvider locale={zhCN}>
@ -521,242 +518,13 @@ class App extends Component {
return (<ProjectIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*题库*/}
<Route path="/topicbank/:username/:topicstype"
render={
(props) => {
return (<Topicbank {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*题库*/}
<Route path="/topicbank/:topicstype"
render={
(props) => {
return (<Topicbank {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*/!*众包创新*!/*/}
{/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/}
{/*竞赛*/}
<Route path={"/competitions"}
render={
(props) => {
return (<NewCompetitions {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*黑客松定制竞赛*/}
<Route
path={"/osshackathon"}
render={
(props)=>{
return(
<Osshackathon {...this.props} {...props} {...this.state} />
)
}
}
/>
{/*认证*/}
<Route path="/account" component={AccountPage}/>
{/*403*/}
<Route path="/403" component={Shixunauthority}/>
<Route path="/500" component={http500}/>
{/*404*/}
<Route path="/nopage" component={Shixunnopage}/>
<Route path="/compatibility" component={CompatibilityPageLoadable}/>
<Route
path="/login"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/>
<Route
path="/register"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/>
<Route
path="/otherloginstart" component={Otherloginstart}
/>
<Route
path={"/otherloginqq"} component={Otherloginsqq}
/>
<Route
path="/otherlogin" component={Otherlogin}
/>
<Route path="/users/:username"
render={
(props) => {
return (<InfosIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
<Route path="/banks"
render={
(props) => {
return (<BanksIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
{/*<Route*/}
{/*path="/personalcompetit"*/}
{/*render={*/}
{/*(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)*/}
{/*}*/}
{/*/>*/}
<Route
path="/changepassword"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/>
{/*<Route*/}
{/* path="/interesse" component={Interestpage}*/}
{/*/>*/}
<Route path="/shixuns/new" component={Newshixuns}>
</Route>
<Route path="/colleges/:id/statistics"
render={
(props) => (<College {...this.props} {...props} {...this.state} />)
}/>
{/* jupyter */}
<Route path="/tasks/:identifier/jupyter/"
render={
(props) => {
return (<JupyterTPI {...this.props} {...props} {...this.state}/>)
}
}
/>
<Route path="/tasks/:stageId" component={IndexWrapperComponent}/>
{/*<Route path="/shixuns/:shixunId" component={TPMIndexComponent}>*/}
{/*</Route>*/}
<Route path="/shixuns/:shixunId"
render={
(props)=>(<TPMIndexComponent {...this.props} {...props} {...this.state}></TPMIndexComponent>)
}
></Route>
{/*列表页 实训项目列表*/}
{/*<Route path="/shixuns" component={TPMShixunsIndexComponent}/>*/}
<Route path="/shixuns"
render={
(props)=>(<TPMShixunsIndexComponent {...this.props} {...props} {...this.state}></TPMShixunsIndexComponent>)
}
></Route>
{/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route>
<Route path="/search"
render={
(props)=>(<SearchPage {...this.props} {...props} {...this.state}></SearchPage>)
}
></Route>
{/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props} {...this.state}></Route>
{/* <Route path="/forums" component={ForumsIndexComponent}>
</Route> */}
{/* 教学案例 */}
<Route path="/moop_cases"render={
(props) => (<MoopCases {...this.props} {...props} {...this.state} />)
}/>
<Route path="/forums"
render={
(props)=>(<ForumsIndexComponent {...this.props} {...props} {...this.state}></ForumsIndexComponent>)
}
>
</Route>
<Route path="/comment" component={CommentComponent}/>
{/*<Route path="/testMaterial" component={TestMaterialDesignComponent}/>*/}
{/*<Route path="/test" component={TestIndex}/>*/}
{/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/}
{/*<Route path="/testRCComponent" component={TestComponent}/>*/}
{/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/}
{/*<Route*/}
{/*path="/registration"*/}
{/*render={*/}
{/*(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)*/}
{/*}*/}
{/*/>*/}
<Route path="/messages"
render={
(props)=>(<Messagerouting {...this.props} {...props} {...this.state}></Messagerouting>)
}
></Route>
<Route path="/help/:type"
render={
(props)=>(<Help {...this.props} {...props} {...this.state}></Help>)
}/>
<Route path="/ecs"
render={
(props)=>(<Ecs {...this.props} {...props} {...this.state}></Ecs>)
}/>
<Route path="/problems/new/:id?"
render={
(props) => {
return (<NewOrEditTask {...this.props} {...props} {...this.state} />)
}
}
/>
<Route
path="/problems/:id/edit"
render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} />
<Route path="/myproblems/record_detail/:id"
<Route exact path="/"
// component={ShixunsHome}
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
(props)=>(<ProjectIndex {...this.props} {...props} {...this.state}></ProjectIndex>)
}
/>
<Route path="/myproblems/:id"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
} />
<Route path="/problems"
render={
(props) => (<Developer {...this.props} {...props} {...this.state} />)
}/>
<Route exact path="/"
// component={ShixunsHome}
render={
(props)=>(<ShixunsHome {...this.props} {...props} {...this.state}></ShixunsHome>)
}
/>
<Route component={Shixunnopage}/>
</Switch>

@ -19,7 +19,7 @@ class SelectBranch extends Component{
</Menu>
);
return(
<div className="branchDropdown">
<div className="branchDropdown f-wrap-alignCenter">
<span className="color-grey-9 mr3"><i className="iconfont icon-fenzhi font-20 color-grey-6 mr3"></i>:</span>
<Dropdown overlay={menu} trigger={['click']} placement="bottomRight">
<a className="ant-dropdown-link">

@ -1,9 +1,9 @@
import React , { Component } from 'react';
import { Link } from "react-router-dom";
import { Dropdown , Menu , Icon } from 'antd';
import { Dropdown , Menu , Icon , Tooltip } from 'antd';
import './list.css'
import axios from 'axios';
import { branch } from 'recompose';
class CoderRootBranch extends Component {
constructor(porps){
@ -24,7 +24,7 @@ class CoderRootBranch extends Component {
return(
<li>
<div>
<span className="color-blue">{item.name}</span>
<span className="color-blue font-15">{item.name}</span>
<p className="f-wrap-alignCenter">
<Link to={``} className="mr5 color-blue hide-1" style={{"maxWidth":"100px"}}>{item.last_commit && item.last_commit.id}</Link>
<span className="color-grey-9 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
@ -33,9 +33,10 @@ class CoderRootBranch extends Component {
</div>
<span>
<Link to={``} className="mr20 operationBtn">创建合并请求</Link>
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="operationBtn">
<a className="ant-dropdown-link">
<Icon type="cloud-download" className="font-18"/>
<Tooltip title={`下载分支${branch}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
</a>
</Dropdown>
</span>

@ -1,5 +1,5 @@
import React , { Component } from 'react';
import { Menu , Table } from 'antd';
import { Menu } from 'antd';
import { getImageUrl } from 'educoder';
import {Link} from 'react-router-dom';
@ -7,6 +7,7 @@ import './list.css';
import SelectBranch from '../Branch/SelectBranch';
import CloneAddress from '../Branch/CloneAddress';
import RootTable from './RootTable';
import axios from 'axios';
class CoderRootDirectory extends Component{
@ -65,7 +66,7 @@ class CoderRootDirectory extends Component{
changeBranch=(value)=>{
const { branchList } = this.state;
let branchLastCommit = branchList[parseInt(value.key)];
this.getProjectRoot(branchLastCommit.name);
this.setState({
branch:branchLastCommit.name,
branchLastCommit,
@ -73,15 +74,19 @@ class CoderRootDirectory extends Component{
})
}
render(){
const { rootList } = this.state;
const { rootList , branch } = this.state;
const { branchLastCommit , http_url } = this.props;
const { projectsId } = this.props.match.params;
const { branchs , branch , branchLastCommit , http_url } = this.props;
const columns = [
{
dataIndex: 'name',
width:"100%",
render: (text,item) => (
<a><i className={ item.type === "file" ? "iconfont icon-zuoye font-15 color-blue mr5":"iconfont icon-wenjian font-15 color-blue mr5"}></i>{text}</a>
<a href={`/projects/${projectsId}/${item.path}`}>
<i className={ item.type === "file" ? "iconfont icon-zuoye font-15 color-blue mr5":"iconfont icon-wenjian font-15 color-blue mr5"}></i>{text}
</a>
),
}
];
@ -119,18 +124,10 @@ class CoderRootDirectory extends Component{
return(
<div>
<div className="f-wrap-between mt20">
<SelectBranch branch={branch} branchs={branchs} changeBranch={this.changeBranch}></SelectBranch>
<SelectBranch branch={branch} changeBranch={this.changeBranch} {...this.props} {...this.state}></SelectBranch>
<CloneAddress http_url={http_url} downloadUrl={downloadUrl}></CloneAddress>
</div>
<Table
className="mt20 wrap-commit-table"
columns={columns}
dataSource={rootList}
showHeader={false}
size="small"
pagination={false}
title={() => title()}
/>
<RootTable columns = {columns} data={rootList} title={() => title()}></RootTable>
</div>
)
}

@ -0,0 +1,108 @@
import React , { Component } from "react";
import SelectBranch from '../Branch/SelectBranch';
import { getImageUrl } from 'educoder';
import {Link} from 'react-router-dom';
import RootTable from './RootTable';
import './list.css';
import axios from 'axios';
class CoderRootFileDetail extends Component{
constructor(props){
super(props);
this.state={
branch:undefined,
subRootData:undefined
}
}
componentDidMount=()=>{
const { branch } = this.props.match.params;
this.getFileDetail(branch);
}
componentDidUpdate=(prevProps)=>{
}
getFileDetail=(branch)=>{
const { current_user } = this.props;
const { fileurl , projectsId } = this.props.match.params;
const url =`/${current_user.login}/${projectsId}/sub_entries.json`;
axios.get(url,{
params:{
filepath:fileurl,
ref:branch
}
}).then((result)=>{
if(result){
this.setState({
subRootData:result.data
})
}
}).catch((error)=>{
console.log(error);
})
}
changeBranch=(value)=>{
}
render(){
const { branch , projectsId , fileurl } = this.props.match.params;
const { branchLastCommit , http_url } = this.props;
const { subRootData } = this.state;
const columns =[
{
dataIndex: 'name',
width:"100%",
render: (text,item) => (
<Link to={`/projects/${projectsId}/${item.path}`}>
<i className={ item.type === "file" ? "iconfont icon-zuoye font-15 color-blue mr5":"iconfont icon-wenjian font-15 color-blue mr5"}></i>{text}
</Link>
),
}
];
const title = () =>{
if(branchLastCommit && branchLastCommit.last_commit){
return(
<div className="f-wrap-alignCenter">
{
branchLastCommit.author ?
<React.Fragment>
<img src={getImageUrl(`images/${branchLastCommit.author.image_url}`)} alt=""/>
<span className="mr15">{branchLastCommit.author.login}</span>
</React.Fragment>
:""
}
<Link to={``} className="commitKey">{branchLastCommit.last_commit.id}</Link>
<span className="color-blue flex-1 hide-1">{branchLastCommit.last_commit.message}</span>
<span>{branchLastCommit.last_commit.time_from_now}</span>
</div>
)
}else{
return undefined;
}
}
return(
<div>
<div className="f-wrap-alignCenter mt20">
<SelectBranch branch={branch} changeBranch={this.changeBranch} {...this.props} {...this.state}></SelectBranch>
<span className="flex-1 ml20 font-16">
<Link to={``} className="color-blue">iSulad</Link>
<span className="color-grey-6 subFileName">{fileurl}</span>
</span>
</div>
<RootTable columns = {columns} data={subRootData} title={() => title()}></RootTable>
</div>
)
}
}
export default CoderRootFileDetail;

@ -15,6 +15,10 @@ const CoderRootCommit = Loadable({
loader: () => import('./CoderRootCommit'),
loading: Loading,
})
const CoderRootFileDetail = Loadable({
loader: () => import('./CoderRootFileDetail'),
loading: Loading,
})
const CoderRootBranch = Loadable({
loader: () => import('./CoderRootBranch'),
loading: Loading,
@ -57,7 +61,7 @@ class CoderRootIndex extends Component{
}).catch((error)=>{})
}
render(){
const {projectDetail} = this.props
const {projectDetail} = this.props;
const { projectsId } = this.props.match.params;
const { pathname } = this.props.location;
return(
@ -79,6 +83,11 @@ class CoderRootIndex extends Component{
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/:fileurl"
render={
(props) => (<CoderRootFileDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/coder/branch"
render={

@ -24,7 +24,7 @@ class IndexItem extends Component{
</span>
</div>
<div className="p-r-content">
<p className="break_word hide-2">{item.description}</p>
<p className="break_word hide-2" style={{maxHeight:"40px"}}>{item.description}</p>
</div>
<div className="p-r-about">
<span className="p-r-detail">

@ -0,0 +1,19 @@
import React , { Component } from 'react';
import { Table } from 'antd';
class RootTable extends Component{
render(){
const { columns , data , title }=this.props;
return(
<Table
className="mt20 wrap-commit-table"
columns={columns}
dataSource={data}
showHeader={false}
size="small"
pagination={false}
title={() => title()}
/>
)
}
}
export default RootTable;

@ -277,7 +277,7 @@ body,#root{
.operationBtn{
border:1px solid #f4f4f4;
border-radius: 3px;
padding:0px 4px;
padding:0px 6px;
background-color:#fff;
color:#666!important;
display: inline-block;
@ -292,14 +292,31 @@ body,#root{
.leftPoint::before{
position: absolute;
left: -10px;
top:3px;
top:8px;
border-radius: 50%;
width: 5px;
height: 5px;
background-color: #f4f4f4;
width: 4px;
height: 4px;
background-color: #dadada;
content: '';
}
/* 文件目录、文件内容 */
.subFileName{
position: relative;
margin-left: 15px;
height: 22px;
}
.subFileName::before{
position: absolute;
content: '/';
left: -10px;
top: 0px;
color: #999;
height: 22px;
line-height: 22px;
}
@media screen and (max-width: 750px){
.list-left,.list-right{

@ -0,0 +1,7 @@
import { combineReducers } from 'redux';
export default combineReducers({
})

@ -0,0 +1,18 @@
/*
* @Description: 指定容器并绑定 reducers
* @Author: tangjiang
* @Date: 2019-11-13 20:13:21
* @Last Modified by: tangjiang
* @Last Modified time: 2019-11-14 19:20:44
*/
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from '../reducers';
const configureStore = () => createStore(
rootReducer,
applyMiddleware(thunk)
);
export default configureStore;
Loading…
Cancel
Save