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