← Back
Editing: exclude-protect-ext.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{K as a,at as t,k as l,l as s,a0 as o,b as n,e as c}from"./utils-lib.js?v=VERSION_NUMBER";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,P as b,B as g,z as j,F as _,b7 as w,D as k}from"./base-lib.js?v=VERSION_NUMBER";import{a as P,u as C,c as E}from"./column.js?v=VERSION_NUMBER";import{f as H}from"./validator.js?v=VERSION_NUMBER";import{u as N}from"./useStore4.js?v=VERSION_NUMBER";import{removeProtectExt as q,removeExcloud as D,getProofFind as V,addProtectExt as z,addExcloud as I}from"./site.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";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(),J=i(!1),L=i(!1),M=i([]),O=i("");i([]);const Q=i(0),W=async e=>{const t={siteName:S.value.name,[Q.value?"protectExt":"excludePath"]:e.path},l=Q.value?q:D;(await a({loading:"正在删除".concat(Q.value?"保护文件名":"排除路径",",请稍后..."),request:l(t),message:!0})).status&&Y()},X=()=>{H({type:"all",path:S.value.path,change:e=>{let a=O.value?O.value.split("\n"):[];a.includes(e)||a.push(e),O.value=a.join("\n")}})},Y=async()=>{J.value=!0;try{const{data:e}=await V({siteName:S.value.name});e&&(M.value=(Q.value?e.protectExt:e.excludePath).map((e=>({path:e}))))}catch(e){t(e)}finally{J.value=!1}},Z=async()=>{if(""===O.value)return R.error("".concat(Q.value?"保护文件":"排除路径","不能为空"));let e={siteName:S.value.name};Q.value?e.protectExt=O.value:e.excludePath=O.value;(await a({loading:"正在添加".concat(Q.value?"保护":"排除",",请稍后..."),request:Q.value?z(e):I(e),message:!0})).status&&(O.value="",Y())},$=()=>{Q.value="protect"===K.compData.childType?1:0,Y()},ee=[{label:"删除",value:"delete",event:async(e,a,t,l)=>{const s=async e=>{let a={siteName:S.value.name,[Q.value?"protectExt":"excludePath"]:e.path};return Q.value?await q(a):await D(a)};await e({title:"批量删除",content:"批量删除选中的名称或路径,防篡改开启时该路径将受保护,是否继续操作?",column:[{label:"".concat(Q.value?"扩展名/文件名":"名称或路径"),prop:"path"},E()],onConfirm:async()=>(await a(s),Y(),!1)})}}],ae=i([P(),{label:"".concat(Q.value?"扩展名/文件名":"名称或路径"),prop:"path"},C([{title:"删除",onClick:W}])]);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((()=>[y("div",A,[h(n,{modelValue:v(O),"onUpdate:modelValue":t[0]||(t[0]=e=>b(O)?O.value=e:null),type:"textarea",rows:4,resize:"none",width:"38rem",placeholder:"".concat(v(Q)?"受保护的文件或扩展名":"排除文件或目录",",每行一条")},null,8,["modelValue","placeholder"]),y("div",B,[y("span",null,[h(c,{type:"default",onClick:X},{default:x((()=>t[1]||(t[1]=[y("i",{class:"svgtofont-el-folder"},null,-1)]))),_:1})]),h(c,{type:"default",onClick:Z},{default:x((()=>[g(" 添加"+j(v(Q)?"保护":"排除"),1)])),_:1})])])])),"header-right":x((()=>t[2]||(t[2]=[]))),content:x((()=>[r(h(p,{ref_key:"excludeTableRef",ref:U,column:v(ae),maxHeight:v(Q)?380:420,data:v(M)},null,8,["column","maxHeight","data"]),[[P,v(L)]])])),"footer-left":x((()=>[h(i,{"table-ref":v(U),options:ee},null,8,["table-ref"])])),"footer-right":x((()=>t[3]||(t[3]=[]))),_:1}),y("ul",F,[v(Q)?(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(J)],[P,"正在获取防篡改配置信息,请稍侯","title"]])}}}),[["__scopeId","data-v-e2e76f47"]]);export{K as default};
Save File
Cancel