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