PageSourceSearch

https://zop.dev/zopnight/app/assets/DaemonSetsPage-DaXLImva.js

js zop.dev collected 2026-09-25 14:34:17 UTC 12,884 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/K8sLogViewer-BSXvWtLv.js","assets/react-vendor-CSsSSEML.js","assets/index-BVsjb7mB.js","assets/tanstack-vendor-D2LStv3_.js","assets/sentry-vendor-DQkRq1-W.js","assets/index-5XzA6R5n.css"])))=>i.map(i=>d[i]);
2import{a8 as F,ai as Y,S as G,E as J,a9 as Q,aa as X,a5 as ee,D as te,_ as se}from"./index-BVsjb7mB.js";import{p as ae,r as d,j as e}from"./react-vendor-CSsSSEML.js";import{D as re}from"./DataTable-CQvcDxIv.js";import{E as ne}from"./ErrorState-CE1mnLGb.js";import{h as K}from"./GenericResourcePage-ChmNpngD.js";import{P as ce}from"./Pagination-BnDSIG0w.js";import{L as le}from"./LiveBadge-Dqdxs81d.js";import{R as oe}from"./ResourceSearchInput-C7e3zrsg.js";import{p as I,a as U,C as B}from"./ContainerResourceChart-Dj-26_5p.js";import{g as de}from"./tanstack-vendor-D2LStv3_.js";import"./sentry-vendor-DQkRq1-W.js";import"./useDebouncedValue-x0dK07ix.js";import"./recharts-vendor-Bx3e4fJd.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:"33b2f1a2eb67da61a8a79f4c3c0fca45c630c2e5"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b84c9a73-bd4f-43d5-9832-bbc61e7dd730",t._sentryDebugIdIdentifier="sentry-dbid-b84c9a73-bd4f-43d5-9832-bbc61e7dd730")}catch{}})();const ie=d.lazy(()=>se(()=>import("./K8sLogViewer-BSXvWtLv.js"),__vite__mapDeps([0,1,2,3,4,5]))),i=de();function b({label:t,children:a}){return e.jsxs("div",{className:"bg-surface-secondary rounded px-3 py-2.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-muted font-medium block mb-0.5",children:t}),e.jsx("div",{className:"text-sm font-medium text-text-primary",children:a})]})}function me({ds:t,clusterResId:a,clusterId:l,clusterUid:o,onClose:D}
2){const[m,L]=d.useState("Selector"),[C,f]=d.useState(null),{data:p}=Q(a,t.namespace||t.Namespace),R=X(a,o),y=t.name||t.Name,j=d.useMemo(()=>{const s=p?.items??[],r=t.selector??t.Selector??t.matchLabels??{},c=r.matchLabels??r,n=Object.entries(c);return n.length===0?s.filter(u=>(u.name||"").startsWith(y+"-")):s.filter(u=>{const M=u.labels||u.Labels||{};return n.every(([P,T])=>M[P]===T)})},[p,y,t]),v=d.useMemo(()=>{const s={};for(const r of j){const c=r.node||"unknown";s[c]||(s[c]=[]),s[c].push(r)}return s},[j]),{data:x}=ee(a,t.namespace||t.Namespace),N=d.useMemo(()=>(x?.items??(Array.isArray(x)?x:[])).filter(r=>r.object?.includes(t.name||t.Name)),[x,t.name||t.Name]),S=t.name||t.Name||"",$=t.namespace||t.Namespace||"",w=t.desiredNumberScheduled??t.DesiredNumberScheduled??0,k=t.currentNumberScheduled??t.CurrentNumberScheduled??0,E=t.numberReady??t.NumberReady??0,h=t.updatedNumberScheduled??t.UpdatedNumberScheduled??0,g=t.numberAvailable??t.NumberAvailable??0,H=K(t.creationTime||t.CreationTime),A=t.nodeSelector??t.NodeSelector??{},O=Object.keys(A).length>0?Object.entries(A).map(([s,r])=>`${s}=${r}`).join(", "):"<none>",V=t.selector??t.Selector??{},_=t.labels??t.Labels??{};return e.jsxs(e.Fragment,{children:[e.jsx(te,{open:!0,onClose:D,title:S,half:!0,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:$}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md bg-surface-tertiary text-text-primary border border-border hover:bg-surface-elevated hover:border-primary-600/20 transition-colors",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{fillRule:"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 7.75A.75.75 0 0 1 2.75 7h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 7.75ZM2 11.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"})}),"Logs"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(b,{label:"Ready",children:e.jsxs("span",{className:"font-mono",children:[E,"/",w]})}),e.jsx(b,{label:"Desired",children:e.jsx("span",{className:"font-mono",children:w})}),e.jsx(b,{label:"Current",children:e.jsx("span",{className:"font-mono",children:k})}),e.jsx(b,{label:"Up-to-date",children:e.jsx("span",{className:"font-mono",children:h})}),e.jsx(b,{label:"Available",children:e.jsx("span",{className:"font-mono",children:g})}),e.jsx(b,{label:"Age",children:H})]}),e.jsxs("div",{className:"bg-surface-secondary rounded px-3 py-2.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-muted font-medium block mb-0.5",children:"Node Selector"}),e.jsx("span",{className:`text-sm font-mono ${O==="<none>"?"text-text-muted":"text-text-primary"}`,children:O})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-text-primary mb-2",children:"Running Pods"}),Object.keys(v).length>0?e.jsx("div",{className:"space-y-4",children:Object.entries(v).map(([s,r])=>e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] text-text-muted mb-2",children:["Node: ",s]}),r.map(c=>e.jsxs("div",{className:"border-l-2 border-border pl-3 mb-3",children:[e.jsx("span",{className:"text-xs font-mono text-primary-600 mb-1",children:c.name}),e.jsx("div",{className:"space-y-2 mt-1",children:(c.containers??[]).map(n=>{const u=R[`${c.namespace}/${c.name}/${n.name}`],M=I(n.cpuRequest),P=I(n.cpuLimit),T=U(n.memoryRequest),W=U(n.memoryLimit),Z=u?.cpuUsageMillis||0,z=u?.memoryUsageBytes||0,q=n.ready;return e.jsxs("div",{className:"bg-surface-secondary rounded-lg p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${q?"bg-success-500":"bg-warning-500"}`}),e.jsx("span",{className:"text-xs font-medium text-text-primary",children:n.name})]}),e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${q?"bg-success-100 text-success-700":"bg-warning-100 text-warning-700"}`,children:n.stateReason||n.state||"unknown"})]}),e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] uppercase tracking-wider text-text-muted font-medium",children:"CPU"}),e.jsx(B,{label:"CPU",request:M,limit:P,usage:Z,requestLabel:n.cpuRequest||void 0,limitLabel:n.cpuLimit||void 0})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] uppercase tracking-wider text-text-muted font-medium",children:"Memory"}),e.jsx(B,{label:"Mem",request:T,limit:W,usage:z,requestLabel:n.memoryRequest||void 0,limitLabel:n.memoryLimit||void 0})]})]})]},n.name)})})]},c.name))]},s))}):e.jsx("p",{className:"text-xs text-text-muted",children:"No running pods"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"flex gap-1 border-b border-border mb-3",children:["Selector","Labels"].map(s=>e.jsx("button",{onClick:()=>L(s),className:`px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ${m===s?"border-primary-600 text-primary-600":"border-transparent text-text-secondary hover:text-text-primary"}`,children:s},s))}),m==="Selector"&&e.jsx("div",{className:"border border-border rounded overflow-hidden",children:Object.keys(V).length>0?e.jsx("table",{className:"w-full text-xs",children:e.jsx("tbody",{children:Object.entries(V).map(([s,r],c)=>e.jsxs("tr",{className:c%2?"bg-surface-secondary/30":"",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-text-primary",children:s}),e.jsx("td",{className:"py-2 text-text-muted w-4 text-center",children:"|"}),e.jsx("td",{className:"px-3 py-2 text-text-secondary",children:String(r)})]},s))})}):e.jsx("p",{className:"px-3 py-3 text-xs text-text-muted",children:"No selector"})}),m==="Labels"&&e.jsx("div",{className:"border border-border rounded overflow-hidden",children:Object.keys(_).length>0?e.jsx("table",{className:"w-full text-xs",children:e.jsx("tbody",{children:Object.entries(_).map(([s,r],c)=>e.jsxs("tr",{className:c%2?"bg-surface-secondary/30":"",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-text-primary",children:s}),e.jsx("td",{className:"py-2 text-text-muted w-4 text-center",children:"|"}),e.jsx("td",{className:"px-3 py-2 text-text-secondary",children:String(r)})]},s))})}):e.jsx("p",{className:"px-3 py-3 text-xs text-text-muted",children:"No labels"})})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-text-primary mb-2",children:"Events"}),N.length>0?e.jsx("div",{className:"space-y-2",children:N.map((s,r)=>e.jsxs("div",{className:`border-l-2 pl-3 py-1.5 ${s.type==="Warning"?"border-warning-400":"border-success-400"}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-xs font-medium ${s.type==="Warning"?"text-warning-700":"text-success-700"}`,children:s.reason}),s.count>1&&e.jsxs("span",{className:"text-xs text-text-muted",children:["x",s.count]})]}),s.message&&e.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:s.message})]},r))}):e.jsx("p",{className:"text-xs text-text-muted",children:"No events"})]})]})}),C&&e.jsx(d.Suspense,{fallback:null,children:e.jsx(ie,{resourceId:a,clusterUid:o,workloadName:S,pods:j,onClose:()=>f(null)})})]})}const xe=[i.accessor(t=>t.name||t.Name||"",{id:"name",header:"Name",meta:{width:"20%",sortable:!0},enableSorting:!0,cell:t=>e.jsx("span",{className:"font-medium text-text-primary text-xs truncate max-w-[200px] block",children:t.getValue()})}),i.accessor(t=>t.namespace||t.Namespace||"",{id:"namespace",header:"Namespace",meta:{width:"12%",sortable:!0},enableSorting:!0,cell:t=>e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[120px] block",children:t.getValue()})}),i.accessor(t=>t.desiredNumberScheduled??t.DesiredNumberScheduled??0,{id:"desired",header:"Desired",meta:{width:"6%",sortable:!0},enableSorting:!0,cell:t=>e.jsx("span",{className:"text-xs font-mono",children:t.getValue()})}),i.accessor(t=>t.currentNumberScheduled??t.CurrentNumberScheduled??0,{id:"current",header:"Current",meta:{width:"6%"},cell:t=>e.jsx("span",{className:"text-xs font-mono",children:t.getValue()})}),i.accessor(t=>{const a=t.numberReady??t.NumberReady??0,l=t.desiredNumberScheduled??t.DesiredNumberScheduled??0;return`${a}/${l}`},{id:"ready",header:"Ready",meta:{width:"6%",sortable:!0},enableSorting:!0,cell:t=>{const[a,l]=t.getValue().split("/"),o=a===l&&l!=="0";return e.jsx("span",{className:`text-xs font-mono ${o?"text-success-600":a===l?"":"text-warning-600"}`,children:t.getValue()})}}),i.accessor(t=>t.updatedNumberScheduled??t.UpdatedNumberScheduled??0,{id:"upToDate",header:"Up-to-date",meta:{width:"7%"},cell:t=>e.jsx("span",{className:"text-xs font-mono",children:t.getValue()})}),i.accessor(t=>
2{const a=t.nodeSelector??t.NodeSelector;return!a||Object.keys(a).length===0?"<none>":Object.entries(a).map(([l,o])=>`${l}=${o}`).join(", ")},{id:"nodeSelector",header:"Node Selector",meta:{width:"18%"},cell:t=>{const a=t.getValue();return e.jsx("span",{className:`text-xs font-mono truncate max-w-[200px] block ${a==="<none>"?"text-text-muted":"text-text-secondary"}`,children:a})}}),i.accessor(t=>K(t.creationTime||t.CreationTime),{id:"age",header:"Age",meta:{width:"5%",sortable:!0},enableSorting:!0,cell:t=>e.jsx("span",{className:"text-xs text-text-secondary",children:t.getValue()})})];function De(){const{cluster:t,clusterResId:a,namespace:l}=ae(),[o,D]=d.useState(""),{page:m,currentToken:L,goNext:C,goPrev:f}=F([l,o]),{data:p,isLoading:R,isError:y,error:j,refetch:v}=Y(a,l,{continue:L,search:o}),[x,N]=d.useState(null),[S,$]=d.useState([]),w=window.location.pathname.match(/\/k8s\/clusters\/([^/]+)/)?.[1],k=p?.hasMore??!1,E=p?.continue??"",h=p?.items??[];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"text-sm font-semibold text-text-primary",children:["DaemonSets ",e.jsxs("span",{className:"text-text-muted font-normal",children:["(",h.length,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oe,{onChange:D,placeholder:"Search daemonsets…"}),e.jsx(le,{})]})]}),R?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(G,{})}):y?e.jsx(ne,{error:j,onRetry:v}):h.length===0?e.jsx(J,{message:o?`No daemonsets match “${o}”.`:"No daemonsets in the selected namespace."}):e.jsx(re,{data:h,columns:xe,onRowClick:g=>N(g),sorting:S,onSortingChange:$,manualSorting:!1}),(m>1||k)&&e.jsx(ce,{page:m,hasMore:k,count:h.length,pageSize:50,label:"daemonsets",onPageChange:g=>g>m?C(E):f()}),x&&e.jsx(me,{ds:x,clusterResId:a,clusterId:w,clusterUid:t?.uid,onClose:()=>N(null)})]})}export{De 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.