HEX
Server: nginx/1.28.3
System: Linux ip-172-31-12-242 6.17.0-1007-aws #7~24.04.1-Ubuntu SMP Thu Jan 22 21:04:49 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/panel/BTPanel/static/js/page5.js
import{aa as U,t as L,J as x,f as o,w as B,b as S,P as D,p as E,a3 as O}from"./utils-lib.js?v=1777008528";import{_ as V}from"./index109.js?v=1777008528";import{_ as $}from"./index110.js?v=1777008528";import{e as i,bg as j,r as h,g as _,w as q,c as H,x as I,y as g,z as l,C as c,O as K,D as y,B as M,R as N,Q as W,A as G}from"./base-lib.js?v=1777008528";import{u as z}from"./hooks2.js?v=1777008528";import{u as J}from"./use-import-export.js?v=1777008528";import{G as Q,H as F,I as X,J as Y,K as Z,L as ee,M as te,N as ae,O as ne,P as se}from"./index432.js?v=1777008528";import{u as k}from"./column.js?v=1777008528";async function le(e){var p,f;const t=await Q(e),a=(f=(p=t.data)!=null?p:t)!=null?f:{};let n=[];if(Array.isArray(a))n=a;else if(a&&typeof a=="object"&&"list"in a){const{list:b}=a;Array.isArray(b)&&(n=b)}return n.length===0?{data:[],total:0}:e.rule.split("_")[0]==="ip"?{data:re(n),total:t.data.total}:{data:n,total:t.data.total}}const ie=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;function re(e){return e.map((t,a)=>ie.test(t[0])?{id:a,type:"ipv4",start_ip:t[0]||"",end_ip:t[1]||"",ps:t[2]||""}:{id:a,type:"ipv6",ip:t[0]||"",ps:t[1]||""})}async function Qe(e,t){return F(e,t)}async function Fe(e,t){return X(e,t)}async function oe(e,t){return await Y(e,{url_rule:t})}async function ue(e,t){const a="ua_".concat(e);return await Z(e,{[a]:t})}async function pe(e){return ne(e)}async function ce(e){return se(e)}async function de(e){return ee(e)}async function me(e){return te({rule:e})}async function ye(e){return await ae({rule:e})}function _e(e){var t,a;return e.type==="ipv6"||e.ip?(t=e.ip)!=null?t:"":e.start_ip&&e.end_ip?e.start_ip===e.end_ip?e.start_ip:"".concat(e.start_ip," - ").concat(e.end_ip):(a=e.start_ip)!=null?a:""}function R(e){return e.type?e.type:e.ip?"ipv6":"ipv4"}function fe(e,t){const a=e.split("_")[0],n={rule:e};if(a==="ip"){const s=t;n.type=R(s),n.type==="ipv6"?n.start_ip=s.ip:(n.start_ip=s.start_ip,n.end_ip=s.end_ip)}else a==="url"?n.url=t:a==="ua"&&(n.ua=t);return n}const be=(e,t)=>[{prop:"ip",label:"起始IP - 结束IP / IPv6地址",minWidth:200,render:a=>i("span",null,[_e(a)])},{prop:"type",label:"类型",width:80,render:a=>i(j,{type:a.type==="ipv6"?"warning":"success",size:"small"},{default:()=>[a.type==="ipv6"?"IPv6":"IPv4"]})},{prop:"ps",label:"备注",minWidth:200,showOverflowTooltip:!1,render:a=>i("input",{type:"text",value:a.ps||"",class:"bt-table-input w-full !whitespace-pre-line",onBlur:n=>{const s=n.target.value;a.ps!==s&&(a.ps=s,e(a))}},null)},k([{title:"删除",onClick:a=>t(a)}])],Ie=e=>[{prop:"url",label:"URL",minWidth:400,render:t=>i("span",{class:"break-all"},[t])},k([{title:"删除",onClick:t=>e(t)}])],ve=e=>[{prop:"ua",label:"UA",minWidth:400,render:t=>i("span",{class:"break-all"},[t])},k([{title:"删除",onClick:t=>e(t)}])];function he(e,t){switch(e.split("_")[0]){case"ip":return be(t.onSaveRemark,t.onDelete);case"url":return Ie(t.onDelete);case"ua":return ve(t.onDelete);default:return[]}}const v=[{key:"ip_white",label:"IP白名单",category:"ip",listType:"white"},{key:"ip_black",label:"IP黑名单",category:"ip",listType:"black"},{key:"ua_white",label:"UA白名单",category:"ua",listType:"white"},{key:"ua_black",label:"UA黑名单",category:"ua",listType:"black"},{key:"url_white",label:"URL白名单",category:"url",listType:"white"},{key:"url_black",label:"URL黑名单",category:"url",listType:"black"}],ke="ip_white",ge={ip_white:["所有规则对白名单中的IP段无效,包括IP黑名单和URL黑名单,IP白名单具备最高优先权","添加某个IP例子:192.168.10.6 起始IP为192.168.10.6 结束IP为192.168.10.6","添加多个IP例子:192.168.100.6-100 起始IP为192.168.100.6 结束IP为192.168.100.100","添加IP段例子:192.168.1.0/24 起始IP为192.168.1.1 结束IP为192.168.1.254","添加IP段例子:172.16.10.1/16 起始IP为172.16.1.1 结束IP为172.16.255.255",{isHtml:!0,content:'如其他地址段计算请参考 <a href="https://ipjisuanqi.com/" target="_blank" class="btlink">ip地址在线计算</a>'}],ip_black:["黑名单中的IP段将被禁止访问,IP白名单中已存在的除外","添加某个IP例子:192.168.10.6 起始IP为192.168.10.6 结束IP为192.168.10.6","添加多个IP例子:192.168.100.6-100 起始IP为192.168.100.6 结束IP为192.168.100.100","添加IP段例子:192.168.1.0/24 起始IP为192.168.1.1 结束IP为192.168.1.254","添加IP段例子:172.16.10.1/16 起始IP为172.16.1.1 结束IP为172.16.255.255",{isHtml:!0,content:'如其他地址段计算请参考 <a href="https://ipjisuanqi.com/" target="_blank" class="btlink">ip地址在线计算</a>'}],ua_white:["初始化阶段在客户端UA中查找关键词。谨慎使用。","可以在API接口使用作为一个秘钥的方式使用","查询到关键词直接跳过任何拦截"],ua_black:["初始化阶段在客户端UA中查找关键词。谨慎使用。","可以在API接口使用作为一个秘钥的方式使用","查询到关键词直接跳过任何拦截"],url_white:["所有规则对白名单中的URL无效,不包括IP黑名单。","当前URL白名单不支持带参数。","例子1 : /admin/admin.php?system=abc 添加地址: /admin/admin.php","例子2: /admin/1 1 为可变 1-99 添加地址为: /admin/[1-99]"],url_black:["禁止访问URL黑名单,URL白名单和IP白名单中存在时除外。","例子1 : /admin/admin.php?system=abc 添加地址: /admin/admin.php","例子2: /admin/1 1 为可变 1-99 添加地址为: /admin/[1-99]"]},r=h(ke),Pe=h("ipv4"),d=h(""),{BtTabs:Re,tabs:Te}=U({type:"card",options:v.map(e=>({label:e.label,name:e.key}))}),u=_(()=>{var e;return(e=v.find(t=>t.key===r.value))!=null?e:v[0]}),Ce=_(()=>u.value.category==="ip"),we=_(()=>{var e;return(e=ge[r.value])!=null?e:[]});q(Te,e=>{r.value=e,d.value="",m()});const T=z({request:async e=>{const{data:t,total:a}=await le({rule:r.value,p:e.p,limit:e.limit,...e.keyword?{keyword:e.keyword}:{}});return{data:t,total:a}},columns:_(()=>he(r.value,{onSaveRemark:Be,onDelete:Se}))}),{BtTable:Ae,BtPage:Ue,BtSearch:Le}=T,m=T.refresh;async function xe(){L({title:"添加".concat(u.value.label),area:"500px",component:()=>x(()=>import("./index446.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{listType:u.value.listType,ipType:Pe.value},btn:["添加","取消"],onConfirm:async()=>(m(),!0)})}async function P(){const e=d.value.trim(),t=o();let a=null;if(!e){o().error("请输入规则内容");return}const{category:n}=u.value,{listType:s}=u.value;try{n==="url"?a=await oe(s,e):n==="ua"&&(a=await ue(s,e)),t.request(a),d.value="",m()}catch(p){t.error("添加失败")}}async function Be(e){var t;try{const a=R(e),n={rule:r.value,type:a,ps:(t=e.ps)!=null?t:""};a==="ipv6"?n.start_ip=e.ip:(n.start_ip=e.start_ip,n.end_ip=e.end_ip),await ce(n),o().success("备注已更新")}catch(a){o().error("备注更新失败")}}async function Se(e){try{const t=fe(r.value,e),a=await pe(t);o().request(a),m()}catch(t){}}async function De(){const{openImport:e}=J();e({type:r.value,onImportSubmit:async t=>{const a=await de({rule:r.value,pdata:t});return a.status?o().success("导入成功"):o().error(a.msg||"导入失败"),a.status},onSuccess:()=>{m()}})}async function Ee(){try{(await ye(r.value)).status&&(window.open("/download?filename=/www/server/panel/data/".concat(r.value,".txt")),o().success("导出成功"))}catch(e){o().error("导出失败")}}async function Oe(){const e=o();let t=null;try{await B({content:"确认清空".concat(u.value.label,"?此操作不可恢复。")}),t=e.load("正在清空名单,请稍候...");const a=await me(r.value);o()[a.status?"success":"error"](a.msg),a.status&&m()}catch(a){}finally{t==null||t.close()}}const Ve={class:"flex flex-col"},$e={key:1,class:"flex items-center gap-2"},je={class:"flex"},qe=H({__name:"page",setup(e){const{mainHeight:t}=S(),a=_(()=>we.value.map(n=>n instanceof Object?n:{content:n}));return(n,s)=>{const p=D,f=E,b=$,C=V,w=O;return I(),g("div",Ve,[i(l(Re)),i(C,null,{"header-left":c(()=>[l(Ce)?(I(),K(p,{key:0,type:"primary",onClick:l(xe)},{default:c(()=>[y(" 添加"+M(l(u).label),1)]),_:1},8,["onClick"])):(I(),g("div",$e,[i(f,{modelValue:l(d),"onUpdate:modelValue":s[0]||(s[0]=A=>N(d)?d.value=A:null),placeholder:"".concat(l(u).category==="url"?"例如:^/api/admin/update":"请输入UA"),class:"!w-[300px]",clearable:"",onKeyup:W(l(P),["enter"])},null,8,["modelValue","placeholder","onKeyup"]),i(p,{type:"primary",onClick:l(P)},{default:c(()=>[...s[1]||(s[1]=[y("添加",-1)])]),_:1},8,["onClick"])])),G("div",je,[i(b,{style:{margin:".5rem 1rem",height:"2rem"}}),i(p,{onClick:l(De)},{default:c(()=>[...s[2]||(s[2]=[y("导入",-1)])]),_:1},8,["onClick"]),i(p,{onClick:l(Ee)},{default:c(()=>[...s[3]||(s[3]=[y("导出",-1)])]),_:1},8,["onClick"]),i(p,{onClick:l(Oe)},{default:c(()=>[...s[4]||(s[4]=[y("清空",-1)])]),_:1},8,["onClick"])])]),"header-right":c(()=>[i(l(Le),{placeholder:l(u).category==="ip"?"请输入IP/备注":l(u).category==="ua"?"请输入UA":"请输入URL",class:"!w-[270px]"},null,8,["placeholder"])]),content:c(()=>[i(l(Ae),{"max-height":l(t)-405},null,8,["max-height"])]),"footer-right":c(()=>[i(l(Ue))]),_:1}),i(w,{"list-style":"disc",options:l(a)},null,8,["options"])])}}}),Xe=Object.freeze(Object.defineProperty({__proto__:null,default:qe},Symbol.toStringTag,{value:"Module"}));export{Qe as a,Fe as b,Xe as p};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}