import{_ as e}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{c as a,f as t,Y as i,a as s,d as n,h as r}from"./public.js?v=1763625242172";import{bn as o,a9 as d,n as l,fV as m,fW as _,fX as p,x as c,m as f,fY as u}from"./page_layout.js?v=1763625242172";import{aC as b}from"./naive.js?v=1763625242172";import{k as x,P as h,R as w,S as y,X as g,a3 as D,j,a4 as k,V as v}from"./vue.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const C={class:"p-20px"},L=x({__name:"index",props:{data:{}},setup(x){const{t:L}=h(),R=x,{sid:S}=R.data,z=o(),E=async()=>{if(null===S)throw f.error(L("Database.redis.index_8")),new Error(L("Database.redis.index_9"));await u({sid:S}),Y()},{table:P,columns:T}=a([{key:"name",title:L("Database.redis.index_36"),width:180,ellipsis:{tooltip:{width:"trigger"}}},{key:"filepath",title:L("Database.redis.index_10"),ellipsis:{tooltip:{width:"trigger"}}},{key:"mtime",title:L("Site.TableRow.index_25"),width:150,render:e=>d(e.mtime)},{key:"size",title:L("Site.TableRow.index_23"),width:80,render:e=>l(e.size)},{key:"sid",title:L("Database.redis.index_11"),width:120,render:e=>{let a="--";for(let t=0;t<z.remoteList.length;t++)if("".concat(z.remoteList[t].id)===e.sid){a=z.remoteList[t].ps||z.remoteList[t].db_host;break}return a}},t({width:100,options:e=>[{label:L("Database.tools.index_3"),onClick:()=>{i({text:L("Database.redis.index_12"),title:L("Database.redis.index_12"),content:L("Database.redis.index_13",[e.name]),onConfirm:async({hide:a})=>{if(null===S)throw new Error(L("Database.redis.index_9"));await m({file:e.filepath,sid:S}),z.setRefresh(!0),a()}})}},{label:L("Public.Btn.Del"),onClick:()=>{s({title:L("Database.redis.index_14"),content:L("Database.redis.index_15",[e.name]),onConfirm:async({hide:a})=>{await _({file:e.filepath}),Y(),a()}})}}]})]),{loading:V,setLoading:X}=n(),Y=async()=>{try{X(!0);const{message:e}=await p();P.data=c(e)?e:[]}finally{X(!1)}};return Y(),(a,t)=>{const i=b,s=r,n=e;return w(),y("div",C,[g(n,null,{toolsLeft:D((()=>[g(i,{type:"primary",onClick:E},{default:D((()=>[j(k(a.$t("Database.index_16")),1)])),_:1})])),table:D((()=>[g(s,{"max-height":400,loading:v(V),columns:v(T),data:v(P).data},null,8,["loading","columns","data"])])),_:1})])}}});export{L as default};
