import{_ as e}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import{c as a,f as t,Z as i,a as s,d as n,h as r}from"./public.js?v=1764830988434";import{aL as o,a9 as d,n as l,fO as m,fP as _,x as p,m as c,fQ as f,fR as u}from"./page_layout.js?v=1764830988434";import{aC as b}from"./naive.js?v=1764830988434";import{k as x,P as h,R as w,V as y,W as g,a3 as D,U as j,j as k,a4 as v}from"./vue.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";const L={class:"p-20px"},C=x({__name:"index",props:{data:{}},setup(x){const{t:C}=h(),R=x,{sid:P}=R.data,z=o(),E=async()=>{if(null===P)throw c.error(C("Database.redis.index_8")),new Error(C("Database.redis.index_9"));await f({sid:P}),O()},{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<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: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===P)throw new Error(C("Database.redis.index_9"));await u({file:e.filepath,sid:P}),z.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}),O(),a()}})}}]})]),{loading:B,setLoading:H}=n(),O=async()=>{try{H(!0);const{message:e}=await _();S.data=p(e)?e:[]}finally{H(!1)}};return O(),(a,t)=>{const i=b,s=r,n=e;return y(),w("div",L,[g(n,null,{toolsLeft:D(()=>[g(i,{type:"primary",onClick:E},{default:D(()=>[k(v(a.$t("Database.index_16")),1)]),_:1})]),table:D(()=>[g(s,{"max-height":400,loading:j(B),columns:j(T),data:j(S).data},null,8,["loading","columns","data"])]),_:1})])}}});export{C as default};
