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