import{_ as h}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as D}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{w as k,C as w,dI as y,h as B,gA as C,gB as L,n as R,m as T,gC as S,gD as $}from"./index-BTglIPU2.js?v=1773287522785";import{u as A}from"./index-B5d4M70B.js?v=1773287522785";import{u as E}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as z}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as I}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{B as N}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as V,R as j,$ as v,Z as P,a0 as r,a9 as d,S as l,j as U,aa as Z}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const q={class:"p-20px"},ne=V({__name:"index",props:{data:{}},setup(p){const{t:e}=j(),_=p,{sid:o}=_.data,s=A(),u=async()=>{if(o===null)throw T.error(e("Database.redis.index_8")),new Error(e("Database.redis.index_9"));await S({sid:o}),n()},{table:m,columns:f}=z([{key:"name",title:e("Database.redis.index_36"),width:180,ellipsis:{tooltip:{width:"trigger"}}},{key:"filepath",title:e("Database.redis.index_10"),ellipsis:{tooltip:{width:"trigger"}}},{key:"mtime",title:e("Site.TableRow.index_25"),width:150,render:t=>k(t.mtime)},{key:"size",title:e("Site.TableRow.index_23"),width:80,render:t=>w(t.size)},{key:"sid",title:e("Database.redis.index_11"),width:120,render:t=>{let a="--";for(let i=0;i<s.remoteList.length;i++)if("".concat(s.remoteList[i].id)===t.sid){a=s.remoteList[i].ps||s.remoteList[i].db_host;break}return a}},I({width:100,options:t=>[{label:e("Database.tools.index_3"),onClick:()=>{y({text:e("Database.redis.index_12"),title:e("Database.redis.index_12"),content:e("Database.redis.index_13",[t.name]),onConfirm:async({hide:a})=>{if(o===null)throw new Error(e("Database.redis.index_9"));await $({file:t.filepath,sid:o}),s.setRefresh(!0),a()}})}},{label:e("Public.Btn.Del"),onClick:()=>{B({title:e("Database.redis.index_14"),content:e("Database.redis.index_15",[t.name]),onConfirm:async({hide:a})=>{await C({file:t.filepath}),n(),a()}})}}]})]),{loading:b,setLoading:c}=E(),n=async()=>{try{c(!0);const{message:t}=await L();m.data=R(t)?t:[]}finally{c(!1)}};return n(),(t,a)=>{const i=N,x=D,g=h;return v(),P("div",q,[r(g,null,{toolsLeft:d(()=>[r(i,{type:"primary",onClick:u},{default:d(()=>[U(Z(t.$t("Database.index_16")),1)]),_:1})]),table:d(()=>[r(x,{"max-height":400,loading:l(b),columns:l(f),data:l(m).data},null,8,["loading","columns","data"])]),_:1})])}}});export{ne as default};
