import{_ as V}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{C as A,dI as U,i as x,gy as j,n as E,p as f,fa as F}from"./index-BTglIPU2.js?v=1773287522785";import{u as M}from"./index-B5d4M70B.js?v=1773287522785";import{u as O}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{c as P}from"./file-B5PwfK2h.js?v=1773287522785";import{a as T,_ as Z}from"./index.vue_vue_type_script_setup_true_lang-zxYX_mVh.js?v=1773287522785";import{k as q,R as z,r as p,a0 as d,$ as b,Z as D,a9 as G,_ as c,aa as m,S as l,ak as H}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ad as J}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const K={class:"px-20px py-24px"},Q={class:"font-bold"},W={class:"mt-16px text-error"},X={key:0,class:"mt-4px"},ct=q({__name:"index",props:{data:{}},emits:["close"],setup(g,{expose:y,emit:h}){const{t:e}=z(),k=g,{ids:_}=k.data,v=h,o=M(),n=p(!0),r=p([]),w=t=>{let a="--";for(let s=0;s<o.remoteList.length;s++){const i=o.remoteList[s];if(i.id===t){a=i.ps||i.db_host;break}}return a},C=p([{key:"name",title:e("Database.index_12"),ellipsis:{tooltip:{width:"trigger"}}},{key:"total",title:e("Component.UploadFile.index_4"),width:120,render:t=>A(t.total)},{key:"position",title:e("Database.index_19")},{key:"addtime",title:e("Docker.Container.config.status.index_11"),width:160,render:t=>t.addtime},{key:"result",title:e("Database.tools.index_24"),align:"right",width:140,render:t=>t.position!==o.remoteList[0].ps?d("div",{class:"text-error"},[e("Database.tools.index_25")]):d("div",{class:n.value?"":"text-error"},[n.value?e("Database.tools.index_26"):e("Database.tools.index_25")])}]),$=async()=>{const{message:t}=await P();x(t)&&(n.value=t.status_db)},{loading:L,setLoading:u}=O(),B=async()=>{try{u(!0);const{message:t}=await j({ids:_});x(t)?r.value=E(t.data)?t.data.map(a=>({...a,position:w(a.sid)})):[]:r.value=[]}finally{u(!1)}},R=()=>{const t=e("Database.tools.index_27"),a=e("Database.tools.index_28");U({text:e("Database.index_30"),title:e("Database.tools.index_29"),content:n.value?t:a,onConfirm:async({hide:s})=>{I(),s()}})},S=async t=>await F(o.type,{name:t.name,id:t.id}),I=()=>{f({title:e("Database.index_30"),hideClose:!0,data:{title:e("Database.index_30"),api:S,data:r.value,callback:N},component:T})},N=t=>{v("close"),o.setRefresh(!0),f({title:e("Database.tools.index_30"),width:440,footer:!0,component:Z,data:{title:e("Database.index_30"),data:t,status:"done",columns:[{key:"name",title:e("Database.index_12"),ellipsis:{tooltip:{width:"trigger"}}}]}})};return(async()=>(await $(),B()))(),y({onConfirm:R}),(t,a)=>{const s=J,i=V;return b(),D("div",K,[d(s,{type:"warning"},{default:G(()=>[c("span",Q,m(t.$t("Database.tools.index_20"))+": ",1),c("span",null,m(t.$t("Database.tools.index_21")),1)]),_:1}),d(i,{class:"mt-16px",loading:l(L),"loading-num":l(_).length,"max-height":300,data:l(r),columns:l(C)},null,8,["loading","loading-num","data","columns"]),c("div",W,[c("p",null,m(t.$t("Database.tools.index_21")),1),l(n)?H("",!0):(b(),D("p",X,m(t.$t("Database.tools.index_22")),1))])])}}});export{ct as default};
