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