← Back
Editing: index273.js
import{n as e,L as a,K as t,S as r,J as s,l,a0 as o,p as n}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as i}from"./index103.js?v=VERSION_NUMBER";import{_ as p}from"./index112.js?v=VERSION_NUMBER";import{c as d,r as _,k as m,e as u,p as c,G as f,q as y,v as g,x as j,M as v,A as b,C as w,B as x,P as h,H as S,y as E,z as k,D as q}from"./base-lib.js?v=VERSION_NUMBER";import{_ as A}from"./index130.js?v=VERSION_NUMBER";import{F,G as J}from"./firewall.js?v=VERSION_NUMBER";import{r as O,e as V,f as C}from"./useMethod6.js?v=VERSION_NUMBER";import{g as D}from"./useStore5.js?v=VERSION_NUMBER";import{a as H}from"./column.js?v=VERSION_NUMBER";import{_ as I}from"./index.vue_vue_type_script_setup_true_lang11.js?v=VERSION_NUMBER";import{_ as N}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"./validator.js?v=VERSION_NUMBER";import"./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang.js?v=VERSION_NUMBER";const P={class:"min-h-[30rem]"},T={class:"mt-16px leading-8 text-[1.2rem] list-disc ml-[2rem]"},U=d({__name:"index",setup(d){const{refs:{firewallInfo:U,systemTabActive:G}}=D(),L=_(null),M=_([]),R=_(""),z=_(0),B=_(!1),K=m({p:1,limit:20}),Q=(t,r)=>{e({title:t?"修改地区规则":"添加地区规则",area:44,component:()=>a((()=>import("./add-area-rule.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),showFooter:!0,compData:{...r,isEdit:t,refreshFn:W}})},W=async(e=1)=>{"area"===G.value&&await t({loading:B,request:F({data:JSON.stringify({...K,query:R.value})}),data:{data:[Array,M],page:r(z)}})},X=[H(),{label:"地区",render:e=>u("span",null,[e.country+"("+e.brief+")"])},{label:"策略",render:(e,a)=>u("span",{class:"text-"+("accept"===e.types?"primary":"danger")},["accept"==e.types?"放行":"禁止"])},{label:"端口",render:e=>u("span",null,[e.ports?e.ports:"全部"])},{label:"时间",prop:"addtime",renderHeader:()=>O("时间","-- : 表示面板数据库中未记录创建时间,规则从系统中直接读取,忽略即可")},V({editEvent:e=>Q(!0,e),deleteEvent:async e=>{await n({icon:"warning-filled",title:"删除地区规则",content:"删除选中规则后,该规则屏蔽的地区,端口将恢复正常访问,是否继续操作?"});const a={...e,s_port:e.start_port,d_port:e.ended_port,d_ip:e.ended_ip};delete a.start_port,a.ended_port,a.ended_ip,await t({loading:"正在删除规则,请稍后...",request:J({data:JSON.stringify(a)}),message:!0,success:W})}})],Y=[{label:"删除",value:"delete",event:async(e,a)=>{await C(e,a,(async e=>{const a={...e,s_port:e.start_port,d_port:e.ended_port,d_ip:e.ended_ip};return delete a.start_port,a.ended_port,a.ended_ip,await J({data:JSON.stringify(a)})}),{label:"地区",prop:"country"},W)}}];return c((()=>W())),(e,a)=>{const t=A,r=q,n=s,d=l,_=o,m=p,c=i,F=f("bt-loading");return y(),g("div",P,[j(U).init_status?w("",!0):(y(),v(t,{key:0,width:"38rem"},{content:b((()=>[u(N)])),_:1})),u(c,null,{"header-left":b((()=>[u(r,{type:"primary",onClick:a[0]||(a[0]=e=>Q())},{default:b((()=>a[6]||(a[6]=[x(" 添加地区规则 ")]))),_:1}),u(I,{type:"country_rule",refreshFn:W})])),"header-right":b((()=>[u(n,{class:"!w-[32rem]",modelValue:j(R),"onUpdate:modelValue":a[1]||(a[1]=e=>h(R)?R.value=e:null),onSearch:a[2]||(a[2]=e=>W()),placeholder:"请输入地区"},null,8,["modelValue"])])),content:b((()=>[S(u(d,{ref_key:"areaTableRef",ref:L,column:X,data:j(M),description:"地区列表为空"},null,8,["data"]),[[F,j(B)],[F,"正在加载地区列表,请稍后...","title"]])])),"footer-left":b((()=>[u(_,{"table-ref":j(L),options:Y},null,8,["table-ref"])])),"footer-right":b((()=>[u(m,{total:j(z),page:j(K).p,"onUpdate:page":a[3]||(a[3]=e=>j(K).p=e),row:j(K).limit,"onUpdate:row":a[4]||(a[4]=e=>j(K).limit=e),onChange:a[5]||(a[5]=e=>W()),name:"area"},null,8,["total","page","row"])])),_:1}),E("ul",T,[E("li",null,"每隔一个月会自动更新一次最新的IP池,最近更新时间:"+k(j(U).update_time),1)])])}}});export{U as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel