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