PageSourceSearch

https://cherry-collective.com/assets/SystemVitality-BTz_apg_.js

js cherry-collective.com collected 2026-10-07 23:56:05 UTC 2,487 bytes, 1 lines download raw bytes

1import{r as a,j as t,m as f}from"./vendor-ui-CQkUJbRj.js";import{D as g}from"./database-Buso6HOV.js";import{n as b,m as y,R as j}from"./index-DuLY_NoB.js";import{H as w}from"./hard-drive-CVgia0Er.js";import{S}from"./server-DStguh2K.js";const N=[{name:"PostgreSQL",icon:g,description:"Primary Database"},{name:"RabbitMQ",icon:b,description:"Message Broker"},{name:"Redis",icon:w,description:"Cache Layer"},{name:"Qdrant",icon:y,description:"Vector Store"},{name:"Cherry API",icon:S,description:"Core Gateway"}];function _(){const[l,n]=a.useState(N.map(e=>({...e,status:"offline"}))),[o,m]=a.useState(null),[i,c]=a.useState(!1),r=a.useCallback(async()=>{c(!0);try{const e=await fetch("/api/health",{signal:AbortSignal.timeout(5e3),credentials:"include"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const s=await e.json(),p=(s==null?void 0:s.status)==="healthy";n(x=>x.map(u=>({...u,status:p?"online":"degraded"})))}catch{n(e=>e.map(s=>({...s,status:"offline",latency:void 0})))}m(new Date),c(!1)},[]);a.useEffect(()=>{r();const e=setInterval(r,15e3);return()=>clearInterval(e)},[r]);const d=e=>e==="online"?"bg-emerald-500":e==="degraded"?"bg-amber-500":"bg-red-500",h=e=>e==="online"?"shadow-[0_0_8px_hsl(142,72%,50%/0.6)]":e==="degraded"?"shadow-[0_0_8px_hsl(38,92%,50%/0.6)]":"";return t.jsxs("div",{className:"glass-panel rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-sm font-mono uppercase tracking-wider text-amber-100/50",children:"System Vitality"}),t.jsx("button",{onClick:r,disabled:i,className:"text-amber-100/50 hover:text-foreground transition-colors",children:t.jsx(j,{className:`w-4 h-4 ${i?"animate-spin":""}`})})]}),t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-5 gap-3",children:l.map((e,s)=>t.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:s*.08},className:"flex flex-col items-center gap-2 p-3 rounded-lg bg-card/50 border border-border/30",children:[t.jsx(e.icon,{className:"w-5 h-5 text-cherry"}),t.jsx("div",{className:`w-3 h-3 rounded-full ${d(e.status)} ${h(e.status)} animate-pulse-slow`}),t.jsx("span",{className:"text-xs font-mono text-foreground",children:e.name}),t.jsx("span",{className:"text-[10px] font-mono text-amber-100/50",children:e.description})]},e.name))}),o&&t.jsxs("p",{className:"text-[10px] text-amber-100/50 mt-3 text-right font-mono",children:["Last check: ",o.toLocaleTimeString()]})]})}export{_ as SystemVitality};

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.