import{_ as k}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{h as E}from"./index-BTglIPU2.js?v=1773287522785";import{e as P}from"./setting-DouXuJGW.js?v=1773287522785";import{m as R}from"./site-D0zX56Uh.js?v=1773287522785";import{k as B,t as A,R as V,c as D,r as F,e as G,ab as I,$ as T,Z,a0 as n,a9 as i,_ as o,S as r,aa as l}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as j,_ as q}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const z={class:"p-20px pt-24px"},H={class:"w-160px mr-8px"},J={class:"text-desc"},K={class:"w-160px mr-8px"},L={class:"text-desc"},M={class:"w-160px mr-8px"},O={class:"text-desc"},Q={class:"text-error"},X={class:"text-error"},Y={class:"text-error"},le=B({__name:"index",props:{config:{},siteName:{}},emits:["refresh"],setup(d,{expose:g,emit:x}){const f=d,v=x,u=A(f,"siteName"),{t:_}=V(),b=D(()=>u.value===void 0),p=F(null),e=G({retry_cycle:120,retry:10,retry_time:1800}),h={retry_cycle:{trigger:["blur","input"],validator:()=>e.retry_cycle?!0:new Error(_("Waf.Site.Config.index_34"))},retry:{trigger:["blur","input"],validator:()=>e.retry?!0:new Error(_("Waf.Site.Config.index_56"))},retry_time:{trigger:["blur","input"],validator:()=>e.retry_time?!0:new Error(_("Waf.Site.Config.index_37"))}},C=()=>{const{config:t}=f;t&&(e.retry_cycle=t.retry_cycle,e.retry=t.retry,e.retry_time=t.retry_time)},w=()=>({retry_cycle:e.retry_cycle,retry:e.retry,retry_time:e.retry_time,is_open_global:u.value?0:1}),S=async({hide:t})=>{var a;await((a=p.value)==null?void 0:a.validate());const{siteName:s}=f;if(s)await y();else return E({title:_("Waf.Site.Config.index_57"),content:_("Waf.Site.Config.index_58"),onConfirm:async({hide:c})=>(await y(),c(),t(),!1)}),!1},y=async()=>{const t=w();b.value?await P(t):await R({...t,siteName:u.value||""}),v("refresh")};return C(),g({onConfirm:S}),(t,s)=>{const a=q,c=j,W=U,N=I("i18n-t"),$=k;return T(),Z("div",z,[n(W,{ref_key:"formRef",ref:p,model:r(e),rules:h},{default:i(()=>[n(c,{label:t.$t("Waf.Site.Config.index_14"),path:"retry_cycle"},{default:i(()=>[o("div",H,[n(a,{value:r(e).retry_cycle,"onUpdate:value":s[0]||(s[0]=m=>r(e).retry_cycle=m),min:1,"show-button":!1},null,8,["value"])]),o("span",J,l(t.$t("Public.Unit.Second",r(e).retry_cycle)),1)]),_:1},8,["label"]),n(c,{label:t.$t("Waf.Site.Config.index_53"),path:"retry"},{default:i(()=>[o("div",K,[n(a,{value:r(e).retry,"onUpdate:value":s[1]||(s[1]=m=>r(e).retry=m),min:1,"show-button":!1},null,8,["value"])]),o("span",L,l(t.$t("Public.Unit.Time",r(e).retry)),1)]),_:1},8,["label"]),n(c,{label:t.$t("Waf.Site.Config.index_18"),path:"retry_time"},{default:i(()=>[o("div",M,[n(a,{value:r(e).retry_time,"onUpdate:value":s[2]||(s[2]=m=>r(e).retry_time=m),min:1,"show-button":!1},null,8,["value"])]),o("span",O,l(t.$t("Public.Unit.Second",r(e).retry_time)),1)]),_:1},8,["label"])]),_:1},8,["model"]),n($,{class:"mt-8px"},{default:i(()=>[n(N,{tag:"li",keypath:"Waf.Site.Config.index_101",scope:"global"},{index_1:i(()=>[o("span",Q,l(r(e).retry),1)]),index_2:i(()=>[o("span",X,l(r(e).retry_cycle),1)]),index_3:i(()=>[o("span",Y,l(r(e).retry_time),1)]),_:1})]),_:1})])}}});export{le as default};
