Files
pymc_console-dist/frontend/dist/assets/Logs-CVA2ZaR8.js
T
GitHub Actions Bot c8c3f164ee Sync build v0.9.286
Automated sync from private repository.
Commit: fad7f9633de61427bfc2c672b7ddecaa0952d717
2026-02-27 07:48:08 +00:00

2 lines
2.6 KiB
JavaScript

import{r as s,j as e}from"./vendor-react-alRNW2nb.js";import{c as a}from"./vendor-core-FtpmsTnh.js";import{bn as t,bo as r,o as n,bp as o,bq as i,br as l,q as c,B as m,bs as d,bd as p,bt as x}from"./index-CkRTgHHA.js";import{P as h,a as j,B as g,C as u}from"./PageLayout-BWMUVZgC.js";import{F as f,aZ as v,a_ as b}from"./vendor-icons-TO0PZKGR.js";import{m as y}from"./vendor-motion-DNp0Qg4F.js";import"./vendor-virt-BytWoLhu.js";import"./cosmograph-DqYT4sUA.js";import"./vendor-charts-C916_-gs.js";import"./vendor-fonts-CRZaZSFf.js";const N=s.memo(function({log:s}){return e.jsx(y.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:a("type-data-sm w-14 shrink-0",x(s.level)),children:s.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:s.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(s.timestamp).toLocaleString()})]})]})})});function w({showDebug:s,onToggle:t}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:a("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(p,{enabled:s,onChange:t,size:"sm"})]})}function k(){const p=t(),x=r(),y=n(),k=o(),D=i(),[B,C]=s.useState(!1),E=s.useCallback(()=>{C(s=>!s)},[]),L=B?p:p.filter(s=>"DEBUG"!==s.level),P=s.useRef(k);return P.current=k,s.useEffect(()=>{if(!y)return;P.current();const s=setInterval(()=>P.current(),l.logs);return()=>clearInterval(s)},[y]),e.jsxs(h,{children:[e.jsx(j,{title:"System Logs",icon:e.jsx(f,{}),controls:e.jsx(w,{showDebug:B,onToggle:E})}),e.jsx(g,{children:e.jsxs(u,{neomorphic:!0,noPadding:!0,children:[e.jsx(c,{listHeader:!0,icon:e.jsx(f,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(m,{plain:!0,color:y?"danger":"primary",onClick:()=>D(!y),title:y?"Pause":"Resume",className:a(!y&&"animate-pulse-slow"),children:y?e.jsx(v,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(b,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:x&&0===p.length?e.jsx(d,{count:10}):0===L.length?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:0===p.length?"No logs available":"No logs match selected filters"}):L.map((s,a)=>e.jsx(N,{log:s},`${s.timestamp}-${a}`))})]})})]})}export{k as default};