forked from Gitlink/build
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[111],{BUDl:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,l=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}(),r=a("cDcd"),s=(n=r)&&n.__esModule?n:{default:n},c=a("eO8H");a("dVyQ");var o=a("sYIF");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){return u(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),l(t,[{key:"render",value:function(){var e=this.props.match.params,t=e.projectsId,a=e.owner,n=this.props.item;return s.default.createElement("div",{className:"activity_item"},s.default.createElement("div",{className:"flex1"},"VersionRelease"===n.trend_type?s.default.createElement("p",{className:"itemLine"},s.default.createElement(c.Link,{to:"/"+a+"/"+t+"/releases",className:"font-16"},n.name),s.default.createElement("span",{className:"activity_type"},n.trend_type)):"Issue"===n.trend_type?s.default.createElement("p",{className:"itemLine"},s.default.createElement(c.Link,{to:"/"+a+"/"+t+"/issues/"+n.trend_id,className:"font-16"},n.name),s.default.createElement("span",{className:"activity_type"},n.trend_type)):s.default.createElement("p",{className:"itemLine"},s.default.createElement(c.Link,{to:"/"+a+"/"+t+"/pulls/"+n.trend_id,className:"font-16"},n.name),s.default.createElement("span",{className:"activity_type"},n.trend_type)),s.default.createElement("p",{className:"itemLine mt10"},s.default.createElement(c.Link,{to:"/"+(n&&n.user_login),className:"show-user-link"},s.default.createElement("img",{alt:"",src:(0,o.getImageUrl)("/"+n.user_avatar),className:"createImage"}),s.default.createElement("span",{className:"mr20"},n.user_name)),n.created_at&&s.default.createElement("span",{className:"color-grey-9"},"创建于",s.default.createElement("span",{className:"ml2 color-grey-6"},n.created_at)))))}}]),t}(r.Component);t.default=d},MN5C:function(e,t,a){},dVyQ:function(e,t,a){},rS1K:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=y(a("NUBc")),l=y(a("W9HT")),r=y(a("jsC+")),s=y(a("CtXQ")),c=y(a("3S7+")),o=y(a("BvKs")),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},i=function(){function e(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,a,n){return a&&e(t.prototype,a),n&&e(t,n),t}}();a("DjyN"),a("T2oS"),a("qVdP"),a("Pwec"),a("5Dmo"),a("lUTK");var d=a("cDcd"),m=y(d),f=a("sYIF");a("7dqz"),a("MN5C"),a("dVyQ");var p=y(a("2CTR")),_=y(a("BUDl")),h=y(a("vDqi"));function y(e){return e&&e.__esModule?e:{default:e}}var E=[{id:"",name:"全部"},{id:1,name:"1天"},{id:3,name:"3天"},{id:7,name:"1周"},{id:30,name:"1个月"}],g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a.componentDidMount=function(){a.updateDocumentTitle();var e=a.state,t=e.time,n=e.type,l=e.status,r=e.page;a.setState({isSpin:!0}),a.getInfo(t,n,l,r),a.getCodeInfo()},a.getInfo=function(e,t,n,l){var r=a.props.match.params,s=r.projectsId,c="/"+r.owner+"/"+s+"/activity.json";h.default.get(c,{params:{time:e,type:t,status:n,page:l}}).then((function(e){e&&(a.setState({data:e.data,project_trends:e.data.project_trends,isSpin:!1,pr_count:e.data.pr_count,new_pr_count:e.data.new_pr_count,close_issues_count:e.data.close_issues_count,open_issues_count:e.data.open_issues_count,pr_all_count:e.data.pr_all_count,issues_count:e.data.issues_count}),window.scrollTo(0,0))})).catch((function(e){}))},a.changeTime=function(e){a.setState({time:"item_0"===e.key?void 0:e.key,isSpin:!0});var t=a.state,n=t.type,l=t.status,r=t.page;a.getInfo("item_0"===e.key?void 0:e.key,n,l,r)},a.changeTrends=function(e,t){a.setState({type:e,status:t,page:1});var n=a.state.time;a.getInfo(n,e,t,1)},a.ChangePage=function(e){a.setState({page:e});var t=a.state,n=t.time,l=t.type,r=t.status;a.getInfo(n,l,r,e)},a.menu=function(){return m.default.createElement(o.default,null,E&&E.map((function(e,t){return m.default.createElement(o.default.Item,{key:e.id,onClick:a.changeTime},e.name)})))},a.state={time:void 0,type:void 0,state:void 0,page:1,pr_count:void 0,new_pr_count:void 0,close_issues_count:void 0,open_issues_count:void 0,pr_all_count:void 0,issues_count:void 0,data:void 0,project_trends:void 0,codeStatus:void 0,isSpin:!1},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"getCodeInfo",value:function(){var e=this,t=this.props.match.params,a=t.projectsId,n="/v1/"+t.owner+"/"+a+"/code_stats.json";h.default.get(n).then((function(t){t&&e.setState({codeStatus:t.data})})).catch((function(e){}))}},{key:"componentDidUpdate",value:function(){this.updateDocumentTitle()}},{key:"updateDocumentTitle",value:function(){var e=this.props.projectDetail;if(e&&-1===document.title.indexOf("动态-")){var t=e.author,a=e.name;document.title="动态-"+t.name+"/"+a}}},{key:"render",value:function(){var e=this,t=this.state,a=t.time,o=t.data,i=t.page,d=t.project_trends,h=t.isSpin,y=t.pr_count,g=t.new_pr_count,v=t.close_issues_count,b=t.open_issues_count,N=t.pr_all_count,w=t.issues_count,j=t.type,k=t.status,I=t.codeStatus,O=a?E.filter((function(e){return e.id===parseInt(a)})):[{name:"全部"}],C=N>0?100*parseFloat(y/N).toFixed(2)+"%":"50%",S=N>0?100*parseFloat(g/N).toFixed(2)+"%":"50%",P=w>0?100*parseFloat(v/w).toFixed(2)+"%":"50%",T=w>0?100*parseFloat(b/w).toFixed(2)+"%":"50%",D=this.props.projectDetail;return m.default.createElement("div",{className:"main mt20"},m.default.createElement("div",{className:"normalBox"},m.default.createElement("div",{class:"normalBox-title"},"概览"),m.default.createElement("div",{className:"orderInfo"},m.default.createElement("div",null,m.default.createElement("div",{className:"percentLine prPercent"},m.default.createElement("p",{className:"percent_purple",style:{width:C}}),m.default.createElement("p",{className:"percent_green resetStyle",style:{width:""+S}})),m.default.createElement("span",null,o&&o.pr_all_count,"合并请求")),m.default.createElement("div",null,m.default.createElement("div",{className:"percentLine"},m.default.createElement("p",{className:"percent_red",style:{width:""+P}}),m.default.createElement("p",{className:"percent_green",style:{width:""+T}})),m.default.createElement("span",null,o&&o.issues_count,"疑修"))),m.default.createElement("ul",{className:"percentBox"},m.default.createElement("li",null,m.default.createElement("span",{className:"purple"},o&&o.pr_count),m.default.createElement("span",{className:"PullRequest"===j&&"delay"===k?"change active":"change",onClick:function(){return e.changeTrends("PullRequest","delay")}},"已处理的合并请求")),m.default.createElement("li",null,m.default.createElement("span",{className:"green"},o&&o.new_pr_count),m.default.createElement("span",{className:"PullRequest"===j&&"not_delay"===k?"change active":"change",onClick:function(){return e.changeTrends("PullRequest","not_delay")}},"未处理的合并请求")),m.default.createElement("li",null,m.default.createElement("span",{className:"red"},o&&o.close_issues_count),m.default.createElement("span",{className:"Issue"===j&&"delay"===k?"change active":"change",onClick:function(){return e.changeTrends("Issue","delay")}},"已关闭的疑修")),m.default.createElement("li",null,m.default.createElement("span",{className:"green"},o&&o.open_issues_count),m.default.createElement("span",{className:"Issue"===j&&"not_delay"===k?"change active":"change",onClick:function(){return e.changeTrends("Issue","not_delay")}},"未处理的疑修"))),I&&m.default.createElement("div",{className:"prMsg"},m.default.createElement("div",null,"排除合并,",m.default.createElement("span",{className:"fontbold"},I.author_count," 作者")," 已经推送 ",m.default.createElement("span",{className:"fontbold"},I.commit_count," 提交")," 到",I.commit_count_in_all_branches&&I.commit_count_in_all_branches>0?m.default.createElement("span",null," ",D&&D.default_branch," 和 ",m.default.createElement("span",null,I.commit_count_in_all_branches," 提交")," 到所有分支"):"","。 在 ",D&&D.default_branch," 上,",I.change_files&&I.change_files>0?m.default.createElement("span",null,m.default.createElement("span",{className:"fontbold"},I.change_files," 文件")," 已经改变 而且"):"",I.additions&&I.additions>0?m.default.createElement("span",null,m.default.createElement("span",{className:"fontbold greencount"},"新增 ",I.additions," 行")):"",I.additions&&I.additions>0&&I.deletions&&I.deletions>0?m.default.createElement("span",null," 和"):"",I.deletions&&I.deletions>0?m.default.createElement("span",null,m.default.createElement("span",{className:"fontbold redcount"}," 删除 ",I.deletions," 行")):"","."),I.authors&&I.authors.length>0&&m.default.createElement("ul",{className:"prAuthor"},I.authors.map((function(e,t){return e.author?e.author.login||e.author.email?m.default.createElement("a",{href:e.author.login?"/"+e.author.login:"mailto:"+e.author.email},m.default.createElement("img",{src:(0,f.getImageUrl)(e.author&&e.author.image_url),width:"38px",alt:""}),m.default.createElement(c.default,{title:e.author&&e.author.name,placement:"bottom"},m.default.createElement("span",null,e.author&&e.author.name))):m.default.createElement("span",null,m.default.createElement("img",{src:(0,f.getImageUrl)(e.author&&e.author.image_url),width:"38px",alt:""}),m.default.createElement(c.default,{title:e.author&&e.author.name,placement:"bottom"},m.default.createElement("span",null,e.author&&e.author.name))):""}))))),m.default.createElement("div",{className:"df trendsTop mt20"},m.default.createElement("div",{className:"branchDropdown f-wrap-alignCenter"},m.default.createElement(r.default,{overlay:this.menu(),trigger:["click"],placement:"bottomLeft"},m.default.createElement("a",{className:"ant-dropdown-link"},m.default.createElement("span",{className:"color-grey-9 mr3"},"周期:"),O&&O.length>0&&O[0].name," ",m.default.createElement(s.default,{type:"down"}))))),m.default.createElement(l.default,{spinning:h},d&&d.length>0?m.default.createElement("div",{className:"activity_list"},d&&d.map((function(t,a){return m.default.createElement(_.default,u({item:t},e.props))}))):m.default.createElement(p.default,{_html:"暂时还没有相关数据!"})),o&&o.project_trends_size>0&&o.project_trends_size>15&&m.default.createElement("div",{className:"pageDIV"},m.default.createElement(n.default,{showQuickJumper:!0,defaultCurrent:i,total:o&&o.project_trends_size,pageSize:15,onChange:this.ChangePage})))}}]),t}(d.Component);t.default=g}}]); |