const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index-B6Y_2X_r.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","js/files-BUbkyTRl.js?v=1773287522785","css/index-FEE1lr_F.css?v=1773287522785"])))=>i.map(i=>d[i]);
import{w as T,h as A,as as f,n as R,l as U,x as V,p as q,P as D,m as E}from"./index-BTglIPU2.js?v=1773287522785";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as L}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{au as O,b as j,B as I}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as $,R as z,i as X,r as u,$ as Z,Z as G,a0 as n,a9 as c,_ as i,S as t,j as H,aa as k,X as g,F as J,a3 as K}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const Q={class:"p-20px"},W={class:"flex items-center gap-16px mb-16px"},Y={class:"p-20px"},ee={class:"mb-16px text-14px"},te={class:"flex items-center gap-20px"},ae={class:"text-13px"},ke=$({__name:"Backup",setup(oe,{expose:x}){const{t:e}=z(),w=X("fileStore"),{backupForm:s}=w,p=u(!1),_=u(!1),r=u([]);x({open(){s.value.path="",p.value=!0,d()},close(){p.value=!1,r.value=[]}});const m=u(!1),M=u([{key:"time",title:e("file.backupModal.backupTime"),width:160,render:a=>T(a.time)},{key:"path",title:e("file.backupModal.backupPath"),ellipsis:{tooltip:!0}},{key:"name",title:e("file.backupModal.backupName"),width:120,ellipsis:{tooltip:!0},render:a=>a.name||"--"},L({width:100,options:a=>[{label:e("Public.Btn.Delete"),onClick:()=>{A({title:e("file.backupModal.deleteBackup"),content:e("file.backupModal.deleteConfirm"),onConfirm:async()=>{await f.post("/files?action=del_path_premissions",{id:a.id},{requestOptions:{loading:e("file.backupModal.deletingBackup"),successMessage:!0}}),d()}})}}]})]);function B(){q({title:e("Component.SelectPath.index_7"),width:750,height:640,footer:!1,data:{path:s.value.path,callback:a=>{s.value.path=a}},component:K(()=>D(()=>import("./index-B6Y_2X_r.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))})}function y(){s.value.path?m.value=!0:E.warning(e("file.backupModal.pleaseSelectPath"))}async function d(){try{_.value=!0;const{message:a}=await f.post("/files?action=get_all_back");R(a)?r.value=a.map(o=>({id:Number(o[0]),time:Number(o[2]),name:o[1],path:o[3]})):r.value=[]}finally{_.value=!1}}async function C(){try{await f.post("/files?action=back_path_permissions",s.value,{requestOptions:{loading:e("file.backupModal.executingBackup"),successMessage:!0}}),d(),s.value.path="",s.value.remark=""}catch(a){console.warn(a)}}return(a,o)=>{const h=j,N=U,b=I,P=O,S=F,v=V;return Z(),G(J,null,[n(v,{show:t(p),"onUpdate:show":o[1]||(o[1]=l=>g(p)?p.value=l:null),title:t(e)("file.backupModal.title"),width:"700"},{default:c(()=>[i("div",Q,[i("div",W,[n(P,null,{default:c(()=>[n(h,{value:t(s).path,"onUpdate:value":o[0]||(o[0]=l=>t(s).path=l)},null,8,["value"]),n(b,{onClick:B},{icon:c(()=>[n(N,{name:"file-dir",size:"20"})]),_:1})]),_:1}),n(b,{type:"primary",onClick:y},{default:c(()=>[H(k(t(e)("file.backupModal.backupButton")),1)]),_:1})]),n(S,{loading:t(_),"max-height":370,data:t(r),columns:t(M)},null,8,["loading","data","columns"])])]),_:1},8,["show","title"]),n(v,{show:t(m),"onUpdate:show":o[3]||(o[3]=l=>g(m)?m.value=l:null),title:t(e)("file.backupModal.confirmTitle"),width:320,footer:!0,onConfirm:C},{default:c(()=>[i("div",Y,[i("div",ee,k(t(e)("file.backupModal.enterBackupName")),1),i("div",te,[i("div",ae,k(t(e)("file.backupModal.remarks")),1),n(h,{class:"flex-1",value:t(s).remark,"onUpdate:value":o[2]||(o[2]=l=>t(s).remark=l)},null,8,["value"])])])]),_:1},8,["show","title"])],64)}}});export{ke as default};
