diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index ce576c636..1e402bad9 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -45,16 +45,7 @@ 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://localhost:3000"; // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 diff --git a/public/react/src/forge/Activity/Activity.js b/public/react/src/forge/Activity/Activity.js index a95397eee..ac75281c5 100644 --- a/public/react/src/forge/Activity/Activity.js +++ b/public/react/src/forge/Activity/Activity.js @@ -6,6 +6,7 @@ import '../css/index.css'; import '../Branch/branch.css'; import './activity.css'; +import ActivityItem from './ActivityItem'; import axios from 'axios'; const LIMIT = 15; const ARRAY = [ @@ -26,6 +27,8 @@ const ARRAY = [ name:'1个月' } ] +const dataformat="YYYY-MM-DD HH:mm"; + class Activity extends Component{ constructor(props){ super(props); @@ -35,7 +38,8 @@ class Activity extends Component{ state:undefined, page:1, - data:undefined + data:undefined, + project_trends:undefined } } componentDidMount=()=>{ @@ -53,7 +57,8 @@ class Activity extends Component{ }).then(result=>{ if(result){ this.setState({ - data:result.data + data:result.data, + project_trends:result.data.project_trends }) } }).catch(error=>{ @@ -62,13 +67,13 @@ class Activity extends Component{ } // 切换周期 - // changeTime=(e)=>{ - // this.setState({ - // time:e.key - // }) - // const { type,status,page } = this.state; - // this.getInfo(e.key,type,status,page); - // } + changeTime=(e)=>{ + this.setState({ + time:e.key + }) + const { type,status,page } = this.state; + this.getInfo(e.key,type,status,page); + } // 分页 ChangePage=(page)=>{ @@ -79,7 +84,7 @@ class Activity extends Component{ this.getInfo(time,type,status,page); } render(){ - const { time , data , page } = this.state; + const { time , data , page , project_trends } = this.state; const menu = ( @@ -94,6 +99,7 @@ class Activity extends Component{ ); + const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%'; const third_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%'; const fourth_per = (parseInt(data && data.open_issues_count)/parseInt(data && data.issues_count)*100)+'%'; @@ -104,9 +110,9 @@ class Activity extends Component{
概览
-
-

-

+
+

+

{data && data.pr_count}合并请求
@@ -148,17 +154,13 @@ class Activity extends Component{
-
-

- ISSUE - title -

-

- - caicai - 创建于{moment('2019-01-18 18:00','')} -

-
+ { + project_trends && project_trends.map((item,key)=>{ + return( + + ) + }) + }
{ data && data.project_trends_size > 0 && data.project_trends_size > LIMIT && diff --git a/public/react/src/forge/Activity/ActivityItem.js b/public/react/src/forge/Activity/ActivityItem.js new file mode 100644 index 000000000..2b6f95d17 --- /dev/null +++ b/public/react/src/forge/Activity/ActivityItem.js @@ -0,0 +1,27 @@ +import React , { Component } from 'react'; +import {Link} from 'react-router-dom'; +import './activity.css'; +import { getImageUrl } from 'educoder'; + + +class ActivityItem extends Component{ + render(){ + const { item } = this.props; + return( +
+
+

+ {item.name} + {item.trend_type} +

+

+ + {item.user_name} + 创建于{item.created_at} +

+
+
+ ) + } +} +export default ActivityItem; \ No newline at end of file diff --git a/public/react/src/forge/Activity/activity.css b/public/react/src/forge/Activity/activity.css index 148273357..fc8d49f17 100644 --- a/public/react/src/forge/Activity/activity.css +++ b/public/react/src/forge/Activity/activity.css @@ -1,7 +1,6 @@ .trendsTop{ padding-bottom: 15px; border-bottom:1px solid #ddd; - margin-bottom: 15px; } .normalBox{ border-radius: 4px; @@ -31,6 +30,7 @@ height: 8px; border-radius: 2px; background: #888; + position: relative; } .percent_green{ background-color: #6cc644; @@ -67,4 +67,43 @@ } .percentBox > li:last-child{ border-right: none; +} +.activity_list .activity_item{ + border-bottom: 1px solid #f4f4f4; + padding:15px 0px; + display: flex; + align-items: flex-start; +} +.prPercent > p{ + position: absolute; + height: 100%; + top:0px; + left: 0px; + z-index: 0; +} +.prPercent > p.resetStyle{ + left: unset; + right: 0px; + z-index: 1; +} +.itemLine{ + display: flex; + align-items: center; +} +.activity_type{ + display: block; + padding:0px 5px; + height: 20px; + line-height: 20px; + background: #6cc644; + margin-left: 10px; + color: #fff; + border-radius: 3px; + font-size: 12px; +} +.createImage{ + margin-right: 5px; + height: 22px; + line-height: 22px; + border-radius: 50%; } \ No newline at end of file