import{aX as s,l as t}from"./utils-lib.js?v=20260328163632";import{r as e,f as a,c as i,B as o,s as r}from"./index190.js?v=20260328163632";import{k as p,o as n,V as l,_ as m,Y as _}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index92.js?v=20260328163632";import"./index50.js?v=20260328163632";import"./index97.js?v=20260328163632";import"./wsl.js?v=20260328163632";const h=p({__name:"edit-ssh",setup:(p,{expose:h})=>(n((()=>{const{sftp:t}=e.value,o=s(t)?JSON.parse(t):t||{};Object.assign(a.value,{ssh_port:o.port,ssh_username:o.username,ssh_password:o.password,ssh_pkey:o.pkey,ssh_pkey_passwd:o.pkey_passwd}),a.value.type=o.pkey?"private":"password",i.value=a.value.type})),h({onConfirm:async()=>{try{const{host:s,port:i,title:o,id:p,tls:n}=e.value;let l={host:s,port:i,title:o,id:p,tls:n,ssh_info:{}};Object.entries(a.value).forEach((([s,t])=>{s.includes("ssh_")&&(l.ssh_info[s.replace("ssh_","")]=s.includes("port")?Number(t):t)})),l.ssh_info.host=s,l.tls=JSON.stringify(l.tls),l.ssh_info=JSON.stringify(l.ssh_info);return(await r(l,t("正在配置SSH信息，请稍后..."))).status}catch(s){}}}),(s,t)=>(l(),m(_(o),{class:"p-20px"})))});export{h as default};
