import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{a,g as l}from"./index69.js?v=1753954525509";import{cR as r,c as t}from"./page_layout.js?v=1753954525509";import"./public.js?v=1753954525509";import{k as s,P as p,r as o,e as u,w as d,U as n,V as i,Q as c,a2 as _,X as m,a1 as v}from"./vue.js?v=1753954525509";import{aq as y,cA as x,c1 as f,bY as w,cJ as b,cE as k}from"./naive.js?v=1753954525509";import"./index102.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./xterm.js?v=1753954525509";import"./xterm-addon-canvas.js?v=1753954525509";const h={class:"p-20px"},g={key:1},j=s({__name:"form",props:{data:{}},setup(s,{expose:j}){const $=r(),{t:T}=p(),U=s,{isEdit:C,row:q}=U.data,P=o(null),I=u({ip:"",port:22,account:"root",type:1,password:"",key:"",keyPassword:"",remark:""});d((()=>I.ip),(e=>{C||(I.remark=e)}));const S={ip:{required:!0,message:T("Security.Conf.Index_28"),trigger:["blur","input"]},port:{required:!0,type:"number",message:T("Security.Conf.Index_28"),trigger:["blur","input"]},account:{required:!0,message:T("Security.Conf.Index_28"),trigger:["blur","input"]},password:{required:!0,message:T("Security.Conf.Index_28"),trigger:["blur","input"]},key:{required:!0,message:T("Security.Conf.Index_28"),trigger:["blur","input"]}};return(async()=>{if(C&&q){const{message:e}=await l({host:q.host});t(e)&&(I.ip=e.host,I.port=e.port,I.account=e.username,I.type=e.password?1:2,I.password=e.password,I.key=e.pkey,I.keyPassword=e.pkey_passwd,I.remark=e.ps)}})(),j({onConfirm:async({hide:e})=>{var l;await(null==(l=P.value)?void 0:l.validate()),await a({host:I.ip,port:I.port,username:I.account,password:1===I.type?I.password:"",pkey:2===I.type?I.key:"",pkey_passwd:2===I.type?I.keyPassword:"",ps:I.remark}),$.setRefresh(!0),e()}}),(a,l)=>{const r=y,t=x,s=f,p=w,o=b,u=k,d=e;return n(),i("div",h,[c(d,{ref_key:"formRef",ref:P,model:m(I),rules:S},{default:_((()=>[c(p,null,{default:_((()=>[c(t,{label:a.$t("Term.index_8"),path:"ip"},{default:_((()=>[c(r,{class:"w-190px!",value:m(I).ip,"onUpdate:value":l[0]||(l[0]=e=>m(I).ip=e),placeholder:a.$t("Term.index_9")},null,8,["value","placeholder"])])),_:1},8,["label"]),c(t,{path:"port"},{default:_((()=>[c(s,{"show-button":!1,class:"w-80px!",value:m(I).port,"onUpdate:value":l[1]||(l[1]=e=>m(I).port=e),placeholder:a.$t("Docker.Container.create.index_7")},null,8,["value","placeholder"])])),_:1})])),_:1}),c(t,{label:a.$t("Term.index_10"),path:"account"},{default:_((()=>[c(r,{class:"w-280px!",value:m(I).account,"onUpdate:value":l[2]||(l[2]=e=>m(I).account=e),placeholder:a.$t("Term.index_11")},null,8,["value","placeholder"])])),_:1},8,["label"]),c(t,{label:a.$t("Term.index_12")},{default:_((()=>[c(u,{value:m(I).type,"onUpdate:value":l[3]||(l[3]=e=>m(I).type=e)},{default:_((()=>[c(o,{label:a.$t("Database.index_14"),value:1},null,8,["label"]),c(o,{label:a.$t("Term.index_13"),value:2},null,8,["label"])])),_:1},8,["value"])])),_:1},8,["label"]),1===m(I).type?(n(),v(t,{key:0,label:a.$t("Database.index_14"),path:"password"},{default:_((()=>[c(r,{class:"w-280px!",value:m(I).password,"onUpdate:value":l[4]||(l[4]=e=>m(I).password=e),placeholder:a.$t("Term.index_14")},null,8,["value","placeholder"])])),_:1},8,["label"])):(n(),i("div",g,[c(t,{label:a.$t("Term.index_13"),path:"key"},{default:_((()=>[c(r,{class:"w-280px!",type:"textarea",value:m(I).key,"onUpdate:value":l[5]||(l[5]=e=>m(I).key=e),placeholder:a.$t("Term.index_15")},null,8,["value","placeholder"])])),_:1},8,["label"]),c(t,{label:a.$t("Term.index_16")},{default:_((()=>[c(r,{class:"w-280px!",value:m(I).keyPassword,"onUpdate:value":l[6]||(l[6]=e=>m(I).keyPassword=e),placeholder:a.$t("Term.index_17")},null,8,["value","placeholder"])])),_:1},8,["label"])])),c(t,{label:"Remarks"},{default:_((()=>[c(r,{class:"w-280px!",value:m(I).remark,"onUpdate:value":l[7]||(l[7]=e=>m(I).remark=e),placeholder:a.$t("Term.index_18")},null,8,["value","placeholder"])])),_:1})])),_:1},8,["model"])])}}});export{j as default};
