← Back
Editing: index271.js
import{u as e,n as a,L as t,K as s,S as r,J as o,l as n,a0 as l,p as i,e as p}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as d}from"./index103.js?v=VERSION_NUMBER";import{_ as c}from"./index112.js?v=VERSION_NUMBER";import{c as m,r as u,k as _,e as f,B as y,p as g,G as v,q as w,v as b,x as h,M as I,A as P,C as j,P as x,H as A,D as S}from"./base-lib.js?v=VERSION_NUMBER";import{_ as k}from"./index130.js?v=VERSION_NUMBER";import{z as q,A as C,B as E}from"./firewall.js?v=VERSION_NUMBER";import{p as F}from"./validator.js?v=VERSION_NUMBER";import{u as L,r as T,e as V,b as D,f as H}from"./useMethod6.js?v=VERSION_NUMBER";import{a as J}from"./column.js?v=VERSION_NUMBER";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang11.js?v=VERSION_NUMBER";import{g as R}from"./useStore5.js?v=VERSION_NUMBER";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang12.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang.js?v=VERSION_NUMBER";const z={class:"min-h-[30rem]"},B=p(m({__name:"index",setup(p){const{payment:m}=e(),{refs:{systemTabActive:B,firewallInfo:M}}=R(),N=u(null),G=u([]),K=u(""),Z=u(0),Q=u(!1),W=_({p:1,row:20}),X=(e,s)=>{a({title:e?"修改IP规则":"添加IP规则",area:44,component:()=>t((()=>import("./add-ip-rules.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),showFooter:!0,compData:{...s,isEdit:e,refreshFn:Y}})},Y=async e=>{"ip"===B.value&&(e&&(D.value=e),await s({loading:Q,request:q({chain:D.value||"ALL",...W,query:K.value}),data:{data:[Array,G],page:r(Z)}}))},$=(e,a)=>{const t={operation:a,address:e.Address,strategy:e.Strategy,chain:e.Chain,family:e.Family,zone:e.Zone};return"remove"===a&&(t.stype=e.stype),t},ee=[{label:"删除",value:"delete",event:async(e,a)=>{await H(e,a,(async(e,a)=>{const t=$(e,"remove");return await E(t)}),{label:"IP地址",prop:"Address"},Y)}}],ae=[J(),{label:"IP地址",prop:"Address",width:120},{label:"IP归属地",render:e=>"ltd"!=m.value.authType?f("span",{class:"bt-link",onClick:()=>F({sourceId:116})},[y("点击查看")]):f("span",null,[(e.area.continent||"")+(e.area.info||"--")])},...L({changePolicy:async e=>{const a="accept"!==e.Strategy;await i({icon:"warning-filled",title:(a?"放行":"禁止")+"IP规则策略【"+e.Address+"】",content:"修改IP策略为“".concat(a?"放行":"禁止","”,设置后该IP将").concat(a?"恢复正常访问":"禁止访问服务器",",是否继续操作?")});const t={old_data:JSON.stringify(e),new_data:JSON.stringify({...$({...e,Strategy:a?"accept":"drop"},"add"),brief:e.brief})};await s({loading:"正在修改IP规则策略,请稍后...",request:C(t),message:!0,success:()=>Y()})},change:Y}),{label:"备注",prop:"brief"},{label:"时间",prop:"addtime",renderHeader:()=>T("时间","-- : 表示面板数据库中未记录创建时间,规则从系统中直接读取,忽略即可")},{label:"过期时间",prop:"expiry_date",width:160,render:e=>e.expiry_date?f("span",null,[e.expiry_date]):f("span",null,[y("--")])},V({editEvent:e=>X(!0,e),deleteEvent:async e=>{await i({icon:"warning-filled",title:"删除端口规则【"+e.Address+"】",content:"删除选中的规则后,该IP将使用默认放行的方式,是否继续操作?"}),await s({loading:"正在删除IP规则,请稍后...",request:E($(e,"remove")),message:!0,success:()=>Y()})}})];return g((()=>Y())),(e,a)=>{const t=k,s=S,r=o,i=n,p=l,m=c,u=d,_=v("bt-loading");return w(),b("div",z,[h(M).init_status?j("",!0):(w(),I(t,{key:0,width:"38rem"},{content:P((()=>[f(U)])),_:1})),f(u,null,{"header-left":P((()=>[f(s,{type:"primary",onClick:a[0]||(a[0]=e=>X())},{default:P((()=>a[6]||(a[6]=[y("添加IP规则")]))),_:1}),f(O,{type:"ip",refreshFn:Y})])),"header-right":P((()=>[f(r,{class:"!w-[32rem]",modelValue:h(K),"onUpdate:modelValue":a[1]||(a[1]=e=>x(K)?K.value=e:null),onSearch:a[2]||(a[2]=e=>Y()),placeholder:"请输入IP地址/备注"},null,8,["modelValue"])])),content:P((()=>[A(f(i,{ref_key:"ipTableRef",ref:N,column:ae,data:h(G),description:"IP列表为空"},null,8,["data"]),[[_,h(Q)],[_,"正在加载IP列表,请稍后...","title"]])])),"footer-left":P((()=>[f(p,{"table-ref":h(N),options:ee},null,8,["table-ref"])])),"footer-right":P((()=>[f(m,{ref:"ipRulesPager",total:h(Z),page:h(W).p,"onUpdate:page":a[3]||(a[3]=e=>h(W).p=e),row:h(W).row,"onUpdate:row":a[4]||(a[4]=e=>h(W).row=e),onChange:a[5]||(a[5]=e=>Y()),name:"ip"},null,8,["total","page","row"])])),_:1})])}}}),[["__scopeId","data-v-e139b88c"]]);export{B as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel