import{q as s,M as e,e as r}from"./utils-lib.js?v=1761009159";import{c as t,o as a,g as l,w as i,q as o,v as m,x as c,z as n,K as u,y as d,A as f,L as x,e as p,B as g,C as v,D as _}from"./base-lib.js?v=1761009159";import{m as y}from"./useMethod4.js?v=1761009159";const b={class:"flex items-center"},w={class:"flex flex-1 items-center"},C={class:"mr-[12px] text-small min-w-[16rem] max-w-30rem"},h={class:"flex items-center"},j={key:0,class:"flex items-center"},k=t({__name:"index",props:{server:{default:()=>({sid:0,ip:""})}},setup(t){const k=t,M=a({status:!1,msg:"检查中...",error:!1}),q=l(()=>M.status?"svgtofont-el-success-filled text-primary":"svgtofont-el-circle-close-filled text-[#EF0808]"),L=async()=>{z(),e.success("刷新成功")},S=()=>{e.msg({dangerouslyUseHTMLString:!0,message:String(M.error)||"暂无异常信息",type:"error",showClose:!0,duration:0})},z=async()=>{if(s(k.server.sid))return e.error("查询失败");M.msg="连接中...";const{db_status:r,msg:t,err_msg:a}=await y(k.server.sid);M.status=r,M.msg=r?"正常":t,M.error=!r&&a};return i(()=>k.server.sid,e=>{!s(e)&&z()},{immediate:!0}),o(()=>{}),(s,e)=>{const t=r;return m(),c("div",b,[n("i",{class:u("text-medium mr-[4px] ".concat(d(q)))},null,2),n("div",w,[n("div",C,[n("span",null,f(s.server.ip)+"状态：",1),n("span",{style:x("color:#".concat(d(M).status?"20a53a":"ef0808"))},f(d(M).msg),5)]),n("div",h,[e[2]||(e[2]=n("i",{class:"svgtofont-icon-refresh text-base mr-[4px] text-primary"},null,-1)),p(t,{onClick:L},{default:g(()=>e[0]||(e[0]=[v("刷新",-1)])),_:1,__:[0]}),d(M).error?(m(),c("div",j,[p(t,{onClick:S,class:"ml-8px"},{default:g(()=>e[1]||(e[1]=[v("| 查看异常信息",-1)])),_:1,__:[1]})])):_("",!0)])])])}}});export{k as _};
