← Back
Editing: index-legacy276.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var n,r={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(n){f=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),i=new O(r||[]);return u(a,"_invoke",{value:E(t,n,i)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function w(){}function b(){}function x(){}var _={};f(_,l,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(q([])));k&&k!==o&&a.call(k,l)&&(_=k);var L=x.prototype=w.prototype=Object.create(_);function V(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(e,n){function r(o,u,i,l){var s=d(e[o],e,u);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==t(f)&&a.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,i,l)}),(function(t){r("throw",t,i,l)})):n.resolve(f).then((function(t){c.value=t,i(c)}),(function(t){return r("throw",t,i,l)}))}l(s.arg)}var o;u(this,"_invoke",{value:function(t,e){function a(){return new n((function(n,o){r(t,e,n,o)}))}return o=o?o.then(a,a):a()}})}function E(t,e,r){var o=h;return function(a,u){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===a)throw u;return{value:n,done:!0}}for(r.method=a,r.arg=u;;){var i=r.delegate;if(i){var l=P(i,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var s=d(t,e,r);if("normal"===s.type){if(o=r.done?y:m,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function P(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,g;var u=a.arg;return u?u.done?(e[t.resultName]=u.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):u:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function H(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function q(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,u=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=n,t.done=!0,t};return u.next=u}}throw new TypeError(t(e)+" is not iterable")}return b.prototype=x,u(L,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},V(j.prototype),f(j.prototype,s,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var u=new j(p(t,e,n,o),a);return r.isGeneratorFunction(e)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},V(L),f(L,c,"Generator"),f(L,l,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},r.values=q,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(H),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return i.type="throw",i.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var l=a.call(u,"catchLoc"),s=a.call(u,"finallyLoc");if(l&&s){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(u)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),H(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;H(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:q(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function n(t,e,n,r,o,a,u){try{var i=t[a](u),l=i.value}catch(t){return void n(t)}i.done?e(l):Promise.resolve(l).then(r,o)}function r(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var u=t.apply(e,r);function i(t){n(u,o,a,i,l,"next",t)}function l(t){n(u,o,a,i,l,"throw",t)}i(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useMethod-legacy6.js?v=VERSION_NUMBER","./useStore-legacy5.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var o,a,u,i,l,s,c,f,p,d,h,m,v,y,g,w,b,x,_,S,k,L,V,j,E,P,C,H,O,q,K,U,F,B,N,I,z,G,A,T,R,D,M,Y,Q,J,W,X,$,Z,tt,et,nt,rt,ot,at,ut,it;return{setters:[function(t){o=t.c,a=t.k,u=t.r,i=t.w,l=t.p,s=t.G,c=t.q,f=t.v,p=t.e,d=t.A,h=t.H,m=t.x,v=t.M,y=t.y,g=t.J,w=t.z,b=t.B,x=t.Q,_=t.D,S=t.a9,k=t.al,L=t.a7,V=t.U,j=t.F,E=t.a_,P=t.P,C=t.aj,H=t.ai,O=t.a$},function(t){q=t.O,K=t.P,U=t.Q,F=t.R,B=t.S,N=t.T,I=t.U,z=t.V,G=t.W,A=t.X,T=t.Y},function(t){R=t.K,D=t.aq,M=t.M,Y=t.r,Q=t.at,J=t.n,W=t.L,X=t.bU,$=t.p,Z=t.A,tt=t.k,et=t.j,nt=t.e,rt=t.T},function(t){ot=t.k},function(t){at=t.c},function(t){ut=t.g},function(t){it=t._},null,null,null],execute:function(){var lt={class:"bt-line"},st={class:"bt-line"},ct=o({__name:"index",setup:function(t){var o,V=ut().refs.sshInfo,j=a({sshBlastStatus:Boolean(null===(o=V.value)||void 0===o||null===(o=o.fail2ban)||void 0===o?void 0:o.status)}),E=u(),P=u(!1),C=u({}),H=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return j.sshBlastStatus=!n,t.next=3,R({request:D({sName:"fail2ban"})});case 3:if(t.sent.data.setup){t.next=7;break}return M.warn("请先安装防暴破插件"),t.abrupt("return");case 7:return t.next=9,R({loading:"正在"+(n?"开启":"关闭")+"防暴破,请稍后...",request:q({act:n}),message:!0});case 9:j.sshBlastStatus=n,at();case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),O=function(){var t=r(e().mark((function t(n){var r,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,R({request:D({sName:"fail2ban"})});case 3:r=t.sent,(o=r.data).setup?n&&n():(ot({name:o.name,type:"i",pluginInfo:o}),M.warn("请先安装防暴破插件")),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),F=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:O((function(){return J({title:"配置SSH防暴破",area:40,component:function(){return W((function(){return n.import("./anti-blast-view-legacy.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},showFooter:!0})}));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),B=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:O((function(){return J({title:"防暴破日志",area:60,compData:{type:"AntiBlast",requestFn:function(){return U()}},component:function(){return W((function(){return n.import("./index-legacy458.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}})}));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),N=function(){Y.push({name:"fixed"})},I=function(){var t=r(e().mark((function t(){var n,r,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,P.value=!0,t.next=4,K();case 4:return n=t.sent,r=n.data,C.value=r,r.status?(C.value.type=!0,o={mail:"邮件",sms:"短信",dingding:"钉钉",wx_account:"微信公众号",feishu:"飞书",weixin:"企业微信",webhook:"自定义通道"},C.value.text=C.value.channels.map((function(t){return o[t]})).join("、")+"已配置"):C.value={type:!1,text:"告警通知未配置"},t.abrupt("return",r);case 11:t.prev=11,t.t0=t.catch(0),Q(t.t0);case 14:return t.prev=14,P.value=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[0,11,14,17]])})));return function(){return t.apply(this,arguments)}}(),z=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:J({title:"SSH登录告警",area:104,compData:{alertStatus:E.value,refreshFn:I},component:function(){return W((function(){return n.import("./login-alert-setting-legacy.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i((function(){return V.value}),(function(){var t;j.sshBlastStatus=Boolean(null===(t=V.value)||void 0===t||null===(t=t.fail2ban)||void 0===t?void 0:t.status)})),l((function(){I()})),function(t,e){var n=_,r=S,o=k,a=L,u=s("bt-loading");return c(),f("div",null,[p(a,{model:m(j),onSubmit:e[5]||(e[5]=x((function(){}),["prevent"]))},{default:d((function(){return[h((c(),v(r,{label:"SSH登录告警"},{default:d((function(){return[y("div",lt,[y("span",{onClick:e[0]||(e[0]=function(t){return z()}),class:g(["!text-[1.2rem] cursor-pointer","text-".concat(m(C).type?"primary":"warning")])},w(m(C).text),3),p(n,{type:"primary",class:"!ml-4",size:"small",onClick:e[1]||(e[1]=function(t){return z()})},{default:d((function(){return e[6]||(e[6]=[b(" 设置登陆告警 ")])})),_:1}),e[7]||(e[7]=y("span",{class:"text-[#999] ml-4 text-[1.2rem]"}," 推荐使用密钥登录,关闭密码,安全性更高 ",-1))])]})),_:1})),[[u,m(P)]]),p(r,{label:"SSH安全防护"},{default:d((function(){return[y("div",st,[p(o,{modelValue:m(j).sshBlastStatus,"onUpdate:modelValue":e[2]||(e[2]=function(t){return m(j).sshBlastStatus=t}),size:"small",width:36,onChange:H},null,8,["modelValue"]),p(n,{onClick:e[3]||(e[3]=function(t){return F()}),size:"small",type:"primary",class:"!ml-8"},{default:d((function(){return e[8]||(e[8]=[b(" 配置 ")])})),_:1}),p(n,{size:"small",onClick:e[4]||(e[4]=function(t){return B()})},{default:d((function(){return e[9]||(e[9]=[b("日志")])})),_:1}),e[10]||(e[10]=y("span",{class:"text-[#999] ml-4 text-[1.2rem]"}," 结合fail2ban服务自动阻止恶意IP地址的攻击、暴力破解等行为;首次安装后,请手动刷新页面 ",-1))])]})),_:1}),p(r,null,{default:d((function(){return[y("span",{class:"text-[1.2rem] text-[#999]"},[e[11]||(e[11]=b(" 更多SSH安全设置请使用系统加固模块 ")),y("span",{class:"bt-link",onClick:N},">> 系统加固")])]})),_:1})]})),_:1},8,["model"])])}}}),ft={class:"bt-line"},pt={class:"bt-line"},dt=o({__name:"root-setting",props:{data:{default:function(){return{}}}},emits:["refresh"],setup:function(t,n){var o=n.emit,l=t,s=o,h=V(l.data),g=a({rootLogin:"",rootPwd:"",rootKey:""}),w=V(),k=u(!1),O=function(){var t=r(e().mark((function t(n){var r,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("yes"===(null===(r=h.value)||void 0===r?void 0:r.pubkey)){t.next=2;break}return t.abrupt("return",M.error("请先开启SSH密钥登录,再"+(n?"查看":"下载")+"密钥"));case 2:return t.next=4,R({loading:"正在获取密钥信息,请稍后...",request:F()});case 4:o=t.sent,n&&o.status?(g.rootKey=o.msg,k.value=!0):window.open("/ssh_security?action=download_key","_blank","noopener,noreferrer");case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(g.rootPwd){t.next=2;break}return t.abrupt("return",M.error("请输入新密码"));case 2:return t.next=4,$({title:"提示",content:"重置root密码后,之前的密码将失效,是否继续操作?",icon:"warning-filled"});case 4:return t.next=6,R({loading:"正在重置root密码,请稍后...",request:B({username:"root",password:g.rootPwd}),message:!0});case 6:s("refresh");case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R({loading:"正在设置root登录,请稍后...",request:N({p_type:n}),message:!0});case 2:s("refresh");case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),U=function(){window.open("/ssh_security?action=download_key","_blank","noopener,noreferrer")},z=function(){var t=r(e().mark((function t(){var n,r,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null===(n=h.value)||void 0===n?void 0:n.pubkey,t.next=3,R({loading:"正在重新生成SSH登录密钥,请稍后...",request:I({ssh:r,type:h.value.key_type}),message:!0});case 3:return t.next=5,R({loading:"正在获取密钥信息,请稍后...",request:F()});case 5:if((o=t.sent).msg){t.next=8;break}return t.abrupt("return",M.msg({type:"warning",message:"请重新开启SSH密钥登录再查看密钥!"}));case 8:g.rootKey=o.msg,s("refresh");case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i((function(){return l.data}),(function(t){w.value=Object.entries((null==t?void 0:t.root_login_types)||[]),g.rootLogin=null==t?void 0:t.root_login_type,h.value=t}),{immediate:!0}),function(t,e){var n=H,r=C,o=S,a=it,u=_,i=L,l=tt,s=et;return c(),f("div",null,[p(i,{ref:"rootFormRef",model:m(g),onSubmit:e[5]||(e[5]=x((function(){}),["prevent"]))},{default:d((function(){return[p(o,{label:"root登录设置",prop:"rootLogin"},{default:d((function(){return[p(r,{modelValue:m(g).rootLogin,"onUpdate:modelValue":e[0]||(e[0]=function(t){return m(g).rootLogin=t}),class:"!w-[26rem]",onChange:K},{default:d((function(){return[(c(!0),f(j,null,E(m(w),(function(t){return c(),v(n,{key:t[0],label:t[1],value:t[0]},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"])]})),_:1}),p(o,{label:"root密码"},{default:d((function(){return[y("div",ft,[p(a,{modelValue:m(g).rootPwd,"onUpdate:modelValue":e[1]||(e[1]=function(t){return m(g).rootPwd=t}),icon:"el-refresh",placeholder:"请输入新密码",onIconClick:e[2]||(e[2]=function(){return m(g).rootPwd=m(X)(16)}),width:"28rem"},null,8,["modelValue"]),p(u,{type:"primary",class:"!ml-4",onClick:q},{default:d((function(){return e[9]||(e[9]=[b(" 重置 ")])})),_:1}),e[10]||(e[10]=y("span",{class:"text-[#999] ml-4 text-[1.2rem]"}," 建议使用复杂度高的密码,修改后请及时保存,刷新页面会清空密码框 ",-1))])]})),_:1}),p(o,{label:"root密钥"},{default:d((function(){return[y("div",pt,[p(u,{size:"small",type:"primary",onClick:e[3]||(e[3]=function(t){return O(!0)})},{default:d((function(){return e[11]||(e[11]=[b(" 查看密钥 ")])})),_:1}),p(u,{size:"small",onClick:e[4]||(e[4]=function(t){return O(!1)})},{default:d((function(){return e[12]||(e[12]=[b(" 下载 ")])})),_:1}),e[13]||(e[13]=y("span",{class:"text-[#999] ml-4 text-[1.2rem]"}," 推荐使用密钥登录,关闭密码,安全性更高 ",-1))])]})),_:1})]})),_:1},8,["model"]),p(s,{title:"SSH密钥登录",modelValue:m(k),"onUpdate:modelValue":e[8]||(e[8]=function(t){return P(k)?k.value=t:null}),area:42},{default:d((function(){return[p(i,{ref:"openSshKeyForm",model:m(g),class:"p-[2rem]","label-width":"5rem"},{default:d((function(){return[p(o,null,{default:d((function(){return[p(l,{modelValue:m(g).rootKey,"onUpdate:modelValue":e[6]||(e[6]=function(t){return m(g).rootKey=t}),class:"sshKey",type:"textarea",readOnly:"",rows:12,width:"36rem"},null,8,["modelValue"])]})),_:1}),p(o,null,{default:d((function(){return[p(u,{type:"primary",class:"copySshPaw",onClick:e[7]||(e[7]=function(t){return e=m(g).rootKey,void Z({value:e});var e}),textContent:"复制"}),p(u,{type:"primary",class:"copy",onClick:U,textContent:"下载"}),p(u,{type:"default",class:"copy",onClick:z,textContent:"重新生成"})]})),_:1})]})),_:1},8,["model"])]})),_:1},8,["modelValue"])])}}}),ht=nt(dt,[["__scopeId","data-v-6d23c4bc"]]),mt={class:"bt-line"},vt={class:"bt-line"},yt={class:"bt-line"},gt={class:"p-20px"},wt=o({__name:"ssh-setting",props:{data:{default:function(){return{}}}},emits:["refresh"],setup:function(t,n){var o,l,s=n.emit,h=t,v=s,g=ut().refs.sshInfo,w=V(null==h?void 0:h.data),j=u(!1),E=a({isPwdLogin:"yes"===(null===(o=w.value)||void 0===o?void 0:o.password),isKeyLogin:"yes"===(null===(l=w.value)||void 0===l?void 0:l.pubkey)}),O=a({ssh:"yes",type:"ed25519"}),q=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R({loading:"正在"+(n?"开启":"关闭")+"SSH密码登录,请稍后...",request:z(Boolean(n)),message:!0});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),K=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R({loading:"正在处理,请稍候...",request:I(O),message:!0});case 2:j.value=!1,O.ssh="yes",O.type="ed25519",v("refresh");case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),U=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=5;break}E.isKeyLogin=!n,j.value=!0,t.next=8;break;case 5:return t.next=7,R({loading:"正在关闭SSH密钥登录,请稍后...",request:G(),message:!0});case 7:v("refresh");case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),F=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(rt(g.value.port)){t.next=3;break}return M.error("端口格式错误,可用范围:1-65535"),t.abrupt("return");case 3:return t.next=5,R({loading:"正在保存SSH端口,请稍后...",request:A(Number(g.value.port)),message:!0});case 5:v("refresh");case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return i((function(){return h.data}),(function(t){t&&(w.value=t),E.isPwdLogin="yes"===(null==t?void 0:t.password),E.isKeyLogin="yes"===(null==t?void 0:t.pubkey)}),{immediate:!0}),function(t,e){var n=k,r=S,o=tt,a=_,u=L,i=H,l=C,s=et;return c(),f("div",null,[p(u,{ref:"sshFormRef",model:m(E),onSubmit:e[4]||(e[4]=x((function(){}),["prevent"]))},{default:d((function(){return[p(r,{label:"SSH密码登录"},{default:d((function(){return[y("div",mt,[p(n,{size:"small",modelValue:m(E).isPwdLogin,"onUpdate:modelValue":e[0]||(e[0]=function(t){return m(E).isPwdLogin=t}),width:36,onChange:q},null,8,["modelValue"]),p(r,{label:"SSH密钥登录",class:"ml-[2rem]"},{default:d((function(){return[y("div",vt,[p(n,{size:"small",modelValue:m(E).isKeyLogin,"onUpdate:modelValue":e[1]||(e[1]=function(t){return m(E).isKeyLogin=t}),width:36,onChange:U},null,8,["modelValue"])])]})),_:1})])]})),_:1}),p(r,{label:"SSH端口"},{default:d((function(){return[y("div",yt,[p(o,{modelValue:m(g).port,"onUpdate:modelValue":e[2]||(e[2]=function(t){return m(g).port=t}),width:"20rem",class:"!max-w-[20rem]",placeholder:"请输入SSH端口"},null,8,["modelValue"]),p(a,{type:"primary",class:"!ml-4",onClick:e[3]||(e[3]=function(t){return F()})},{default:d((function(){return e[8]||(e[8]=[b("保存")])})),_:1}),e[9]||(e[9]=y("span",{class:"text-[#999] ml-4 text-[1.2rem]"},"当前SSH协议所使用的的端口,默认为22",-1))])]})),_:1})]})),_:1},8,["model"]),p(s,{title:"开启SSH密钥登录",modelValue:m(j),"onUpdate:modelValue":e[7]||(e[7]=function(t){return P(j)?j.value=t:null}),area:40,onConfirm:K,showFooter:""},{default:d((function(){return[y("div",gt,[p(u,{"label-position":"right",model:m(O)},{default:d((function(){return[p(r,{label:"SSH密码登录"},{default:d((function(){return[p(l,{modelValue:m(O).ssh,"onUpdate:modelValue":e[5]||(e[5]=function(t){return m(O).ssh=t}),class:"!w-[20rem]"},{default:d((function(){return[p(i,{label:"开启",value:"yes"}),p(i,{label:"关闭",value:"no"})]})),_:1},8,["modelValue"])]})),_:1}),p(r,{label:"密钥加密方式"},{default:d((function(){return[p(l,{modelValue:m(O).type,"onUpdate:modelValue":e[6]||(e[6]=function(t){return m(O).type=t}),class:"!w-[20rem]"},{default:d((function(){return[p(i,{label:"ED25519(推荐)",value:"ed25519"}),p(i,{label:"ECDSA",value:"ecdsa"}),p(i,{label:"RSA",value:"rsa"}),p(i,{label:"DSA",value:"dsa"})]})),_:1},8,["modelValue"])]})),_:1})]})),_:1},8,["model"])])]})),_:1},8,["modelValue"])])}}}),bt=nt(wt,[["__scopeId","data-v-f92ed601"]]),xt={class:"px-2rem"};t("default",o({__name:"index",setup:function(t){var n=u(),o=u(!0),a=function(){var t=r(e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,R({loading:o,request:T()});case 2:r=t.sent,n.value=r.data;case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return l((function(){a()})),function(t,e){var r=O,u=s("bt-loading");return h((c(),f("div",xt,[p(bt,{data:m(n),onRefresh:a},null,8,["data"]),p(r,{class:"!mt-0"}),p(ht,{data:m(n),onRefresh:a},null,8,["data"]),p(r,{class:"!mt-0"}),p(ct,{data:m(n),onRefresh:a},null,8,["data"])])),[[u,m(o)],[u,"正在获取配置信息,请稍后...","title"]])}}}))}}}))}();
Save File
Cancel