build/static/js/194.d51e74db.chunk.js

1 line
7.3 KiB
JavaScript
Raw Permalink 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([[194],{KwVS:function(e,a,t){"use strict";t.r(a);var n=t("+oHS"),l=t.n(n),r=t("OWCx"),c=t.n(r),s=t("5PDf"),i=t.n(s),m=t("fHi0"),o=t.n(m),u=t("RXMP"),d=t.n(u),p=t("qjzJ"),b=t.n(p),E=t("HnXd"),f=t.n(E),_=t("LYCE"),h=t.n(_),g=(t("T2oS"),t("W9HT")),v=(t("fOrg"),t("+KLJ")),y=(t("bP8k"),t("gFTJ")),N=(t("OaEy"),t("2fM7")),j=(t("y8nQ"),t("Vl3Y")),w=(t("5NDa"),t("5rEg")),O=(t("+L6B"),t("2/Rp")),I=(t("miYZ"),t("tsqr")),k=t("04Ix"),C=t.n(k),S=t("zLi2"),x=t.n(S),D=t("o+MX"),F=t.n(D),L=t("FLGM"),M=t.n(L),B=t("cDcd"),q=t.n(B),z=t("vDqi"),H=t.n(z),J=t("3Diz");function T(e,a){var t=l()(e);if(c.a){var n=c()(e);a&&(n=i()(n).call(n,(function(a){return o()(e,a).enumerable}))),t.push.apply(t,n)}return t}function W(e){for(var a=1;a<arguments.length;a++){var t,n,l=null!=arguments[a]?arguments[a]:{};a%2?d()(t=T(Object(l),!0)).call(t,(function(a){C()(e,a,l[a])})):b.a?f()(e,b()(l)):d()(n=T(Object(l))).call(n,(function(a){h()(e,a,o()(l,a))}))}return e}t("Ws+N"),a.default=j.a.create()((function(e){var a,t=e.current_user,n=e.history,l=e.form,r=e.projectDetail,c=e.defaultBranch,s=e.isManager,i=e.mygetHelmetapi.site_page_deploy_domain,m=e.match.params,o=m.owner,u=m.projectsId,d=t.id_card_verify,p=l.getFieldDecorator,b=l.validateFieldsAndScroll,E=Object(B.useState)(void 0),f=x()(E,2),_=f[0],h=f[1],k=Object(B.useState)(!1),C=x()(k,2),S=C[0],D=C[1],L=Object(B.useState)(void 0),z=x()(L,2),T=z[0],P=z[1],R=Object(B.useState)(void 0),V=x()(R,2),X=V[0],Y=V[1],A=Object(B.useState)(null),K=x()(A,2),Z=K[0],G=K[1],Q=Object(B.useState)(!1),$=x()(Q,2),U=$[0],ee=$[1],ae=Object(B.useState)(!1),te=x()(ae,2),ne=te[0],le=te[1],re=Object(B.useState)(void 0),ce=x()(re,2),se=ce[0],ie=ce[1];return Object(B.useEffect)((function(){if(r){var e,a=r.author,t=r.name;document.title=F()(e="个人建站-".concat(a.name,"/")).call(e,t)}}),[r]),Object(B.useEffect)((function(){d&&(D(!0),H.a.get("/site_pages/x.json",{params:{owner:o,repo:u}}).then((function(e){if(e&&200===e.status&&(P(e.data.data),e.data.data)){var a=e.data.data.last_build_info;a&&a.length&&ie(a)}D(!1)})))}),[d,_]),q.a.createElement("div",{className:"mb100"},q.a.createElement("div",{className:"servertitle"},q.a.createElement("span",{className:"systitle"},"个人建站服务",!T&&!S&&d&&s&&" - 新建站点")),!d&&q.a.createElement(B.Fragment,null,q.a.createElement("div",{className:"tipsBox font-15 mt30"},"您尚未通过实名认证,无法使用此服务,如需使用,请先进行实名认证。"),q.a.createElement(O.a,{type:"primary",className:"mt20",onClick:function(){n.push("/settings/verification")}},"前往验证")),d&&s&&q.a.createElement(g.a,{spinning:S},T?T.state?q.a.createElement("div",{className:"mt30"},q.a.createElement(y.a,{title:"站点信息"},q.a.createElement(y.a.Item,{label:"站点名称"},q.a.createElement("span",{onClick:function(){T.last_build_at&&window.open(T.url)},className:T.last_build_at&&"theme-btn"},T.site_name),q.a.createElement("span",{className:"pageStateBox ml20 font-12 ".concat(T.build_state?"public":"private")},null===T.build_state?"未部署":T.build_state?"已部署":"部署失败")),q.a.createElement(y.a.Item,{label:"网站地址",span:2},q.a.createElement("span",{onClick:function(){T.last_build_at&&window.open(T.url)},className:T.last_build_at&&"theme-btn"},T.url)),q.a.createElement(y.a.Item,{label:"建站工具"},T.language_frame),q.a.createElement(y.a.Item,{label:"建站时间"},T.created_at),T.last_build_at&&q.a.createElement(y.a.Item,{label:"上次部署时间"},T.last_build_at)),!ne&&q.a.createElement(O.a,{type:"primary",style:{width:"135px",height:"34px"},className:"mt20",onClick:function(){le(!0)}},"去部署"),ne&&q.a.createElement("div",null,q.a.createElement("div",{className:"mt20 ant-descriptions-title"},"部署"),q.a.createElement("div",{style:{display:"inline-flex"}},q.a.createElement("span",null,"部署分支:"),q.a.createElement(J.a,{repo_id:r&&r.repo_id,projectsId:u,branch:Z||c,changeBranch:function(e){G(e)},owner:o,history:e.history,tagflag:!1,branchList:r&&r.branches&&r.branches.list}),q.a.createElement("span",{className:"color-grey-6 ml30"},"选择您要部署的分支")),q.a.createElement("div",{className:"mt20"},q.a.createElement(O.a,{type:"primary",loading:U,onClick:function(){ee(!0),H.a.post("/site_pages/".concat(T.id,"/build.json"),{owner:o,repo:u,branch:Z||c}).then((function(e){e&&e.data&&0===e.data.status?ie(e.data.data):I.a.error(e&&e.data&&e.data.message||"部署失败,请稍后重试"),h(Math.random()),le(!1),ee(!1)}))}},"确定"),q.a.createElement(O.a,{type:"primary",ghost:!0,onClick:function(){le(!1)},className:"ml30"},"取消")))):q.a.createElement("div",{className:"mt30"},T&&q.a.createElement(v.a,{type:"error",message:F()(a="您的个人站点 ".concat(T.site_name," 已被关闭,关闭原因为:")).call(a,T.state_description)})):q.a.createElement(j.a,{form:l,name:"register",className:"mt30",scrollToFirstError:!0,layout:"horizontal",labelCol:{span:2},wrapperCol:{span:14},onSubmit:function(e){e.preventDefault(),b((function(e,a){e||H.a.post("/site_pages.json",W(W({},a),{},{owner:o,repo:u})).then((function(e){e&&200===e.status&&(h(Math.random()),I.a.success("创建成功"))}))}))}},q.a.createElement(j.a.Item,{name:"站点名称",label:"站点名称"},p("site_name",{rules:[{required:!0,message:"请输入站点名称"},{type:"string",max:50,min:1,message:"长度1-50"}]})(q.a.createElement(w.a,{placeholder:"请输入站点名称"}))),q.a.createElement(j.a.Item,{name:"站点标识",label:"站点标识",className:"Create-Form-biaoshi"},p("identifier",{rules:[{required:!0,message:"请输入站点标识"},{pattern:/^[a-zA-Z0-9]{2,100}$/,message:"长度2-100只能包含数字和字母"}]})(q.a.createElement(w.a,{onChange:function(e){Y(e.target.value)},placeholder:"请输入站点标识"})),q.a.createElement("span",{style:{wordBreak:"break-all"}},"http://",t.login,".",i,"/",X)),q.a.createElement(j.a.Item,{name:"建站工具",label:"建站工具"},p("language_frame",{initialValue:0})(q.a.createElement(N.a,{style:{width:100}},q.a.createElement(N.a.Option,{value:0},"hugo"),q.a.createElement(N.a.Option,{value:1},"jekyll"),q.a.createElement(N.a.Option,{value:2},"hexo")))),q.a.createElement(j.a.Item,{style:{marginLeft:"100px"},className:"mt40"},q.a.createElement(O.a,{type:"primary",htmlType:"submit",className:"mr20"},"创建站点"),q.a.createElement(O.a,{onClick:function(){var e;n.push(F()(e="/".concat(o,"/")).call(e,u,"/service"))}},"取消"))),se&&q.a.createElement("div",{className:"mt30"},q.a.createElement("div",{className:"mt20 ant-descriptions-title"},"部署结果"),q.a.createElement("div",{className:"buildResult"},M()(se).call(se,(function(e){return q.a.createElement("p",null,e)}))))),!s&&q.a.createElement("div",{className:"mt30"},T&&T.state&&q.a.createElement(y.a,{title:"站点信息"},q.a.createElement(y.a.Item,{label:"站点名称"},q.a.createElement("span",{onClick:function(){T.last_build_at&&window.open(T.url)},className:T.last_build_at&&"theme-btn"},T.site_name)),q.a.createElement(y.a.Item,{label:"网站地址",span:2},q.a.createElement("span",{onClick:function(){T.last_build_at&&window.open(T.url)},className:T.last_build_at&&"theme-btn"},T.url)),q.a.createElement(y.a.Item,{label:"建站工具"},T.language_frame),q.a.createElement(y.a.Item,{label:"建站时间"},T.created_at),T.last_build_at&&q.a.createElement(y.a.Item,{label:"上次部署时间"},T.last_build_at))))}))},"Ws+N":function(e,a,t){}}]);