diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 5949c2fb5..322b95ce0 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -45,16 +45,9 @@ export function initAxiosInterceptors(props) { // https://github.com/axios/axios/issues/1497 // TODO 读取到package.json中的配置? - var //proxy = "http://localhost:3000" - //proxy = "http://testbdweb.trustie.net" - //proxy = "http://testbdweb.educoder.net" - // proxy = "https://testeduplus2.educoder.net" - //proxy="http://47.96.87.25:48080" - // proxy="https://pre-newweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - //proxy="https://test-jupyterweb.educoder.net" - //proxy="http://192.168.2.63:3001" - proxy="http://123.59.135.93:56666" + var + // proxy="http://123.59.135.93:56666" + proxy="http://localhost:3000" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 diff --git a/public/react/src/forge/Images/1.png b/public/react/src/forge/Images/1.png new file mode 100644 index 000000000..e288da625 Binary files /dev/null and b/public/react/src/forge/Images/1.png differ diff --git a/public/react/src/forge/Images/2.png b/public/react/src/forge/Images/2.png new file mode 100644 index 000000000..0e764579c Binary files /dev/null and b/public/react/src/forge/Images/2.png differ diff --git a/public/react/src/forge/Images/3.png b/public/react/src/forge/Images/3.png new file mode 100644 index 000000000..f268c0c6a Binary files /dev/null and b/public/react/src/forge/Images/3.png differ diff --git a/public/react/src/forge/Images/4.png b/public/react/src/forge/Images/4.png new file mode 100644 index 000000000..b1f053398 Binary files /dev/null and b/public/react/src/forge/Images/4.png differ diff --git a/public/react/src/forge/Images/5.png b/public/react/src/forge/Images/5.png new file mode 100644 index 000000000..7ee439832 Binary files /dev/null and b/public/react/src/forge/Images/5.png differ diff --git a/public/react/src/forge/Images/6.png b/public/react/src/forge/Images/6.png new file mode 100644 index 000000000..d0f295a53 Binary files /dev/null and b/public/react/src/forge/Images/6.png differ diff --git a/public/react/src/forge/Images/array.png b/public/react/src/forge/Images/array.png new file mode 100644 index 000000000..077e61337 Binary files /dev/null and b/public/react/src/forge/Images/array.png differ diff --git a/public/react/src/forge/Images/banner_list.png b/public/react/src/forge/Images/banner_list.png new file mode 100644 index 000000000..9bc449d63 Binary files /dev/null and b/public/react/src/forge/Images/banner_list.png differ diff --git a/public/react/src/forge/Images/banner_sub.png b/public/react/src/forge/Images/banner_sub.png new file mode 100644 index 000000000..ecc293183 Binary files /dev/null and b/public/react/src/forge/Images/banner_sub.png differ diff --git a/public/react/src/forge/Images/banner_team.png b/public/react/src/forge/Images/banner_team.png new file mode 100644 index 000000000..f0ca667f6 Binary files /dev/null and b/public/react/src/forge/Images/banner_team.png differ diff --git a/public/react/src/forge/Images/dir.png b/public/react/src/forge/Images/dir.png new file mode 100644 index 000000000..5172862c9 Binary files /dev/null and b/public/react/src/forge/Images/dir.png differ diff --git a/public/react/src/forge/Images/focus.png b/public/react/src/forge/Images/focus.png new file mode 100644 index 000000000..4dd123719 Binary files /dev/null and b/public/react/src/forge/Images/focus.png differ diff --git a/public/react/src/forge/Images/focused.png b/public/react/src/forge/Images/focused.png new file mode 100644 index 000000000..414f168a2 Binary files /dev/null and b/public/react/src/forge/Images/focused.png differ diff --git a/public/react/src/forge/Images/fork.png b/public/react/src/forge/Images/fork.png new file mode 100644 index 000000000..768bd8b50 Binary files /dev/null and b/public/react/src/forge/Images/fork.png differ diff --git a/public/react/src/forge/Images/item.png b/public/react/src/forge/Images/item.png new file mode 100644 index 000000000..ecb532c65 Binary files /dev/null and b/public/react/src/forge/Images/item.png differ diff --git a/public/react/src/forge/Images/new.png b/public/react/src/forge/Images/new.png new file mode 100644 index 000000000..9255fe828 Binary files /dev/null and b/public/react/src/forge/Images/new.png differ diff --git a/public/react/src/forge/Images/parise.png b/public/react/src/forge/Images/parise.png new file mode 100644 index 000000000..6f95cbf96 Binary files /dev/null and b/public/react/src/forge/Images/parise.png differ diff --git a/public/react/src/forge/Images/parised.png b/public/react/src/forge/Images/parised.png new file mode 100644 index 000000000..58d889a57 Binary files /dev/null and b/public/react/src/forge/Images/parised.png differ diff --git a/public/react/src/forge/Images/type.png b/public/react/src/forge/Images/type.png new file mode 100644 index 000000000..4b860f712 Binary files /dev/null and b/public/react/src/forge/Images/type.png differ diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index 9e007c18a..3556cd681 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -8,6 +8,17 @@ import Loadable from 'react-loadable'; import Loading from '../../Loading'; import axios from 'axios'; + +import img_1 from '../Images/1.png'; +import img_2 from '../Images/2.png'; +import img_3 from '../Images/3.png'; +import img_4 from '../Images/4.png'; +import img_6 from '../Images/6.png'; +import img_parise from '../Images/parise.png'; +import img_focus from '../Images/focus.png'; +import img_parised from '../Images/parised.png'; +import img_focused from '../Images/focused.png'; +import img_fork from '../Images/fork.png'; const FileNew = Loadable({ loader: () => import('../Newfile/Index'), loading: Loading, @@ -277,43 +288,49 @@ class Detail extends Component{ return(
-
-

{projectDetail && projectDetail.author && projectDetail.author.name} / { projectDetail && projectDetail.identifier }

- - - - this.focusFunc(projectDetail && projectDetail.watched)}> - - {projectDetail && projectDetail.watched ? '取消关注':'关注'} - - {watchers_count} - - - this.pariseFunc(projectDetail && projectDetail.praised)}> - - {projectDetail && projectDetail.praised ? '取消点赞':'点赞'} - - {praises_count} +
+
+

+ {projectDetail && projectDetail.author && projectDetail.author.name} + | + { projectDetail && projectDetail.identifier } +

+
+
+
    +
  • 0 || urlFlag)? "active" : ""}>代码
  • +
  • 0 ? "active" : ""}>工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}
  • +
  • 0 ? "active" : ""}>合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}
  • +
  • 0 ? "active" : ""}>版本发布
  • +
  • 0 ? "active" : ""}>动态
  • + { + isManager && +
  • 0 ? "active" : ""}>仓库设置
  • + } +
  • 0 ? "active" : ""}>仓库设置
  • +
+ + + this.focusFunc(projectDetail && projectDetail.watched)}> + + {projectDetail && projectDetail.watched ? '取消关注':'关注'} + + {watchers_count} + + + this.pariseFunc(projectDetail && projectDetail.praised)}> + + {projectDetail && projectDetail.praised ? '取消点赞':'点赞'} + + {praises_count} + + + + Fork + {forked_count} + - - Fork - {forked_count} - - -
-
-
    -
  • 0 || urlFlag)? "active" : ""}>代码
  • -
  • 0 ? "active" : ""}>工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}
  • -
  • 0 ? "active" : ""}>合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}
  • -
  • 0 ? "active" : ""}>版本发布
  • -
  • 0 ? "active" : ""}>动态
  • - { - isManager && -
  • 0 ? "active" : ""}>仓库设置
  • - } -
  • 0 ? "active" : ""}>仓库设置
  • -
+
diff --git a/public/react/src/forge/Main/Index.js b/public/react/src/forge/Main/Index.js index 8b2e4cf3c..869805ad9 100644 --- a/public/react/src/forge/Main/Index.js +++ b/public/react/src/forge/Main/Index.js @@ -8,8 +8,11 @@ import './list.css'; import ListItem from './IndexItem' import axios from 'axios'; +import img_new from '../Images/new.png'; +import img_array from '../Images/array.png'; + const Search = Input.Search; -const { SubMenu } = Menu; + class Index extends Component{ constructor(props){ super(props); @@ -68,16 +71,6 @@ class Index extends Component{ axios.get(url).then((result)=>{ if(result && result.data){ this.setTypeList(result.data, undefined) - // this.setState({ - // typeList:result.data && result.data.map((item,key)=>{ - // return( - //
  • this.changeType(`${item.project_type}`, `${item.id}`)}> - // {item.name} - // {item.projects_count} - //
  • - // ) - // }) - // }) } }).catch((error)=>{}) } @@ -86,9 +79,11 @@ class Index extends Component{ this.setState({ typeList:list.map((item)=>{ return( -
  • this.changeType(`${item.project_type}`, list)}> - {item.name} - {item.projects_count} +
  • this.changeType(`${item.project_type}`, list)}> +

    + {item.name} + {item.projects_count} +

  • ) }) @@ -122,9 +117,11 @@ class Index extends Component{ this.setState({ categoryList:list.map((item)=>{ return( -
  • this.changeCategory(`${item.id}`,list)}> - {item.name} - {item.projects_count} +
  • this.changeCategory(`${item.id}`,list)}> +

    + {item.name} + {item.projects_count} +

  • ) }) @@ -217,9 +214,21 @@ class Index extends Component{ { categoryList }
    -
    +
    + -
    { pagination } diff --git a/public/react/src/forge/Main/IndexItem.js b/public/react/src/forge/Main/IndexItem.js index 3d80770d0..51e110fb3 100644 --- a/public/react/src/forge/Main/IndexItem.js +++ b/public/react/src/forge/Main/IndexItem.js @@ -3,7 +3,7 @@ import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import '../css/index.css' import './list.css'; - +import img_parise from '../Images/parise.png'; class IndexItem extends Component{ render(){ @@ -17,21 +17,22 @@ class IndexItem extends Component{
    {item.name} + +
    +
    +

    {item.description}

    - { item.forked_count ? { item.forked_count}:"" } - { item.praises_count } + {/* { item.forked_count ? { item.forked_count}:"" } */} + 点赞 ({ item.praises_count }) { item.language && item.language.id ? :"" }
    -
    -

    {item.description}

    -
    {item.visits} { item.category && item.category.id && {item.category.name}} + {item.last_update_time ? {item.time_ago} : "" } - {item.last_update_time ? 更新于{item.time_ago} : "" }
    diff --git a/public/react/src/forge/Main/list.css b/public/react/src/forge/Main/list.css index e17397862..d28b36a00 100644 --- a/public/react/src/forge/Main/list.css +++ b/public/react/src/forge/Main/list.css @@ -3,8 +3,8 @@ body,#root{ } .lineH2{line-height:2} .t_project_banner { - background: url(../../images/forge/project.jpg) no-repeat top center; height: 260px; + background: url(../Images/banner_list.png) no-repeat center; background-color: #050d34; } .ProjectListIndex{ @@ -30,30 +30,43 @@ body,#root{ margin-bottom: 20px; } .list-l-Menu>li{ - height: 40px; - line-height: 40px; font-size: 1rem; padding:0px 20px; box-sizing: border-box; color: #333; + position: relative; +} +.list-l-Menu>li > p{ + height: 50px; + line-height: 50px; + width: 100%; + border-bottom: 1px solid #eee; display: flex; justify-content: space-between; cursor: pointer; } -.list-l-Menu li span:last-child{ +.list-l-Menu>li:last-child > p{ + border-bottom: none; +} +.list-l-Menu li p span:last-child{ color: #999; } .list-l-Menu .MenuTitle{ - background-color: #efefef; - border-radius: 4px 4px 0px 0px; font-size: 16px; + background:url(../Images/dir.png) no-repeat; + background-size: 100% 100%; + color: #fff!important; + height: 50px; + line-height: 50px; } -.list-l-Menu > li:not(.MenuTitle):hover{ - background-color: #1890ff; +.list-l-Menu:nth-child(2) .MenuTitle{ + background:url(../Images/type.png) no-repeat; + background-size: 100% 100%; } -.list-l-Menu > li:not(.MenuTitle):hover span{ - color: #fff; +.list-l-Menu > li:not(.MenuTitle):hover{ + background-color: #ECF6FF; } + /* 左侧menu */ .list-l-Menu .ant-menu-inline{ border:none; @@ -64,17 +77,27 @@ body,#root{ .list-l-Menu .ant-menu-item-group-title{ padding:0px; } - +.list-l-Menu li.active::before{ + position: absolute; + left: 0px; + top: 8px; + width: 2px; + content: ''; + height: 34px; + background: #4CACFF; +} .list-r-operation{ display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; - padding:15px 0px 25px; + padding:25px 0px; } .list-r-Search{ width: 400px; - margin-right: 20px; +} +.padding0-25{ + padding:0px 25px; } .list-r-Search .ant-btn-lg{ height: 38px; @@ -94,7 +117,14 @@ body,#root{ .p-r-Item{ display: flex; padding:15px 0px; - border-top: 1px solid #eee; + box-shadow:0px 2px 20px 0px rgba(0,0,0,0.05); + border-radius:2px; + border:1px solid rgba(238,238,238,1); + margin-bottom: 15px; + padding:20px; +} +.boxShandow{ + box-shadow:0px 2px 20px 10px rgba(0,0,0,0.03); } .p-r-photo{ width: 42px; @@ -151,15 +181,19 @@ body,#root{ } .p-r-tags > span{ margin-left: 15px; - border-radius: 4px; - border:1px solid #efefef; - background: #e2f0fd; + padding:0px 10px; + border-radius:15px; + background: #EBF4FE; + color: #333; height: 24px; line-height: 24px; display: block; font-size: 12px; display: flex; } +.p-r-tags > span.pariseTag{ + background: #FFF3DC; +} .p-r-tags.large > span >label{ padding:0px 12px; } @@ -169,6 +203,12 @@ body,#root{ .p-r-tags.large > span >span{ padding:0px 6px; } +.pariseImg{ + width: 14px; + height: 12px; + margin-top: 6px; + margin-right: 3px; +} .p-r-tags > span >span{ display: block; background: #fff; @@ -180,6 +220,7 @@ body,#root{ .p-r-content{ margin-top:10px; color: #666; + display: flex; } .p-r-detail > span{ margin-right: 15px; @@ -199,28 +240,57 @@ body,#root{ /* -----------详情------------ */ .detailHeader-wrapper{ - background: #f7f7f7; - padding-top:20px; - border-bottom: 1px solid rgba(34,36,38,.15); + background:url(../Images/banner_sub.png) no-repeat center; + background-size: 100% 100%; + height: 120px; } .headerMenu-wrapper{ - background: #f7f7f7; font-size: 16px; display: flex; flex-direction: row; - color: #999; } .headerMenu-wrapper li{ - padding:6px 14px; + padding:0px 18px; position: relative; - text-align: center + text-align: center; + height: 30px; + line-height: 30px; +} +.headerMenu-wrapper li a{ + color: #fff; + display: flex; + align-items: center; +} +.headerMenu-wrapper li a > img{ + margin-right: 5px; } .headerMenu-wrapper li.active{ - background: #fff; - margin-bottom: -1px; - border:1px solid rgba(34,36,38,.15); - border-bottom: none; - border-radius: 4px 4px 0px 0px; + background:linear-gradient(180deg,rgba(58,194,255,1) 0%,rgba(27,143,255,1) 100%); + border-radius: 15px; +} +.detail_tag_btn{ + height:30px; + line-height: 30px; + border-radius:4px; + border:1px solid rgba(28,145,255,1); + display: flex; + align-items: center; + margin-left: 30px +} +.detail_tag_btn_name{ + padding:0px 10px; + display: flex; + align-items: center; + color: #fff; +} +.detail_tag_btn_name img{ + margin-right: 3px; +} +.detail_tag_btn_count{ + padding:0px 10px; + color: #fff; + background: #1C91FF; + border-radius: 0px 4px 4px 0px; } /* 详情-代码 */ .branch-wrapper{ diff --git a/public/react/src/forge/Settings/Collaborator.js b/public/react/src/forge/Settings/Collaborator.js index c8602ea97..0691645c6 100644 --- a/public/react/src/forge/Settings/Collaborator.js +++ b/public/react/src/forge/Settings/Collaborator.js @@ -1,6 +1,6 @@ import React , { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Input , AutoComplete , Dropdown , Menu , Icon , Spin } from 'antd'; +import { Input , AutoComplete , Dropdown , Menu , Icon , Spin , Pagination } from 'antd'; import axios from 'axios'; const { Option } = AutoComplete; @@ -24,25 +24,27 @@ class Collaborator extends Component{ user_id:undefined, userDataSource:undefined, page:1, + total_count:undefined, isSpin:true } } componentDidMount=()=>{ if(this.props.project_id){ - this.getMember(this.props.project_id); + const { page } = this.state; + this.getMember(this.props.project_id,page); } } componentDidUpdate=(prevState)=>{ if(this.props.project_id && this.props.project_id !== prevState.project_id){ - this.getMember(this.props.project_id); + const { page } = this.state; + this.getMember(this.props.project_id,page); } } // 获取项目协作者 - getMember=(project_id)=>{ - const { page } = this.state; + getMember=(project_id,page)=>{ const url = `/projects/${project_id}/members.json`; axios.get(url,{ params:{ @@ -52,7 +54,8 @@ class Collaborator extends Component{ if(result){ this.setState({ listData:result.data.members, - isSpin:false + isSpin:false, + total_count:result.data.total_count }) } }).catch(error=>{ @@ -108,7 +111,7 @@ class Collaborator extends Component{ // 修改权限 changeOperaiton=(e,id)=>{ - const { project_id } = this.props; + const { project_id , page } = this.props; this.setState({ isSpin:true }) @@ -122,7 +125,7 @@ class Collaborator extends Component{ isSpin:true }) this.props.showNotification('权限修改成功!'); - this.getMember(project_id); + this.getMember(project_id,page); } }).catch(error=>{ console.log(error); @@ -131,6 +134,7 @@ class Collaborator extends Component{ // 删除协作者 deleteUser=(id)=>{ + const { page } = this.state; this.props.confirm({ content:"确认将此成员从项目中移除?", onOk:()=>{ @@ -144,7 +148,7 @@ class Collaborator extends Component{ isSpin:true }) this.props.showNotification("成员删除成功!"); - this.getMember(project_id); + this.getMember(project_id,page); } }).catch(error=>{ console.log(error); @@ -152,8 +156,15 @@ class Collaborator extends Component{ } }) } + changePage=(page)=>{ + this.setState({ + page + }) + const { project_id } = this.props; + this.getMember(project_id,page); + } render(){ - const { userDataSource , listData , isSpin } = this.state; + const { userDataSource , listData , isSpin , page , total_count } = this.state; // 获取当前项目的拥有者 const { author } = this.props; const menu =(id)=> ( @@ -223,7 +234,13 @@ class Collaborator extends Component{ 增加协作者
    - + { + total_count && total_count > LIMIT ? +
    + +
    + :"" + } ) }