import{n as e,Q as a,P as r,W as t,O as o,l as s,ah as l,p as i}from"./utils-lib.js?v=1761009159";import{_ as n}from"./index105.js?v=1761009159";import{_ as d}from"./index114.js?v=1761009159";import{c as p,r as _,o as m,q as u,H as f,v as c,x as w,y as v,N as j,B as y,e as b,D as g,C as h,Q as P,I as T,G as x}from"./base-lib.js?v=1761009159";import{_ as A}from"./index133.js?v=1761009159";import{D as S,E}from"./firewall.js?v=1761009159";import{a as I}from"./column.js?v=1761009159";import{r as q,e as C,f as D}from"./useMethod6.js?v=1761009159";import{_ as V}from"./index.vue_vue_type_script_setup_true_lang11.js?v=1761009159";import{g as k}from"./useStore5.js?v=1761009159";import{_ as F}from"./index.vue_vue_type_script_setup_true_lang12.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./validator.js?v=1761009159";import"./index.vue_vue_type_style_index_0_scoped_cdc7f4d3_lang.js?v=1761009159";const H={class:"min-h-[30rem]"},U=p({__name:"index",setup(p){const{refs:{systemTabActive:U,firewallInfo:L}}=k(),O=_(),Q=_([]),R=_(""),B=_(0),G=_(!1),M=m({p:1,row:20}),N=(r,t)=>{e({title:r?"修改端口转发规则":"添加端口转发规则",area:44,component:()=>a(()=>import("./add-port-transmit.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),showFooter:!0,compData:{...t,isEdit:r,refreshFn:W}})},W=async()=>{"forward"===U.value&&await r({loading:G,request:S({query:R.value}),data:{data:[Array,Q],page:t(B)}})},z=(e,a)=>({operation:a,protocol:e.Protocol.toLowerCase(),S_Address:e.S_Address,S_Port:e.S_Port,T_Address:e.T_Address,T_Port:e.T_Port}),J=[I(),{label:"协议",prop:"Protocol"},{label:"源端口",prop:"S_Port"},{label:"目标IP",render:e=>e.T_Address?e.T_Address:"127.0.0.1"},{label:"目标端口",prop:"T_Port"},{label:"时间",prop:"addtime",renderHeader:()=>q("时间","-- : 表示面板数据库中未记录创建时间，规则从系统中直接读取，忽略即可")},{label:"备注",prop:"brief"},C({editEvent:e=>{N(!0,e)},deleteEvent:async e=>{await i({icon:"warning-filled",title:"删除端口转发规则【源端口："+e.S_Port+" -> 目标端口："+e.T_Port+"】",content:"删除选中规则后，该源端口将停止转发至目标端口，是否继续操作？"}),await r({loading:"正在删除IP规则，请稍后...",request:E(z(e,"remove")),message:!0,success:W})}})],K=[{label:"删除",value:"delete",event:async(e,a)=>{await D(e,a,async(e,a)=>await E(z(e,"remove")),{label:"端口",prop:"T_Address"},W)}}];return u(()=>W()),(e,a)=>{const r=A,t=x,i=o,p=s,_=l,m=d,u=n,S=f("bt-loading");return c(),w("div",H,[v(L).init_status?g("",!0):(c(),j(r,{key:0,width:"38rem"},{content:y(()=>[b(F)]),_:1})),b(u,null,{"header-left":y(()=>[b(t,{type:"primary",onClick:a[0]||(a[0]=e=>N())},{default:y(()=>a[6]||(a[6]=[h(" 添加端口转发 ",-1)])),_:1,__:[6]}),b(V,{type:"forward",refreshFn:W})]),"header-right":y(()=>[b(i,{class:"!w-[32rem]",modelValue:v(R),"onUpdate:modelValue":a[1]||(a[1]=e=>P(R)?R.value=e:null),onSearch:a[2]||(a[2]=e=>W()),placeholder:"请输入端口/来源"},null,8,["modelValue"])]),content:y(()=>[T(b(p,{ref_key:"portTransmitRef",ref:O,column:J,data:v(Q),description:"端口转发列表为空"},null,8,["data"]),[[S,v(G)],[S,"正在加载端口转发列表，请稍后...","title"]])]),"footer-left":y(()=>[b(_,{"table-ref":v(O),options:K},null,8,["table-ref"])]),"footer-right":y(()=>[b(m,{total:v(B),page:v(M).p,"onUpdate:page":a[3]||(a[3]=e=>v(M).p=e),row:v(M).row,"onUpdate:row":a[4]||(a[4]=e=>v(M).row=e),onChange:a[5]||(a[5]=e=>W()),name:"forward"},null,8,["total","page","row"])]),_:1})])}}});export{U as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
