forgeplus/public/react/build/static/js/133.d2e96d75.chunk.js

1 line
2.5 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[133],{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},n=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")};a("tULf"),a("1vPl");var u=a("q1tI"),i=c(u),o=a("eO8H"),d=c(a("vDqi"));function c(e){return e&&e.__esModule?e:{default:e}}var f=r.default.TextArea;t.default=s.default.create()((0,u.forwardRef)((function(e){var t=e.form,a=e.showNotification,c=e.history,m=t.getFieldDecorator,h=t.validateFields,v=(t.setFieldsValue,(0,u.useState)(void 0)),p=n(v,2),y=p[0],S=p[1];return i.default.createElement("div",null,i.default.createElement("div",{className:"sshHead"},i.default.createElement("span",{className:"add-SSH-title"},i.default.createElement(o.Link,{to:"/settings/SSH",className:"blue-Purple"},"SSH密钥"),i.default.createElement("i",{className:"iconfont icon-youjiantou ml5 mr5 font-12"}),"添加SSH密钥")),i.default.createElement(s.default,{className:"sshForm"},i.default.createElement(s.default.Item,{label:"标题",validateStatus:y&&10001===y.status?"error":void 0,help:y&&10001===y.status?y.message:void 0},m("title",{rules:[{required:!0,message:"请输入密钥标题"}]})(i.default.createElement(r.default,{placeholder:"请输入密钥标题",size:"large",maxLength:"200"}))),i.default.createElement(s.default.Item,{label:"密钥",validateStatus:y&&10002===y.status?"error":void 0,help:y&&10002===y.status?y.message:void 0},m("key",{rules:[{required:!0,message:"请输入密钥"}]})(i.default.createElement(f,{placeholder:"支持以'ssh-rsa','ssh-dss','ssh-ed25519','ecdsa-sha2-nistp256','ecdsa-sha2-nistp384','ecdsa-sha2-nistp521'开头",autoSize:{minRows:6,maxRows:6}}))),i.default.createElement("button",{style:{width:"100px"},onClick:function(){h((function(e,t){if(!e){d.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};S(t)}})).catch((function(e){}))}}))},className:"but25"},"确定")))})))}}]);