← Back
Editing: index341.js
import{p as s,K as e,iN as t,M as a,f1 as i,iO as o,n as r,L as n,e as l}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as c}from"./index.vue_vue_type_style_index_0_lang.js?v=VERSION_NUMBER";import{c as d,r as p,p as u,a4 as m,q as _,v,y as f,B as h,x as y,e as b,C as k,a$ as S}from"./base-lib.js?v=VERSION_NUMBER";import{u as j}from"./useStore9.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./add-host.vue_vue_type_script_setup_true_lang.js?v=VERSION_NUMBER";import"./form-item.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./useController2.js?v=VERSION_NUMBER";const{setNodeSSHisSet:x,setNodeInfo:g,isRefreshNodeList:w,sshTerminalVisible:C}=j(),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"},I={class:"flex justify-between items-center"},T={class:"pr-[1rem]"},L={key:0},V={key:0},q={key:1},D={class:"h-[44rem] overflow-hidden bg-white mt-[10px]"},E={key:0,class:"terminal-view"},O={key:1,style:{height:"44rem"}},R=l(d({__name:"index",setup(s){const{setNodeInfo:e,setNodeSSHisSet:t,sshTerminalVisible:l}=j(),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=VERSION_NUMBER")),__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=S,r=c;return _(),v("div",N,[f("div",I,[f("span",T,[a[3]||(a[3]=h(" root 密码: ")),y(t)?(_(),v("span",L,"已设置")):(_(),v("span",{key:1,class:"cursor-pointer underline",onClick:a[0]||(a[0]=s=>g(y(e)))},"未设置"))]),f("div",null,[y(t)?(_(),v("span",V,[f("span",{class:"cursor-pointer bt-link",onClick:x},"终端"),b(o,{direction:"vertical"})])):k("",!0),f("span",{onClick:a[1]||(a[1]=s=>g(y(e))),class:"cursor-pointer bt-link"},"编辑"),y(t)?(_(),v("span",q,[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)})},"删除")])):k("",!0)])]),a[4]||(a[4]=f("div",{class:"my-[16px] text-[#888]"}," * 保存root密码用于终端或者节点功能调用 ",-1)),f("div",D,[y(l)?(_(),v("div",E,[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",O))])])}}}),[["__scopeId","data-v-98dbe68b"]]);export{R as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel