forked from Gitlink/build
1 line
9.0 KiB
JavaScript
1 line
9.0 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[101],{"E+/Y":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.httpUrl=void 0;var r,n=(r=a("JGtk"))&&r.__esModule?r:{default:r},i=JSON.parse(localStorage.chromesetting),o=i&&i.common.wiki,l=(0,n.default)(o);t.httpUrl=o,t.default=l},FRFo:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(a("3S7+"));a("5Dmo");var n=a("cDcd"),i=o(n);function o(e){return e&&e.__esModule?e:{default:e}}function l(e){var t=e.beforeText,a=e.afterText,o=e.className,l=e.inputId,u=e.timeOut,c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(n)throw i}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}((0,n.useState)((function(){return t})),2),d=c[0],s=c[1],f=(0,n.useCallback)((function(){var e=document.querySelector("#"+l);e&&(e.select(),document.execCommand("copy")&&document.execCommand("copy"),document.getSelection().removeAllRanges(),s(a),u&&setTimeout((function(){s(t)}),1500))}),[]);return i.default.createElement(r.default,{placement:"top",title:d,onVisibleChange:function(){s(t)}},i.default.createElement("i",{className:"iconfont icon-fuzhiicon "+o,style:{color:"#466aff"},onClick:f}))}l.defaultProps={beforeText:"复制链接",afterText:"复制成功",className:"",inputId:"copyText",timeOut:!0},t.default=(0,n.memo)(l)},H5Q0:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e){var t=document.createElement("div");function a(){i.unmountComponentAtNode(t)&&t.parentNode&&t.parentNode.removeChild(t)}document.body.appendChild(t),setTimeout((function(){i.render(n.default.createElement(u,{afterClose:a}),t)}))};var r=a("cDcd"),n=l(r),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}(a("faye")),o=l(a("CWZq"));function l(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=e.afterClose,a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(n)throw i}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}((0,r.useState)(!0),2),i=a[0],l=a[1];return n.default.createElement(o.default,{isRender:i,Modifyloginvalue:function(){l(!1),t()}})}},JGtk:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKey=void 0;var r=u(a("TeRw")),n=u(a("tsqr"));t.default=function(e){window.location.href.indexOf("localhost")<0&&(i.default.defaults.withCredentials=!0);var t=i.default.create({baseURL:e,timeout:18e5});return t.interceptors.request.use((function(e){if(o.default.load(c)&&(e.headers.Authorization=o.default.load(c)),"3007"===window.location.port){var t=o.default.load(c);-1===e.url.indexOf("?")?e.url=e.url+"?token="+t:e.url=e.url+"&token="+t}return e}),(function(e){})),t.interceptors.response.use((function(e){var t=e||{};return 400===t.status?(n.default.error(t.data.message||"操作失败"),Promise.reject("error")):401===t.status?(n.default.error(t.data.message||"登录信息已过期"),Promise.reject("error")):403===t.status?(n.default.error(t.data.message||"无权限!"),Promise.reject("error")):40001===t.status?(r.default.open({message:"提示",description:"账户或密码错误!"}),Promise.reject("error")):200===e.status||200===t.status?e.data:void r.default.open({message:"提示",description:t.message})}),(function(e){var t=e.response||{};return 400===t.status?(n.default.error(t.data.message||"操作失败"),Promise.reject("error")):401===t.status?(n.default.error(t.data.message||"登录信息已过期"),(0,l.default)(),Promise.reject("error")):403===t.status?(n.default.error(t.data.message||"无权限!"),Promise.reject("error")):(r.default.open({message:"提示",description:e.message}),Promise.reject(e))})),t},a("/xke"),a("miYZ");var i=u(a("vDqi")),o=u(a("Po8q")),l=u(a("H5Q0"));function u(e){return e&&e.__esModule?e:{default:e}}var c=t.TokenKey="autologin_trustie"},"j/6D":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wikiPages=function(e){return(0,n.default)({url:"/api/wiki/wikiPages",method:"get",params:e})},t.getWiki=function(e){return(0,n.default)({url:"/api/wiki/getWiki",method:"get",params:e})},t.addWiki=function(e){return(0,n.default)({url:"/api/wiki/createWiki",method:"post",data:e})},t.updateWiki=function(e){return(0,n.default)({url:"/api/wiki/updateWiki",method:"PUT",data:e})},t.deleteWiki=function(e){return(0,n.default)({url:"/api/wiki/deleteWiki",method:"DELETE",data:e})};var r,n=(r=a("E+/Y"))&&r.__esModule?r:{default:r}},j29u:function(e,t,a){},oHRg:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(a("jsC+")),n=v(a("2/Rp")),i=v(a("CtXQ")),o=v(a("BvKs")),l=v(a("2fM7")),u=v(a("5rEg")),c=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var o,l=e[Symbol.iterator]();!(r=(o=l.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){n=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(n)throw i}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("qVdP"),a("+L6B"),a("Pwec"),a("lUTK"),a("OaEy"),a("5NDa");var d=a("cDcd"),s=v(d),f=v(a("FRFo")),m=a("j/6D"),p=a("E+/Y");function v(e){return e&&e.__esModule?e:{default:e}}a("j29u");var w=u.default.Group,y=l.default.Option;t.default=function(e){var t=e.match,a=e.history,v=e.showNotification,k=e.project,h=e.projectDetail,E=h&&h.permission&&"Reporter"!==h.permission,g=t.params.projectsId,_=t.params.owner,j=t.params.projectName,N=t.params.projectId,b=(0,d.useState)({}),P=c(b,2),T=P[0],S=P[1],C=(0,d.useState)({}),M=c(C,2),O=M[0],x=M[1],I=(0,d.useState)([]),H=c(I,2),D=H[0],W=H[1],A=(0,d.useState)("HTTPS"),R=c(A,2),U=R[0],q=R[1];(0,d.useEffect)((function(){T&&(document.title=T.name+"-维基预览")}),[T,h]),(0,d.useEffect)((function(){g&&(0,m.wikiPages)({owner:_,repo:g,projectId:N}).then((function(e){e&&"200"===e.message?(W(e.data),e.data.length&&S(e.data[0])):v("加载失败")}))}),[k]),(0,d.useEffect)((function(){g&&T.name&&(0,m.getWiki)({owner:_,repo:g,pagename:T.name,projectId:N}).then((function(e){e&&"200"===e.message?x(e.data):v("加载失败")}))}),[k,T]);var F=s.default.createElement(o.default,null,s.default.createElement(o.default.Item,{key:"1",onClick:function(){J("markdown")}},"Markdown"),s.default.createElement(o.default.Item,{key:"2",onClick:function(){J("html")}},"HTML"),s.default.createElement(o.default.Item,{key:"3",onClick:function(){J("pdf")}},"PDF"));function J(e){window.open(p.httpUrl+"/api/wikiExport/wikiExport-wrapper?repoName="+g+"&owner="+_+"&type="+e+"&projectName="+j+"&projectId="+N)}return s.default.createElement("div",{className:"wiki-preview"},s.default.createElement("div",{className:"preview-head"},s.default.createElement("div",{className:"preview-head-left",onClick:function(){a.push("/"+_+"/"+g+"/wiki")}},s.default.createElement("i",{className:"iconfont icon-wendangyulan_icon mr3"}),s.default.createElement("span",{className:"ml10"},j)),s.default.createElement("div",{className:"preview-head-right"},s.default.createElement("span",{className:"copy-desc"},"克隆地址"),T.wiki_clone_link&&s.default.createElement(w,{className:"copy-url",compact:!0},s.default.createElement(l.default,{dropdownClassName:"wiki-url-type",defaultValue:"HTTPS",onChange:function(e){q(e)}},s.default.createElement(y,{value:"HTTPS"},"HTTPS"),s.default.createElement(y,{value:"SSH"},"SSH")),s.default.createElement(u.default,{id:"wikiUrl",value:"HTTPS"===U?T.wiki_clone_link.https:T.wiki_clone_link.ssh}),s.default.createElement(f.default,{className:"copy-wiki",inputId:"wikiUrl"})),s.default.createElement(r.default,{overlay:F},s.default.createElement(n.default,{className:"ml10"},"导出",s.default.createElement(i.default,{type:"caret-down"}))))),s.default.createElement("div",{className:"wiki-body"},s.default.createElement("div",{className:"wiki-nav"},D.map((function(e){return s.default.createElement("div",{className:(e.name===T.name?"active":"")+" wiki-nav-title",key:e.name,onClick:function(){S(e)}},s.default.createElement("span",{className:"nav-title-left"},s.default.createElement("i",{className:"iconfont icon-wenjianjia2 mr3"}),s.default.createElement("span",{className:"nav-title-left-text"},e.name)))}))),s.default.createElement("div",{className:"wiki-content"},s.default.createElement("div",{className:"wiki-content-head"},s.default.createElement("h3",null,T.name),E&&s.default.createElement(n.default,{type:"primary",onClick:function(){a.push("/"+_+"/"+g+"/wiki/edit/"+T.name)}},"编辑")),s.default.createElement("div",{className:"wiki-content-detail editor-content-panel markdown-body",dangerouslySetInnerHTML:{__html:O&&O.simple_content}}))))}}}]); |