import{_ as a}from"./index105.js?v=1761009159";import{P as e,aK as t,k as l,l as s,ah as o,b as n,_ as c}from"./utils-lib.js?v=1761009159";import{c as i,r as p,q as u,H as d,I as r,y as v,v as m,x as f,e as h,B as b,z as x,Q as y,C as _,A as g,F as j,ba as w,G as k}from"./base-lib.js?v=1761009159";import{a as C,u as P,c as E}from"./column.js?v=1761009159";import{f as H}from"./validator.js?v=1761009159";import{u as N}from"./useStore4.js?v=1761009159";import{removeProtectExt as q,removeExcloud as I,getProofFind as V,addProtectExt as z,addExcloud as D}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const T={class:"pb-2rem"},A={class:"flex gap-col-1rem"},B={class:"flex flex-col justify-between"},F={class:"mt-8px leading-8 text-small list-disc ml-20px tamper-help-info"},G={key:0,class:"text-danger"},K=c(i({__name:"exclude-protect-ext",props:{compData:{default:{}}},setup(c,{expose:i}){const K=c,Q=n(),{siteInfo:R}=N(),S=p(),U=p(!1),J=p(!1),L=p([]),M=p("");p([]);const O=p(0),W=async a=>{const t={siteName:R.value.name,[O.value?"protectExt":"excludePath"]:a.path},l=O.value?q:I;(await e({loading:"正在删除".concat(O.value?"保护文件名":"排除路径","，请稍后..."),request:l(t),message:!0})).status&&Y()},X=()=>{H({type:"all",path:R.value.path,change:a=>{let e=M.value?M.value.split("\n"):[];e.includes(a)||e.push(a),M.value=e.join("\n")}})},Y=async()=>{U.value=!0;try{const{data:a}=await V({siteName:R.value.name});a&&(L.value=(O.value?a.protectExt:a.excludePath).map(a=>({path:a})))}catch(a){t(a)}finally{U.value=!1}},Z=async()=>{if(""===M.value)return Q.error("".concat(O.value?"保护文件":"排除路径","不能为空"));let a={siteName:R.value.name};O.value?a.protectExt=M.value:a.excludePath=M.value;(await e({loading:"正在添加".concat(O.value?"保护":"排除","，请稍后..."),request:O.value?z(a):D(a),message:!0})).status&&(M.value="",Y())},$=()=>{O.value="protect"===K.compData.childType?1:0,Y()},aa=[{label:"删除",value:"delete",event:async(a,e,t,l)=>{const s=async a=>{let e={siteName:R.value.name,[O.value?"protectExt":"excludePath"]:a.path};return O.value?await q(e):await I(e)};await a({title:"批量删除",content:"批量删除选中的名称或路径，防篡改开启时该路径将受保护，是否继续操作？",column:[{label:"".concat(O.value?"扩展名/文件名":"名称或路径"),prop:"path"},E()],onConfirm:async()=>(await e(s),Y(),!1)})}}],ea=p([C(),{label:"".concat(O.value?"扩展名/文件名":"名称或路径"),prop:"path"},P([{title:"删除",onClick:W}])]);return u($),i({init:$}),(e,t)=>{const n=l,c=k,i=s,p=o,u=a,C=d("bt-loading");return r((m(),f("div",T,[h(u,null,{"header-left":b(()=>[x("div",A,[h(n,{modelValue:v(M),"onUpdate:modelValue":t[0]||(t[0]=a=>y(M)?M.value=a:null),type:"textarea",rows:4,resize:"none",width:"38rem",placeholder:"".concat(v(O)?"受保护的文件或扩展名":"排除文件或目录","，每行一条")},null,8,["modelValue","placeholder"]),x("div",B,[x("span",null,[h(c,{type:"default",onClick:X},{default:b(()=>t[1]||(t[1]=[x("i",{class:"svgtofont-el-folder"},null,-1)])),_:1,__:[1]})]),h(c,{type:"default",onClick:Z},{default:b(()=>[_(" 添加"+g(v(O)?"保护":"排除"),1)]),_:1})])])]),"header-right":b(()=>t[2]||(t[2]=[])),content:b(()=>[r(h(i,{ref_key:"excludeTableRef",ref:S,column:v(ea),maxHeight:v(O)?380:420,data:v(L)},null,8,["column","maxHeight","data"]),[[C,v(J)]])]),"footer-left":b(()=>[h(p,{"table-ref":v(S),options:aa},null,8,["table-ref"])]),"footer-right":b(()=>t[3]||(t[3]=[])),_:1}),x("ul",F,[v(O)?(m(),f(j,{key:1},[t[4]||(t[4]=w('<li class="leading-2rem" data-v-54f2b08e><div data-v-54f2b08e>支持以下4种方式</div><div data-v-54f2b08e><span data-v-54f2b08e> 1. 文件扩展名，如： <code data-v-54f2b08e>php jsp</code></span><span data-v-54f2b08e> 2. 文件名，如： <code data-v-54f2b08e>bt.php、 index.php</code></span></div><div data-v-54f2b08e><span data-v-54f2b08e> 3. 文件全路径，如： <code data-v-54f2b08e>/bt.cn/1.txt</code></span><span data-v-54f2b08e> 4. 文件相对路径，如： <code data-v-54f2b08e>app/test.php</code></span></div></li><li data-v-54f2b08e>一般添加常见容易被篡改的扩展名即可，如html,php,js等</li>',2))],64)):(m(),f("li",G,"排除规则具备最高优先级，在此列表中的目录或文件名将不受保护"))])])),[[C,v(U)],[C,"正在获取防篡改配置信息，请稍侯","title"]])}}}),[["__scopeId","data-v-54f2b08e"]]);export{K as default};
