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