import{c as a,al as t,u as e,f as s}from"./public.js?v=1753954525509";import{b1 as i,n as o,c as n,eY as l,w as d,ee as r}from"./page_layout.js?v=1753954525509";import{e as m}from"./file2.js?v=1753954525509";import{a as p,_ as c}from"./index.vue_vue_type_script_setup_true_lang13.js?v=1753954525509";import{k as _,P as x,r as u,Q as b,U as g,V as D,a2 as f,W as y,a3 as h,X as v,al as w}from"./vue.js?v=1753954525509";import{c6 as k}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const j={class:"px-20px py-24px"},C={class:"font-bold"},L={class:"mt-16px text-error"},$={key:0,class:"mt-4px"},U=_({__name:"index",props:{data:{}},emits:["close"],setup(_,{expose:U,emit:F}){const{t:H}=x(),P=_,{ids:Q}=P.data,R=F,V=i(),W=u(!0),X=u([]),Y=a=>{let t="--";for(let e=0;e<V.remoteList.length;e++){const s=V.remoteList[e];if(s.id===a){t=s.ps||s.db_host;break}}return t},q=u([{key:"name",title:H("Database.index_12"),ellipsis:{tooltip:{width:"trigger"}}},{key:"total",title:H("Component.UploadFile.index_4"),width:120,render:a=>o(a.total)},{key:"position",title:H("Database.index_19")},{key:"addtime",title:H("Docker.Container.config.status.index_11"),width:160,render:a=>a.addtime},{key:"result",title:H("Database.tools.index_24"),align:"right",width:140,render:a=>a.position!==V.remoteList[0].ps?b("div",{class:"text-error"},[H("Database.tools.index_25")]):b("div",{class:W.value?"":"text-error"},[W.value?H("Database.tools.index_26"):H("Database.tools.index_25")])}]),{loading:z,setLoading:A}=a(),B=async a=>await r(V.type,{name:a.name,id:a.id}),E=()=>{e({title:H("Database.index_30"),hideClose:!0,data:{title:H("Database.index_30"),api:B,data:X.value,callback:G},component:p})},G=a=>{R("close"),V.setRefresh(!0),e({title:H("Database.tools.index_30"),width:440,footer:!0,component:c,data:{title:H("Database.index_30"),data:a,status:"done",columns:[{key:"name",title:H("Database.index_12"),ellipsis:{tooltip:{width:"trigger"}}}]}})};return(async()=>{await(async()=>{const{message:a}=await m();n(a)&&(W.value=a.status_db)})(),(async()=>{try{A(!0);const{message:a}=await l({ids:Q});n(a)?X.value=d(a.data)?a.data.map((a=>({...a,position:Y(a.sid)}))):[]:X.value=[]}finally{A(!1)}})()})(),U({onConfirm:()=>{const a=H("Database.tools.index_27"),e=H("Database.tools.index_28");t({text:H("Database.index_30"),title:H("Database.tools.index_29"),content:W.value?a:e,onConfirm:async({hide:a})=>{E(),a()}})}}),(a,t)=>{const e=k,i=s;return g(),D("div",j,[b(e,{type:"warning"},{default:f((()=>[y("span",C,h(a.$t("Database.tools.index_20"))+": ",1),y("span",null,h(a.$t("Database.tools.index_21")),1)])),_:1}),b(i,{class:"mt-16px",loading:v(z),"loading-num":v(Q).length,"max-height":300,data:v(X),columns:v(q)},null,8,["loading","loading-num","data","columns"]),y("div",L,[y("p",null,h(a.$t("Database.tools.index_21")),1),v(W)?w("",!0):(g(),D("p",$,h(a.$t("Database.tools.index_22")),1))])])}}});export{U as default};
