PageSourceSearch

https://console.vpsbg.eu/assets/index.D2N-JlIb.js

js vpsbg.eu collected 2026-09-25 14:07:02 UTC 28,993 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.BQP95cMi.js","assets/index.JsRkwupY.js","assets/index.B6mlqhg_.css","assets/Box.BrTkpDa6.js","assets/TitleWithIcon.LYqR3QTW.js","assets/RangeDatepicker.CnRcZGtz.js","assets/Datepicker.BBW6YX9S.js","assets/addDays.C8wUzRgd.js","assets/differenceInDays.BI4rIzdi.js","assets/subMonths.CZOsaU4b.js","assets/differenceInSeconds.CJySEiea.js","assets/differenceInMonths.D7DNHDe6.js","assets/isToday.DZG53McW.js","assets/formatDistance.B9S_U5sr.js","assets/isBefore.bQIFWat2.js","assets/subDays.C0xI8SVf.js","assets/ModernChart.C3G-ABge.js","assets/FileSaver.min.CRsOhDjD.js","assets/colorUtils.CbTIV_o6.js","assets/Table.BIf-mB6C.js","assets/useListTableData.BZZVxBSk.js","assets/useColumns.DsOfxMZd.js","assets/AttachFloatingIp.ZkMRQAbI.js","assets/useAttachFloatingIpToServer.BYFL_SQQ.js","assets/useFloatingIps.lT2TIz7H.js","assets/useServersOptions.BeSDcuC2.js","assets/shallow.BT7fL84N.js","assets/handleLockServerMessage.DjDysY7T.js","assets/TableLoader.LN_TjOwe.js","assets/index.pbrgoI2c.js","assets/BackButton.DWcEBZ5W.js","assets/index.BXGDw18n.js","assets/index.D4QO5pMm.js","assets/OutlineErrorButton.BaS6M4wR.js","assets/ResponsiveDisabledTooltip.CYYKfKC8.js","assets/useUpdateWhitelistBlacklistIps.DeFSzW5P.js","assets/index.BzbiPRl7.js","assets/ActionButton.DkcFvScI.js","assets/constants.DkLGceHr.js"])))=>i.map(i=>d[i]);
2import{Y as _,aa as P,m as S,r as m,j as s,ac as G,I as u,L as N,E as se,a as h,aN as ae,Q as A,b5 as ie,b6 as U,aP as ne,b4 as W,T as l,am as re,b7 as le,al as oe,b as V,P as ce,b8 as de,H as q,d as B,aE as Y,b9 as X,ba as pe,bb as xe,bc as me,aR as ue,bd as be,be as he,bf as ge,bg as fe,i as Ie,R as H,a$ as Te,n as _e,bh as we,ae as K,e as Q,bi as ke,w as Ne,bj as je,bk as C,bl as O,q as ye}from"./index.JsRkwupY.js";import{B as E}from"./Box.BrTkpDa6.js";import{T as $}from"./TitleWithIcon.LYqR3QTW.js";import{A as ve}from"./AttachFloatingIp.ZkMRQAbI.js";import{T as k}from"./Table.BIf-mB6C.js";import{S as Pe}from"./index.pbrgoI2c.js";import{M as Se}from"./ModernChart.C3G-ABge.js";import{s as Ae}from"./subMonths.CZOsaU4b.js";import{B as Ce}from"./BackButton.DWcEBZ5W.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"console@72d704626a"};var e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="5c637b88-ea92-4d86-9976-3932ddbab967",t._sentryDebugIdIdentifier="sentry-dbid-5c637b88-ea92-4d86-9976-3932ddbab967")}catch{}})();const Oe=async t=>t?await S.get(`/network-protection/${t}`):void 0,Ee=()=>{const t=_();return P({queryFn:()=>Oe(t.id),queryKey:["network-protection-ip-general-info",t.id]})},Re=async(t,e)=>e?await S.get(`/network-protection/${e}/${t}`,{}):void 0,De=({type:t})=>{const e=_();return P({queryFn:()=>Re(t,e.id),queryKey:[`network-protection-${t}-list`,t,e.id],enabled:!0})},z=t=>{const{data:e,isPending:a,refetch:i}=De({type:t}),n=e==null?void 0:e.data;return{ips:(n==null?void 0:n.networks)||[],isPending:a,isActive:n==null?void 0:n.active,refetch:i}},Z=m.createContext({ipAddress:{},blacklistIps:[],blacklistIsActive:!1,blacklistIsPending:!1,whitelistIps:[],whitelistIsActive:!1,whitelistIsPending:!1,refetchIps:()=>{},updateIp:()=>{}}),Le=({children:t})=>{const{data:e,isPending:a,status:i,error:n}=Ee(),o=n,[r,d]=m.useState({}),c=m.useCallback((v,D)=>{d(te=>({...te,[v]:D}))},[]);m.useEffect(()=>{i==="success"&&d(e==null?void 0:e.data)},[e]);const{ips:x,isActive:b,isPending:g,refetch:j}=z("whitelist"),{ips:T,isActive:R,isPending:w,refetch:f}=z("blacklist"),y=m.useCallback(()=>{f(),j()},[f,j]);return s.jsx(Z.Provider,{value:{ipAddress:r,updateIp:c,blacklistIps:T,blacklistIsActive:R??!1,blacklistIsPending:w,refetchIps:y,whitelistIps:x,whitelistIsActive:b??!1,whitelistIsPending:g},children:(o==null?void 0:o.status)===404?s.jsx(G,{to:u.FLOATING_IPS_LISTING}):a&&r?s.jsx(N,{}):Object.keys(r).length===0?null:t})},J=()=>m.useContext(Z),Be=({menu:t,tabParam:e})=>{const[a,i]=m.useState(null);return m.useEffect(()=>{i(e?t.find(n=>n.key===e)||null:t[0])},[e]),{activeMenuItem:a,setActiveMenuItem:i}},ee=m.createContext({activeMenuItem:null,setActiveMenuItem:()=>{},menu:[]}),$e=({menu:t,tabParam:e,children:a})=>{const{activeMenuItem:i,setActiveMenuItem:n}=Be({menu:t,tabParam:e});return s.jsx(ee.Provider,{value:{activeMenuItem:i,setActiveMenuItem:n,menu:t},children:a})},F=()=>{const t=m.useContext(ee);if(!t)throw new Error("useBasicTabs must be used within a BasicTabsProvi
2der");return t},I=({menu:t,tabParam:e,children:a})=>s.jsx($e,{tabParam:e,menu:t,children:a}),Fe=({className:t,wrap:e=!0})=>{const{activeMenuItem:a,menu:i}=F(),n=se(),{t:o}=h();return s.jsx("div",{className:`flex items-center ${e?"flex-wrap":"flex-nowrap w-max min-w-max"} gap-4 ${t||""}`,children:i.map(r=>r.isHidden?null:s.jsxs(ae,{size:"large",type:"text","data-key":r.key,className:`flex items-center gap-2.5 max-sm:gap-1 max-sm:text-sm max-sm:!px-2 ${e?"":"flex-shrink-0"} hover:!bg-primary-light hover:!text-primary text-text ${r.key===(a==null?void 0:a.key)||(a==null?void 0:a.shouldAnotherTabActiveKey)===r.key?"bg-primary-light  text-primary":""}`,onClick:()=>{n(r.url)},children:[(r.key===(a==null?void 0:a.key)||(a==null?void 0:a.shouldAnotherTabActiveKey)===r.key)&&r.iconActive?r.iconActive:r.icon,r.label?o(r.label):null]},r.key))})},He=()=>{const{activeMenuItem:t}=F();return t!=null&&t.children?s.jsx(m.Suspense,{fallback:s.jsx("div",{className:"flex justify-center p-2",children:s.jsx(N,{size:"small"})}),children:s.jsx("div",{className:"pt-6 max-sm:pt-3",children:t.children})}):null};I.List=Fe;I.Content=He;const Ke=()=>{var d,c;const{t}=h(),{ipAddress:e,updateIp:a}=J(),{activeMenuItem:i}=F(),[n,o]=m.useState(!1),r=A(x=>x.isCollapsed);return ie({onUpdate:x=>{var b;((b=e.protected_service)==null?void 0:b.id)===x.server_id?a("isAssigning",!0):(a("isAssigning",!1),a("protected_service",{id:x.server_id||0,label:x.server_hostname||"",type:"server"}))}}),s.jsxs(E,{contentStart:!0,className:"max-sm:!gap-3",children:[s.jsxs("div",{className:"flex flex-wrap max-xl:justify-between items-start gap-2 justify-between w-full border-b border-border-secondary pb-4 relative max-sm:pb-3",children:[s.jsxs("div",{className:"grid xl:grid-cols-auto_second_col grid-cols-1 gap-5 max-xl:gap-2 max-xl:text-left justify-start items-center",children:[s.jsxs("div",{className:"flex items-center h-full gap-2.5 max-sm:gap-1 pr-5 border-r border-border-secondary max-sm:justify-start max-xl:pr-0 max-xl:border-0",children:[s.jsxs("div",{className:"flex items-center gap-2.5 max-sm:gap-1",children:[s.jsx($,{type:"h3",className:"!text-base !gap-2.5 max-sm:!gap-1 max-sm:!text-sm [&_span:last-child]:max-sm:!text-sm",label:(d=e==null?void 0:e.ip_address)==null?void 0:d.ip_address,icon:e.under_attack?s.jsx(U,{className:"text-error size-6 max-sm:!size-5"}):s.jsx(ne,{className:"text-success size-6 max-sm:!size-5"})}),e.under_attack?s.jsx(W,{type:"error",message:s.jsx(l,{className:"text-error",children:t("floatingIpsProtection.header.UNDER_ATTACK_ALERT")})}):null,e!=null&&e.protected_service?s.jsx(re,{className:"text-icon size-6 max-sm:size-5"}):null]}),e!=null&&e.protected_service?s.jsx(le,{to:u.SERVER.replace(":id",String(e.protected_service.id)),children:s.jsxs("div",{className:"flex items-center gap-2 max-sm:gap-1 text-h4/7 font-semibold text-link hover:text-link-hover max-sm:text-sm",children:[s.jsx(oe,{className:"text-primary size-6 max-sm:size-5 shrink-0"}),s.jsx("span",{className:`truncate max-w-[100px] sm:max-w-[220px] md:max-w-[150px] ${r?"lg:max-w-[220px] xl:max-w-[200px] 2xl:max-w-[420px]":"lg:max-w-[140px] xl:max-w-[140px] 2xl:max-w-[360px]"}`,children:e.protected_service.label})]})}):null,e.isAssigning?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{size:"small"}),s.jsx(l,{children:"Attaching..."})]}):null]}),s.jsxs(l,{className:"max-sm:text-xs",children:[t("floatingIpsProtection.header.EXPIRATION_DATE")," ",s.jsx("strong",{children:V(e.expiry_at,"dd MMM y")})]})]}),s.jsx(ce,{className:"shrink-0 max-md:w-[35px] max-md:h-[35px] max-md:px-0",disabled:e.isAssigning,icon:s.jsx(de,{className:"btn-icon-fixed size-6 max-md:size-4"}),"aria-label":t("floatingIpsProtection.header.ATTACH_TO_SERVER_BUTTON"),onClick:()=>{o(!0)},children:s.jsx("span",{className:"hidden md:inline",children:e!=null&&e.protected_service?t("floatingIpsProtection.header.ATTACH_TO_SERVER_BUTTON"):t("floatingIpsProtection.header.ATTACH_TO_SERVER_BUTTON_PLAIN")})})]}),s.jsx(ve,{isOpen:n,handleIsOpen:(x,b,g)=>{g&&a("protected_service",void 0),o(!1)},ids:[e.floating_ip_id||0],serverId:(c=e.protected_service)==null?void 0:c.id,isIpv6:e.ip_address.version===6}),s.jsx("div",{className:"w-full [&_button]:max-sm:text-sm",children:s.jsx(q,{unstyled:!0,activeKey:i==null?void 0:i.key,activeKeyAttr:"data-key",containerClassName:"flex items-center gap-4 max-sm:gap-3 w-full",children:s.jsx(I.List,{wrap:!1,className:"max-sm:!gap-3"})})})]})},p=(t,e,a,i)=>{const n=t<1e3?t:t/1e3,o=()=>{switch(e){case"bps":return t<1e3?"Mbps":"Gbps";
2case"pps":return t<1e3?"pps":"Kpps";default:return""}};return`${n.toFixed(a)} ${i?o().replace("ps","").toUpperCase():o()}`},ze=t=>[{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.sourceTable.FIRST_COL"),dataIndex:"port",key:"port",render:e=>s.jsx(l,{children:e})},{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.sourceTable.SECOND_COL"),dataIndex:"name",key:"name",render:e=>s.jsx(l,{children:e})},{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.sourceTable.THIRD_COL"),dataIndex:"peak_bandwidth",key:"peak_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.peak_bandwidth-a.peak_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2)})}],Me=t=>[{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.destinationTable.FIRST_COL"),dataIndex:"port",key:"port",render:e=>s.jsx(l,{children:e})},{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.destinationTable.SECOND_COL"),dataIndex:"name",key:"name",render:e=>s.jsx(l,{children:e})},{title:t("floatingIpsProtection.attackDetails.tabs.topPorts.destinationTable.THIRD_COL"),dataIndex:"peak_bandwidth",key:"peak_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.peak_bandwidth-a.peak_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2)})}],Ge=({topPorts:t})=>{var x,b;const{t:e}=h(),[a,i]=m.useState("tcp"),n=A(g=>g.isCollapsed),{lg:o,xl:r}=B(),c=o||!o&&r&&!n;return s.jsxs("div",{className:"w-full relative",children:[s.jsxs("div",{className:"flex items-center gap-2 relative top-0 mb-4 justify-start xl:absolute xl:-top-14 xl:right-0 xl:mb-0 xl:justify-end",children:[s.jsx(l,{children:"TCP"}),s.jsx(Pe,{checked:a==="udp",onChange:g=>i(g?"udp":"tcp")}),s.jsx(l,{children:"UDP"})]}),s.jsxs("div",{className:`grid ${c?"grid-cols-1":"grid-cols-2"} gap-4`,children:[s.jsx(k,{noResultsLabel:e("floatingIpsProtection.attackDetails.tabs.topPorts.NO_RESULTS_CONTENT"),rowKey:"number",columns:ze(e),dataSource:(x=t==null?void 0:t[a])==null?void 0:x.source,paginationConfig:!1,scroll:{x:"calc(300px + 40%)"}}),s.jsx(k,{noResultsLabel:e("floatingIpsProtection.attackDetails.tabs.topPorts.NO_RESULTS_CONTENT"),rowKey:"number",columns:Me(e),dataSource:(b=t==null?void 0:t[a])==null?void 0:b.destination,paginationConfig:!1,scroll:{x:"calc(300px + 40%)"}})]})]})},Ue=t=>[{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.FIRST_COL"),dataIndex:"number",key:"number",render:e=>s.jsx("div",{className:"flex items-center gap-2.5",children:s.jsx(l,{children:e})})},{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.SECOND_COL"),dataIndex:"name",key:"name",render:e=>s.jsx(l,{children:e})},{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.THIRD_COL"),dataIndex:"peak_bandwidth",key:"peak_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.peak_bandwidth-a.peak_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.FOURTH_COL"),dataIndex:"total_bandwidth",key:"total_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.total_bandwidth-a.total_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2,!0)})},{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.FIFTH_COL"),dataIndex:"peak_pps",key:"peak_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topProtocols.table.SIXTH_COL"),dataIndex:"total_pps",key:"total_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2,!0)})}],We=({topProtocols:t})=>{const{t:e}=h();return s.jsx("div",{className:"w-full",children:s.jsx(k,{noResultsLabel:e("floatingIpsProtection.attackDetails.tabs.topProtocols.table.NO_RESULTS_CONTENT"),rowKey:"name",columns:Ue(e),dataSource:t,paginationConfig:!1})})},Ve=t=>[{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.FIRST_COL"),dataIndex:"asn",key:"asn",render:(e,a,i)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Y,{preview:!1,src:X(a.country),className:"!min-w-[20px] !min-h-[13px] !w-[20px] !h-[13px] max-sm:!min-w-[24px] max-sm:!min-h-[15px] max-sm:!w-[24px] max-sm:!h-[15px]"})," ",e]},`${a.asn}-${i}`)}
2,{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.SECOND_COL"),dataIndex:"name",key:"name"},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.THIRD_COL"),dataIndex:"peak_bandwidth",key:"peak_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.peak_bandwidth-a.peak_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.FOURTH_COL"),dataIndex:"total_bandwidth",key:"total_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.total_bandwidth-a.total_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2,!0)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.FIFTH_COL"),dataIndex:"peak_pps",key:"peak_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.SIXTH_COL"),dataIndex:"total_pps",key:"total_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2,!0)})}],qe=({topSourceAsns:t})=>{const{t:e}=h();return s.jsx("div",{className:"w-full",children:s.jsx(k,{noResultsLabel:e("floatingIpsProtection.attackDetails.tabs.topSourceASNS.table.NO_RESULTS_CONTENT"),rowKey:"asn",columns:Ve(e),dataSource:t,paginationConfig:!1})})},Ye=t=>[{title:t("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.FIRST_COL"),dataIndex:"ip",key:"ip",render:(e,a,i)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Y,{preview:!1,src:X(a.country),className:"!min-w-[20px] !min-h-[13px] !w-[20px] !h-[13px] max-sm:!min-w-[24px] max-sm:!min-h-[15px] max-sm:!w-[24px] max-sm:!h-[15px]"})," ",e]},`${a.ip}-${i}`)},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.SECOND_COL"),dataIndex:"peak_bandwidth",key:"peak_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.peak_bandwidth-a.peak_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.THIRD_COL"),dataIndex:"total_bandwidth",key:"total_bandwidth",className:"min-w-[170px]",onHeaderCell:()=>({className:"min-w-[170px]"}),sorter:(e,a)=>e.total_bandwidth-a.total_bandwidth,render:e=>s.jsx(l,{children:p(e,"bps",2,!0)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.FOURTH_COL"),dataIndex:"peak_pps",key:"peak_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2)})},{title:t("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.FIFTH_COL"),dataIndex:"total_pps",key:"total_pps",className:"min-w-[120px]",onHeaderCell:()=>({className:"min-w-[120px]"}),render:e=>s.jsx(l,{children:p(e,"pps",2,!0)})}],Xe=({topSourceIps:t})=>{const{t:e}=h();return s.jsx("div",{className:"w-full",children:s.jsx(k,{noResultsLabel:e("floatingIpsProtection.attackDetails.tabs.topSourceIps.table.NO_RESULTS_CONTENT"),rowKey:"ip",columns:Ye(e),dataSource:t,paginationConfig:!1})})},Qe=({attackId:t,ipId:e,attack:a})=>[{key:"",label:"floatingIpsProtection.attackDetails.tabs.topSourceIps.TITLE",children:s.jsx(Xe,{topSourceIps:a.top_source_ips}),icon:s.jsx(xe,{className:"size-5 text-primary"}),iconActive:s.jsx(pe,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB_ATTACK.replace(":id",String(e)).replace(":tab","attack").replace(":attackId",String(t))},{key:"top-source-asns",label:"floatingIpsProtection.attackDetails.tabs.topSourceASNS.TITLE",children:s.jsx(qe,{topSourceAsns:a.top_source_asns}),icon:s.jsx(ue,{className:"size-5 text-primary"}),iconActive:s.jsx(me,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB_ATTACK_TAB.replace(":id",String(e)).replace(":tab","attack").replace(":attackId",String(t)).replace(":attackIdTab","top-source-asns")},{key:"top-protocols",label:"floatingIpsProtection.attackDetails.tabs.topProtocols.TITLE",icon:s.jsx(he,{className:"size-5 text-primary"}),iconActive:s.jsx(be,{className:"size-5 text-primary"}),children:s.jsx(We,{topProtocols:a.top_protocols}),url:u.NETWORK_PROTECTION_TAB_ATTACK_TAB.replace(":id",String(e)).replace(":tab","attack").replace(":attackId",String(t)).replace(":attackIdTab","top-protocols")}
2,{key:"top-ports",label:"floatingIpsProtection.attackDetails.tabs.topPorts.TITLE",children:s.jsx(Ge,{topPorts:a.top_ports}),icon:s.jsx(fe,{className:"size-5 text-primary"}),iconActive:s.jsx(ge,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB_ATTACK_TAB.replace(":id",String(e)).replace(":tab","attack").replace(":attackId",String(t)).replace(":attackIdTab","top-ports")}],{t:L}=Ie,M=t=>{switch(t){case"high":return{className:"text-red-600 bg-red-300 border-red-100",label:L("floatingIpsProtection.attackDetails.headerBar.SEVERITY_HIGH")};case"middle":return{className:"text-orange-600 bg-orange-100 border-orange-300",label:L("floatingIpsProtection.attackDetails.headerBar.SEVERITY_MID")};case"low":return{className:"text-green-600 bg-green-100 border-green-300",label:L("floatingIpsProtection.attackDetails.headerBar.SEVERITY_LOW")}}},Ze=t=>{var i,n;const{t:e}=h();return t?[{id:"attack-id",title:e("floatingIpsProtection.attackDetails.headerBar.ATTACK_ID"),value:t.id},{id:"status",title:e("floatingIpsProtection.attackDetails.headerBar.STATUS"),value:s.jsxs(H.Fragment,{children:[t.ongoing?s.jsx(U,{className:"text-error size-5 sm:size-7"}):s.jsx(Te,{className:"text-success size-5 sm:size-7"}),s.jsx("span",{className:"whitespace-nowrap",children:t.ongoing?e("floatingIpsProtection.attackDetails.headerBar.STATUS_ONGOING"):e("floatingIpsProtection.attackDetails.headerBar.STATUS_FINISHED")})]})},{id:"severity",title:e("floatingIpsProtection.attackDetails.headerBar.SEVERITY"),value:s.jsx(H.Fragment,{children:s.jsx("span",{className:`px-2 py-[2px] max-sm:py-0 border rounded-sm transition-all block text-xs leading-5 whitespace-nowrap max-sm:ml-1 ${(i=M(t.severity))==null?void 0:i.className}`,children:(n=M(t.severity))==null?void 0:n.label})})},{id:"detector",title:e("floatingIpsProtection.attackDetails.headerBar.DETECTOR"),value:t.detector}]:[]},Je=({attack:t})=>{const e=Ze(t),a=A(c=>c.isCollapsed),{lg:i,xl:n}=B(),d=!n||!i&&n&&a?"flex flex-wrap items-center justify-center gap-14 max-2xl:gap-4":"grid grid-cols-1 sm:grid-cols-2 items-center gap-x-14 gap-y-2 max-sm:gap-y-3 max-2xl:gap-x-4";return s.jsx("div",{className:`${d} bg-bg-container rounded-lg py-5 px-6 mb-6 max-sm:mb-3 max-sm:p-4`,children:e.map(c=>s.jsxs(l,{className:"flex items-center gap-2 sm:[&]:text-base max-sm:[&]:text-sm max-sm:gap-1",children:[s.jsx("strong",{className:"font-semibold",children:c.title})," ",c.value]},c.id))})},et=Ae(new Date,3),tt=async(t,e,a)=>!e||!a?void 0:await S.get(`/network-protection/${e}/attacks/${a}/bandwidth`,{params:{type:t,"filter[start]":et.getTime(),"filter[end]":new Date().getTime()}}),st=t=>{const e=_();return P({queryFn:()=>tt(t,e.id,e.attackId),queryKey:["network-protection-attack-bandwidth",e.id,e.attackId,t],refetchOnWindowFocus:!1})},at=[{value:"bandwidth",label:"BPS"},{value:"pps",label:"PPS"}],it=[{value:"as",label:"ASN"},{value:"protocol",label:"Protocols"}],nt=()=>{const{t}=h(),{control:e,watch:a}=_e({defaultValues:{type:"as",selectedMetric:"bandwidth"}}),i=a("type"),n=a("selectedMetric"),{data:o,isPending:r}=st(i),d=o==null?void 0:o.data,c=d==null?void 0:d.data,x=["blue-500","cyan-500","volcano-400","gold-400","green-500","lime-400","magenta-500","orange-500","red-500","purple-500","volcano-800"],b=m.useMemo(()=>{var w;return c!=null&&c.length?(((w=c[0])==null?void 0:w.lanes.map(f=>f.name))||[]).map(f=>({label:f==="total"?"Total":i==="as"?`AS${f}`:f,data:c.map(y=>{var v;return{x:new Date(y.timestamp*1e3),y:((v=y.lanes.find(D=>D.name===f))==null?void 0:v[n])||0}})})):[]},[c,n,i]),g=m.useMemo(()=>T=>p(T,n==="bandwidth"?"bps":"pps",2),[n]),j=m.useMemo(()=>{const T=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return`vpsbg_${n==="bandwidth"?"bandwidth":"packets"}_${i==="as"?"asn":"protocol"}_${T}.png`},[n,i]);return s.jsxs(E,{contentStart:!0,className:"min-w-0",children:[s.jsxs("div",{className:"w-full flex items-center justify-between gap-4 max-sm:flex-col max-sm:items-start max-sm:gap-4",children:[s.jsx($,{type:"h3",label:t("floatingIpsProtection.attackDetails.graphBox.TITLE"),icon:s.jsx(we,{className:"text-primary size-8"})}),s.jsxs("div",{className:"flex items-center gap-4 max-sm:w-full max-sm:justify-between",children:[s.jsx(K,{size:"small",className:"min-w-24 max-sm:flex-1",control:e,options:it,name:"type"}),s.jsx(K,{size:"small",className:"min-w-24 max-sm:flex-1",control:e,options:at,name:"selectedMetric"})]})]}),s.jsx("div",{className:"w-full h-full min-h-96",children:!r&&b.length>0?s.jsx(Se,{series:b,height:400,colors:x,showLegend:!0,controls:{showDownload:!0,showResetZoom:!0,downloadFilename:j},customYAxisFormatter:g,dateFormat:{xAxisFormat:"HH:mm",tooltipOptions:{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}}}):s.jsx(N,{})})]})},rt=async(t,e)=>!t||!e?void 0:await S.get(`/network-protection/${t}/attacks/${e}`,{}),lt=()=>{const t=_();return P({queryFn:()=>rt(t==null?void 0:t.id,t==null?void 0:t.attackId),queryKey:["network-protection-get-attack",t==null?void 0:t.id,t==null?void 0:t.attackId]})},ot=()=>{const{data:t,isPending:e,error:a}=lt();return{attack:t==null?void 0:t.data,isPending:e,error:a}},ct=(t,e)=>
2[{id:"start-time",title:t("floatingIpsProtection.attackDetails.overviewBox.START_TIME"),isDate:!0,value:e.started_at},{id:"end-time",title:t("floatingIpsProtection.attackDetails.overviewBox.END_TIME"),isDate:!0,value:e.ended_at},{id:"init-bandwidth",title:t("floatingIpsProtection.attackDetails.overviewBox.INITIAL_BANDWIDTH"),value:p(e.initial_bandwidth,"bps",2)},{id:"peak-bandwidth",title:t("floatingIpsProtection.attackDetails.overviewBox.PEAK_BANDWIDTH"),value:p(e.peak_bandwidth,"bps",2)},{id:"init-pps",title:t("floatingIpsProtection.attackDetails.overviewBox.INITIAL_PPS"),value:p(e.initial_pps,"pps",2)},{id:"peak-pps",title:t("floatingIpsProtection.attackDetails.overviewBox.PEAK_PPS"),value:p(e.peak_pps,"pps",2)}],dt=({attack:t})=>{const{t:e}=h(),a=ct(e,t);return s.jsx(E,{contentStart:!0,children:s.jsxs("div",{className:"w-full",children:[s.jsx($,{label:e("floatingIpsProtection.attackDetails.overviewBox.TITLE"),type:"h3",className:"mb-6 max-sm:mb-4",icon:s.jsx(Q,{className:"size-8 text-primary"})}),s.jsx("ul",{className:"grid grid-cols-2 gap-x-4 gap-y-4 justify-between mb-8 max-sm:mb-6",children:a.map(i=>s.jsxs("li",{className:"flex flex-col text-sm min-[391px]:text-base text-text gap-1 max-sm:gap-0",children:[s.jsx("span",{className:"font-semibold",children:i.title}),i.isDate?V(i.value):i.value]},i.id))}),s.jsx(W,{type:"warning",message:s.jsxs("div",{className:"space-y-3 max-sm:p-1",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-sm min-[391px]:text-base",children:e("floatingIpsProtection.attackDetails.overviewBox.warningAlert.REASON_LABEL")}),s.jsx(l,{className:"text-text text-sm min-[391px]:text-base",children:t.reason})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-semibold text-sm min-[391px]:text-base",children:e("floatingIpsProtection.attackDetails.overviewBox.warningAlert.DESCRIPTION_LABEL")}),s.jsx(l,{className:"text-text text-sm min-[391px]:text-base",children:t.description})]})]})})]})})},pt=()=>{const{attack:t,isPending:e,error:a}=ot(),i=a,n=_(),o=A(b=>b.isCollapsed),{xl:r,xl1440:d}=B(),x=!r&&d&&!o?"xl:grid-cols-1":"";return(i==null?void 0:i.status)===404?s.jsx(G,{to:u.NETWORK_PROTECTION.replace(":id",(n==null?void 0:n.id)||"")}):e?s.jsx(N,{}):t&&s.jsxs("div",{children:[s.jsx(Je,{attack:t}),s.jsxs("div",{className:`grid grid-cols-[2fr_1fr] max-xl:grid-cols-1 gap-6 mb-6 max-sm:gap-3 max-sm:mb-3 ${x}`,children:[s.jsx(nt,{}),s.jsx(dt,{attack:t})]}),s.jsx(E,{contentStart:!0,children:s.jsx("div",{className:"w-full",children:s.jsxs(I,{menu:Qe({attackId:t.id,ipId:n==null?void 0:n.id,attack:t}),tabParam:n.attackIdTab||"",children:[s.jsx(q,{unstyled:!0,activeKey:n.attackIdTab||"",activeKeyAttr:"data-key",containerClassName:"flex items-center gap-4 max-sm:gap-3 w-full",children:s.jsx(I.List,{wrap:!1,className:"pr-32 max-lg:pr-0 max-sm:!gap-3"})}),s.jsx(I.Content,{})]})})})]})},xt=C(()=>O(()=>import("./index.BQP95cMi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]))),mt=C(()=>O(()=>import("./index.BXGDw18n.js"),__vite__mapDeps([31,1,2,20,3,19,5,6,7,8,9,10,11,12,13,14,15,4,21,22,23,24,25,26,27,28,29,16,17,18,30]))),ut=C(()=>O(()=>import("./index.D4QO5pMm.js"),__vite__mapDeps([32,1,2,3,33,4,34,35,29,22,23,24,25,26,27,28,19,16,9,8,7,10,11,17,18,30]))),bt=C(()=>O(()=>import("./index.BzbiPRl7.js"),__vite__mapDeps([36,1,2,3,19,37,35,20,4,5,6,7,8,9,10,11,12,13,14,15,38,22,23,24,25,26,27,28,29,16,17,18,30]))),ht=t=>[{key:"",label:"floatingIpsProtection.tabs.dashboard.TITLE",icon:s.jsx(ke,{className:"size-5 text-primary"}),children:s.jsx(xt,{}),url:u.NETWORK_PROTECTION.replace(":id",String(t))},{key:"attack-history",label:"floatingIpsProtection.tabs.attackHistory.TITLE",children:s.jsx(mt,{}),icon:s.jsx(Q,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB.replace(":id",String(t)).replace(":tab","attack-history")},{key:"access-list",label:"floatingIpsProtection.tabs.accessList.TITLE",children:s.jsx(ut,{}),icon:s.jsx(Ne,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB.replace(":id",String(t)).replace(":tab","access-list")},{key:"blocked-ips",label:"floatingIpsProtection.tabs.blockedIps.TITLE",children:s.jsx(bt,{}),icon:s.jsx(je,{className:"size-5 text-primary"}),url:u.NETWORK_PROTECTION_TAB.replace(":id",String(t)).replace(":tab","blocked-ips")},{key:"attack",children:s.jsx(pt,{}),isHidden:!0,url:u.NETWORK_PROTECTION_TAB.replace(":id",String(t)).replace(":tab","attack"),shouldAnotherTabActiveKey:"attack-history"}],gt=()=>{const t=_(),{t:e}=h(),a=()=>t.attackId?u.NETWORK_PROTECTION_TAB.replace(":id",String(t.id||"")).replace(":tab","attack-history"):u.FLOATING_IPS_LISTING;return s.jsxs("div",{children:[s.jsxs("div",{className:"pb-5 flex items-center gap-3 justify-between max-sm:pb-3",children:[s.jsx(ye,{type:"h2",children:t.attackId?e("floatingIpsProtection.TITLE_ATTACK"):e("floatingIpsProtection.TITLE")}),s.jsx(Ce,{navigateTo:a(),behavior:"route-only",children:t.attackId?e("floatingIpsProtection.BACK_BUTTON_ATTACK"):e("floatingIpsProtection.BACK_BUTTON")})]}),s.jsx(Le,{children:s.jsx(ft,{params:t})})]})}
2,ft=({params:t})=>{var o;const{ipAddress:e}=J(),{tab:a,attackId:i,attackIdTab:n}=t;return m.useEffect(()=>{var r;if((r=e==null?void 0:e.ip_address)!=null&&r.ip_address){const d=e.ip_address.ip_address;if(i&&a==="attack"){document.title=`${d} - Attack Details - VPSBG.eu`;return}const x={"access-list":`${d} - Access List - VPSBG.eu`,"attack-history":`${d} - Attack History - VPSBG.eu`,"blocked-ips":`${d} - Blocked IPs - VPSBG.eu`}[a??"overview"]??`${d} - Overview - VPSBG.eu`;document.title=x}},[(o=e==null?void 0:e.ip_address)==null?void 0:o.ip_address,a,i,n]),s.jsxs(I,{menu:ht(t.id),tabParam:(t==null?void 0:t.tab)||"",children:[s.jsx(Ke,{}),s.jsx(I.Content,{})]})},Pt=Object.freeze(Object.defineProperty({__proto__:null,default:gt},Symbol.toStringTag,{value:"Module"}));export{p as h,Pt as i,J as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.