1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[23],{"0Rql":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAQCAYAAABtPJ3XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAAEAAAAACYv7IkAAABuElEQVRIDdVWr0/DQBT+ujQowgSZwAAKQkhAoAiGTBT2B+ARM/wIAQx2dgYICdRU4PkDBhM4goYEgwODWBBDIjje17VJV9rudkdIeMmt69137333+n6cg1+StR01L6rqMjwFTFKtA7zKoy0juDl3njhnK6LTTjYaauSjg2PRsqUUSlnaHAdfMu+PVXB41XA+szC6c1aESbbbQQsKVSGF2gqwvgxMTfTMv7wB1/dA6w6Qw9Dlt+UKajakXd2TZeFCzwrZ8TJwtAkszvSjZqcBjtUloHkJvHdRjb7Gbj9S/83Yw1HMPoqpUnPvJ9k0hYdnOdRZOMvwWDCN6cyYSxvLea8zZhkGac9m4YkhNopzJqeR2BD2aJExqysJbLhXd18SZ0w4Ll1xgiWV5v2PsfHePFzRvOtth/lbhMleY9abisKoqV1jD8dcWbp0ZRhsnk63fcEKOrxIlTiRb7PPOsvSpSPEUsTiqVSJg97bcL82Hg7YwdgUWLIGCTHEco9gg0H4vHVjwlEd9ZkBbApFpLlGTJQtvmkN5iGsOh3vBtKa59jB2BR0WjP30LCpGMVv0ti/uvwkif/V9fIbUzmWMlmEs/gAAAAASUVORK5CYII="},"3ppx":function(t,e,n){(e=n("JPst")(!1)).push([t.i,"/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable no-duplicate-selectors */\n/* stylelint-disable */\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\n.ant-timeline {\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n font-feature-settings: 'tnum';\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.ant-timeline-item {\n position: relative;\n margin: 0;\n padding: 0 0 20px;\n font-size: 14px;\n list-style: none;\n}\n.ant-timeline-item-tail {\n position: absolute;\n top: 10px;\n left: 4px;\n height: calc(100% - 10px);\n border-left: 2px solid #e8e8e8;\n}\n.ant-timeline-item-pending .ant-timeline-item-head {\n font-size: 12px;\n background-color: transparent;\n}\n.ant-timeline-item-pending .ant-timeline-item-tail {\n display: none;\n}\n.ant-timeline-item-head {\n position: absolute;\n width: 10px;\n height: 10px;\n background-color: #fff;\n border: 2px solid transparent;\n border-radius: 100px;\n}\n.ant-timeline-item-head-blue {\n color: #466aff;\n border-color: #466aff;\n}\n.ant-timeline-item-head-red {\n color: #f5222d;\n border-color: #f5222d;\n}\n.ant-timeline-item-head-green {\n color: #52c41a;\n border-color: #52c41a;\n}\n.ant-timeline-item-head-gray {\n color: rgba(0, 0, 0, 0.25);\n border-color: rgba(0, 0, 0, 0.25);\n}\n.ant-timeline-item-head-custom {\n position: absolute;\n top: 5.5px;\n left: 5px;\n width: auto;\n height: auto;\n margin-top: 0;\n padding: 3px 1px;\n line-height: 1;\n text-align: center;\n border: 0;\n border-radius: 0;\n transform: translate(-50%, -50%);\n}\n.ant-timeline-item-content {\n position: relative;\n top: -6px;\n margin: 0 0 0 18px;\n word-break: break-word;\n}\n.ant-timeline-item-last > .ant-timeline-item-tail {\n display: none;\n}\n.ant-timeline-item-last > .ant-timeline-item-content {\n min-height: 48px;\n}\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,\n.ant-timeline.ant-timeline-right .ant-timeline-item-tail,\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,\n.ant-timeline.ant-timeline-right .ant-timeline-item-head,\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,\n.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom {\n left: 50%;\n}\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,\n.ant-timeline.ant-timeline-right .ant-timeline-item-head {\n margin-left: -4px;\n}\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,\n.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom {\n margin-left: 1px;\n}\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,\n.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content {\n left: calc(50% - 4px);\n width: calc(50% - 14px);\n text-align: left;\n}\n.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,\n.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content {\n width: calc(50% - 12px);\n margin: 0;\n text-align: right;\n}\n.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail,\n.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,\n.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom {\n left: calc(100% - 4px - 2px);\n}\n.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content {\n width: calc(100% - 18px);\n}\n.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail {\n display: block;\n height: calc(100% - 14px);\n border-left: 2px dotted #e8e8e8;\n}\n.ant-timeline.ant-timeline-reverse .ant-timeline-item-last .ant-timeline-item-tail {\n display: none;\n}\n.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail {\n top: 15px;\n display: block;\n height: calc(100% - 15px);\n border-left: 2px dotted #e8e8e8;\n}\n.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-content {\n min-height: 48px;\n}\n",""]),t.exports=e},"Ehk+":function(t,e,n){var a=n("3ppx");"string"==typeof a&&(a=[[t.i,a,""]]);n("aET+")(a,{hmr:!0,transform:void 0}),a.locals&&(t.exports=a.locals)},RC8p:function(t,e,n){"use strict";n("cIOH"),n("Ehk+")},VEFH:function(t,e,n){"use strict";n.r(e);var a=n("yQr1"),i=n.n(a),r=(n("T2oS"),n("W9HT")),o=(n("DjyN"),n("NUBc")),l=(n("RC8p"),n("rgW5")),c=(n("5Dmo"),n("3S7+")),m=n("06Pm"),s=n.n(m),p=n("kA7L"),u=n.n(p),f=n("3SUL"),h=n.n(f),d=n("eYnF"),g=n.n(d),b=n("hO3g"),y=n.n(b),v=n("X5/F"),A=n.n(v),x=n("04Ix"),E=n.n(x),w=n("o+MX"),j=n.n(w),O=n("lHQ6"),S=n.n(O),C=n("FLGM"),P=n.n(C),N=n("ZbhI"),k=n.n(N),I=n("UtpJ"),B=n.n(I),D=n("cDcd"),R=n.n(D),T=n("sYIF"),U=n("PhNK"),_=n("spEH"),H=n("3Diz"),L=n("2CTR"),F=n("Rs/d"),Q=n("bjH3"),M=n("0Rql"),K=n.n(M),Y=n("vDqi"),J=n.n(Y),V=n("2iEm"),z=n("FRFo");n("r+Iv");var q=function(t){function e(t){var n;return s()(this,e),n=function(t,e,n){return e=g()(e),h()(t,function(){try{var t=!Boolean.prototype.valueOf.call(i()(Boolean,[],(function(){})))}catch(t){}return!!t}()?i()(e,n||[],g()(t).constructor):e.apply(t,n))}(this,e,[t]),E()(y()(n),"componentDidMount",(function(){n.updateDocumentTitle(),n.Init(),n.getBranchs()})),E()(y()(n),"getBranchs",(function(){var t,e=n.props.match.params,a=e.projectsId,i=e.owner;J.a.get(j()(t="/".concat(i,"/")).call(t,a,"/branches.json")).then((function(t){n.setState({branchList:t.data})})).catch((function(t){}))})),E()(y()(n),"componentDidUpdate",(function(t){n.updateDocumentTitle(),n.props.location!==(t&&t.location)&&n.Init()})),E()(y()(n),"Init",(function(){var t=n.props.match.params.branchName,e=n.state.limit,a=n.props.location.search,i=a&&n.UrlParamHash(a).page?S()(n.UrlParamHash(a).page):1;n.setState({isSpining:!0,page:i}),n.getCommitList(Object(T.v)(t),i,e)})),E()(y()(n),"getCommitList",(function(t,e,a){var i;n.setState({isSpining:!0});var r=n.props.match.params,o=r.projectsId,l=r.owner,c=j()(i="/".concat(l,"/")).call(i,o,"/commits.json");J.a.get(c,{params:{sha:Object(T.v)(t),page:e,limit:a}}).then((function(t){if(t&&t.data){var e;n.setState({isSpining:!1});var a=[];t.data.commits&&t.data.commits.length>0&&P()(e=t.data.commits).call(e,(function(t,e){a.push({name:t.author&&t.author.name,login:t.author&&t.author.login,id:t.author&&t.author.id,image_url:t.author&&t.author.image_url,sha:t.sha,time_from_now:t.time_from_now,message:t.message,timestamp:t.timestamp})})),n.setState({commitDatas:a,dataCount:t.data.total_count,isSpining:!1})}})).catch((function(t){}))})),E()(y()(n),"changeBranch",(function(t){var e,a,i=n.props.match.params,r=i.projectsId,o=i.owner;n.props.history.push(j()(e=j()(a="/".concat(o,"/")).call(a,r,"/commits/branch/")).call(e,t))})),E()(y()(n),"ChangePage",(function(t){n.props.history.push({pathname:n.props.history.location.pathname,search:"page=".concat(t)})})),n.state={commitDatas:void 0,dataCount:void 0,limit:10,page:1,isSpining:!1,branchList:void 0},n}return A()(e,t),u()(e,[{key:"updateDocumentTitle",value:function(){var t,e=this.props.projectDetail;if(e&&-1===k()(t=document.title).call(t,"提交-")){var n,a=e.author,i=e.name;document.title=j()(n="提交-".concat(a.name,"/")).call(n,i)}}},{key:"UrlParamHash",value:function(t){for(var e,n={},a=B()(t).call(t,k()(t).call(t,"?")+1).split("&"),i=0;i<a.length;i++)n[(e=a[i].split("="))[0]]=e[1];return n}},{key:"render",value:function(){var t=this.state,e=t.commitDatas,n=t.dataCount,a=t.limit,i=t.page,m=t.isSpining,s=t.branchList,p=this.props,u=p.projectDetail,f=(p.commit_class,p.defaultBranch),h=p.platform,d=this.props.match.params,g=d.projectsId,b=d.owner,y=d.branchName,v=Object(T.v)(y||f);return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"main",style:{padding:"0px",border:"none"}},R.a.createElement("div",{className:"f-wrap-between"},R.a.createElement(H.a,{repo_id:u&&u.repo_id,projectsId:g,branch:v,changeBranch:this.changeBranch,owner:b,history:this.props.history,branchList:s})),R.a.createElement(r.a,{spinning:m},R.a.createElement(l.a,{className:"commitList"},e&&e.length>0&&P()(e).call(e,(function(t,e){var n,a,r,o;return R.a.createElement(l.a.Item,{key:e,dot:1===i&&0===e?R.a.createElement("span",{className:"new-conmmit"},"最新"):R.a.createElement("i",{className:"iconfont icon-a-yuanquan2x"})},R.a.createElement("div",{className:"commitList-item f-wrap-between"},R.a.createElement("div",null,R.a.createElement(_.c,null,R.a.createElement("div",{className:"commitDesc"},h?R.a.createElement(V.a,{to:j()(n=j()(a="/".concat(b,"/")).call(a,g,"/commits/")).call(n,Object(U.b)("".concat(t.sha))),className:"font-14 color-grey-3 font-bd"},R.a.createElement(Q.a,{value:t.message})):R.a.createElement(Q.a,{value:t.message}))),R.a.createElement("p",{className:"f-wrap-alignCenter mt15 pb5"},R.a.createElement(F.a,{id:t.id,url:t.image_url&&Object(T.i)("/".concat(t.image_url))||"https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg",name:t.name,login:t.login}),t.timestamp&&R.a.createElement("label",{className:"font-14 color-grey-3 ml3"},"提交于 ",Object(U.a)(t.timestamp)))),R.a.createElement("div",null,R.a.createElement("div",{className:"treecopy"},R.a.createElement("div",null,R.a.createElement("span",{className:"treecopy-cont shadow"},R.a.createElement("img",{src:K.a,alt:"sha",width:"16px"}),h?R.a.createElement(V.a,{to:j()(r=j()(o="/".concat(b,"/")).call(o,g,"/commits/")).call(r,Object(U.b)("".concat(t.sha)))},Object(U.b)("".concat(t.sha))):R.a.createElement("span",{style:{color:"#466AFF",cursor:"default"}},Object(U.b)("".concat(t.sha))),R.a.createElement("input",{type:"text",id:"value".concat(e),value:"".concat(Object(U.b)("".concat(t.sha)))})),R.a.createElement(z.a,{beforeText:"复制commit id",afterText:"复制成功",inputId:"value".concat(e)})),R.a.createElement(c.a,{title:"浏览该提交对应历史版本的所有文件"},R.a.createElement("button",{className:"btn-83",onClick:function(){var e,n;window.location.href=j()(e=j()(n="/".concat(b,"/")).call(n,g,"/tree/")).call(e,Object(U.b)(t.sha))}},"浏览文件"))))))})),e&&0===e.length&&R.a.createElement(L.a,{_html:"暂无数据"})),n>a?R.a.createElement("div",{className:"edu-txt-center pt30 mb30"},R.a.createElement(o.a,{simple:!0,current:i,total:n,pageSize:a,onChange:this.ChangePage})):"")))}}]),e}(D.Component);e.default=q},"r+Iv":function(t,e,n){},rgW5:function(t,e,n){"use strict";var a=n("cDcd"),i=n("eHJ2"),r=n.n(i),o=n("BGR+"),l=n("H84U");function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(t){return a.createElement(l.a,null,(function(e){var n,i,l=e.getPrefixCls,s=t.prefixCls,p=t.className,u=t.color,f=void 0===u?"":u,h=t.children,d=t.pending,g=t.dot,b=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(t,["prefixCls","className","color","children","pending","dot"]),y=l("timeline",s),v=r()((m(n={},"".concat(y,"-item"),!0),m(n,"".concat(y,"-item-pending"),d),n),p),A=r()((m(i={},"".concat(y,"-item-head"),!0),m(i,"".concat(y,"-item-head-custom"),g),m(i,"".concat(y,"-item-head-").concat(f),!0),i));return a.createElement("li",c({},Object(o.default)(b,["position"]),{className:v}),a.createElement("div",{className:"".concat(y,"-item-tail")}),a.createElement("div",{className:A,style:{borderColor:/blue|red|green|gray/.test(f)?void 0:f}},g),a.createElement("div",{className:"".concat(y,"-item-content")},h))}))};s.defaultProps={color:"blue",pending:!1,position:""};var p=s,u=n("CtXQ");function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(this,arguments)}function d(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function A(t,e){return(A=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var w=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n},j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&A(t,e)}(o,t);var e,n,i=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=E(t);if(e){var i=E(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return x(this,n)}}(o);function o(){var t;return y(this,o),(t=i.apply(this,arguments)).renderTimeline=function(e){var n,i=e.getPrefixCls,o=t.props,l=o.prefixCls,c=o.pending,m=void 0===c?null:c,s=o.pendingDot,f=o.children,g=o.className,y=o.reverse,v=o.mode,A=w(o,["prefixCls","pending","pendingDot","children","className","reverse","mode"]),x=i("timeline",l),E="boolean"==typeof m?null:m,j=r()(x,(b(n={},"".concat(x,"-pending"),!!m),b(n,"".concat(x,"-reverse"),!!y),b(n,"".concat(x,"-").concat(v),!!v),n),g),O=m?a.createElement(p,{pending:!!m,dot:s||a.createElement(u.a,{type:"loading"})},E):null,S=y?[O].concat(d(a.Children.toArray(f).reverse())):[].concat(d(a.Children.toArray(f)),[O]),C=function(t,e){return"alternate"===v?"right"===t.props.position?"".concat(x,"-item-right"):"left"===t.props.position?"".concat(x,"-item-left"):"".concat(x,e%2==0?"-item-left":"-item-right"):"left"===v?"".concat(x,"-item-left"):"right"===v||"right"===t.props.position?"".concat(x,"-item-right"):""},P=S.filter((function(t){return!!t})),N=a.Children.count(P),k="".concat(x,"-item-last"),I=a.Children.map(P,(function(t,e){var n=e===N-2?k:"",i=e===N-1?k:"";return a.cloneElement(t,{className:r()([t.props.className,!y&&m?n:i,C(t,e)])})}));return a.createElement("ul",h({},A,{className:j}),I)},t}return e=o,(n=[{key:"render",value:function(){return a.createElement(l.a,null,this.renderTimeline)}}])&&v(e.prototype,n),o}(a.Component);j.Item=p,j.defaultProps={reverse:!1,mode:""},e.a=j}}]); |