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