← Back
Editing: index485.js
import{aM as t,n as e,L as a,a6 as s,p as n,K as o,a7 as l,a8 as r,M as i,at as m,W as c,a2 as u}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as p}from"./index103.js?v=VERSION_NUMBER";import{j as d,r as _,s as f,c as y,q as h,v,e as b,A as w,x as B,y as j}from"./base-lib.js?v=VERSION_NUMBER";import{getDirAuth as L,getFileDeny as R,deleteDirAuth as E,delFileDeny as x}from"./site.js?v=VERSION_NUMBER";import{u as g}from"./useController5.js?v=VERSION_NUMBER";import{a as C,u as D}from"./column.js?v=VERSION_NUMBER";import{o as T}from"./useController6.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./useStore4.js?v=VERSION_NUMBER";import"./validator.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./useMethod5.js?v=VERSION_NUMBER";const k=d("wp-wordpress-security",(()=>({isRefreshLimitList:_(!1),isRefreshDenyList:_(!1)}))),{localRow:P}=f(g()),I={class:"flex flex-col"},O=y({__name:"limit",setup(u){const{localRow:d}=f(g()),{isRefreshLimitList:_}=f(k()),{BtOperation:y}=t({options:[{onClick:()=>{e({title:"添加限制访问",area:48,component:()=>a((()=>import("./limit-form.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:{isEdit:!1,siteId:d.value.id,getList:()=>{_.value=!0}},btn:!0})},type:"button",active:!0,label:"添加限制访问"}]}),R=r([{label:"批量删除",value:"delete",event:async(t,e,a,s)=>{await n({title:"批量删除限制访问规则",content:"批量删除选中的限制访问规则,该操作可能会存在风险,是否继续?"});let o=i.load("正在删除,请稍后...");try{const t=await Promise.all(a.value.map((async t=>{try{const{data:e}=await E({id:d.value.id,name:t.name});return e.status?{name:t.name,status:!0}:{name:t.name,status:!1}}catch(e){return{name:t.name,status:!1}}})));T({resultData:t,resultTitle:"删除限制访问规则"}),_.value=!0}catch(l){m(l)}finally{o.close()}}}]),{BtTable:x,BtPage:O,BtRecommendSearch:A,BtRefresh:q,BtColumn:M,BtBatch:V,BtTableCategory:S,BtErrorMask:N,tableRef:H,classList:K,refresh:W}=s({request:t=>(async()=>{try{const{data:t}=await L({id:P.value.id});return{data:t[P.value.name],total:0,other:{search_history:[]}}}catch(t){return{data:[],total:0,other:{search_history:[]}}}})(),columns:[C(),{label:"名称",prop:"name"},{label:"路径",prop:"site_dir"},D([{onClick:t=>{e({title:"添加限制访问",area:48,component:()=>a((()=>import("./limit-form.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:{isEdit:!0,siteId:d.value.id,row:t,getList:()=>{_.value=!0}},btn:!0})},title:"编辑"},{onClick:t=>{n({title:"删除限制访问规则【".concat(t.name,"】"),content:"删除选中的规则后,访问".concat(t.site_dir,"将不再需要安全验证,是否继续操作?"),icon:"warning-filled",type:"calc",onConfirm:async()=>{await o({loading:"正在删除,请稍后...",request:E({id:d.value.id,name:t.name}),message:!0,success:()=>{_.value=!0}})}})},title:"删除"}])],extension:[l(_),R]});return(t,e)=>{const a=c,s=p;return h(),v("div",null,[b(s,null,{"header-left":w((()=>[b(B(y))])),content:w((()=>[b(B(x))])),"footer-left":w((()=>[j("div",I,[b(B(V)),b(a,{options:[{content:"目录设置加密访问后,访问时需要输入账号密码才能访问"},{content:"例如我设置了加密访问 /test/ ,那我访问 http://aaa.com/test/ 时就要输入账号密码才能访问"}],class:"ml-[20px] mt-[20px]"})])])),_:1})])}}}),A={class:"flex flex-col"},q=y({__name:"deny",setup(u){const{localRow:d}=f(g()),{isRefreshDenyList:_}=f(k()),{BtOperation:y}=t({options:[{onClick:()=>{e({title:"添加拒绝访问",area:48,component:()=>a((()=>import("./deny-form.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:{isEdit:!1,siteName:d.value.name,getList:()=>{_.value=!0}},btn:!0})},type:"button",active:!0,label:"添加拒绝访问"}]}),L=r([{label:"删除",value:"delete",event:async(t,e,a,s)=>{await n({title:"批量删除拒绝访问规则",content:"批量删除选中的拒绝访问规则,该操作可能会存在风险,是否继续?"});let o=i.load("正在删除,请稍后...");try{const t=await Promise.all(a.value.map((async t=>{try{const{data:e}=await x({website:d.value.name,deny_name:t.name});return e.status?{name:t.name,status:!0}:{name:t.name,status:!1}}catch(e){return{name:t.name,status:!1}}})));T({resultData:t,resultTitle:"删除拒绝访问规则"}),_.value=!0}catch(l){m(l)}finally{o.close()}}}]),{BtTable:E,BtPage:I,BtRecommendSearch:O,BtRefresh:q,BtColumn:M,BtBatch:V,BtTableCategory:S,BtErrorMask:N,tableRef:H,classList:K,refresh:W}=s({request:t=>(async()=>{try{const{data:t}=await R({website:P.value.name});return{data:t,total:0,other:{search_history:[]}}}catch(t){return{data:[],total:0,other:{search_history:[]}}}})(),columns:[C(),{label:"名称",prop:"name"},{label:"路径",prop:"dir"},D([{onClick:t=>{e({title:"添加拒绝访问",area:48,component:()=>a((()=>import("./deny-form.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:{isEdit:!0,siteName:d.value.name,row:t,getList:()=>{_.value=!0}},btn:!0})},title:"编辑"},{onClick:t=>{n({title:"删除拒绝访问规则【".concat(t.name,"】"),content:"删除选中的规则后,访问".concat(t.dir,"该保护目录将失去防护,是否继续操作?"),icon:"warning-filled",type:"calc",onConfirm:async()=>{await o({loading:"正在删除,请稍后...",request:x({website:d.value.name,deny_name:t.name}),message:!0,success:()=>{_.value=!0}})}})},title:"删除"}])],extension:[l(_),L]});return(t,e)=>{const a=c,s=p;return h(),v("div",null,[b(s,null,{"header-left":w((()=>[b(B(y))])),content:w((()=>[b(B(E))])),"footer-left":w((()=>[j("div",A,[b(B(V)),b(a,{options:[{content:"后缀:禁止访问的文件后缀"},{content:"目录:规则会在这个目录内生效"}],class:"mt-4px"})])])),_:1})])}}}),M=y({__name:"index",setup(t){const e=_("access"),s=[{name:"access",label:"访问限制",render:()=>O},{name:"deny",label:"拒绝访问",render:()=>q},{name:"hotlink",label:"防盗链",render:()=>a((()=>import("./index205.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url)}],{BtTabs:n}=u({type:"card",options:s,value:e});return(t,e)=>(h(),v("div",null,[b(B(n))]))}});export{M as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel