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