← Back
Editing: form9.js
import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753755607904";import{a,g as l}from"./index69.js?v=1753755607904";import{cR as r,d as t}from"./page_layout.js?v=1753755607904";import"./public.js?v=1753755607904";import{k as s,P as p,r as o,e as u,w as d,U as n,X as i,Q as c,a2 as _,a1 as m,W as v}from"./vue.js?v=1753755607904";import{bZ as y,cC as x,aq as f,c1 as w,cE as b,cJ as k}from"./naive.js?v=1753755607904";import"./index102.js?v=1753755607904";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753755607904";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753755607904";import"./index.js?v=1753755607904";import"./common.js?v=1753755607904";import"./__commonjsHelpers__.js?v=1753755607904";import"./xterm.js?v=1753755607904";import"./xterm-addon-canvas.js?v=1753755607904";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=f,t=x,s=w,p=y,o=k,u=b,d=e;return i(),n("div",h,[c(d,{ref_key:"formRef",ref:P,model:v(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:v(I).ip,"onUpdate:value":l[0]||(l[0]=e=>v(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:v(I).port,"onUpdate:value":l[1]||(l[1]=e=>v(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:v(I).account,"onUpdate:value":l[2]||(l[2]=e=>v(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:v(I).type,"onUpdate:value":l[3]||(l[3]=e=>v(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===v(I).type?(i(),m(t,{key:0,label:a.$t("Database.index_14"),path:"password"},{default:_((()=>[c(r,{class:"w-280px!",value:v(I).password,"onUpdate:value":l[4]||(l[4]=e=>v(I).password=e),placeholder:a.$t("Term.index_14")},null,8,["value","placeholder"])])),_:1},8,["label"])):(i(),n("div",g,[c(t,{label:a.$t("Term.index_13"),path:"key"},{default:_((()=>[c(r,{class:"w-280px!",type:"textarea",value:v(I).key,"onUpdate:value":l[5]||(l[5]=e=>v(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:v(I).keyPassword,"onUpdate:value":l[6]||(l[6]=e=>v(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:v(I).remark,"onUpdate:value":l[7]||(l[7]=e=>v(I).remark=e),placeholder:a.$t("Term.index_18")},null,8,["value","placeholder"])])),_:1})])),_:1},8,["model"])])}}});export{j as default};
Save File
Cancel