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