PageSourceSearch

https://cloud.shellhub.io/assets/AdminFirewallRuleDetails-Dcq7WZVS.js

js shellhub.io collected 2026-09-25 21:02:15 UTC 5,158 bytes, 1 lines download raw bytes

1import{r as l,j as e,b as d}from"./index-BPFw6Db2.js";import{a as p}from"./useAdminFirewallRules-C1vilvRr.js";import{F as x,A as m,a as u}from"./FilterBadge-B5ZF2x-Z.js";import{B as f}from"./Breadcrumb-BPPkFFf-.js";import{ae as N,a7 as w,ax as g,L as o,D as h,af as v,E as j}from"./main-DlSV9Dem.js";import"./TagIcon-CkEBG2v5.js";function y({title:a,titleId:s,...n},i){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":s},n),a?l.createElement("title",{id:s},a):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const b=l.forwardRef(y),t="text-2xs font-mono font-semibold uppercase tracking-label text-text-muted",c="text-sm text-text-primary font-medium mt-0.5";function E(){const{id:a}=N(),{data:s,isLoading:n,error:i}=p(a??"");if(n)return e.jsx(w,{label:"Loading firewall rule details"});if(i||!s)return e.jsxs("div",{className:"text-center py-24",children:[e.jsx(g,{className:"w-10 h-10 text-text-muted/30 mx-auto mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-muted mb-2",children:"Firewall rule not found"}),e.jsx(o,{to:"/admin/firewall-rules",className:"text-sm text-primary hover:underline",children:"Back to firewall rules"})]});const r=s.action==="allow";return e.jsxs("div",{className:"animate-fade-in",children:[e.jsx(f,{items:[{label:"Firewall Rules",to:"/admin/firewall-rules"},{label:s.id}]}),e.jsxs("div",{className:"flex items-start gap-4 mb-8",children:[e.jsx("div",{className:`w-14 h-14 rounded-xl flex items-center justify-center shrink-0 border ${r?"bg-accent-green/10 border-accent-green/20":"bg-accent-red/10 border-accent-red/20"}`,children:r?e.jsx(d,{className:"w-7 h-7 text-accent-green"}):e.jsx(x,{className:"w-7 h-7 text-accent-red"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-text-primary",children:r?"Allow Rule":"Deny Rule"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 bg-hover-strong text-text-muted text-2xs rounded font-mono",children:["Priority ",s.priority]}),e.jsx(m,{active:s.active})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(h,{className:"p-5 space-y-4",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2",children:[e.jsx(v,{className:"w-4 h-4 text-primary"}),"Rule Properties"]}),e.jsxs("dl",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"ID"}),e.jsxs("dd",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-primary truncate min-w-0",title:s.id,children:s.id}),e.jsx(j,{text:s.id})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Namespace"}),e.jsxs("dd",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx(o,{to:`/admin/namespaces/${s.tenant_id}`,className:"text-xs font-mono text-primary hover:underline truncate min-w-0",children:s.tenant_id}),e.jsx(j,{text:s.tenant_id})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Priority"}),e.jsx("dd",{className:c,children:s.priority})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Action"}),e.jsx("dd",{className:"flex items-center gap-1.5 mt-0.5",children:r?e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"w-4 h-4 text-accent-green"}),e.jsx("span",{className:"text-sm font-medium text-accent-green",children:"Allow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{className:"w-4 h-4 text-accent-red"}),e.jsx("span",{className:"text-sm font-medium text-accent-red",children:"Deny"})]})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Status"}),e.jsx("dd",{className:"mt-0.5",children:e.jsx(m,{active:s.active})})]})]})]}),e.jsxs(h,{className:"p-5 space-y-4",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2",children:[e.jsx(b,{className:"w-4 h-4 text-primary"}),"Connection Criteria"]}),e.jsxs("dl",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Source IP"}),e.jsx("dd",{className:c,children:s.source_ip===".*"?e.jsx("span",{className:"text-text-secondary",children:"Any IP"}):e.jsx("span",{className:"font-mono text-xs",children:s.source_ip})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Username"}),e.jsx("dd",{className:c,children:s.username===".*"?e.jsx("span",{className:"text-text-secondary",children:"All users"}):e.jsx("span",{className:"font-mono text-xs",children:s.username})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Device Filter"}),e.jsx("dd",{className:"mt-1",children:e.jsx(u,{filter:s.filter})})]})]})]})]})]})}export{E as default};

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.