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