import{i as V,c as k}from"./app-a6cKceqE.js";import{_ as N}from"./app-C3oVnfUH.js";import{_ as w}from"./app-CQ-vNlMj.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-BYcXwl4U.js";import{_ as B}from"./app-B2nvVMhu.js";import{_ as O}from"./app-DwtlHtUX.js";import{_ as I}from"./app-Ufpj4Ll4.js";import{C as b}from"./app-iaXXZg9Y.js";import{_ as g}from"./app-Co4ciZEn.js";import{D as L}from"./app-7GBSHA5C.js";import{_ as S}from"./app-CignoBaV.js";import{_ as q}from"./app-B8JChEZz.js";import"./app-CLawzVMq.js";import"./app-BeFNDz9n.js";import"./app-BDgR0DSb.js";import"./app-DxjODhok.js";import"./app-DPDEogA0.js";import"./app-BHl80pFw.js";import"./app-BG60hdvp.js";import"./app-ysQ8KbGS.js";import"./app-D2Wz0BUQ.js";import"./app-D3zbrzdO.js";import"./app-DxbU-QrX.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-CrjU8lgK.js";import"./app-D7QVa3_6.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.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};
