forked from Gitlink/build
1 line
8.1 KiB
JavaScript
1 line
8.1 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[148],{"4k9F":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l,n,r=w(a("2/Rp")),u=w(a("fyUT")),i=w(a("PArb")),c=w(a("kaz8")),d=w(a("9yH6")),o=w(a("Vl3Y")),f=w(a("5rEg")),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},m=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],l=!0,n=!1,r=void 0;try{for(var u,i=e[Symbol.iterator]();!(l=(u=i.next()).done)&&(a.push(u.value),!t||a.length!==t);l=!0);}catch(e){n=!0,r=e}finally{try{!l&&i.return&&i.return()}finally{if(n)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},p=(l=["{\n padding:20px 30px;\n}"],n=["{\n padding:20px 30px;\n}"],Object.freeze(Object.defineProperties(l,{raw:{value:Object.freeze(n)}})));a("L/Qf"),a("QCje"),a("qNb/"),a("MKzF"),a("K4yd"),a("tULf"),a("1vPl");var v=a("q1tI"),g=w(v),E=a("spEH"),h=w(a("ess8")),y=w(a("vOnD")),b=w(a("tlJt")),x=w(a("vDqi")),_=w(a("kksi")),k=a("sYIF");function w(e){return e&&e.__esModule?e:{default:e}}var N=f.default.TextArea,O=y.default.div(p),j={display:"block",height:"30px",lineHeight:"30px"};t.default=o.default.create()((0,v.forwardRef)((function(e){var t=e.form,a=e.organizeDetail,l=e.showNotification,n=e.history,p=e.current_user,y=e.updateFunc,w=(0,v.useState)(void 0),z=m(w,2),C=z[0],F=z[1],T=(0,v.useState)(!1),A=m(T,2),I=A[0],S=A[1],q=(0,v.useState)(void 0),P=m(q,2),L=P[0],M=P[1],U=(0,v.useState)(!1),D=m(U,2),J=D[0],B=D[1],G=(0,v.useState)(!1),R=m(G,2),W=R[0],H=R[1],Q=(0,v.useState)(0),V=m(Q,2),Y=V[0],K=V[1],X=t.getFieldDecorator,Z=t.validateFields,$=t.setFieldsValue;(0,v.useEffect)((function(){a&&($(s({},a,{max_repo_creation:-1===a.max_repo_creation?"":a.max_repo_creation})),F(a.avatar_url),K(a.description?a.description.length:0))}),[a]);var ee=(0,v.useCallback)((function(e,t,a,l,n,r,u){return g.default.createElement("div",null,g.default.createElement("span",{className:n?"required":""},e),g.default.createElement(o.default.Item,{help:u},X(t,{rules:a,validateFirst:!0,valuePropName:r?"checked":"value"})(l)))}),[]);return g.default.createElement("div",null,g.default.createElement(E.WhiteBack,null,g.default.createElement(h.default,null,"基本设置"),g.default.createElement(O,null,g.default.createElement(o.default,null,ee("组织账号:","name",[{required:!0,message:"请输入组织账号"},{validator:function(e,t,a){t||a(),t&&!t.match(/^[a-zA-Z0-9][a-zA-Z0-9_-]{3,19}$/)&&a("只能使用以字母开头,包含字母、数字、下划线、横杠等,长度4到20个字符"),a()}}],g.default.createElement(f.default,{placeholder:"请输入组织账号",disabled:!0}),!0),ee("组织名称:","nickname",[{required:!0,message:"请输入组织名称"}],g.default.createElement(f.default,{placeholder:"请输入组织名称",maxLength:100}),!0),g.default.createElement("div",{className:"pr"},g.default.createElement("span",{className:"toprightNum"},Y,"/200"),ee("组织描述:","description",[],g.default.createElement(N,{placeholder:"请输入组织名称",maxLength:200,onChange:function(e){K(e.target.value?e.target.value.length:0)}}))),ee("官方网站:","website",[],g.default.createElement(f.default,{placeholder:"请输入官方网站"})),ee("所在地区:","location",[],g.default.createElement(f.default,{placeholder:"请输入城市"})),ee("可见性:","visibility",[],g.default.createElement(d.default.Group,null,g.default.createElement(d.default,{value:"common",style:j},"公开"),g.default.createElement(d.default,{value:"limited",style:j},"受限",g.default.createElement("span",null,"(仅对登录用户可见)")),g.default.createElement(d.default,{value:"privacy",style:j},"私有",g.default.createElement("span",null,"(仅对组织成员可见)")))),ee("权限:","repo_admin_change_team_access",[],g.default.createElement(c.default,{style:j},"项目管理员可以添加或移除团队的访问权限"),!1,!0),g.default.createElement(i.default,null),ee("最大仓库数:","max_repo_creation",[],g.default.createElement(u.default,{value:"-1",max:1e3,style:{width:"350px"}}),!1,!1,"当输入栏为空时,默认数量无限制"),g.default.createElement("p",null,"选择头像:"),g.default.createElement(b.default,{url:C&&C.startsWith("images/avatars/Organization")?(0,k.getImageUrl)("/"+C):C,getImage:function(e){S(!0),F(e),console.log(e)}}),g.default.createElement(r.default,{type:"primary",onClick:function(){Z((function(e,t){if(!e){var r="/organizations/"+a.id+".json";x.default.patch(r,s({},t,{image:I?C:void 0})).then((function(e){e&&e.data&&(l("组织信息更新成功!"),t.name!==a.name&&(console.log("false111"),n.push("/"+t.name+"/setting")),y&&y(t.name,t.description))})).catch((function(e){}))}}))}},"更新组织设置")))),g.default.createElement(E.WhiteBack,{className:"padding20 mt20"},g.default.createElement("div",{className:"warningBox"},g.default.createElement("div",{className:"warningTitle"},"删除当前组织"),g.default.createElement("div",{className:"warningContent"},g.default.createElement("p",{className:"font-16 mb15"},"删除操作会永久清除该组织的信息,并且不可恢复!"),g.default.createElement(E.FlexAJ,null,g.default.createElement("div",null,g.default.createElement("span",{className:"required"},"密码:"),g.default.createElement(f.default,{type:"password",placeholder:"请输入当前用户的登录密码",style:{width:"350px"},value:L,onChange:function(e){return M(e.target.value)}}),J&&g.default.createElement("span",{className:"color-red ml10"},"请输入密码")),g.default.createElement("a",{className:"warningDelete",onClick:function(){L?(B(!1),H(!0)):B(!0)}},"删除组织"),g.default.createElement(_.default,{visible:W,okText:"确定",cancelText:"取消",onCancel:function(){return H(!1)},onOk:function(){return function(e){var t="/organizations/"+a.id+".json";x.default.delete(t,{params:{password:e}}).then((function(e){e&&e.data&&n.push("/"+(p&&p.login)+"/organizes")})),H(!1)}(L)}},g.default.createElement("p",{className:"font-16 edu-txt-center"},"确定要删除当前组织吗?")))))))})))},kksi:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=r(a("kLXV"));a("k3Gp");var n=r(a("q1tI"));function r(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.visible,a=e.okText,r=e.cancelText,u=e.onOk,i=e.onCancel,c=e.children;return n.default.createElement(l.default,{visible:t,okText:a,onCancel:i,onOk:u,cancelText:r,title:"提示",closable:!1,centered:!0},c)}},tlJt:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=o(a("8z0m")),n=o(a("CtXQ")),r=o(a("tsqr")),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],l=!0,n=!1,r=void 0;try{for(var u,i=e[Symbol.iterator]();!(l=(u=i.next()).done)&&(a.push(u.value),!t||a.length!==t);l=!0);}catch(e){n=!0,r=e}finally{try{!l&&i.return&&i.return()}finally{if(n)throw r}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("7W5+"),a("2oDE"),a("8/o9");var i=a("q1tI"),c=o(i),d=a("sYIF");function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.getImage,a=e.url,o=(0,i.useState)(void 0),f=u(o,2),s=f[0],m=f[1];return(0,i.useEffect)((function(){a&&m(a)}),[a]),c.default.createElement(l.default,{name:"file",listType:"picture-card",className:"avatar-uploader",showUploadList:!1,action:(0,d.getUploadActionUrl)(),beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type;t||r.default.error("上传的图片只能是JPG或者PNG格式!");var a=e.size/1024/1024<2;return a||r.default.error("上传的图片不能超过2MB!"),t&&a},onChange:function(e){var a,l,n;e&&e.file&&"done"===e.file.status&&(a=e.file.originFileObj,l=function(e){return m(e)},(n=new FileReader).addEventListener("load",(function(){return l(n.result)})),n.readAsDataURL(a),n.onload=function(e){t&&t(e.target.result)})}},s?c.default.createElement("img",{src:s,alt:"avatar",style:{width:"100%"}}):c.default.createElement("div",null,c.default.createElement(n.default,{type:"plus"}),c.default.createElement("div",{className:"ant-upload-text"},"点击上传")))}}}]); |