File: /www/server/panel/BTPanel/static/js/useController6.js
import{k as o,w as n,f as i}from"./utils-lib.js?v=1777008528";import{r as d}from"./base-lib.js?v=1777008528";import{g as c,b as l,r as u,c as f}from"./useStore9.js?v=1777008528";import{actionType as g}from"./useController5.js?v=1777008528";import{g as m}from"./useStore8.js?v=1777008528";const p=i(),h=d(!1),{refs:{sshTabActive:y}}=m(),A=async(s,e)=>{try{s.limit=5,e&&(s.historyType="ALL");const t=await o({request:e?c({data:JSON.stringify(s)}):l(s),data:{data:Array,total:Number}});return{data:t.data,total:t.total,other:{}}}catch(t){return{data:[],total:0,other:{}}}},N=s=>{if(!s||typeof s!="string")return"-";const e=s.toLowerCase();return e.includes("edg/")?"Edge":e.includes("opr/")||e.includes("opera")?"Opera":e.includes("chrome")&&!e.includes("edg/")&&!e.includes("opr/")?"Chrome":e.includes("firefox")?"Firefox":e.includes("safari")&&!e.includes("chrome")?"Safari":e.includes("msie")||e.includes("trident/")?"IE":"Unknown"},R=async(s,e)=>{const t=s.deny_status;await n({title:"提示",content:t?"解封该IP后,将恢复此IP对服务器的访问,是否继续操作?":"封禁该IP后,将不再允许此IP访问服务器,是否继续操作?",icon:"warning-filled"});let r={address:s.address};t||(r={address:s.address,types:"drop",brief:e&&typeof e=="string"?e:"SSH登录日志页面点击IP手动封禁",domain:"",choose:"address"}),r={data:JSON.stringify(r)};const a=await I(r,t);return p.request(a),h.value=!0,a},I=async(s,e)=>{try{const t=await o({loading:"正在处理中,请稍后...",request:e?u(s):f(s)});return{msg:t.data[0].msg,status:t.data[0].status,data:{ip:t.data[0].ip}}}catch(t){return{msg:"操作失败",status:!1,data:{}}}},b=s=>{g.value="ALL",y.value="login",s.push("/firewall/ssh-manger")};export{R as a,N as b,A as g,h as i,b as o};