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-SC54XQDl.js";import{i as w,c as P}from"./app-Ba7ZqSpq.js";import{_ as A}from"./app-Cft_lrsr.js";import{_ as F}from"./app-DWUwCFNm.js";import{_ as I}from"./app-rIYFLdeU.js";import{_ as U}from"./app-DFulsyXy.js";import{_ as b}from"./app-DkOT0Z3c.js";import{_ as d}from"./app-FlPLZh9D.js";import{_ as N}from"./app-huVLEujn.js";import{D as S}from"./app-ZeVDYyDS.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-Dhl-Bw0H.js";import"./app-BjSCO7rC.js";import"./app-CNHjdV6U.js";import"./app-B9xxzP2y.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DZaelcLs.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};
