import{_ as S}from"./index-DIKmrNCq.js?v=1773287522785";import{l as U,C as d,ar as T}from"./index-BTglIPU2.js?v=1773287522785";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{k as F,R as I,a6 as j,r as q,e as z,$ as E,a8 as L,a9 as s,a0 as a,S as e,j as f,aa as l,ak as O,_ as k}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as A,B as G,C as H,D as J,E as K,F as M}from"./utils-fCmtiQ1f.js?v=1773287522785";import Q from"./backup-info-oSTuIzgU.js?v=1773287522785";import{a1 as W,b as X,a6 as Y,ah as Z,al as ee,a9 as ae,ad as ne}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";const ke=F({__name:"index",props:{onRefresh:{type:Function}},setup(g,{expose:x}){const{t}=I(),c=A(),{loading:b,backupData:r}=j(c),C=g,u=q(null),n=z({back_name:G(Date.now()),storage_type:"local",timestamp:null,auto_exit:!1}),B={back_name:{required:!0,trigger:"input",message:t("Config.Backup.index_49")}},h=()=>({backup_name:n.back_name,auto_exit:n.auto_exit?1:0,storage_type:n.storage_type,timestamp:n.timestamp?n.timestamp/1e3:0}),w=async()=>{var p;return await((p=u.value)==null?void 0:p.validate()),new Promise(o=>{T({title:t("Config.Backup.index_57"),content:()=>a(ne,{type:"warning"},{default:()=>[a("span",{class:"color-warning font-bold"},[f(" "),t("Config.Backup.index_58"),f(" ")])]}),onConfirm:async()=>{await M(h()),C.onRefresh(n.timestamp),o(!0)}})})},y=()=>{c.getData()};return c.getData(),x({onConfirm:w}),(p,o)=>{const v=X,_=W,$=Y,D=Z,oe=ee,R=P,m=U,N=S,V=ae;return E(),L(V,{show:e(b),class:"p-16px",description:e(t)("Config.Backup.index_56")},{default:s(()=>[a(R,{ref_key:"formRef",ref:u,model:e(n),rules:B},{default:s(()=>[a(_,{label:p.$t("Config.Backup.index_3"),path:"back_name"},{default:s(()=>[a(v,{class:"w-600px!",value:e(n).back_name,"onUpdate:value":o[0]||(o[0]=i=>e(n).back_name=i),placeholder:e(t)("Config.Backup.index_49"),clearable:""},null,8,["value","placeholder"])]),_:1},8,["label"]),a(_,{label:p.$t("Config.Backup.index_50"),path:"type"},{default:s(()=>[a($,{class:"w-600px",value:e(n).storage_type,"onUpdate:value":o[1]||(o[1]=i=>e(n).storage_type=i),options:e(J),"render-label":e(H)},null,8,["value","options","render-label"])]),_:1},8,["label"]),a(_,{label:p.$t("Config.Backup.index_51")},{default:s(()=>[a(D,{class:"w-600px",value:e(n).timestamp,"onUpdate:value":o[2]||(o[2]=i=>e(n).timestamp=i),type:"datetime",clearable:"","is-date-disabled":e(K),placeholder:e(t)("Config.Backup.index_52")},null,8,["value","is-date-disabled","placeholder"])]),_:1},8,["label"]),a(_,{label:"Backup Data"},{default:s(()=>[a(Q,{class:"w-600px"})]),_:1}),O("",!0)]),_:1},8,["model"]),a(N,{class:"mt-16px"},{default:s(()=>[k("li",null,[a(m,{name:"base-warning",class:"text-warning mr-4px",size:"16"}),k("span",null,l(e(t)("Config.Backup.index_54"))+" "+l(e(d)(e(r).disk_use))+" "+l(e(t)("Config.Backup.index_55"))+" "+l(e(d)(e(r).disk_free)),1),a(m,{name:"base-refresh",class:"text-primary ml-4px",onClick:y})])]),_:1})]),_:1},8,["show","description"])}}});export{ke as default};
