import{b as a,h as t,d as e,c as s,f as o,_ as i}from"./public.js?v=1753954525509";import{_ as n}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{_ as l}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import{_ as p}from"./index.vue_vue_type_script_setup_true_lang6.js?v=1753954525509";import{b1 as r,X as d,n as c,eT as m,eW as _,c as u,x as g}from"./page_layout.js?v=1753954525509";import{c as f}from"./file2.js?v=1753954525509";import{o as y}from"./file3.js?v=1753954525509";import{ay as b}from"./naive.js?v=1753954525509";import{k as h,P as x,e as w,U as j,V as k,Q as v,a2 as z,j as D,a3 as q,X as C,W as U}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";const P={class:"p-20px"},R=h({__name:"index",props:{data:{}},setup(h){const{t:R}=x(),$=h,{row:S,type:W}=$.data,L=r(),Q=w({p:1,limit:10,keyword:""}),X=async()=>{Q.p=1,await T()},B=()=>{const a=(()=>{if(!L.backupPath)throw new Error(R("Database.tools.index_35"));const a="".concat(L.backupPath,"/database");switch(W){case"pgsql":return"".concat(a,"/pgsql");case"mongodb":return"".concat(a,"/mongodb");default:return a}})(),t="pgsql"==L.type?".sql":".sql,.gz,.tar.gz,.zip";y(a,t,(()=>{T()}))},{table:E,columns:F}=a([{key:"name",title:R("Component.UploadFile.index_3"),ellipsis:{tooltip:{width:"trigger"}}},{key:"addtime",title:R("Database.tools.index_77"),width:150,render:a=>d(a.ctime)},{key:"size",title:R("Database.tools.index_14"),width:100,render:a=>c(a.size)},t({width:120,options:a=>[{label:R("Waf.Setting.index_13"),onClick:()=>{e({title:R("Database.tools.index_17"),content:R("Database.tools.index_36"),onConfirm:async({hide:t})=>{await(async a=>{await m(L.type,{file:a.path,name:S.name})})(a),t()}})}},{label:R("Public.Btn.Del"),onClick:()=>{e({title:"".concat(R("Database.tools.index_37")," [").concat(a.name,"]"),content:R("Database.tools.index_38",[a.name]),onConfirm:async({hide:t})=>{await(async a=>{await f({path:a.path}),T(),L.setRefresh(!0)})(a),t()}})}}]})]),{loading:H,setLoading:J}=s(),T=async()=>{try{J(!0);const{message:a}=await _({p:Q.p,limit:Q.limit,search:Q.keyword,type_sql:W});u(a)&&(E.data=a.data,E.total=g(a.page))}finally{J(!1)}};return T(),(a,t)=>{const e=b,s=p,r=o,d=l,c=n,m=i;return j(),k("div",P,[v(c,null,{toolsLeft:z((()=>[v(e,{onClick:B},{default:z((()=>[D(q(a.$t("Database.tools.index_31")),1)])),_:1})])),toolsRight:z((()=>[v(s,{value:C(Q).keyword,"onUpdate:value":t[0]||(t[0]=a=>C(Q).keyword=a),onSearch:X},null,8,["value"])])),table:z((()=>[v(r,{"max-height":348,loading:C(H),data:C(E).data,columns:C(F)},null,8,["loading","data","columns"])])),pageRight:z((()=>[v(d,{page:C(Q).p,"onUpdate:page":t[1]||(t[1]=a=>C(Q).p=a),"page-size":C(Q).limit,"onUpdate:pageSize":t[2]||(t[2]=a=>C(Q).limit=a),"item-count":C(E).total,onRefresh:T,showQuickJumper:!1},null,8,["page","page-size","item-count"])])),_:1}),v(m,{class:"mt-16px"},{default:z((()=>[U("li",null,q(a.$t("Database.tools.index_32"))+" sql, zip, (tar.gz|gz|tgz)",1),U("li",null,q(a.$t("Database.tools.index_33")),1),U("li",null,q(a.$t("Database.tools.index_34")),1)])),_:1})])}}});export{R as default};
