import{i as V,c as k}from"./app-BT68AfZ-.js";import{_ as N}from"./app-CKBPOVnC.js";import{_ as w}from"./app-DokSVapq.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-DA7OTM4Q.js";import{_ as B}from"./app-d5h3qGYt.js";import{_ as O}from"./app-a9KqBnqw.js";import{_ as I}from"./app-DuUYZNNT.js";import{C as b}from"./app-BQJXgoGu.js";import{_ as g}from"./app-CmG-mh--.js";import{D as L}from"./app-DNL2FXPk.js";import{_ as S}from"./app-CKSEN_Rg.js";import{_ as q}from"./app-DQ7IohAF.js";import"./app-P70ZK_FT.js";import"./app-D5twQdhO.js";import"./app-BotiHebp.js";import"./app-OC5wWJiS.js";import"./app-CnGe5nlE.js";import"./app-KNE_24OY.js";import"./app-Dxa5h-uG.js";import"./app-DSiZNBrr.js";import"./app-BkWUIifj.js";import"./app-CQwVTjAx.js";import"./app-BHFzVhjx.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-Zes_jb7S.js";import"./app-D6fSNcLx.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.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};
