import{p as s,P as e,jh as t,M as a,fn as i,ji as o,n as r,Q as n,_ as l}from"./utils-lib.js?v=1761009159";import{_ as c}from"./index.vue_vue_type_style_index_0_lang.js?v=1761009159";import{c as d,r as p,q as u,a6 as m,v as _,x as v,z as f,C as h,y,e as b,D as j,b1 as k}from"./base-lib.js?v=1761009159";import{u as S}from"./useStore9.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./add-host.vue_vue_type_script_setup_true_lang.js?v=1761009159";import"./form-item.js?v=1761009159";import"./index106.js?v=1761009159";import"./useController2.js?v=1761009159";const{setNodeSSHisSet:x,setNodeInfo:g,isRefreshNodeList:w,sshTerminalVisible:C}=S(),H=async i=>{await s({icon:"warning-filled",title:"提示",content:"即将删除节点SSH，是否继续操作？"}),await e({loading:"正在删除节点，请稍后...",request:t({node_id:i}),message:!0,success:s=>{s.status?(a.success("删除成功"),g.value.ssh_conf={},w.value=!0,x.value=!1,C.value=!1):a.error(s.msg||"删除失败")}})},N={height:"500px"},D={class:"flex justify-between items-center"},I={class:"pr-[1rem]"},T={key:0},E={key:0},V={key:1},q={class:"h-[44rem] overflow-hidden bg-white dark:bg-[#1D1E1F] mt-[10px]"},L={key:0,class:"terminal-view"},P={key:1,style:{height:"44rem"}},R=l(d({__name:"index",setup(s){const{setNodeInfo:e,setNodeSSHisSet:t,sshTerminalVisible:l}=S(),d=p();function x(){l.value=!l.value}const g=async s=>{if(!s)return;const{id:e,ssh_conf:t={},server_ip:l}=s;if(i(t.host)){const s=a.load("正在获取SSH端口信息..."),{data:i}=await o({node_id:e});i.status||a.error(i.msg||"获取SSH端口信息失败"),t.port=i.data.port,null==s||s.close()}r({title:"编辑root账号信息",area:50,compData:{node_id:e,server_ip:l,ssh_conf:t||{}},btn:["保存"],component:()=>n(()=>import("./ssh-edit.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})};return u(()=>{const s=e.value||{};(s.ssh_conf||{}).host?t.value=!0:g(s)}),m(()=>{t.value=!1,l.value=!1}),(s,a)=>{var i;const o=k,r=c;return _(),v("div",N,[f("div",D,[f("span",I,[a[3]||(a[3]=h(" root 密码： ",-1)),y(t)?(_(),v("span",T,"已设置")):(_(),v("span",{key:1,class:"cursor-pointer underline",onClick:a[0]||(a[0]=s=>g(y(e)))},"未设置"))]),f("div",null,[y(t)?(_(),v("span",E,[f("span",{class:"cursor-pointer bt-link",onClick:x},"终端"),b(o,{direction:"vertical"})])):j("",!0),f("span",{onClick:a[1]||(a[1]=s=>g(y(e))),class:"cursor-pointer bt-link"},"编辑"),y(t)?(_(),v("span",V,[b(o,{direction:"vertical"}),f("span",{class:"cursor-pointer bt-link",onClick:a[2]||(a[2]=s=>{var t;return y(H)(null==(t=y(e))?void 0:t.id)})},"删除")])):j("",!0)])]),a[4]||(a[4]=f("div",{class:"my-[16px] text-tertiary"},"* 保存root密码用于终端或者节点功能调用",-1)),f("div",q,[y(l)?(_(),v("div",L,[b(r,{ref:y(d),active:!0,id:"nodeTerminal","host-info":(null==(i=y(e))?void 0:i.ssh_conf)||{},class:"h-[43rem] p-[8px]"},null,8,["host-info"])])):(_(),v("div",P))])])}}}),[["__scopeId","data-v-eb9fe7dd"]]);export{R as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
