import{_ as a,p as e}from"./public.js?v=1764233927359";import{a6 as s,_ as t,n as l,T as n}from"./page_layout.js?v=1764233927359";import{_ as o}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import{u as i,B as p,C as r,D as u,E as m,F as _}from"./utils.js?v=1764233927359";import c from"./backup-info.js?v=1764233927359";import{k as d,P as f,a0 as g,r as x,e as k,a2 as b,V as v,a3 as y,W as C,U as w,an as j,j as B,a4 as h,S as D}from"./vue.js?v=1764233927359";import{dR as R,au as U,dV as $,_ as F,dk as P}from"./naive.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./soft.js?v=1764233927359";import"./site.js?v=1764233927359";const V=d({__name:"index",props:{onRefresh:{type:Function}},setup(d,{expose:F}){const{t:V}=f(),q=i(),{loading:z,backupData:E}=g(q),H=d,S=x(null),T=k({back_name:p(Date.now()),storage_type:"local",timestamp:null,auto_exit:!1}),W={back_name:{required:!0,trigger:"input",message:V("Config.Backup.index_49")}},A=()=>{q.getData()};return q.getData(),F({onConfirm:async()=>{var a;return await(null==(a=S.value)?void 0:a.validate()),new Promise(a=>{e({title:V("Config.Backup.index_57"),content:()=>C(P,{type:"warning"},{default:()=>[C("span",{class:"color-warning font-bold"},[B(" "),V("Config.Backup.index_58"),B(" ")])]}),onConfirm:async()=>{await _({backup_name:T.back_name,auto_exit:T.auto_exit?1:0,storage_type:T.storage_type,timestamp:T.timestamp?T.timestamp/1e3:0}),H.onRefresh(T.timestamp),a(!0)}})})}}),(e,i)=>{const p=U,_=R,d=$,f=s,g=o,x=t,k=a,B=n;return v(),b(B,{show:w(z),class:"p-16px",description:w(V)("Config.Backup.index_56")},{default:y(()=>[C(g,{ref_key:"formRef",ref:S,model:w(T),rules:W},{default:y(()=>[C(_,{label:e.$t("Config.Backup.index_3"),path:"back_name"},{default:y(()=>[C(p,{class:"w-600px!",value:w(T).back_name,"onUpdate:value":i[0]||(i[0]=a=>w(T).back_name=a),placeholder:w(V)("Config.Backup.index_49"),clearable:""},null,8,["value","placeholder"])]),_:1},8,["label"]),C(_,{label:e.$t("Config.Backup.index_50"),path:"type"},{default:y(()=>[C(d,{class:"w-600px",value:w(T).storage_type,"onUpdate:value":i[1]||(i[1]=a=>w(T).storage_type=a),options:w(u),"render-label":w(r)},null,8,["value","options","render-label"])]),_:1},8,["label"]),C(_,{label:e.$t("Config.Backup.index_51")},{default:y(()=>[C(f,{class:"w-600px",value:w(T).timestamp,"onUpdate:value":i[2]||(i[2]=a=>w(T).timestamp=a),type:"datetime",clearable:"","is-date-disabled":w(m),placeholder:w(V)("Config.Backup.index_52")},null,8,["value","is-date-disabled","placeholder"])]),_:1},8,["label"]),C(_,{label:"Backup Data"},{default:y(()=>[C(c,{class:"w-600px"})]),_:1}),j("",!0)]),_:1},8,["model"]),C(k,{class:"mt-16px"},{default:y(()=>[D("li",null,[C(x,{name:"base-warning",class:"text-warning mr-4px",size:"16"}),D("span",null,h(w(V)("Config.Backup.index_54"))+" "+h(w(l)(w(E).disk_use))+" "+h(w(V)("Config.Backup.index_55"))+" "+h(w(l)(w(E).disk_free)),1),C(x,{name:"base-refresh",class:"text-primary ml-4px",onClick:A})])]),_:1})]),_:1},8,["show","description"])}}});export{V as default};
