forked from Gitlink/forgeplus
1 line
8.6 KiB
JavaScript
1 line
8.6 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[97],{PhNK:function(e,t,a){"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),a=t.getHours()<10?"0".concat(t.getHours()):t.getHours(),n=t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes();return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+a+":"+n}},"Rs/d":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,l,r=(n=["\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(n,{raw:{value:Object.freeze(l)}}))),o=c(a("q1tI")),i=c(a("vOnD")),s=a("eO8H");function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.url,a=e.name,n=e.column,l=e.id,c=e.login,u=i.default.span(r,n&&"flex-direction: column;text-align:center;",!n&&"\n & span{\n margin-left:8px;\n }");return l?o.default.createElement(s.Link,{to:"/"+c},o.default.createElement(u,null,t&&o.default.createElement("img",{src:t,alt:""}),o.default.createElement("span",null,a))):o.default.createElement(u,null,t&&o.default.createElement("img",{src:t,alt:""}),o.default.createElement("span",null,a))}},izWe:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(a("2/Rp"));a("L/Qf");var l=r(a("q1tI"));function r(e){return e&&e.__esModule?e:{default:e}}a("e4dm"),t.default=function(e){var t=e.operation,a=e.addFunc;return l.default.createElement("div",{className:"emptyPanel color-grey-3"},l.default.createElement("i",{className:"iconfont icon-banbenicon font-50 color-grey-3",style:{height:"50px",lineHeight:"50px",marginBottom:"13px"}}),l.default.createElement("span",{className:"weight font-26 mb15"},"这里暂未发布过任何版本"),l.default.createElement("span",{className:"weight400",style:{textAlign:"center",lineHeight:"20px"}},"发行版功能基于仓库中的历史标记",l.default.createElement("br",null),"建议使用类似 V1.0 的版本标记作为发布点"),l.default.createElement("div",{className:"operation"},t?l.default.createElement(n.default,{type:"primary",onClick:a,className:"btnblue",style:{width:"118px",height:"36px"}},"发布新版本"):l.default.createElement("span",{className:"color-grey-3 weight font-16"},"该项目暂时没有发布版本")))}},nCbK:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=p(a("W9HT")),l=p(a("2/Rp")),r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,l=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(n=(o=i.next()).done)&&(a.push(o.value),!t||a.length!==t);n=!0);}catch(e){l=!0,r=e}finally{try{!n&&i.return&&i.return()}finally{if(l)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("04bd"),a("L/Qf");var o=a("q1tI"),i=p(o),s=a("eO8H"),c=a("sYIF"),u=a("PhNK"),m=p(a("izWe"));a("e4dm");var d=p(a("vDqi")),f=p(a("x97h")),A=p(a("bjH3")),g=p(a("Rs/d"));function p(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=(0,o.useState)(void 0),a=r(t,2),p=a[0],h=a[1],E=(0,o.useState)(void 0),v=r(E,2),b=v[0],y=v[1],N=(0,o.useState)(!0),w=r(N,2),_=w[0],x=w[1],j=e.match.params,I=j.projectsId,R=j.owner,L=e.location,O=e.projectDetail&&e.projectDetail.type,k=L&&L.query&&L.query.turnFromNew;function F(){var e="/"+R+"/"+I+"/releases.json";d.default.get(e).then((function(e){if(e){h(e.data);var t=e.data.releases,a=void 0===t?[]:t;a.length&&(a[0].bodyshow=!0),y(e.data.releases),x(!1)}})).catch((function(e){console.log(e)}))}function M(t,a){return i.default.createElement("div",{className:"versionInfo",key:a},i.default.createElement("span",{className:"versionInfo_left"},i.default.createElement("span",{className:"稳定"===t.draft?"versionTag green":"versionTag orange"},t.draft),i.default.createElement("span",{className:"color-grey-3 mt15 font-12"},i.default.createElement("i",{className:"iconfont icon-biaoqianicon mr3 font-14"}),i.default.createElement(s.Link,{className:"hover",to:"/"+R+"/"+I+"/tree/"+t.tag_name},t.tag_name)),i.default.createElement("span",{className:"color-grey-3 font-12"},i.default.createElement("img",{src:f.default,width:"16px",color:"#333333",className:"mr3"}),i.default.createElement(s.Link,{className:"hover",to:"/"+R+"/"+I+"/commits/"+(0,u.truncateCommitId)(""+t.sha)},(0,u.truncateCommitId)(t.sha)))),i.default.createElement("div",{className:"versionInfo_right"},i.default.createElement("div",{className:"versionName"},i.default.createElement(s.Link,{to:"/"+R+"/"+I+"/tree/"+t.tag_name,className:"task-hide color-blue hover font-18"},t.name),i.default.createElement("span",null,p&&p.user_admin_permission&&2!==O&&i.default.createElement(s.Link,{to:{pathname:"/"+R+"/"+I+"/releases/"+t.version_id+"/update",state:{stable:"稳定"===t.draft}},className:"ml15"},i.default.createElement("i",{className:"iconfont icon-a-bianji1 font-16 color-grey-6"})),p&&p.user_admin_permission&&2!==O&&i.default.createElement("i",{className:"iconfont icon-shanchuicon1 font-16 ml15",onClick:function(){var e;(e=t.version_id)&&d.default.delete("/"+R+"/"+I+"/releases/"+e+".json").then((function(e){e&&F()}))}}))),i.default.createElement("span",{className:"color-grey-3 mb15 version-user"},i.default.createElement("i",{className:t.bodyshow?"iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14",onClick:function(){return function(e,t){var a=b.concat();a[e].bodyshow=!t,a.splice(),y(a)}(a,t.bodyshow)}}),i.default.createElement(g.default,{id:t.id,url:t.image_url&&(0,c.getImageUrl)("/"+t.image_url)||"https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg",name:t.user_name,login:t.user_login}),i.default.createElement("span",{className:"ml5"},"发布于",t.created_at)),t.bodyshow&&i.default.createElement("div",{className:"body-show"},i.default.createElement(A.default,{className:"break_word_comments imageLayerParent",value:t.body||"",url:e.history.location})),i.default.createElement(A.default,null),i.default.createElement("p",{className:"versionFile"},t.attachments&&t.attachments.map((function(e){return i.default.createElement("a",{href:e.url},i.default.createElement("i",{className:"iconfont icon-wenjian7 font-14 mr10 color-grey-3"}),"下载 ",e.title)})),i.default.createElement("a",{href:t.tarball_url},i.default.createElement("i",{className:"iconfont icon-wenjian7 font-14 mr10 color-grey-3"}),"下载 ",t.tag_name,".TAR.gz"),i.default.createElement("a",{href:t.zipball_url},i.default.createElement("i",{className:"iconfont icon-wenjian7 font-14 mr10 color-grey-3"}),"下载 ",t.tag_name,".ZIP"))))}function Q(){e.history.push({pathname:"/"+R+"/"+I+"/releases/new",state:{stable:!0}})}return(0,o.useEffect)((function(){F()}),[]),i.default.createElement("div",{className:"releaseIndex"},i.default.createElement("div",{className:"releasesVersion"},i.default.createElement(n.default,{spinning:_},function(e){return e&&e.length>0?i.default.createElement(i.default.Fragment,null,p&&p.user_admin_permission&&2!==O&&i.default.createElement("div",{className:"addReleaseBtn"},i.default.createElement(l.default,{type:"primary",onClick:Q,className:"btnblue",style:{height:"36px"}},"发布新版本")),i.default.createElement("div",null,k?M(e[0],0):e.map((function(e,t){return M(e,t)})))):e&&0===e.length?i.default.createElement(m.default,{operation:p&&p.user_admin_permission&&2!==O,addFunc:Q}):i.default.createElement("div",null)}(b))))}},x97h:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAQCAYAAABtPJ3XAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAAEAAAAACYv7IkAAAB4UlEQVRIDdVWv0/CQBR+ReLUqYMLiUlZGGQDXLo5SNxYWJ1Y3NSdP6HqYDQhLs4sLMTEGHd+jZKwQOLAgAMbgwTq+y5tQkNrj2tj4iUXuHff972vl+t71SihUSqVjhzHqfE8ZclDV/ZT07RXnk+9Xu8jiVRaXJFqtbo/mUxu2OgFa6VC9NZs+tE0zetms/kdgpEKxzIMs+Px+IUznSBbpVIRM5vNiuS8R61WS0wRIHrnvbO4pl2t3X+KxeJ9oVBwyuWy0+12+ZCDB/aAARac3TMlwMCdZQMrmPjNrPcIwAALDriqFsLuXKQeG6kxKIVrwAYi8cAAC47LjeQEAeIYRjXwTARpb8Vcw8SGBXcLIBFQNszaonR5L5hELtrAemVPhubDpHGvfJG/WeiqeeOcsHg0lC7ZsQs2TDM9GAyUajGXp1u+i5eos/l8PkzfFwcWg5vIXb/fv/JtSi6UTxjtlnOsYYLbbmQ6YFzD6HrgKo09JRaTptPpVyaTOeC/x51Oh3K5HPE6UA5m6/U6LRYLnO4Dn+5zIFAiqGwY2pZlvc3nc4uNmO12m2azGRmGQbqu03K5pNFoRI1Gg2zbFmaZgtZ8PhwOVxLeAiFK93dT6V99/GwaR7tFB3ObgldnE/+8/AGE+wKxroRyyAAAAABJRU5ErkJggg=="}}]); |