File: /www/server/panel/BTPanel/static/js/index49.js
import{e as q,_ as u,w as x,k as V,c as N,cR as H,K as h}from"./utils-lib.js?v=1777008528";import{_ as B}from"./index175.js?v=1777008528";import{d as O,e as z,l as S,s as P,f as U}from"./useMethod7.js?v=1777008528";import{g as T}from"./useStore8.js?v=1777008528";import{c as L,o as R,j as y,k as D,q as n,e as m,p as s,v as C,x as A,ap as G,z as M,r as K,H as $,w as j,a8 as Q,Q as E,C as J,y as W}from"./base-lib.js?v=1777008528";import{n as X,aA as Y,aB as Z}from"./firewall.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";import"./index3.js?v=1777008528";import"./index116.js?v=1777008528";import"./index.vue_vue_type_style_index_0_scoped_cdc7f4d3_lang.js?v=1777008528";const ee={class:"tab-header-operate"},te=L({__name:"index",setup(F,{expose:l}){const{refs:{firewallInfo:a}}=T(),_=async e=>{a.value.status=!e,e?q({title:"启用系统防火墙",area:46,component:()=>u(()=>import("./set-firewall.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),confirmText:"启用",showFooter:!0,compData:{callback:()=>{a.value.status=e}}}):(await x({icon:"question-filled",title:e?"启用系统防火墙":"停用系统防火墙",content:e?"推荐启用,启用系统防火墙后,可以更好的防护当前的服务器安全,是否继续操作?":"停用系统防火墙,服务器将失去安全防护,是否继续操作?"}),await V({loading:"正在"+(e?"启用系统防火墙":"停用系统防火墙")+",请稍后...",request:X({status:Number(e)}),message:!0}),a.value.status=e)},c=async e=>{a.value.ping=!e,await x({icon:"question-filled",title:e?"禁Ping":"解Ping",content:e?"禁PING后不影响服务器正常使用,但无法ping通服务器,您真的要禁PING吗?":"解除禁PING状态可能会被黑客发现您的服务器,您真的要解禁吗?"}),await V({loading:"正在"+(e?"禁Ping":"解Ping")+",请稍后...",request:Y({status:e?"0":"1"}),message:!0}),a.value.ping=e},r=async()=>{await x({icon:"question-filled",title:"清理缓存",content:"清理缓存后,系统将重新加载,是否继续操作?"}),await V({loading:"正在清理缓存,请稍后...",request:Z(),message:!0}),setTimeout(()=>{window.location.reload()},1e3)};return R(async()=>{await O()}),l({onChangeFirewall:_}),(e,t)=>{const d=G,f=M;return y(),D("div",ee,[t[3]||(t[3]=n("div",{class:"mr-4"},"防火墙开关",-1)),n("div",null,[m(d,{modelValue:s(a).status,"onUpdate:modelValue":t[0]||(t[0]=i=>s(a).status=i),width:36,onChange:_},null,8,["modelValue"])]),t[4]||(t[4]=n("div",{class:"bg-darker w-[1px] h-2rem mx-8"},null,-1)),t[5]||(t[5]=n("div",{class:"mr-4"},"禁ping",-1)),n("div",null,[m(d,{modelValue:s(a).ping,"onUpdate:modelValue":t[1]||(t[1]=i=>s(a).ping=i),width:36,onChange:c},null,8,["modelValue"])]),t[6]||(t[6]=n("div",{class:"bg-darker w-[1px] h-2rem mx-8"},null,-1)),m(f,{class:"ml-[1rem]",onClick:r},{default:C(()=>[...t[2]||(t[2]=[A("清理缓存",-1)])]),_:1})])}}}),ae=["innerHTML"],ce=L({__name:"index",setup(F){var t,d,f,i,I;const{refs:{firewallInfo:l,systemTabActive:a}}=T(),{adHideInfo:_}=N(),c=K(),r=$([{label:"端口规则:"+((t=l.value.port)!=null?t:"获取中..."),name:"port",render:()=>u(()=>import("./index401.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)},{label:"IP规则:"+(((d=l.value)==null?void 0:d.ip)||"获取中..."),name:"ip",lazy:!0,render:()=>u(()=>import("./index402.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)},{label:"端口转发:"+(((f=l.value)==null?void 0:f.trans)||"获取中..."),name:"forward",lazy:!0,render:()=>u(()=>import("./index319.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)},{label:"地区规则:"+(((i=l.value)==null?void 0:i.country)||"获取中..."),name:"area",lazy:!0,render:()=>u(()=>import("./index320.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)},..._.value.firewallMalicious?[]:[{label:"恶意IP自动封禁:"+(((I=l.value)==null?void 0:I.banned)||"获取中..."),name:"banned",lazy:!0,render:()=>u(()=>import("./index403.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)}]]),k=async()=>{c.value.onChangeFirewall(!0)},e=g=>{U.value="ALL"};return j(()=>l.value,g=>{if(g){const{port:o,ip:w,trans:b,country:v,banned:p}=g;r[0].label="端口规则:"+o,r[1].label="IP规则:"+w,r[2].label="端口转发:"+b,r[3].label="地区规则:"+v,r[4].label="恶意IP自动封禁:"+p}}),R(()=>{z()}),Q(()=>{a.value="port"}),(g,o)=>{const w=H,b=B,v=h;return y(),D("div",null,[m(te,{ref_key:"HeaderRef",ref:c},null,512),n("div",null,[m(w,{type:"card",modelValue:s(a),"onUpdate:modelValue":o[0]||(o[0]=p=>E(a)?a.value=p:null),options:s(r),onTabClick:e},null,8,["modelValue","options"]),s(l).status?W("",!0):(y(),J(b,{key:0,width:"38rem"},{content:C(()=>[n("div",{class:"content-mask"},[o[3]||(o[3]=n("i",{class:"svgtofont-el-warning text-warning mr-[4px] !text-extraLarge"},null,-1)),n("div",{class:"flex items-center"},[o[2]||(o[2]=A(" 未开启防火墙,请 ",-1)),n("span",{onClick:k,class:"bt-link"},"点击开启")])])]),_:1})),m(v,{modelValue:s(P),"onUpdate:modelValue":o[1]||(o[1]=p=>E(P)?P.value=p:null),width:"50rem",title:"正在初始化防火墙,请稍后...",area:54,showClose:!1},{default:C(()=>[n("div",{class:"flex flex-col bg-darkPrimary text-white leading-[2.2rem] h-[30rem] overflow-y-auto p-[1rem]",innerHTML:s(S)},null,8,ae)]),_:1},8,["modelValue"])])])}}});export{ce as default};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}