import{az as e,P as a,aK as l,aC as s,$ as t,_ as o}from"./utils-lib.js?v=1761009159";import{c as n,r as i,o as r,e as c,q as m,H as d,I as u,y as p,v,x as f,N as _,D as g,Q as h,z as y,C as V,A as j,K as x,F as w,b0 as b,an as k,b1 as C}from"./base-lib.js?v=1761009159";import{modifyPathConfig as U,modifyPathConfigBatch as D,getTamperRuleByPath as R}from"./site.js?v=1761009159";import{u as z}from"./useStore4.js?v=1761009159";import{t as I}from"./useController6.js?v=1761009159";import{_ as L}from"./masker.vue_vue_type_script_setup_true_lang.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./validator.js?v=1761009159";import"./index133.js?v=1761009159";import"./index.vue_vue_type_style_index_0_scoped_cdc7f4d3_lang.js?v=1761009159";const q=""+new URL("../icons/icon-site-create.svg",import.meta.url).href,H=""+new URL("../icons/icon-site-edit.svg",import.meta.url).href,K=""+new URL("../icons/icon-site-delete.svg",import.meta.url).href,A={class:"overall-config overall-config-top"},F={class:"overall-config-item"},N={class:"overall-config-item"},O={class:"overall-config-item"},P={class:"mt-2rem"},Q={class:"flex items-center"},S={class:"ml-[1rem] text-primary mr-[.4rem] select-none"},$={key:0,class:"overall-config-content"},B={class:"overall-config-content-left"},E={class:"overall-config-content-right"},G={class:"mr-1rem"},J=o(n({__name:"advanced",props:{compData:{default:{}}},setup(o){const{siteInfo:n}=z(),J=i("forbid"),M=i(!1),T=i(!1),W=r({create:["create","mkdir","link"],edit:["rename","chown","chmod","modify"],delete:["unlink","rmdir"]}),X=i({}),Y=i({create:!1,edit:!1,delete:!1}),Z=r({create:"创建",edit:"编辑",delete:"删除"}),ee=i([{label:"禁止功能",name:"forbid",lazy:!0,render:()=>c("span",null,null)}]),ae=async(l,s)=>{const t={value:l?1:0,path_id:X.value.pid,[e(s)?"key":"batch"]:s},o=e(s)?U:D;(await a({loading:"正在修改配置，请稍后...",request:o(t),message:!0})).status&&le()},le=async()=>{try{M.value=!0;const{data:e}=await R({path:n.value.path});let a=[];if(e){for(const l in e)-1!==l.indexOf("is_")?a[l]=!!e[l]:a[l]=e[l];X.value=a;for(const a in W)Y.value[a]=W[a].some(a=>e["is_".concat(a)])}}catch(e){l(e)}finally{M.value=!1}};return m(()=>{le()}),(e,a)=>{var l;const o=s,n=k,i=C,r=t,m=d("bt-loading");return u((v(),f("div",null,[(null==(l=p(X))?void 0:l.path)?g("",!0):(v(),_(L,{key:0,compData:{...e.compData,init:le}},null,8,["compData"])),c(o,{ref:"tamperRef",type:"",modelValue:p(J),"onUpdate:modelValue":a[0]||(a[0]=e=>h(J)?J.value=e:null),options:p(ee)},null,8,["modelValue","options"]),y("div",A,[y("div",F,[a[8]||(a[8]=y("img",{class:"mr-[.6rem]",width:"16",src:q,alt:""},null,-1)),a[9]||(a[9]=y("span",{class:"mr-1rem"},"拦截创建",-1)),c(n,{modelValue:p(Y).create,"onUpdate:modelValue":a[1]||(a[1]=e=>p(Y).create=e),onChange:a[2]||(a[2]=e=>ae(p(Y).create,1))},null,8,["modelValue"])]),c(i,{direction:"vertical",class:"!h-2rem !mx-1.6rem"}),y("div",N,[a[10]||(a[10]=y("img",{class:"mr-[.6rem]",width:"16",src:H,alt:""},null,-1)),a[11]||(a[11]=y("span",{class:"mr-1rem"},"拦截编辑",-1)),c(n,{modelValue:p(Y).edit,"onUpdate:modelValue":a[3]||(a[3]=e=>p(Y).edit=e),onChange:a[4]||(a[4]=e=>ae(p(Y).edit,2))},null,8,["modelValue"])]),c(i,{direction:"vertical",class:"!h-2rem !mx-1.6rem"}),y("div",O,[a[12]||(a[12]=y("img",{class:"mr-[.6rem]",width:"16",src:K,alt:""},null,-1)),a[13]||(a[13]=y("span",{class:"mr-1rem"},"拦截删除",-1)),c(n,{modelValue:p(Y).delete,"onUpdate:modelValue":a[5]||(a[5]=e=>p(Y).delete=e),onChange:a[6]||(a[6]=e=>ae(p(Y).delete,3))},null,8,["modelValue"])])]),y("div",P,[y("div",Q,[a[14]||(a[14]=V(" 开启高级设置 ",-1)),y("div",{class:"more flex items-center cursor-pointer pl-[1rem]",onClick:a[7]||(a[7]=e=>T.value=!p(T))},[y("div",S,j("".concat(p(T)?"折叠":"详情")),1),y("i",{class:x(["text-medium",p(T)?"svgtofont-el-arrow-up":"svgtofont-el-arrow-down"])},null,2)])]),p(T)?(v(),f("div",$,[(v(!0),f(w,null,b(p(W),(e,a)=>(v(),f("div",{class:"overall-config-content-item",key:a},[y("div",B,"拦截"+j(p(Z)[a]),1),y("div",E,[(v(!0),f(w,null,b(e,(e,a)=>(v(),f("div",{class:"overall-config-item",key:a},[y("span",G,"拦截"+j(p(I)[e]),1),c(n,{modelValue:p(X)["is_".concat(e)],"onUpdate:modelValue":a=>p(X)["is_".concat(e)]=a,onChange:a=>ae(p(X)["is_".concat(e)],"is_".concat(e))},null,8,["modelValue","onUpdate:modelValue","onChange"])]))),128))])]))),128))])):g("",!0)]),c(r,{class:"mt-2rem",options:[{content:"提示：当前配置默认拦截以上规则，请根据当前项目需求设置和配置规则"}]})])),[[m,p(M)],[m,"正在获取站点防篡改信息，请稍侯","title"]])}}}),[["__scopeId","data-v-de6f16d7"]]);export{J as default};
