import{c as e,o as a,r as s,v as l,x as t,e as r,B as d,y as m,z as o,ab as i,a9 as u}from"./base-lib.js?v=1761009159";import{aK as n,k as p,b as c}from"./utils-lib.js?v=1761009159";import{setFileDeny as f}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const b={class:"p-[20px]"},g=e({__name:"add-forbid-limit",props:{compData:{default:()=>({})}},emits:["close"],setup(e,{expose:g,emit:_}){const y=c(),x=e,w=_,h=a({suffix:x.compData.suffix||"php|jsp",deny_name:x.compData.name||"",dir:x.compData.dir||""}),D=s(!1),V=s(),j=a({dir:[{required:!0,message:"请输入需要禁止访问的目录",trigger:"blur"}],deny_name:[{required:!0,message:"请输入名称",trigger:"blur"}],suffix:[{required:!0,message:"请输入后缀",trigger:"blur"}]});return g({onConfirm:async e=>{await V.value.validate();try{D.value=!0;const e=await f({website:x.compData.website,...h,act:x.compData.name?"edit":"add"});e.status?(x.compData.name&&(e.msg="修改成功"),y.success(e.msg),x.compData.refresh(),w("close")):y.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:e.msg,type:"error",duration:0,showClose:!0})}catch(a){n(a)}finally{D.value=!1}}}),(e,a)=>{const s=p,n=i,c=u;return l(),t("div",b,[r(c,{ref_key:"forbidSiteForm",ref:V,rules:m(j),model:m(h),disabled:m(D)},{default:d(()=>[r(n,{label:"名称",prop:"deny_name"},{default:d(()=>[r(s,{modelValue:m(h).deny_name,"onUpdate:modelValue":a[0]||(a[0]=e=>m(h).deny_name=e),disabled:e.compData.name,width:"26rem"},null,8,["modelValue","disabled"])]),_:1}),r(n,{label:"后缀",prop:"suffix"},{default:d(()=>[r(s,{modelValue:m(h).suffix,"onUpdate:modelValue":a[1]||(a[1]=e=>m(h).suffix=e),width:"26rem"},null,8,["modelValue"])]),_:1}),r(n,{label:"访问路径",prop:"dir"},{default:d(()=>[r(s,{modelValue:m(h).dir,"onUpdate:modelValue":a[2]||(a[2]=e=>m(h).dir=e),placeholder:"URL中禁止访问的，如/api等",width:"26rem"},null,8,["modelValue"])]),_:1}),a[3]||(a[3]=o("ul",{class:"ml-6 mt-8 list-disc leading-10"},[o("li",{class:"text-secondary"},"后缀：禁止访问的文件后缀"),o("li",{class:"text-secondary"},"访问路径：如需要禁止https://www.bt.cn/api/，则填写/api即可")],-1))]),_:1,__:[3]},8,["rules","model","disabled"])])}}});export{g as default};
