import{_ as a}from"./index.js?v=1764233927359";import{f as e,a as t,h as l}from"./public.js?v=1764233927359";import{a9 as s,bf as i,x as o,_ as n,m as u}from"./page_layout.js?v=1764233927359";import{R as p}from"./ResourceManagerWindow.js?v=1764233927359";import{av as r,au as c,aC as m}from"./naive.js?v=1764233927359";import{k as d,P as f,i as k,r as v,av as h,R as b,V as _,W as x,a3 as g,S as M,U as w,j,a4 as y,ak as C,F as B}from"./vue.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./index39.js?v=1764233927359";import"./soft2.js?v=1764233927359";import"./soft.js?v=1764233927359";import"./site.js?v=1764233927359";import"./file2.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1764233927359";const P={class:"p-20px"},R={class:"flex items-center gap-16px mb-16px"},U={class:"p-20px"},N={class:"mb-16px text-14px"},S={class:"flex items-center gap-20px"},q={class:"text-13px"},D=d({__name:"Backup",setup(d,{expose:D}){const{t:F}=f(),O=k("fileStore"),{currentPath:T,backupForm:W}=O,z=v(!1),H=v(!1),V=v([]);D({open(){W.value.path="",z.value=!0,L()},close(){z.value=!1,V.value=[]}});const A=v(!1),E=h("resourceManagerRef"),G=v([{key:"time",title:F("file.backupModal.backupTime"),width:160,render:a=>s(a.time)},{key:"path",title:F("file.backupModal.backupPath"),ellipsis:{tooltip:!0}},{key:"name",title:F("file.backupModal.backupName"),width:120,ellipsis:{tooltip:!0},render:a=>a.name||"--"},e({width:100,options:a=>[{label:F("Public.Btn.Delete"),onClick:()=>{t({title:F("file.backupModal.deleteBackup"),content:F("file.backupModal.deleteConfirm"),onConfirm:async()=>{await i.post("/files?action=del_path_premissions",{id:a.id},{requestOptions:{loading:F("file.backupModal.deletingBackup"),successMessage:!0}}),L()}})}}]})]);function I(){var a;null==(a=E.value)||a.open()}function J(a){W.value.path=a}function K(){W.value.path?A.value=!0:u.warning(F("file.backupModal.pleaseSelectPath"))}async function L(){try{H.value=!0;const{message:a}=await i.post("/files?action=get_all_back");o(a)?V.value=a.map(a=>({id:Number(a[0]),time:Number(a[2]),name:a[1],path:a[3]})):V.value=[]}finally{H.value=!1}}async function Q(){try{await i.post("/files?action=back_path_permissions",W.value,{requestOptions:{loading:F("file.backupModal.executingBackup"),successMessage:!0}}),L(),W.value.path="",W.value.remark=""}catch(a){console.warn(a)}}return(e,t)=>{const s=c,i=n,o=m,u=r,d=l,f=a;return _(),b(B,null,[x(f,{show:w(z),"onUpdate:show":t[1]||(t[1]=a=>C(z)?z.value=a:null),title:w(F)("file.backupModal.title"),width:"700"},{default:g(()=>[M("div",P,[M("div",R,[x(u,null,{default:g(()=>[x(s,{value:w(W).path,"onUpdate:value":t[0]||(t[0]=a=>w(W).path=a)},null,8,["value"]),x(o,{onClick:I},{icon:g(()=>[x(i,{name:"file-dir",size:"20"})]),_:1})]),_:1}),x(o,{type:"primary",onClick:K},{default:g(()=>[j(y(w(F)("file.backupModal.backupButton")),1)]),_:1})]),x(d,{loading:w(H),"max-height":370,data:w(V),columns:w(G)},null,8,["loading","data","columns"])])]),_:1},8,["show","title"]),x(f,{show:w(A),"onUpdate:show":t[3]||(t[3]=a=>C(A)?A.value=a:null),title:w(F)("file.backupModal.confirmTitle"),width:320,footer:!0,onConfirm:Q},{default:g(()=>[M("div",U,[M("div",N,y(w(F)("file.backupModal.enterBackupName")),1),M("div",S,[M("div",q,y(w(F)("file.backupModal.remarks")),1),x(s,{class:"flex-1",value:w(W).remark,"onUpdate:value":t[2]||(t[2]=a=>w(W).remark=a)},null,8,["value"])])])]),_:1},8,["show","title"]),x(p,{ref_key:"resourceManagerRef",ref:E,"current-path":w(T),onChooseDir:J},null,8,["current-path"])],64)}}});export{D as default};
