import{i as V,c as k}from"./app-Ba7ZqSpq.js";import{_ as N}from"./app-Cft_lrsr.js";import{_ as w}from"./app-DFulsyXy.js";import{r as _,J as x,o as u,g as p,a as t,u as e,b as i,w as d,c as y,h as f,d as C,e as h,bb as P,f as r}from"./app-SC54XQDl.js";import{_ as B}from"./app-DkOT0Z3c.js";import{_ as O}from"./app-FlPLZh9D.js";import{_ as I}from"./app-CVQkwzlf.js";import{C as b}from"./app-Ciy_QwIW.js";import{_ as g}from"./app-BXes872u.js";import{D as L}from"./app-ZeVDYyDS.js";import{_ as S}from"./app-DWUwCFNm.js";import{_ as q}from"./app-rIYFLdeU.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-Dhl-Bw0H.js";import"./app-BjSCO7rC.js";import"./app-DZaelcLs.js";import"./app-PPG0ZS4d.js";import"./app-DnXuoh8P.js";import"./app-DoVkxbmA.js";import"./app-C2mBgI5Z.js";import"./app-PrSv7rSt.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CNHjdV6U.js";import"./app-B9xxzP2y.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";function R(){V(this),this.success=this.$NotifyReloadSuccess("保存成功")}const T=["value"],D=t("td",{class:"title"},"启用请求限制",-1),G=t("td",null,"最大并发连接数",-1),J={class:"comment"},U=t("td",null,"单IP最大并发连接数",-1),z={class:"comment"},E={key:0,class:"red"},H=t("td",null,"单连接带宽限制",-1),j=t("p",{class:"comment"},"客户端单个请求每秒可以读取的下行流量。",-1),A=t("td",null,"单请求最大尺寸",-1),F=t("p",{class:"comment"},"单个请求能发送的最大内容尺寸。",-1),K={__name:"HTTPRequestLimitConfigBox",props:["v-request-limit-config","v-is-group","v-is-location"],setup(v){const l=v,{config:n,maxConns:m,maxConnsPerIP:a}=function(){let o=l.vRequestLimitConfig;return o==null&&(o={isPrior:!1,isOn:!1,maxConns:0,maxConnsPerIP:0,maxBodySize:{count:-1,unit:"kb"},outBandwidthPerConn:{count:-1,unit:"kb"}}),{config:_(o),maxConns:_(o.maxConns),maxConnsPerIP:_(o.maxConnsPerIP)}}(),$=function(){return(!l.vIsLocation&&!l.vIsGroup||n.value.isPrior)&&n.value.isOn};return x(m,function(o){let s=parseInt(o,10);if(isNaN(s)){n.value.maxConns=0;return}s<0?n.value.maxConns=0:n.value.maxConns=s}),x(a,function(o){let s=parseInt(o,10);if(isNaN(s)){n.value.maxConnsPerIP=0;return}s<0?n.value.maxConnsPerIP=0:n.value.maxConnsPerIP=s}),(o,s)=>(u(),p("div",null,[t("input",{type:"hidden",name:"requestLimitJSON",value:JSON.stringify(e(n))},null,8,T),i(L,null,{default:d(()=>[o.vIsLocation||o.vIsGroup?(u(),y(B,{key:0,"v-config":e(n)},null,8,["v-config"])):f("",!0),C(t("tbody",null,[t("tr",null,[D,t("td",null,[i(O,{modelValue:e(n).isOn,"onUpdate:modelValue":s[0]||(s[0]=c=>e(n).isOn=c)},null,8,["modelValue"])])])],512),[[h,!o.vIsLocation&&!o.vIsGroup||e(n).isPrior]]),C(t("tbody",null,[t("tr",null,[G,t("td",null,[i(I,{type:"text",maxlength:"6",modelValue:e(m),"onUpdate:modelValue":s[1]||(s[1]=c=>P(m)?m.value=c:null)},null,8,["modelValue"]),t("p",J,[r("当前网站最大并发连接数，超出此限制则响应用户 "),i(b,null,{default:d(()=>[r("429")]),_:1}),r(" 代码。为0表示不限制。 ")])])]),t("tr",null,[U,t("td",null,[i(I,{type:"text",maxlength:"6",modelValue:e(a),"onUpdate:modelValue":s[2]||(s[2]=c=>P(a)?a.value=c:null)},null,8,["modelValue"]),t("p",z,[r("单IP最大连接数，统计单个IP总连接数时不区分网站，超出此限制则响应用户 "),i(b,null,{default:d(()=>[r("429")]),_:1}),r(" 代码。为0表示不限制。"),e(a)>0&&e(a)<=3?(u(),p("span",E,"当前设置的并发连接数过低，可能会影响正常用户访问，建议不小于3。")):f("",!0)])])]),t("tr",null,[H,t("td",null,[i(g,{"v-value":e(n).outBandwidthPerConn,"v-supported-units":["byte","kb","mb"]},null,8,["v-value"]),j])]),t("tr",null,[A,t("td",null,[i(g,{"v-value":e(n).maxBodySize,"v-supported-units":["byte","kb","mb","gb"]},null,8,["v-value"]),F])])],512),[[h,$()]])]),_:1})]))}},M={key:0},Q=["value"],W={key:1},Bt={__name:"index",setup(v){const l=k(new R);return(n,m)=>(u(),y(N,{ctx:e(l)},{default:d(()=>[e(l).featureIsOn?(u(),p("div",M,[i(w,{action:"$",onSuccess:e(l).success},{default:d(()=>[t("input",{type:"hidden",name:"webId",value:e(l).webId},null,8,Q),i(K,{"v-request-limit-config":e(l).requestLimitConfig},null,8,["v-request-limit-config"]),i(S,{class:"mt-4"})]),_:1},8,["onSuccess"])])):f("",!0),e(l).featureIsOn?f("",!0):(u(),p("div",W,[i(q)]))]),_:1},8,["ctx"]))}};export{Bt as default};
