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/index401.js
import{c as ee,e as E,_ as S,k as g,c4 as te,c_ as ae,d3 as se,d4 as ne,K as oe,f as re,w as L,cZ as le}from"./utils-lib.js?v=1777008528";import{_ as ie}from"./index118.js?v=1777008528";import{c as pe,r as i,H as R,e as a,x as b,o as ue,n as ce,I as de,j as h,C as $,v as l,q as v,p as n,Q as q,J as me,k as _e,B as fe,s as B,F as ge,z as be,b5 as ve,b6 as Pe}from"./base-lib.js?v=1777008528";import{_ as ye}from"./index217.js?v=1777008528";import{aG as he,aH as ke,aI as we,aJ as H,aK as xe}from"./firewall.js?v=1777008528";import{e as De,g as Fe,p as Ve}from"./index3.js?v=1777008528";import{r as k,p as w,h as Ie,u as Te,f as x,g as Ae,a as Ce}from"./useMethod7.js?v=1777008528";import{_ as Ee}from"./index.vue_vue_type_script_setup_true_lang25.js?v=1777008528";import{g as Se}from"./useStore8.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";import"./index116.js?v=1777008528";const Le={class:"p-2rem"},Re={class:"!w-[6rem] inline-block"},$e={class:"max-w-[26rem] inline-block"},qe=pe({__name:"index",setup(Be){const O=re();ee();const{refs:{systemTabActive:N}}=Se(),D=i(),F=i(!1),c=i([]),u=R({p:1,row:20}),d=i(""),V=i(0),m=i({}),_=i(!1),f=R({processName:["进程名",""],processId:["进程pid",""],processTip:["启动命令",""]}),J=()=>{u.p=1,x.value="ALL",o()},M=async()=>{const e=await Ae("fail2ban");e.setup?E({title:"端口防扫描",area:60,compData:{type:"AntiScan",requestFn:()=>he()},component:()=>S(()=>import("./index323.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)}):(Ve({name:e.name,type:"i",pluginInfo:e}),O.warn("请先安装防暴破插件"))},I=e=>{E({title:e?"修改端口规则":"添加端口规则",area:44,component:()=>S(()=>import("./add-port-rule.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{...m.value,isEdit:e,refreshFn:o},showFooter:!0})},o=async e=>{N.value==="port"&&(e&&(x.value=e),await g({loading:F,data:{data:[Array,c],page:te(V)},request:ke({chain:x.value||"ALL",...u,query:d.value})}),c.value=c.value.map(t=>({...t,key:"".concat(t.Port,"_").concat(t.id,"_").concat(t.Family)})))},U=async(e,t)=>{await L({icon:"warning-filled",title:"删除端口规则【"+e.Port+"】",content:"删除当前端口规则,是否继续操作?"});const s={...P(e,"remove"),domain:e.domain};await g({loading:"正在删除端口规则,请稍后...",request:H(s,!1),message:!0,success:()=>o()})},P=(e,t)=>({operation:t,protocol:e.Protocol,address:e.Address,port:e.Port,strategy:e.Strategy,chain:e.Chain,brief:e.brief}),K=async e=>{const t=e.Strategy!=="accept";await L({icon:"warning-filled",title:"修改端口规则策略【"+e.Port+"】",content:"修改端口策略为“".concat(t?"放行":"禁止","”,设置后该端口将").concat(t?"恢复正常访问":"禁止访问服务器",",是否继续操作?")});const s={old_data:JSON.stringify({...e}),new_data:JSON.stringify({...P({...e,Strategy:t?"accept":"drop"},"add")})};await g({loading:"正在修改端口规则策略...",request:xe(s,!1),message:!0,success:()=>o()})},G=async e=>{m.value=e,await g({loading:"正在获取数据,请稍后...",request:we({port:e.Port}),success:({data:t})=>{f.processName[1]=t.process_name,f.processId[1]=t.process_pid,f.processTip[1]=t.process_cmd}}),_.value=!0},j=[{label:"删除",value:"delete",event:async(e,t)=>{await Ce(e,t,async(p,A)=>{const y={...P(p,"remove"),domain:p.domain};return await H(y,!1)},{label:"端口",prop:"Port"},o)}}],T=i([De({key:"key"}),{label:"协议",width:80,prop:"Protocol"},{label:"端口",width:150,renderHeader:()=>k("端口","防火墙会加载系统所有端口信息,IPV6端口无法与IPV4分开管理,非必要勿删除IPV6端口"),render:(e,t)=>(e.brief=e.brief||w[e.Port],a("span",{class:"mr-[1rem]"},[e.Port+(e.Family==="ipv6"?"(ipv6)":"")]))},{label:"状态",width:100,renderHeader:()=>k("状态","link","https://www.bt.cn/bbs/thread-4708-1-1.html"),render:(e,t)=>{var s,p;return a("div",null,[a("span",null,[e.status===0?"未使用":e.status===1&&!((s=e.Port)!=null&&s.includes("-"))?"外网不通":"正常"]),a("span",{class:e.status!==2||(p=e.Port)!=null&&p.includes("-")||e.Protocol==="udp"?"!hidden":"bt-link",onClick:()=>G(e)},[b("(详情)")])])}},...Ie({changePolicy:K,change:o}),{label:"来源",render:(e,t)=>a("div",null,[e.sid>0?a("span",{title:e.domain},[e.domain]):e.Address==="all"?a("span",null,[b("所有IP")]):a("span",{title:e.Address},[e.Address])])},{label:"备注",showOverflowTooltip:!0,render:e=>a("span",null,[e.brief||w[e.Port]||""])},{label:"时间",prop:"addtime",width:160,renderHeader:()=>k("时间","-- : 表示面板数据库中未记录更新时间,规则从系统中直接读取,忽略即可")},Te({editEvent:e=>{m.value=e,I(!0)},deleteEvent:U})]);return ue(()=>{ce(async()=>{try{const e=await window.$extension();if(!e||e.extensionElement({custom:{useOperate:Fe,portsPs:w,setPortConfig:s=>{T.value[2]=s,o()}}}).every(s=>s===!1))return o()}catch(e){return o()}})}),(e,t)=>{const s=be,p=ae,A=se,y=ne,z=ye,Q=ve,Z=Pe,W=oe,X=ie,C=de("bt-loading");return h(),$(X,null,{"header-left":l(()=>[a(s,{type:"primary",onClick:t[0]||(t[0]=r=>I(!1))},{default:l(()=>[...t[6]||(t[6]=[b(" 添加端口规则 ",-1)])]),_:1}),a(Ee,{type:"port",refreshFn:o}),a(s,{onClick:M},{default:l(()=>[...t[7]||(t[7]=[b("端口防扫描",-1)])]),_:1})]),"header-right":l(()=>[t[8]||(t[8]=v("div",{id:"extension-rulesTable"},null,-1)),a(p,{modelValue:n(d),"onUpdate:modelValue":t[1]||(t[1]=r=>q(d)?d.value=r:null),onSearch:J,placeholder:"请输入端口/来源",class:"!w-24rem"},null,8,["modelValue"])]),content:l(()=>[me(a(A,{ref_key:"portTableRef",ref:D,column:n(T),data:n(c),description:"端口列表为空"},null,8,["column","data"]),[[C,n(F)],[C,"正在加载端口列表,请稍后...","title"]])]),"footer-left":l(()=>[a(y,{"table-ref":n(D),options:j},null,8,["table-ref"])]),"footer-right":l(()=>[a(z,{ref:"portRulesPager",total:n(V),page:n(u).p,"onUpdate:page":t[2]||(t[2]=r=>n(u).p=r),row:n(u).row,"onUpdate:row":t[3]||(t[3]=r=>n(u).row=r),onChange:t[4]||(t[4]=r=>o()),name:"port"},null,8,["total","page","row"])]),popup:l(()=>[a(W,{title:n(m).Port+"-端口使用进程详情",modelValue:n(_),"onUpdate:modelValue":t[5]||(t[5]=r=>q(_)?_.value=r:null),area:42},{default:l(()=>[v("div",Le,[a(Z,{class:"margin-top table-descriptions",border:"",column:1},{default:l(()=>[(h(!0),_e(ge,null,fe(n(f),(r,Y)=>(h(),$(Q,{key:Y},{label:l(()=>[v("span",Re,B(r[0]),1)]),default:l(()=>[v("span",$e,B(r[1]),1)]),_:2},1024))),128))]),_:1})])]),_:1},8,["title","modelValue"])]),_:1})}}}),We=le(qe,[["__scopeId","data-v-785a79a0"]]);export{We as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}