import{I as e,j as a}from"./database.js?v=20260328163632";import{l as s,am as t,Y as i,a4 as o,$ as n,z as r,x as l,bn as m,a2 as c}from"./utils-lib.js?v=20260328163632";import{u as d}from"./store.js?v=20260328163632";import{B as f}from"./naive-ui.js?v=20260328163632";import{k as p,r as u,o as _,V as h,_ as j,a3 as g,Y as y,O as b,j as w,Z as k}from"./base-lib.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const v=p({__name:"index",setup(p){const{rowData:v,isRefreshList:x}=d(),C=u(!1),q=u({columns:[{title:s("文件名称"),key:"file"},{title:s("文件大小"),key:"size",render:e=>t(e.size)},{title:s("备份时间"),key:"time",width:150,render:e=>i(e.time)},o([{title:s("下载"),onClick:async({path:e,file:a})=>{window.open("".concat(window.location.origin,"/files/download_file?filename=").concat(encodeURIComponent(e)),"_self")}},{title:s("删除"),onClick:async({path:e,file:a})=>{await r({title:s("删除备份【{0}】",[a]),content:s("是否删除【{0}】备份?",[a])}),l({loading:s("正在备份数据库,请稍后..."),request:m({filename:e}),message:!0,success:Y})}}])],data:[]}),[z,I]=n(q),R=()=>{l({loading:s("正在备份，请稍后..."),request:a({path:v.value.db_path}),message:!0,success:()=>{x.value=!0,Y()}})},Y=async()=>{l({loading:C,request:e({name:v.value.db_name}),data:Array,success:e=>{q.value.data=e||[]}})};return _(Y),(e,a)=>{const t=f;return h(),j(y(c),{class:"p-20px"},{"header-left":g((()=>[b(t,{type:"primary",onClick:R},{default:g((()=>[w(k(y(s)("备份")),1)])),_:1})])),"header-right":g((()=>a[0]||(a[0]=[]))),content:g((()=>[b(y(z),{"max-height":400})])),"footer-left":g((()=>a[1]||(a[1]=[]))),"footer-right":g((()=>a[2]||(a[2]=[]))),_:1})}}});export{v as default};
