build/static/js/215.37ba2402.chunk.js

1 line
5.7 KiB
JavaScript
Raw 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([[215],{u5sb:function(e,t,a){"use strict";a.r(t),a("DjyN");var n=a("NUBc"),c=(a("cWXX"),a("/ezw")),l=(a("Mwp2"),a("VXEj")),s=(a("+L6B"),a("2/Rp")),i=a("zLi2"),r=a.n(i),o=a("FLGM"),m=a.n(o),u=a("cDcd"),E=a.n(u),A=a("yYO3"),d=a.n(A),g=a("vDqi"),p=a.n(g),f=a("spEH"),h=a("/k9T"),S=function(e){var t=e.visible,a=e.onCancel,n=e.onSuccess;return E.a.createElement(h.a,{visible:t,onCancel:a,title:"删除SSH密钥",btn:E.a.createElement("div",null,E.a.createElement(s.a,{size:"large",onClick:a},"取消"),E.a.createElement(s.a,{type:"danger",size:"large",onClick:n},"确认删除"))},E.a.createElement("div",{className:"desc"},E.a.createElement(f.a,{className:"descMain"},E.a.createElement("i",{className:"iconfont icon-jinggao1 mr10 font-20 red"}),"您确定要删除此 SSH 密钥吗?"),E.a.createElement("p",null,"此操作将永久删除该SSH密钥且不可恢复。如果您想再次使用该密钥则需要您重新上传。")))},b=(a("2qtc"),a("kLXV")),v=function(e){var t=e.visible,a=e.onCancel,n=e.desc;return E.a.createElement(b.a,{visible:t,onCancel:a,title:"SSH密钥详情",width:"600px",footer:null,className:"descModal"},E.a.createElement("div",null,E.a.createElement("p",{className:"color-grey-3 font-16 keysTitle"},E.a.createElement("span",{style:{fontWeight:"600"}},"SSH Key"),E.a.createElement("span",null,n&&n.name)),E.a.createElement("p",{className:"mt5"},"添加时间:",n&&n.created_time),E.a.createElement("p",{className:"color-grey-3 mt30 keysTitle mb15"},E.a.createElement("span",{style:{fontWeight:"600"}},"公钥指纹:"),E.a.createElement("span",null,n&&n.fingerprint)),E.a.createElement("div",{className:"keyContent"},n&&n.content),E.a.createElement("div",{className:"edu-txt-center mt30 mb20"},E.a.createElement(s.a,{type:"primary",size:"large",style:{width:"100px"},onClick:a},"关闭"))))};t.default=function(e){var t=Object(u.useState)(void 0),a=r()(t,2),i=a[0],o=a[1],A=Object(u.useState)(1),g=r()(A,2),f=g[0],h=g[1],b=Object(u.useState)(0),k=r()(b,2),y=k[0],N=k[1],C=Object(u.useState)(void 0),z=r()(C,2),w=z[0],D=z[1],j=Object(u.useState)(!1),U=r()(j,2),I=U[0],O=U[1],H=Object(u.useState)(!1),Q=r()(H,2),q=Q[0],B=Q[1],L=Object(u.useState)(void 0),V=r()(L,2),X=V[0],F=V[1];function G(){p.a.get("/public_keys.json",{params:{page:f,limit:10}}).then((function(e){e&&e.data&&(o(e.data.public_keys),N(e.data.total_count))})).catch((function(e){}))}return Object(u.useEffect)((function(){document.title="SSH密钥"}),[]),Object(u.useEffect)((function(){G()}),[f]),E.a.createElement("div",null,E.a.createElement(S,{visible:I,onCancel:function(){return O(!1)},onSuccess:function(){if(w){var t="/public_keys/".concat(w,".json");p.a.delete(t).then((function(t){t&&t.data&&(e.showNotification("密钥删除成功!"),O(!1),f>1&&i&&1===i.length?h(f-1):G())})).catch((function(e){}))}}}),E.a.createElement(v,{visible:q,onCancel:function(){return B(!1)},desc:X}),E.a.createElement("div",{className:"sshHead",style:{paddingBottom:"10px"}},E.a.createElement("span",{className:"text-shadow07"},"SSH密钥"),E.a.createElement("button",{type:"primary",size:"large",onClick:function(){return e.history.push("/settings/SSH/new")},className:"but25"},"添加SSH密钥")),i&&i.length>0&&E.a.createElement(l.a,null,m()(i).call(i,(function(e,t){return E.a.createElement(l.a.Item,{key:e.id},E.a.createElement("img",{src:d.a,alt:""}),E.a.createElement("div",null,E.a.createElement("p",{className:"color-grey-3"},E.a.createElement("a",{className:"task-hide",style:{display:"block",fontWeight:"500"},onClick:function(){F(e),B(!0)}},e.name)),E.a.createElement("p",{className:"task-hide color-grey-6"},e.fingerprint),E.a.createElement("span",{className:"color-grey-6"},"添加时间:",e.created_time)),E.a.createElement(s.a,{type:"danger",onClick:function(){D(e.id),O(!0)}},"删除"))}))),!i&&E.a.createElement(c.a,null),y>10&&E.a.createElement("div",{className:"edu-txt-center mt15"},E.a.createElement(n.a,{simple:!0,current:f,onChange:function(e){h(e)},pageSize:10,total:y})),(!i||i&&0===i.length)&&E.a.createElement("p",{className:"mt30 pl20"},"您还没有添加任何SSH密钥"),E.a.createElement("p",{className:"questionLink"},E.a.createElement("a",{href:"https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",target:"_blank"},"如何生成SSH密钥")))}},yYO3:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA75JREFUaEPtmUtoFEEQhqt6DyKIGPUkig8QDyoqCiIoRBAfCCJCRPGBwnZ3sh4MKiKIj5CLgqAeZGdqRrJEUTyLD/Bg8IUeRDzoQQVzEfUg3oKsmSnpsCubzc7uvHaNsA3LsEx11f91dQ81NQhNGFLKHUKIs8x8hIheNSHEX5eYpnMp5VIhxAlmPlT2y8y9juNcTTNOpa9UALq6uqZ2dHScAADzm14tFhFve5532nXdz2mDJAbQWitm7gaAVQ3EfUPEAd/3C47jfEgLJDaAEQ4ARvzqiGJGAGAgk8nczOfzLyPOnWAeGqC7u3uB53mdiLgaEdfFEF5Lq9lSz33ff1QsFu8NDg7+iAo0DiCbzXYaB0KIGQCwAADml64rS9eo/qPaf2Hmj4j4CQDGrsz8vlgsDhcKhV+1nI0DUEqdB4BzUaM22973/Y2u6w61AZq90kH+2xn4VytfjtvOQDsDCVeg1Vuoz/f9IfPcllJuA4A9iHgwCUOrAL4z8y7HcV5Ui5VSHkDEwbgQrQK4TETHgkQqpW4AwP44EK0C2EBEz4IEmjpLCPF40gIIIeZalvXlfwZYaFnWcBCAlNIc5tuTNgOIWLBt+3CdM/AAALZOWo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