System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./terminal-legacy-lSIZbtj-.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./useLoading-legacy-IiShPpjk.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./xterm-legacy-UzqSqzXt.js?v=1773287522785","./useSocket-legacy-D9BDJ2id.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785","./xterm-addon-canvas-legacy-Tys2uZOF.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785"],(function(e,a){"use strict";var l,t,r,s,n,o,u,d,p,i,c,y,_,m,v,f,g,k,x,w,h,b,$,j,T,U,C,S,P;return{setters:[e=>{l=e._},e=>{t=e.u,r=e.t,s=e.h,n=e.i},e=>{o=e.i},e=>{u=e.u},e=>{d=e.ad,p=e.k,i=e.a1,c=e.b,y=e._,_=e.a3,m=e.ag,v=e.B},e=>{f=e.k,g=e.R,k=e.r,x=e.e,w=e.w,h=e.$,b=e.Z,$=e.S,j=e.a8,T=e.a9,U=e.j,C=e.aa,S=e.ak,P=e.a0},null,null,null,null,null],execute:function(){const a={class:"p-20px"},q={key:1};e("default",f({__name:"form",props:{data:{}},setup(e,{expose:f}){const I=t(),{t:R}=g(),D=e,{isEdit:Z,row:L,tips:B,localhost:E,onRefresh:z}=D.data,A=k(null),{loading:F,setLoading:G}=u(),H=x({ip:"",port:22,account:"root",type:1,password:"",key:"",keyPassword:"",remark:""});w((()=>H.ip),(e=>{Z||(H.remark=e)}));const J={ip:{required:!0,message:R("Security.Conf.Index_28"),trigger:["blur","input"]},port:{required:!0,type:"number",message:R("Security.Conf.Index_28"),trigger:["blur","input"]},account:{required:!0,message:R("Security.Conf.Index_28"),trigger:["blur","input"]},password:{required:!0,message:R("Security.Conf.Index_28"),trigger:["blur","input"]},key:{required:!0,message:R("Security.Conf.Index_28"),trigger:["blur","input"]}},K=async()=>{try{G(!0),await r(M())}finally{G(!1)}},M=()=>({host:H.ip,port:H.port,username:H.account,password:1===H.type?H.password:"",pkey:2===H.type?H.key:"",pkey_passwd:2===H.type?H.keyPassword:"",ps:H.remark});return(async()=>{if(E)return H.ip="127.0.0.1",H.port=22,H.account="root",H.type=1,H.password="",H.key="",H.keyPassword="",void(H.remark="127.0.0.1");if(Z&&L){const{message:e}=await n({host:L.host});o(e)&&(H.ip=e.host,H.port=e.port,H.account=e.username,H.type=e.password?1:2,H.password=e.password,H.key=e.pkey,H.keyPassword=e.pkey_passwd,H.remark=e.ps)}})(),f({onConfirm:async({hide:e})=>{await(A.value?.validate()),await s(M()),I.setRefresh(!0),e(),z?.()}}),(e,t)=>{const r=d,s=c,n=i,o=y,u=p,f=m,g=_,k=v,x=l;return h(),b("div",a,[$(B)?(h(),j(r,{key:0,class:"mb-16px",type:"warning"},{default:T((()=>[U(C(e.$t("Unable to authenticate automatically, please fill in the login information of the local server!")),1)])),_:1})):S("",!0),P(x,{ref_key:"formRef",ref:A,model:$(H),rules:J},{default:T((()=>[P(u,null,{default:T((()=>[P(n,{label:e.$t("Term.index_8"),path:"ip"},{default:T((()=>[P(s,{class:"w-190px!",value:$(H).ip,"onUpdate:value":t[0]||(t[0]=e=>$(H).ip=e),placeholder:e.$t("Term.index_9")},null,8,["value","placeholder"])])),_:1},8,["label"]),P(n,{path:"port"},{default:T((()=>[P(o,{"show-button":!1,class:"w-80px!",value:$(H).port,"onUpdate:value":t[1]||(t[1]=e=>$(H).port=e),placeholder:e.$t("Docker.Container.create.index_7")},null,8,["value","placeholder"])])),_:1})])),_:1}),P(n,{label:e.$t("Term.index_10"),path:"account"},{default:T((()=>[P(s,{class:"w-280px!",value:$(H).account,"onUpdate:value":t[2]||(t[2]=e=>$(H).account=e),placeholder:e.$t("Term.index_11")},null,8,["value","placeholder"])])),_:1},8,["label"]),P(n,{label:e.$t("Term.index_12")},{default:T((()=>[P(g,{value:$(H).type,"onUpdate:value":t[3]||(t[3]=e=>$(H).type=e)},{default:T((()=>[P(f,{label:e.$t("Database.index_14"),value:1},null,8,["label"]),P(f,{label:e.$t("Term.index_13"),value:2},null,8,["label"])])),_:1},8,["value"])])),_:1},8,["label"]),1===$(H).type?(h(),j(n,{key:0,label:e.$t("Database.index_14"),path:"password"},{default:T((()=>[P(s,{class:"w-280px!",value:$(H).password,"onUpdate:value":t[4]||(t[4]=e=>$(H).password=e),placeholder:e.$t("Term.index_14")},null,8,["value","placeholder"])])),_:1},8,["label"])):(h(),b("div",q,[P(n,{label:e.$t("Term.index_13"),path:"key"},{default:T((()=>[P(s,{class:"w-280px!",type:"textarea",value:$(H).key,"onUpdate:value":t[5]||(t[5]=e=>$(H).key=e),placeholder:e.$t("Term.index_15")},null,8,["value","placeholder"])])),_:1},8,["label"]),P(n,{label:e.$t("Term.index_16")},{default:T((()=>[P(s,{class:"w-280px!",value:$(H).keyPassword,"onUpdate:value":t[6]||(t[6]=e=>$(H).keyPassword=e),placeholder:e.$t("Term.index_17")},null,8,["value","placeholder"])])),_:1},8,["label"])])),P(n,{label:"Remarks"},{default:T((()=>[P(s,{class:"w-280px!",value:$(H).remark,"onUpdate:value":t[7]||(t[7]=e=>$(H).remark=e),placeholder:e.$t("Term.index_18")},null,8,["value","placeholder"])])),_:1}),P(n,{label:" ","show-feedback":!1},{default:T((()=>[P(k,{onClick:K,loading:$(F)},{default:T((()=>[U(C(e.$t("Test connection")),1)])),_:1},8,["loading"])])),_:1})])),_:1},8,["model"])])}}}))}}}));
