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