build/static/js/85.68b6ea23.chunk.js

1 line
13 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(this.webpackJsonp=this.webpackJsonp||[]).push([[85],{"0Rql":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAQCAYAAABtPJ3XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAAEAAAAACYv7IkAAABuElEQVRIDdVWr0/DQBT+ujQowgSZwAAKQkhAoAiGTBT2B+ARM/wIAQx2dgYICdRU4PkDBhM4goYEgwODWBBDIjje17VJV9rudkdIeMmt69137333+n6cg1+StR01L6rqMjwFTFKtA7zKoy0juDl3njhnK6LTTjYaauSjg2PRsqUUSlnaHAdfMu+PVXB41XA+szC6c1aESbbbQQsKVSGF2gqwvgxMTfTMv7wB1/dA6w6Qw9Dlt+UKajakXd2TZeFCzwrZ8TJwtAkszvSjZqcBjtUloHkJvHdRjb7Gbj9S/83Yw1HMPoqpUnPvJ9k0hYdnOdRZOMvwWDCN6cyYSxvLea8zZhkGac9m4YkhNopzJqeR2BD2aJExqysJbLhXd18SZ0w4Ll1xgiWV5v2PsfHePFzRvOtth/lbhMleY9abisKoqV1jD8dcWbp0ZRhsnk63fcEKOrxIlTiRb7PPOsvSpSPEUsTiqVSJg97bcL82Hg7YwdgUWLIGCTHEco9gg0H4vHVjwlEd9ZkBbApFpLlGTJQtvmkN5iGsOh3vBtKa59jB2BR0WjP30LCpGMVv0ti/uvwkif/V9fIbUzmWMlmEs/gAAAAASUVORK5CYII="},PhNK:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateCommitId=function(e){return e&&e.length>11?e.substring(0,10):e},t.timeFormat=function(e){var t=new Date(1e3*e),n=t.getHours()<10?"0".concat(t.getHours()):t.getHours(),a=t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes();return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+n+":"+a}},"Rs/d":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,l,r=(a=["\n display:flex;\n font-weight: bold;\n ","\n align-items: center;\n & img{\n width:30px;\n height:30px;\n border-radius:50%;\n }\n ","\n "],l=["\n display:flex;\n font-weight: bold;\n ","\n align-items: center;\n & img{\n width:30px;\n height:30px;\n border-radius:50%;\n }\n ","\n "],Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(l)}}))),i=c(n("q1tI")),o=c(n("vOnD")),d=n("eO8H");function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.url,n=e.name,a=e.column,l=e.id,c=e.login,s=o.default.span(r,a&&"flex-direction: column;text-align:center;",!a&&"\n & span{\n margin-left:8px;\n }");return l?i.default.createElement(d.Link,{to:"/"+c},i.default.createElement(s,null,t&&i.default.createElement("img",{src:t,alt:""}),i.default.createElement("span",null,n))):i.default.createElement(s,null,t&&i.default.createElement("img",{src:t,alt:""}),i.default.createElement("span",null,n))}},VPG4:function(e,t,n){},aABL:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=s(n("3S7+")),l=s(n("CFYs")),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,l=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("TfFZ"),n("D8SU");var i=n("q1tI"),o=s(i),d=n("PhNK"),c=n("spEH");function s(e){return e&&e.__esModule?e:{default:e}}n("js5m"),n("VPG4"),t.default=function(e){var t=e.data,n=e.history,s=e.owner,u=e.projectsId,f=e.parentsSha,m=(0,i.useState)(t&&t.files),p=r(m,2),A=p[0],g=p[1],E=(0,i.useState)("复制文件路径"),b=r(E,2),h=b[0],v=b[1],x=(0,i.useState)(!1),w=r(x,2),y=w[0],N=w[1];function k(e,t,n){if(!n){var a=A.concat();a[t].flag=!e,a.splice(),g(a)}}(0,i.useEffect)((function(){t&&g(t.files)}),[t]),(0,i.useEffect)((function(){document.addEventListener("click",(function(){N(!1)}))}),[]);var C=o.default.createElement("div",{className:"folders"},o.default.createElement("div",{className:"folderList"},A&&A.map((function(e,t){return o.default.createElement("a",{href:"#value"+t},o.default.createElement(c.FlexAJ,{className:"filesInfo",key:t,onClick:function(){e.flag&&k(e.flag,t,e.isBin),N(!1)}},o.default.createElement(c.AlignCenter,null,o.default.createElement("i",{className:"iconfont icon-wenjianicon mr4"}),o.default.createElement("span",{className:"cursor-pointer","data-clipboard-text":e.name},e.name)),o.default.createElement("div",{className:"see-file"},o.default.createElement(a.default,{placement:"top",title:e.addition+e.deletion+"处更改"+(e.addition+e.deletion>0?"":"")+(e.addition>0?e.addition+"处添加":"")+(e.addition>0&&e.deletion>0?"和":"")+(e.deletion>0?e.deletion+"处删除":"")},o.default.createElement(l.default,{showInfo:!1,strokeColor:"#2DB44D",size:"small",percent:e.addition/(e.addition+e.deletion)*100}),e.addition>0&&o.default.createElement("span",{className:"color-green ml10"},"+",e.addition),e.deletion>0&&o.default.createElement("span",{className:"color-red ml10"},"-",e.deletion)))))}))));return o.default.createElement("div",{onClick:function(e){e.nativeEvent.stopImmediatePropagation()}},o.default.createElement(c.AlignCenter,{className:"color-grey-9",style:{position:"relative"}},o.default.createElement("div",{onClick:function(){N(!y)}},o.default.createElement("i",{className:"iconfont mr5 "+(y?"font-18 icon-sanjiaoxing-down":"font-16 icon-triangle")}),o.default.createElement("span",{className:"color-grey-6 update-file-count"},"共有",o.default.createElement("span",{className:"color-grey-3"}," ",t&&t.files_count," 个文件 "),"被更改,包括",t&&t.total_addition?o.default.createElement("span",{className:"color-green"}," ",t&&t.total_addition," 次插入"):"",t&&t.total_addition&&t.total_deletion?" 和 ":"",t&&t.total_deletion?o.default.createElement("span",{className:"color-red"}," ",t&&t.total_deletion," 次删除"):"")),y&&C),A&&A.length>0&&o.default.createElement("div",{className:"fileList"},A.map((function(e,t){return o.default.createElement("div",{className:"files",key:t},o.default.createElement("a",{id:"value"+t,className:"anchorPoint"}),o.default.createElement(c.FlexAJ,{className:"filesInfo"},o.default.createElement(c.AlignCenter,null,e.isBin?"":o.default.createElement("i",{className:e.flag?"iconfont icon-triangle font-15 color-grey-9":"iconfont icon-sanjiaoxing-down color-grey-9 mt4",onClick:function(){return k(e.flag,t,e.isBin)}}),o.default.createElement("span",{className:"cursor-pointer","data-clipboard-text":e.name,onClick:function(){return k(e.flag,t,e.isBin)}},e.name),o.default.createElement(a.default,{title:h,onVisibleChange:function(){return v("复制文件路径")}},o.default.createElement("i",{className:"iconfont icon-fuzhiicon ml6",onClick:function(){return t=e.name,(n=document.createElement("input")).defaultValue=t,document.body.appendChild(n),n.select(),document.execCommand("Copy"),n.className="copyCont",n.style.display="none",void v("复制成功");var t,n}}))),o.default.createElement("div",{className:"see-file"},o.default.createElement(a.default,{placement:"top",title:e.addition+e.deletion+"处更改"+(e.addition+e.deletion>0?"":"")+" "+(e.addition>0?e.addition+"处添加":"")+(e.addition>0&&e.deletion>0?"和":"")+(e.deletion>0?e.deletion+"处删除":"")},o.default.createElement(l.default,{showInfo:!1,strokeColor:"#2DB44D",size:"small",percent:e.addition/(e.addition+e.deletion)*100}),o.default.createElement("span",{className:"ml10"},e.addition+e.deletion,"处")),!e.isSubmodule&&o.default.createElement("span",{className:"see-file-btn",onClick:function(){n.push("/"+s+"/"+u+(e.isDeleted?"/commits/"+(0,d.truncateCommitId)(f):"/tree/"+(0,d.truncateCommitId)(e.sha)+"/"+e.name))}},"查看文件"))),e.sections&&e.sections.length>=1&&!e.flag&&o.default.createElement("div",{className:"filesContent"},e.sections.map((function(e,t){return e.lines&&e.lines.length>0&&e.lines.map((function(e,n){return o.default.createElement("div",{key:t+n,className:2===e.type?"linesContent add":3===e.type?"linesContent reduce":4===e.type?"linesContent translate":"linesContent"},o.default.createElement("span",{className:"lines"},o.default.createElement("span",null,e.leftIdx&&"0"!==e.leftIdx?e.leftIdx:""),o.default.createElement("span",null,e.rightIdx&&"0"!==e.rightIdx?e.rightIdx:"")),o.default.createElement("p",null,e.content))}))}))))}))))}},cfbA:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,l,r=v(n("W9HT")),i=v(n("2/Rp")),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,l=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},d=(a=["\n border: 1px solid #FAFCFF;\n margin-bottom:15px;\n & .commitinfos {\n background-color: #f1f8ff;\n border: 1px solid rgba(42, 97, 255, 0.23);\n border-radius: 3px 3px 0px 0px;\n padding: 10px 20px 10px 16px;\n & .markdown-body table{\n background: #f1f8ff;\n }\n & .btnblue{\n margin-top: 12px;\n }\n & .task-hide{\n width: 65rem;\n overflow:hidden;\n white-space:normal;\n word-break:break-all;\n font-weight: bold;\n color: #333333;\n font-size: 16px;\n }\n }\n & > .f-wrap-between {\n padding: 14px 20px 14px 16px;\n border-radius: 0px 0px 3px 3px;\n border: 1px solid #D0D0D0;\n border-top: none;\n .df{\n align-items: center;\n & .underline:hover{\n text-decoration: underline;\n }\n }\n }\n"],l=["\n border: 1px solid #FAFCFF;\n margin-bottom:15px;\n & .commitinfos {\n background-color: #f1f8ff;\n border: 1px solid rgba(42, 97, 255, 0.23);\n border-radius: 3px 3px 0px 0px;\n padding: 10px 20px 10px 16px;\n & .markdown-body table{\n background: #f1f8ff;\n }\n & .btnblue{\n margin-top: 12px;\n }\n & .task-hide{\n width: 65rem;\n overflow:hidden;\n white-space:normal;\n word-break:break-all;\n font-weight: bold;\n color: #333333;\n font-size: 16px;\n }\n }\n & > .f-wrap-between {\n padding: 14px 20px 14px 16px;\n border-radius: 0px 0px 3px 3px;\n border: 1px solid #D0D0D0;\n border-top: none;\n .df{\n align-items: center;\n & .underline:hover{\n text-decoration: underline;\n }\n }\n }\n"],Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(l)}})));n("04bd"),n("L/Qf");var c=n("q1tI"),s=v(c),u=v(n("vOnD")),f=n("PhNK"),m=n("sYIF"),p=v(n("aABL")),A=v(n("0Rql")),g=v(n("Rs/d")),E=v(n("bjH3")),b=v(n("vDqi")),h=n("eO8H");function v(e){return e&&e.__esModule?e:{default:e}}var x=u.default.div(d);t.default=function(e){var t=e.match,n=e.history,a=(0,c.useState)({undefined:void 0}),l=o(a,2),d=l[0],u=l[1],v=(0,c.useState)(void 0),w=o(v,2),y=w[0],N=w[1],k=(0,c.useState)(void 0),C=o(k,2),I=C[0],j=C[1],S=(0,c.useState)(void 0),B=o(S,2),D=B[0],O=B[1],P=(0,c.useState)(!0),M=o(P,2),F=M[0],_=M[1],R=t.params,L=R.sha,T=R.projectsId,z=R.owner;return(0,c.useEffect)((function(){if(T&&z&&L){var e="/"+z+"/"+T+"/commits/"+L+".json";b.default.get(e).then((function(e){e&&(u(e.data),N(e.data.commit),j(e.data.parents),O(e.data.committer||e.data.commit&&e.data.commit.committer),_(!1))})).catch((function(e){console.log(e)}))}}),[T,z,L]),s.default.createElement("div",{className:"main",style:{padding:"0px",border:"none"}},s.default.createElement(r.default,{spinning:F},s.default.createElement(x,null,s.default.createElement("div",{className:"commitinfos"},s.default.createElement("div",{className:"f-wrap-between"},s.default.createElement("div",null,y&&y.message&&s.default.createElement(E.default,{className:"task-hide",value:y.message}),s.default.createElement(h.Link,{to:"/"+z+"/"+T+"/tree/"+d.branch},s.default.createElement("i",{className:"iconfont icon-fenzhi2 font-18"}),d.branch)),s.default.createElement(i.default,{type:"primary",onClick:function(){n.push("/"+z+"/"+T+"/tree/"+(0,f.truncateCommitId)(L))},className:"btnblue",style:{height:"36px"}},"浏览文件"))),s.default.createElement("div",{className:"f-wrap-between",style:{alignItems:"center"}},s.default.createElement("ul",{className:"df"},s.default.createElement(g.default,{id:D&&D.id,url:D&&(0,m.getImageUrl)("/"+D.image_url),name:D&&D.name,login:D&&D.login}),y&&y.timestamp&&s.default.createElement("li",{className:"ml4"},"提交于",(0,f.timeFormat)(y.timestamp))),s.default.createElement("li",{className:"df"},I&&I.length>0&&I.map((function(e,t){return s.default.createElement("div",{className:"ml40 f-wrap-alignCenter"},s.default.createElement("label",{className:"mr8"},"父节点"),s.default.createElement("img",{src:A.default,alt:"sha",width:"16px",className:"mr4"}),s.default.createElement(h.Link,{to:"/"+z+"/"+T+"/commits/"+(0,f.truncateCommitId)(""+e.sha)+"/"+d.branch,className:"underline"},(0,f.truncateCommitId)(e.sha)))})),s.default.createElement("div",{className:"ml40 f-wrap-alignCenter"},s.default.createElement("label",{className:"mr8"},"当前节点"),s.default.createElement("img",{src:A.default,alt:"sha",width:"16px",className:"mr4"}),s.default.createElement("span",null,(0,f.truncateCommitId)(L)))))),s.default.createElement(p.default,{history:n,data:d,owner:z,projectsId:T,parentsSha:I&&I.length>0&&I[0].sha})))}},js5m:function(e,t,n){}}]);