import{a as e,_ as t}from"./public.js?v=1763625242172";import{_ as r}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{e as a}from"./setting.js?v=1763625242172";import{m as i}from"./site3.js?v=1763625242172";import{k as s,t as l,P as n,c as o,r as c,e as _,a5 as y,R as m,S as p,X as u,a3 as d,U as f,V as x,a4 as v}from"./vue.js?v=1763625242172";import{df as g,dP as b}from"./naive.js?v=1763625242172";import"./page_layout.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const w={class:"p-20px pt-24px"},S={class:"w-160px mr-8px"},h={class:"text-desc"},C={class:"w-160px mr-8px"},j={class:"text-desc"},W={class:"w-160px mr-8px"},U={class:"text-desc"},$={class:"text-error"},P={class:"text-error"},N={class:"text-error"},k=s({__name:"index",props:{config:{},siteName:{}},emits:["refresh"],setup(s,{expose:k,emit:E}){const R=s,H=E,T=l(R,"siteName"),{t:V}=n(),X=o((()=>void 0===T.value)),q=c(null),z=_({retry_cycle:120,retry:10,retry_time:1800}),A={retry_cycle:{trigger:["blur","input"],validator:()=>!!z.retry_cycle||new Error(V("Waf.Site.Config.index_34"))},retry:{trigger:["blur","input"],validator:()=>!!z.retry||new Error(V("Waf.Site.Config.index_56"))},retry_time:{trigger:["blur","input"],validator:()=>!!z.retry_time||new Error(V("Waf.Site.Config.index_37"))}},B=async()=>{const e={retry_cycle:z.retry_cycle,retry:z.retry,retry_time:z.retry_time,is_open_global:T.value?0:1};X.value?await a(e):await i({...e,siteName:T.value||""}),H("refresh")};return(()=>{const{config:e}=R;e&&(z.retry_cycle=e.retry_cycle,z.retry=e.retry,z.retry_time=e.retry_time)})(),k({onConfirm:async({hide:t})=>{var r;await(null==(r=q.value)?void 0:r.validate());const{siteName:a}=R;if(!a)return e({title:V("Waf.Site.Config.index_57"),content:V("Waf.Site.Config.index_58"),onConfirm:async({hide:e})=>(await B(),e(),t(),!1)}),!1;await B()}}),(e,a)=>{const i=g,s=b,l=r,n=y("i18n-t"),o=t;return m(),p("div",w,[u(l,{ref_key:"formRef",ref:q,model:x(z),rules:A},{default:d((()=>[u(s,{label:e.$t("Waf.Site.Config.index_14"),path:"retry_cycle"},{default:d((()=>[f("div",S,[u(i,{value:x(z).retry_cycle,"onUpdate:value":a[0]||(a[0]=e=>x(z).retry_cycle=e),min:1,"show-button":!1},null,8,["value"])]),f("span",h,v(e.$t("Public.Unit.Second",x(z).retry_cycle)),1)])),_:1},8,["label"]),u(s,{label:e.$t("Waf.Site.Config.index_53"),path:"retry"},{default:d((()=>[f("div",C,[u(i,{value:x(z).retry,"onUpdate:value":a[1]||(a[1]=e=>x(z).retry=e),min:1,"show-button":!1},null,8,["value"])]),f("span",j,v(e.$t("Public.Unit.Time",x(z).retry)),1)])),_:1},8,["label"]),u(s,{label:e.$t("Waf.Site.Config.index_18"),path:"retry_time"},{default:d((()=>[f("div",W,[u(i,{value:x(z).retry_time,"onUpdate:value":a[2]||(a[2]=e=>x(z).retry_time=e),min:1,"show-button":!1},null,8,["value"])]),f("span",U,v(e.$t("Public.Unit.Second",x(z).retry_time)),1)])),_:1},8,["label"])])),_:1},8,["model"]),u(o,{class:"mt-8px"},{default:d((()=>[u(n,{tag:"li",keypath:"Waf.Site.Config.index_101",scope:"global"},{index_1:d((()=>[f("span",$,v(x(z).retry),1)])),index_2:d((()=>[f("span",P,v(x(z).retry_cycle),1)])),index_3:d((()=>[f("span",N,v(x(z).retry_time),1)])),_:1})])),_:1})])}}});export{k as default};
