import{_ as O}from"./index-BRQskX9P.js?v=1773287522785";import{_ as U}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{i as C,m as z}from"./index-BTglIPU2.js?v=1773287522785";import{u as R}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{w as G,g as B,x as I,y as M,z as X,A as Z}from"./setting-DouXuJGW.js?v=1773287522785";import{k as h,R as E,a0 as a,$ as v,Z as $,S as o,a9 as _,_ as u,aa as m,e as H,r as w,F as q,n as J,j as N,N as K,X as Q}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a8 as T,_ as x,b as Y,B as V,a1 as tt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{g as L}from"./data-BVsViUMm.js?v=1773287522785";import{u as et}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{_ as nt}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const at=h({__name:"type",setup(S,{expose:c}){const{t:l}=E(),{table:e,columns:r,setLoading:p}=R([{key:"type",title:l("Waf.Setting.config_93")},{key:"status",title:l("Public.Table.Status"),align:"right",width:100,render:n=>a(T,{value:n.status,size:"small",onUpdateValue:async s=>{await G({method_type:n.type,check:s?1:0}),n.status=s}},null)}]),d=async()=>{try{p(!0);const{message:n}=await B();C(n)&&(e.data=n.method_type.map(s=>({type:s[0],status:s[1]})))}finally{p(!1)}};return d(),c({init:d}),(n,s)=>{const b=P,f=U;return v(),$("div",null,[a(b,{"max-height":400,loading:o(e).loading,data:o(e).data,columns:o(r)},null,8,["loading","data","columns"]),a(f,{class:"mt-16px"},{default:_(()=>[u("li",null,m(n.$t("Waf.Setting.config_91")),1),u("li",null,m(n.$t("Waf.Setting.config_92")),1)]),_:1})])}}}),ot={class:"flex mb-12px"},st={class:"flex-1 mr-12px"},lt={class:"w-100px mr-12px"},it=h({__name:"header",setup(S,{expose:c}){const{t:l}=E(),e=H({type:"",length:null}),r=async()=>{if(!e.type){z.error(l("Waf.Setting.config_98"));return}if(!e.length){z.error(l("Waf.Setting.config_99"));return}await X({header_type:e.type,header_type_len:e.length}),g(),e.type="",e.length=null},p=w(null),{table:d,columns:n,setLoading:s}=R([{key:"type",title:"Header"},{key:"len",title:l("Waf.Setting.config_95"),width:100,render:t=>a(q,null,[t.isEdit?a(x,{ref:p,value:t.editLen,min:1,size:"small",showButton:!1,placeholder:"",onUpdateValue:i=>{t.editLen=i||1}},null):t.len])},et({width:100,options:t=>t.isEdit?[{label:l("Public.Btn.Save"),onClick:()=>{f(t)}},{label:l("Public.Btn.Cancel"),onClick:()=>{y(t)}}]:[{label:l("Public.Btn.Edit"),show:!t.isEdit,onClick:()=>{b(t)}},{label:l("Public.Btn.Del"),show:!t.isEdit,onClick:()=>{k(t)}}]})]),b=t=>{t.isEdit=!0,J(()=>{var i;(i=p.value)==null||i.focus()})},f=async t=>{await I({header_type:t.type,header_type_len:t.editLen}),t.isEdit=!1,t.len=t.editLen},y=t=>{t.isEdit=!1,t.editLen=t.len},k=async t=>{await M({header_type:t.type,header_type_len:t.len}),g()},g=async()=>{try{s(!0);const{message:t}=await B();C(t)&&(d.data=t.header_len.map(i=>({type:i[0],len:L(i[1]),editLen:L(i[1]),isEdit:!1})))}finally{s(!1)}};return g(),c({init:g}),(t,i)=>{const A=Y,D=V,j=P,F=U;return v(),$("div",null,[u("div",ot,[u("div",st,[a(A,{value:o(e).type,"onUpdate:value":i[0]||(i[0]=W=>o(e).type=W),placeholder:t.$t("Waf.Setting.config_94")},null,8,["value","placeholder"])]),u("div",lt,[a(o(x),{value:o(e).length,"onUpdate:value":i[1]||(i[1]=W=>o(e).length=W),"show-button":!1,placeholder:t.$t("Waf.Setting.config_95")},null,8,["value","placeholder"])]),a(D,{type:"primary",onClick:r},{default:_(()=>[N(m(t.$t("Public.Btn.Add")),1)]),_:1})]),a(j,{"max-height":380,loading:o(d).loading,data:o(d).data,columns:o(n)},null,8,["loading","data","columns"]),a(F,{class:"mt-16px"},{default:_(()=>[u("li",null,m(t.$t("Waf.Setting.config_96")),1),u("li",null,m(t.$t("Waf.Setting.config_97")),1)]),_:1})])}}}),_t={class:"p-20px"},ut={class:"w-200px"},pt={class:"w-200px"},ct={class:"w-200px"},dt=h({__name:"count",setup(S,{expose:c}){const l=w(null),e=H({base64:1,body_size:8e5,post_count:1e3,get_count:1e3}),r={},p=async()=>{var n;await((n=l.value)==null?void 0:n.validate()),await Z(K(e))};return c({init:async()=>{const{message:n}=await B();C(n)&&(e.base64=n.http_config.base64?1:0,e.body_size=n.http_config.body_size,e.post_count=n.http_config.post_count,e.get_count=n.http_config.get_count)}}),(n,s)=>{const b=T,f=tt,y=x,k=V,g=nt;return v(),$("div",_t,[a(g,{ref_key:"formRef",ref:l,model:o(e),rules:r,"label-width":"150"},{default:_(()=>[a(f,{label:n.$t("Waf.Setting.config_100"),path:"base64"},{default:_(()=>[a(b,{value:o(e).base64,"onUpdate:value":s[0]||(s[0]=t=>o(e).base64=t),"checked-value":1,"unchecked-value":0},null,8,["value"])]),_:1},8,["label"]),a(f,{label:n.$t("Waf.Setting.config_101"),path:"body_size"},{default:_(()=>[u("div",ut,[a(y,{value:o(e).body_size,"onUpdate:value":s[1]||(s[1]=t=>o(e).body_size=t),min:1,"show-button":!1},null,8,["value"])])]),_:1},8,["label"]),a(f,{label:n.$t("Waf.Setting.config_102"),path:"post_count"},{default:_(()=>[u("div",pt,[a(y,{value:o(e).post_count,"onUpdate:value":s[2]||(s[2]=t=>o(e).post_count=t),min:1,"show-button":!1},{suffix:_(()=>[u("span",null,m(n.$t("Waf.Setting.config_103")),1)]),_:1},8,["value"])])]),_:1},8,["label"]),a(f,{label:n.$t("Waf.Setting.config_104"),path:"get_count"},{default:_(()=>[u("div",ct,[a(y,{value:o(e).get_count,"onUpdate:value":s[3]||(s[3]=t=>o(e).get_count=t),min:1,"show-button":!1},{suffix:_(()=>[u("span",null,m(n.$t("Waf.Setting.config_103")),1)]),_:1},8,["value"])])]),_:1},8,["label"]),a(f,{label:" "},{default:_(()=>[a(k,{type:"primary",onClick:p},{default:_(()=>[N(m(n.$t("Waf.Setting.config_105")),1)]),_:1})]),_:1})]),_:1},8,["model"])])}}}),ft={class:"p-20px"},zt=h({__name:"index",setup(S){const{t:c}=E(),l=w("type"),e=[{key:"type",label:c("Waf.Setting.config_88"),component:at},{key:"header",label:c("Waf.Setting.config_89"),component:it},{key:"count",label:c("Waf.Setting.config_90"),component:dt}];return(r,p)=>{const d=O;return v(),$("div",ft,[a(d,{value:o(l),"onUpdate:value":p[0]||(p[0]=n=>Q(l)?l.value=n:null),options:e},null,8,["value"])])}}});export{zt as default};