import{r as h,o as r,g as f,a as t,u as e,b as a,w as u,c as C,h as _,d as m,e as p,F as O,D as $,f as c,t as k}from"./app-DA7OTM4Q.js";import{i as w,c as P}from"./app-BT68AfZ-.js";import{_ as A}from"./app-CKBPOVnC.js";import{_ as F}from"./app-CKSEN_Rg.js";import{_ as I}from"./app-DQ7IohAF.js";import{_ as U}from"./app-DokSVapq.js";import{_ as b}from"./app-d5h3qGYt.js";import{_ as d}from"./app-a9KqBnqw.js";import{_ as N}from"./app-D2gM4iLU.js";import{D as S}from"./app-DNL2FXPk.js";import"./app-P70ZK_FT.js";import"./app-D5twQdhO.js";import"./app-BotiHebp.js";import"./app-OC5wWJiS.js";import"./app-CnGe5nlE.js";import"./app-Zes_jb7S.js";import"./app-D6fSNcLx.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-KNE_24OY.js";function D(){w(this),this.success=this.$NotifyReloadSuccess("保存成功")}const B=["value"],T=t("td",{class:"title"},"启用访问日志",-1),E={colspan:"2"},J=t("td",null,"要存储的访问日志字段",-1),R={class:"grid grid-cols-2 lg:grid-cols-3 gap-2"},W=t("td",null,"要存储的访问日志状态码",-1),G={class:"label-group !gap-4"},H=t("td",null,"只记录WAF相关日志",-1),j=t("p",{class:"comment"},"选中后只记录WAF相关的日志。",-1),q={__name:"HTTPAccessLogConfigBox",props:["v-access-log-config","v-fields","v-default-field-codes","v-access-log-policies","v-is-location","v-is-group"],setup(v){const i=v,{accessLog:s,showAdvancedOptions:g}=function(){setTimeout(function(){V(),x()},100);let l={isPrior:!1,isOn:!1,fields:[],status1:!0,status2:!0,status3:!0,status4:!0,status5:!0,storageOnly:!1,storagePolicies:[],firewallOnly:!1};return i.vAccessLogConfig!=null&&(l=i.vAccessLogConfig),i.vFields.forEach(function(o){i.vAccessLogConfig==null?o.isChecked=i.vDefaultFieldCodes.$contains(o.code):o.isChecked=l.fields.$contains(o.code)}),i.vAccessLogPolicies.forEach(function(o){o.isChecked=l.storagePolicies.$contains(o.id)}),{accessLog:h(l),showAdvancedOptions:h(!1)}}(),V=function(){s.value.fields=i.vFields.filter(function(l){return l.isChecked}).map(function(l){return l.code})},x=function(){s.value.storagePolicies=i.vAccessLogPolicies.filter(function(l){return l.isChecked}).map(function(l){return l.id})},L=function(l){g.value=l};return(l,o)=>(r(),f("div",null,[t("input",{type:"hidden",name:"accessLogJSON",value:JSON.stringify(e(s))},null,8,B),a(S,null,{default:u(()=>[l.vIsLocation?(r(),C(b,{key:0,"v-config":e(s)},null,8,["v-config"])):_("",!0),m(t("tbody",null,[t("tr",null,[T,t("td",null,[a(d,{modelValue:e(s).isOn,"onUpdate:modelValue":o[0]||(o[0]=n=>e(s).isOn=n)},null,8,["modelValue"])])])],512),[[p,!l.vIsLocation||e(s).isPrior]]),m(t("tbody",null,[t("tr",null,[t("td",E,[a(N,{onChange:L})])])],512),[[p,(!l.vIsLocation&&!l.vIsGroup||e(s).isPrior)&&e(s).isOn]]),m(t("tbody",null,[t("tr",null,[J,t("td",null,[t("div",R,[(r(!0),f(O,null,$(l.vFields,n=>(r(),f("div",null,[a(d,{modelValue:n.isChecked,"onUpdate:modelValue":y=>n.isChecked=y,onChange:V},{default:u(()=>[c(k(n.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),256))])])]),t("tr",null,[W,t("td",null,[t("div",G,[a(d,{modelValue:e(s).status1,"onUpdate:modelValue":o[1]||(o[1]=n=>e(s).status1=n)},{default:u(()=>[c("1xx")]),_:1},8,["modelValue"]),a(d,{modelValue:e(s).status2,"onUpdate:modelValue":o[2]||(o[2]=n=>e(s).status2=n)},{default:u(()=>[c("2xx")]),_:1},8,["modelValue"]),a(d,{modelValue:e(s).status3,"onUpdate:modelValue":o[3]||(o[3]=n=>e(s).status3=n)},{default:u(()=>[c("3xx")]),_:1},8,["modelValue"]),a(d,{modelValue:e(s).status4,"onUpdate:modelValue":o[4]||(o[4]=n=>e(s).status4=n)},{default:u(()=>[c("4xx")]),_:1},8,["modelValue"]),a(d,{modelValue:e(s).status5,"onUpdate:modelValue":o[5]||(o[5]=n=>e(s).status5=n)},{default:u(()=>[c("5xx")]),_:1},8,["modelValue"])])])]),t("tr",null,[H,t("td",null,[a(d,{modelValue:e(s).firewallOnly,"onUpdate:modelValue":o[6]||(o[6]=n=>e(s).firewallOnly=n)},null,8,["modelValue"]),j])])],512),[[p,(!l.vIsLocation||e(s).isPrior)&&e(s).isOn&&e(g)]])]),_:1})]))}},z={key:0},K=["value"],M={key:1},Ce={__name:"index",setup(v){const i=P(new D);return(s,g)=>(r(),C(A,{ctx:e(i)},{default:u(()=>[e(i).featureIsOn?(r(),f("div",z,[m(a(U,{action:"$",onSuccess:e(i).success},{default:u(()=>[t("input",{type:"hidden",name:"webId",value:e(i).webId},null,8,K),a(q,{"v-access-log-config":e(i).accessLogConfig,"v-fields":e(i).fields,"v-default-field-codes":e(i).defaultFieldCodes,"v-access-log-policies":e(i).accessLogPolicies},null,8,["v-access-log-config","v-fields","v-default-field-codes","v-access-log-policies"]),a(F,{class:"mt-4"})]),_:1},8,["onSuccess"]),[[p,e(i).featureIsOn]])])):_("",!0),e(i).featureIsOn?_("",!0):(r(),f("div",M,[a(I,null,{default:u(()=>[c("尚未为当前用户开通此功能。")]),_:1})]))]),_:1},8,["ctx"]))}};export{Ce as default};
