(this.webpackJsonp=this.webpackJsonp||[]).push([[177],{WYTE:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=c(a("Vl3Y")),r=c(a("5rEg")),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e};a("y8nQ"),a("5NDa");var n=a("cDcd"),u=c(n),i=a("eO8H"),o=c(a("vDqi"));function c(e){return e&&e.__esModule?e:{default:e}}var d=r.default.TextArea;t.default=s.default.create()((0,n.forwardRef)((function(e){var t=e.form,a=e.showNotification,c=e.history,f=t.getFieldDecorator,m=t.validateFields,h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],s=!0,r=!1,l=void 0;try{for(var n,u=e[Symbol.iterator]();!(s=(n=u.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){r=!0,l=e}finally{try{!s&&u.return&&u.return()}finally{if(r)throw l}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}((t.setFieldsValue,(0,n.useState)(void 0)),2),p=h[0],v=h[1];return(0,n.useEffect)((function(){document.title="添加SSH密钥"}),[]),u.default.createElement("div",null,u.default.createElement("div",{className:"sshHead"},u.default.createElement("span",{className:"add-SSH-title"},u.default.createElement(i.Link,{to:"/settings/SSH",className:"blue-Purple"},"SSH密钥"),u.default.createElement("i",{className:"iconfont icon-youjiantou ml5 mr5 font-12"}),"添加SSH密钥")),u.default.createElement(s.default,{className:"sshForm"},u.default.createElement(s.default.Item,{label:"标题",validateStatus:p&&10001===p.status?"error":void 0,help:p&&10001===p.status?p.message:void 0},f("title",{rules:[{required:!0,message:"请输入密钥标题"}]})(u.default.createElement(r.default,{placeholder:"请输入密钥标题",size:"large",maxLength:"200"}))),u.default.createElement(s.default.Item,{label:"密钥",validateStatus:p&&10002===p.status?"error":void 0,help:p&&10002===p.status?p.message:void 0},f("key",{rules:[{required:!0,message:"请输入密钥"}]})(u.default.createElement(d,{placeholder:"支持以'ssh-rsa','ssh-ed25519','ecdsa-sha2-nistp256','ecdsa-sha2-nistp384','ecdsa-sha2-nistp521'开头",autoSize:{minRows:6,maxRows:6}}))),u.default.createElement("button",{style:{width:"100px",height:"36px"},onClick:function(){m((function(e,t){e||o.default.post("/public_keys.json",l({},t)).then((function(e){if(e){0===e.data.status&&(c.push("/settings/SSH"),a("密钥创建成功!"));var t={status:e.data.status,message:e.data.message};v(t)}})).catch((function(e){}))}))},className:"but25"},"确定")))})))}}]);