import{P as g}from"./app-CyTk3GnO.js";import{i as T,c as V}from"./app-DckefXYL.js";import{_ as c,a as n}from"./app-DntYVxd7.js";import{_ as k}from"./app-MnSDCF4P.js";import{_ as y}from"./app-DPkDcD7h.js";import{_ as v}from"./app-COct4tsy.js";import{D as P}from"./app-Cx7ENVlu.js";import{o as d,c as _,w as i,b as o,a as s,u as t,g as h,D as $,f as u,t as f,F as x,h as r}from"./app-DnroACXc.js";import"./app-CUqfl6on.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-CF0qXH5Q.js";import"./app-xECxwo4T.js";import"./app-LqsmzyUT.js";function K(){T(this);var m=this;this.success=this.$NotifyPopup,this.selectedType=this.scheduling.code,this.schedulingTypeDescription=null,this.changeSchedulingType=function(){this.schedulingTypeDescription=this.schedulingTypes.$find(function(e,p){return p.code==m.selectedType}).description},this.changeSchedulingType(),this.hashKey="",this.hashVar="",this.scheduling.code=="hash"?this.hashKey=this.scheduling.options.key:this.hashKey="${remoteAddr}",this.changeHashVar=function(){this.hashVar.length>0&&(this.hashKey=this.hashVar)},this.scheduling.code=="sticky"?(this.stickyType=this.scheduling.options.type,this.stickyParam=this.scheduling.options.param):(this.stickyType="cookie",this.stickyParam="Origin")}const U=s("header",null,"修改调度算法",-1),C=["value"],D=["value"],H=["value"],S=s("td",{class:"title"},"选择调度算法",-1),I={class:"comment"},w={key:0},N=s("td",null," Key ",-1),B=s("p",{class:"comment"},"用来计算Hash的字符串，其中可以使用变量。",-1),L={key:1},R=s("td",null,"常用变量",-1),b={key:2},A=s("td",null,"参数类型",-1),F={key:3},q=s("td",null,"参数名",-1),E=s("p",{class:"comment"},"记录或指定源站的参数名，只能是英文字母和数字的组合，不允许有下划线（因为在HTTP Header中下划线是不标准的）",-1),ne={__name:"updateSchedulingPopup",setup(m){const e=V(new K);return(p,a)=>(d(),_(g,null,{default:i(()=>[U,o(k,{action:"$",onSuccess:t(e).success},{default:i(()=>[s("input",{type:"hidden",name:"dataType",value:t(e).dataType},null,8,C),s("input",{type:"hidden",name:"serverId",value:t(e).serverId},null,8,D),s("input",{type:"hidden",name:"reverseProxyId",value:t(e).reverseProxyId},null,8,H),o(P,null,{default:i(()=>[s("tbody",null,[s("tr",null,[S,s("td",null,[o(c,{name:"type",modelValue:t(e).selectedType,"onUpdate:modelValue":a[0]||(a[0]=l=>t(e).selectedType=l),onChange:a[1]||(a[1]=l=>t(e).changeSchedulingType())},{default:i(()=>[(d(!0),h(x,null,$(t(e).schedulingTypes,l=>(d(),_(n,{value:l.code},{default:i(()=>[u(f(l.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),s("p",I,f(t(e).schedulingTypeDescription),1)])]),t(e).selectedType=="hash"?(d(),h("tr",w,[N,s("td",null,[o(y,{name:"hashKey",modelValue:t(e).hashKey,"onUpdate:modelValue":a[2]||(a[2]=l=>t(e).hashKey=l),maxlength:"500",class:"w-full"},null,8,["modelValue"]),B])])):r("",!0),t(e).selectedType=="hash"?(d(),h("tr",L,[R,s("td",null,[o(c,{modelValue:t(e).hashVar,"onUpdate:modelValue":a[3]||(a[3]=l=>t(e).hashVar=l),onChange:a[4]||(a[4]=l=>t(e).changeHashVar())},{default:i(()=>[o(n),o(n,{value:"${remoteAddr}"},{default:i(()=>[u("客户端IP")]),_:1}),o(n,{value:"${host}${requestURI}"},{default:i(()=>[u("请求URL")]),_:1})]),_:1},8,["modelValue"])])])):r("",!0),t(e).selectedType=="sticky"?(d(),h("tr",b,[A,s("td",null,[o(c,{name:"stickyType",modelValue:t(e).stickyType,"onUpdate:modelValue":a[5]||(a[5]=l=>t(e).stickyType=l)},{default:i(()=>[o(n,{value:"cookie"},{default:i(()=>[u("Cookie")]),_:1}),o(n,{value:"header"},{default:i(()=>[u("HTTP Header")]),_:1}),o(n,{value:"argument"},{default:i(()=>[u("URL参数")]),_:1})]),_:1},8,["modelValue"])])])):r("",!0),t(e).selectedType=="sticky"?(d(),h("tr",F,[q,s("td",null,[o(y,{name:"stickyParam",modelValue:t(e).stickyParam,"onUpdate:modelValue":a[6]||(a[6]=l=>t(e).stickyParam=l),maxlength:"50",class:"w-full"},null,8,["modelValue"]),E])])):r("",!0)])]),_:1}),o(v)]),_:1},8,["onSuccess"])]),_:1}))}};export{ne as default};
