import{_ as e}from"./index105.js?v=1761009159";import{aA as a,x as t,V as s,p as o,P as n,b2 as i,an as r,ao as l,ap as c}from"./utils-lib.js?v=1761009159";import{s as m,c as p,v as d,x as u,e as f,B as b,y as _}from"./base-lib.js?v=1761009159";import{B as h,C as k,D as y,d as B}from"./useMethod5.js?v=1761009159";import{a as g,u as C,c as j}from"./column.js?v=1761009159";import{u as v}from"./useController5.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./validator.js?v=1761009159";import"./index106.js?v=1761009159";import"./site.js?v=1761009159";import"./useStore4.js?v=1761009159";import"./useController6.js?v=1761009159";const{localRow:w,isRefreshBackupList:x}=m(v()),R=async(e,a,t,s)=>{const{label:o,value:n}=s,i=new Map([["delete","批量删除已选的备份文件，是否继续操作？"]]),r=async(e,a)=>{const{id:t}=e;if("delete"===n)return await k({bak_id:t})};await e({title:"批量".concat(o,"备份文件"),content:"".concat(i.get(n),"，是否继续操作！"),column:[{label:"备份文件",prop:"filename"},j()],onConfirm:async()=>(await a(r),x.value=!0,!1)})},q={class:"p-[2rem]"},L=p({__name:"index",setup(p){const{isRefreshBackupList:j}=m(v()),{BtOperation:L}=i({options:[{type:"button",label:"备份",active:!0,onClick:()=>{n({loading:"正在备份，请稍后...",request:B({s_id:w.value.id,bak_type:3}),success:e=>{e.status&&(x.value=!0)},message:!0})}}]}),M=c([{label:"删除",value:"delete",event:R}]),{BtTable:W,BtPage:z,BtRecommendSearch:D,BtRefresh:P,BtColumn:S,BtBatch:T,BtTableCategory:A,BtErrorMask:E,tableRef:H,classList:I,refresh:N}=r({request:e=>(async e=>{try{const{data:{data:t,page:s}}=await h({s_id:w.value.id,p:e.p,limit:e.limit});return{data:t,total:a(s)}}catch(t){return{data:[],total:0}}})(e),columns:[g(),{label:"文件名",prop:"filename",isCustom:!0,minWidth:180},{label:"文件大小",prop:"size",render:e=>t(Number(e.size),!0)},{label:"备份时间",prop:"addtime",minWidth:120,render:e=>s(e.bak_time)},{label:"信息",prop:"bak_type",minWidth:80,render:e=>1==e.bak_type?"仅文件":2==e.bak_type?"仅DB":"完整的备份"},C([{title:"恢复",onClick:async e=>{await o({title:"恢复备份文件",content:"将恢复站点文件和数据库，继续吗？",onConfirm:async()=>{n({loading:"正在恢复备份文件，请稍后...",request:y({bak_id:e.id}),success:e=>{},message:!0})}})}},{title:"下载",onClick:e=>{const a="".concat(window.location.origin);window.open("".concat(a,"/download?filename=").concat(encodeURIComponent(e.bak_file)).concat(e.filename?"&amp;name=".concat(e.filename):""),"_blank","noopener,noreferrer")}},{title:"删除",onClick:e=>{o({title:"删除备份文件",content:"网站备份即将被删除 【".concat(e.filename,"】，是否继续操作?"),onConfirm:async()=>{n({loading:"正在删除备份文件，请稍后...",request:k({bak_id:e.id}),success:e=>{e.status&&(x.value=!0)},message:!0})}})}}])],extension:[M,l(j)]});return(a,t)=>{const s=e;return d(),u("div",q,[f(s,null,{"header-left":b(()=>[f(_(L))]),"header-right":b(()=>t[0]||(t[0]=[])),content:b(()=>[f(_(W),{"min-height":500})]),"footer-left":b(()=>[f(_(T))]),"footer-right":b(()=>[f(_(z))]),_:1})])}}});export{L as default};
