bunqueue-dashboard 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +77 -75
- package/dist/assets/AddJob-D9r_ckWp.js +3 -0
- package/dist/assets/Alerts-D5HU-0Dx.js +1 -0
- package/dist/assets/AreaChart-Dl_9G6GH.js +1 -0
- package/dist/assets/Benchmark-CYC3PIii.js +1 -0
- package/dist/assets/BulkAddJobs-BFjzY7tK.js +5 -0
- package/dist/assets/{CopilotPanel-05UREVXq.js → CopilotPanel-CZCHTE8m.js} +2 -2
- package/dist/assets/{CopyButton-BjMe8rqo.js → CopyButton-fN1FbSIy.js} +1 -1
- package/dist/assets/{Cron-BVu2xGBX.js → Cron-BhZGb_DH.js} +1 -1
- package/dist/assets/CronManager-CU9_cil9.js +1 -0
- package/dist/assets/Database-DYlWeDIA.js +3 -0
- package/dist/assets/{Diagnostics-DbncxLB8.js → Diagnostics-BAfmoJ0e.js} +1 -1
- package/dist/assets/Dlq-BPUAPLUg.js +1 -0
- package/dist/assets/DlqControl-BjeqsueE.js +1 -0
- package/dist/assets/DlqPro-vuL9h-Ab.js +1 -0
- package/dist/assets/Flows-Czq_GBW2.js +1 -0
- package/dist/assets/JobInspector-BMi76I46.js +2 -0
- package/dist/assets/Jobs-I66fxS_x.js +1 -0
- package/dist/assets/JobsPro-CNgYYpHP.js +1 -0
- package/dist/assets/{Logs-BXITESJ-.js → Logs-QacZ07Ig.js} +1 -1
- package/dist/assets/LogsPro-BK6dIfm_.js +1 -0
- package/dist/assets/{McpServer-DaYWa4Es.js → McpServer-DCTEyxfJ.js} +2 -2
- package/dist/assets/{Metrics-BMGLcgiU.js → Metrics-Bo_LGDpq.js} +1 -1
- package/dist/assets/MetricsPro-mUantDrK.js +1 -0
- package/dist/assets/{Overview-Bex4G7ch.js → Overview-DRa8YOXL.js} +1 -1
- package/dist/assets/{Pagination-CTSsxJT4.js → Pagination-ByLXrTJL.js} +1 -1
- package/dist/assets/QueueActions-CPo6RJsA.js +1 -0
- package/dist/assets/QueueControl-DnGbiwVj.js +1 -0
- package/dist/assets/{QueueDetail-ZRFUt3mH.js → QueueDetail-BZQkagxC.js} +1 -1
- package/dist/assets/QueueDetailPro-C2faHlWj.js +1 -0
- package/dist/assets/{Queues-DkPMFOIm.js → Queues-DwdrD6Fs.js} +1 -1
- package/dist/assets/QueuesOverview-CQdc1MDE.js +1 -0
- package/dist/assets/{S3Backup-DDpYyr9K.js → S3Backup-9rl71zZ0.js} +1 -1
- package/dist/assets/S3BackupPro-BgZyvD-0.js +1 -0
- package/dist/assets/ServerControl-C5Rh0kip.js +3 -0
- package/dist/assets/Settings-DmnnURrE.js +1 -0
- package/dist/assets/{Usage-C50S2SA2.js → Usage-Df84EVYP.js} +1 -1
- package/dist/assets/{UsagePro-VGYI-JGk.js → UsagePro-xAJXeKjl.js} +1 -1
- package/dist/assets/Webhooks-CxKY1jum.js +1 -0
- package/dist/assets/{Workers-RzwwzTJK.js → Workers-C7btFQcD.js} +1 -1
- package/dist/assets/WorkersPro-CsGyS9Aq.js +1 -0
- package/dist/assets/index-CjnfFs1N.js +8 -0
- package/dist/assets/index-KT02j1ql.css +1 -0
- package/dist/assets/{useThroughputSeries-PGVgpwVj.js → useThroughputSeries-DMoDDf05.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/scripts/embedded.gen.ts +108 -108
- package/dist/assets/AddJob-C-p_fUxU.js +0 -3
- package/dist/assets/Alerts-DHUQoHrO.js +0 -1
- package/dist/assets/AreaChart-lY-mk5E1.js +0 -1
- package/dist/assets/Benchmark-9UTONKIr.js +0 -1
- package/dist/assets/BulkAddJobs-DOlzFFNp.js +0 -5
- package/dist/assets/CronManager-pAbkEMqi.js +0 -1
- package/dist/assets/Database-Q_X_NR2I.js +0 -3
- package/dist/assets/Dlq-Dht-XE8I.js +0 -1
- package/dist/assets/DlqControl-BdW51Eje.js +0 -1
- package/dist/assets/DlqPro-Bc5dBrfL.js +0 -1
- package/dist/assets/Flows-BgUrkVp9.js +0 -1
- package/dist/assets/JobInspector-cr-oB9MB.js +0 -2
- package/dist/assets/Jobs-HgcrHTuA.js +0 -1
- package/dist/assets/JobsPro-CHgECoqr.js +0 -1
- package/dist/assets/LogsPro-D0trm52t.js +0 -1
- package/dist/assets/MetricsPro-4SzRtKMO.js +0 -1
- package/dist/assets/QueueActions--MLQejui.js +0 -1
- package/dist/assets/QueueControl-D62X3ifm.js +0 -1
- package/dist/assets/QueueDetailPro-DY_XL6iK.js +0 -1
- package/dist/assets/QueuesOverview-BJaVSLW9.js +0 -1
- package/dist/assets/S3BackupPro-DD7fYduD.js +0 -1
- package/dist/assets/ServerControl-BzpGcDMa.js +0 -3
- package/dist/assets/Settings-BhNwQcDj.js +0 -1
- package/dist/assets/Webhooks-WT9fT_UK.js +0 -1
- package/dist/assets/WorkersPro-C-Rl2JGa.js +0 -1
- package/dist/assets/index-C2XEM9ex.css +0 -1
- package/dist/assets/index-DtMgfAiz.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{c as r}from"./index-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{c as r}from"./index-CjnfFs1N.js";var i=e(t(),1),a=n();function o({page:e,pageSize:t,total:n,hasNext:o,onPageChange:s,label:c=`items`,className:l}){let u=n!=null,d=u?Math.max(1,Math.ceil(n/t)):void 0;(0,i.useEffect)(()=>{u&&e>d-1&&s(d-1)},[u,e,d,s]);let f=u?Math.min(e,d-1):e,p=f*t,m=f>0,h=u?f<d-1:!!o;if(u&&n<=t&&f===0)return null;let g=u?n===0?`No ${c}`:`${r(p+1)}–${r(Math.min(p+t,n))} of ${r(n)} ${c}`:`Page ${f+1}`;return(0,a.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-sm text-faint ${l??``}`,children:[(0,a.jsx)(`span`,{children:g}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsx)(`button`,{type:`button`,disabled:!m,onClick:()=>s(f-1),className:`rounded-md px-3 py-1 text-xs hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 disabled:opacity-40 disabled:hover:text-faint`,children:`Previous`}),(0,a.jsx)(`span`,{className:`rounded-md bg-accent/15 px-2.5 py-1 text-xs font-medium text-accent tnum`,children:u?`${f+1} / ${d}`:f+1}),(0,a.jsx)(`button`,{type:`button`,disabled:!h,onClick:()=>s(f+1),className:`rounded-md px-3 py-1 text-xs hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 disabled:opacity-40 disabled:hover:text-faint`,children:`Next`})]})]})}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{C as r,T as i,nt as a,w as o}from"./index-CjnfFs1N.js";import{n as s,o as c,t as l}from"./form-C-zZyKfB.js";var u=e(t(),1),d=n();function f(e){let[t,n]=(0,u.useState)(e),r=(0,u.useRef)(JSON.stringify(e));return(0,u.useEffect)(()=>{let t=JSON.stringify(e);t!==r.current&&(r.current=t,n(e))},[e]),[t,n]}function p(e){let t=String(e).trim();if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function m({queue:e,config:t,onSaved:n}){let[m,h]=f(t),[g,_]=(0,u.useState)(null),[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(!1);return(0,d.jsxs)(r,{children:[(0,d.jsx)(o,{title:`Stall detection`}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,d.jsxs)(`div`,{className:`col-span-2 flex items-center gap-2`,children:[(0,d.jsx)(c,{checked:m.enabled,onChange:e=>h({...m,enabled:e}),label:`enabled`}),(0,d.jsx)(`span`,{className:`text-sm text-muted`,"aria-hidden":`true`,children:`enabled`})]}),(0,d.jsx)(l,{label:`Stall interval (ms)`,children:(0,d.jsx)(s,{type:`number`,value:m.stallInterval,onChange:e=>h({...m,stallInterval:e.target.value})})}),(0,d.jsx)(l,{label:`Max stalls`,children:(0,d.jsx)(s,{type:`number`,value:m.maxStalls,onChange:e=>h({...m,maxStalls:e.target.value})})}),(0,d.jsx)(l,{label:`Grace period (ms)`,children:(0,d.jsx)(s,{type:`number`,value:m.gracePeriod,onChange:e=>h({...m,gracePeriod:e.target.value})})})]}),(0,d.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,d.jsx)(i,{variant:`accent`,size:`sm`,disabled:v,onClick:async()=>{let t=p(m.stallInterval),r=p(m.maxStalls),i=p(m.gracePeriod);if(t==null||r==null||i==null){_(`All numeric fields must be filled in`);return}y(!0),x(!1);try{_(null),await a.setStallConfig(e,{...m,stallInterval:t,maxStalls:r,gracePeriod:i}),n(),x(!0),window.setTimeout(()=>x(!1),2e3)}catch(e){_(e.message)}finally{y(!1)}},children:`Save`}),b&&(0,d.jsx)(`span`,{className:`text-xs text-success`,children:`Saved ✓`}),g&&(0,d.jsx)(`span`,{className:`text-xs text-danger`,children:g})]})]})}function h({queue:e,config:t,onSaved:n}){let[m,h]=f(t),[g,_]=(0,u.useState)(null),[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(!1);return(0,d.jsxs)(r,{children:[(0,d.jsx)(o,{title:`DLQ policy`}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,d.jsxs)(`div`,{className:`col-span-2 flex items-center gap-2`,children:[(0,d.jsx)(c,{checked:m.autoRetry,onChange:e=>h({...m,autoRetry:e}),label:`auto-retry`}),(0,d.jsx)(`span`,{className:`text-sm text-muted`,"aria-hidden":`true`,children:`auto-retry`})]}),(0,d.jsx)(l,{label:`Retry interval (ms)`,children:(0,d.jsx)(s,{type:`number`,value:m.autoRetryInterval,onChange:e=>h({...m,autoRetryInterval:e.target.value})})}),(0,d.jsx)(l,{label:`Max auto-retries`,children:(0,d.jsx)(s,{type:`number`,value:m.maxAutoRetries,onChange:e=>h({...m,maxAutoRetries:e.target.value})})}),(0,d.jsx)(l,{label:`Max age (ms)`,children:(0,d.jsx)(s,{type:`number`,value:m.maxAge??``,onChange:e=>h({...m,maxAge:e.target.value})})}),(0,d.jsx)(l,{label:`Max entries`,children:(0,d.jsx)(s,{type:`number`,value:m.maxEntries,onChange:e=>h({...m,maxEntries:e.target.value})})})]}),(0,d.jsxs)(`div`,{className:`mt-3 flex items-center gap-3`,children:[(0,d.jsx)(i,{variant:`accent`,size:`sm`,disabled:v,onClick:async()=>{let t=p(m.autoRetryInterval),r=p(m.maxAutoRetries),i=p(m.maxEntries),o=m.maxAge==null?null:p(m.maxAge);if(t==null||r==null||i==null){_(`All numeric fields must be filled in`);return}y(!0),x(!1);try{_(null),await a.setDlqConfig(e,{...m,autoRetryInterval:t,maxAutoRetries:r,maxAge:o,maxEntries:i}),n(),x(!0),window.setTimeout(()=>x(!1),2e3)}catch(e){_(e.message)}finally{y(!1)}},children:`Save`}),b&&(0,d.jsx)(`span`,{className:`text-xs text-success`,children:`Saved ✓`}),g&&(0,d.jsx)(`span`,{className:`text-xs text-danger`,children:g})]})]})}function g({queue:e,paused:t,busy:n,run:c}){let[f,p]=(0,u.useState)(`0`),[m,h]=(0,u.useState)(`1000`),[g,_]=(0,u.useState)(``);return(0,d.jsxs)(r,{className:`mb-6`,children:[(0,d.jsx)(o,{title:`Lifecycle`}),(0,d.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[t?(0,d.jsx)(i,{variant:`success`,size:`sm`,disabled:n,onClick:()=>c(`Resumed`,()=>a.resume(e)),children:`Resume`}):(0,d.jsx)(i,{variant:`warning`,size:`sm`,disabled:n,onClick:()=>c(`Paused`,()=>a.pause(e)),children:`Pause`}),(0,d.jsx)(i,{size:`sm`,disabled:n,onClick:()=>c(`Retried completed`,()=>a.retryCompleted(e)),children:`Retry completed`}),(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsx)(`div`,{className:`w-24`,children:(0,d.jsx)(l,{label:`Promote N`,children:(0,d.jsx)(s,{type:`number`,value:g,onChange:e=>_(e.target.value),placeholder:`all`})})}),(0,d.jsx)(i,{size:`sm`,disabled:n,onClick:()=>c(`Promoted`,()=>a.promoteJobs(e,g?Number(g):void 0)),children:`Promote delayed`})]})]}),(0,d.jsxs)(`div`,{className:`mt-4 border-t border-line pt-3`,children:[(0,d.jsx)(`p`,{className:`mb-2 text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Destructive — these permanently remove jobs`}),(0,d.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,d.jsx)(i,{size:`sm`,disabled:n,onClick:()=>c(`Drained`,()=>a.drain(e),`Drain waiting jobs from "${e}"?`),children:`Drain`}),(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsx)(`div`,{className:`w-24`,children:(0,d.jsx)(l,{label:`Grace (ms)`,children:(0,d.jsx)(s,{type:`number`,value:f,onChange:e=>p(e.target.value)})})}),(0,d.jsx)(`div`,{className:`w-24`,children:(0,d.jsx)(l,{label:`Limit`,children:(0,d.jsx)(s,{type:`number`,value:m,onChange:e=>h(e.target.value)})})}),(0,d.jsx)(i,{variant:`danger`,size:`sm`,disabled:n,onClick:()=>c(`Cleaned`,()=>a.clean(e,{grace:Number(f),limit:Number(m)}),`Permanently delete up to ${m} completed/failed jobs older than ${f}ms from "${e}"?`),children:`Clean`})]})]})]})]})}function _({queue:e,busy:t,run:n}){let[c,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(``);return(0,d.jsxs)(`div`,{className:`mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,d.jsxs)(r,{children:[(0,d.jsx)(o,{title:`Rate limit`}),(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsx)(`div`,{className:`flex-1`,children:(0,d.jsx)(l,{label:`Limit`,children:(0,d.jsx)(s,{type:`number`,value:c,onChange:e=>f(e.target.value),placeholder:`max per window`})})}),(0,d.jsx)(i,{variant:`accent`,size:`sm`,disabled:t||!c,onClick:()=>n(`Rate limit set`,()=>a.setRateLimit(e,Number(c))),children:`Set`}),(0,d.jsx)(i,{size:`sm`,disabled:t,onClick:()=>n(`Rate limit cleared`,()=>a.clearRateLimit(e)),children:`Clear`})]})]}),(0,d.jsxs)(r,{children:[(0,d.jsx)(o,{title:`Concurrency`}),(0,d.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,d.jsx)(`div`,{className:`flex-1`,children:(0,d.jsx)(l,{label:`Concurrency`,children:(0,d.jsx)(s,{type:`number`,value:p,onChange:e=>m(e.target.value),placeholder:`max in-flight`})})}),(0,d.jsx)(i,{variant:`accent`,size:`sm`,disabled:t||!p,onClick:()=>n(`Concurrency set`,()=>a.setConcurrency(e,Number(p))),children:`Set`}),(0,d.jsx)(i,{size:`sm`,disabled:t,onClick:()=>n(`Concurrency cleared`,()=>a.clearConcurrency(e)),children:`Clear`})]})]})]})}export{m as i,_ as n,h as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{S as r,_ as i,c as a,h as o,k as s,m as c,nt as l,x as u}from"./index-CjnfFs1N.js";import{a as d}from"./form-C-zZyKfB.js";import{i as f,n as p,r as m,t as h}from"./QueueActions-CPo6RJsA.js";var g=e(t(),1),_=n(),v=[`waiting`,`active`,`completed`,`failed`,`delayed`,`paused`];function y(){let[e,t]=(0,g.useState)(``),[n,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(null),{data:S}=s(()=>l.queues(),[],{intervalMs:3e4});(0,g.useEffect)(()=>{!e&&S?.queues?.length&&t(S.queues[0].name)},[S,e]);let{data:C,error:w,loading:T,refetch:E}=s((0,g.useCallback)(async()=>{if(!e)return null;let[t,n,r]=await Promise.all([l.queueDetail(e,!1),l.getStallConfig(e).catch(()=>null),l.getDlqConfig(e).catch(()=>null)]);return{queue:e,detail:t,stall:n?.config??null,dlq:r?.config??null}},[e]),[e]),D=C&&C.queue===e?C:null,O=(e,t,n)=>{n&&!window.confirm(n)||(y(!0),x(null),t().then(t=>{let n=t?.count;x({ok:!0,text:`${e}${n==null?` ✓`:`: ${n}`}`}),E()}).catch(e=>x({ok:!1,text:e.message})).finally(()=>y(!1)))};return(0,_.jsxs)(`div`,{children:[(0,_.jsx)(o,{title:`Queue Control`,description:`Full per-queue operations and configuration.`,live:!0}),(0,_.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-3`,children:[(0,_.jsx)(`div`,{className:`w-56`,children:(0,_.jsx)(d,{value:e,"aria-label":`Queue`,onChange:e=>t(e.target.value),children:(S?.queues??[]).map(e=>(0,_.jsx)(`option`,{value:e.name,children:e.name},e.name))})}),D?.detail&&(0,_.jsx)(i,{label:D.detail.paused?`Paused`:`Active`,tone:D.detail.paused?`amber`:`green`}),b&&(0,_.jsx)(`span`,{role:`status`,className:b.ok?`text-xs text-success`:`text-xs text-danger`,children:b.text})]}),w&&(0,_.jsx)(r,{onRetry:E}),T&&!D&&!w?(0,_.jsx)(u,{}):D?.detail?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`mb-6 grid grid-cols-3 gap-3 md:grid-cols-6`,children:v.map(e=>(0,_.jsx)(c,{label:e,value:a(D.detail.counts[e]),compact:!0},e))}),(0,_.jsx)(h,{queue:e,paused:D.detail.paused,busy:n,run:O}),(0,_.jsx)(p,{queue:e,busy:n,run:O}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[D.stall&&(0,_.jsx)(f,{queue:e,config:D.stall,onSaved:()=>x({ok:!0,text:`Stall config saved ✓`})},e),D.dlq&&(0,_.jsx)(m,{queue:e,config:D.dlq,onSaved:()=>x({ok:!0,text:`DLQ config saved ✓`})},e)]})]}):!w&&(0,_.jsx)(`p`,{className:`text-sm text-faint`,children:`Select a queue.`})]})}export{y as QueueControl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{d as t,h as n,r,t as i,u as a}from"./react-vendor-B68RYDeC.js";import{A as o,
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{d as t,h as n,r,t as i,u as a}from"./react-vendor-B68RYDeC.js";import{A as o,C as s,E as c,N as l,S as u,T as d,U as f,V as p,W as m,X as h,_ as g,c as _,f as v,g as y,j as b,k as x,l as S,m as C,n as w,o as T,u as E,x as D}from"./index-CjnfFs1N.js";import{n as O,t as k}from"./form-C-zZyKfB.js";var A=e(n(),1),j=i();function M({queue:e}){return(0,j.jsxs)(`div`,{className:`mt-8`,children:[(0,j.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Configuration`}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,j.jsx)(P,{queue:e}),(0,j.jsx)(F,{queue:e})]})]})}function N(){let[e,t]=(0,A.useState)(!1),[n,r]=(0,A.useState)(null),[i,a]=(0,A.useState)(!1);return{busy:e,error:n,done:i,run:async e=>{t(!0),r(null),a(!1);try{await e(),a(!0),setTimeout(()=>a(!1),2e3)}catch(e){r(e.message)}finally{t(!1)}}}}function P({queue:e}){let[t,n]=(0,A.useState)(``),{busy:r,error:i,done:a,run:c}=N();return(0,j.jsxs)(s,{children:[(0,j.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,j.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Rate Limit`}),(0,j.jsx)(p,{className:`size-4 text-faint`})]}),(0,j.jsx)(k,{label:`Max jobs / second`,children:(0,j.jsx)(O,{type:`number`,inputMode:`numeric`,placeholder:`100`,value:t,onChange:e=>n(e.target.value)})}),(0,j.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,j.jsx)(d,{variant:`accent`,size:`sm`,disabled:r||!t,onClick:()=>c(()=>o.setRateLimit(e,Number(t))),children:`Set`}),(0,j.jsx)(d,{size:`sm`,disabled:r,onClick:()=>c(()=>o.clearRateLimit(e)),children:`Clear`}),a&&(0,j.jsx)(`span`,{className:`text-xs text-emerald-400`,children:`Saved`}),i&&(0,j.jsx)(`span`,{className:`text-xs text-red-400`,children:i})]})]})}function F({queue:e}){let[t,n]=(0,A.useState)(``),{busy:r,error:i,done:a,run:c}=N();return(0,j.jsxs)(s,{children:[(0,j.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,j.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Concurrency`}),(0,j.jsx)(h,{className:`size-4 text-faint`})]}),(0,j.jsx)(k,{label:`Concurrency`,children:(0,j.jsx)(O,{type:`number`,inputMode:`numeric`,placeholder:`5`,value:t,onChange:e=>n(e.target.value)})}),(0,j.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,j.jsx)(d,{variant:`accent`,size:`sm`,disabled:r||!t,onClick:()=>c(()=>o.setConcurrency(e,Number(t))),children:`Set`}),(0,j.jsx)(d,{size:`sm`,disabled:r,onClick:()=>c(()=>o.clearConcurrency(e)),children:`Clear`}),a&&(0,j.jsx)(`span`,{className:`text-xs text-emerald-400`,children:`Saved`}),i&&(0,j.jsx)(`span`,{className:`text-xs text-red-400`,children:i})]})]})}var I=[`active`,`waiting`,`completed`,`failed`,`delayed`,`paused`],L={detail:{ok:!1,name:``,counts:{waiting:0,active:0,completed:0,failed:0,delayed:0,prioritized:0,paused:0},paused:!1,priorityCounts:{},dlqPreview:[],timestamp:0},jobs:[]};function R(){let{name:e=``}=t(),n=a(),[i,s]=(0,A.useState)(null),[p,h]=(0,A.useState)(null),{data:O,error:k,loading:N,refetch:P}=x((0,A.useCallback)(async()=>{let[t,n]=await Promise.all([o.queueDetail(e,!1),o.jobsList(e,{states:I,limit:12})]);return{detail:t,jobs:n.jobs??[]}},[e]),[e]),F=async(e,t,r)=>{if(!(r&&!window.confirm(r))){s(e),h(null);try{if(await t(),e===`obliterate`){n(`/queues`);return}await P()}catch(e){h(e.message)}finally{s(null)}}};if(N&&!O&&!k)return(0,j.jsx)(D,{label:`Loading ${e}…`});let R=O??L,{detail:z}=R,B=z.counts,V=w(B.completed??0,B.failed??0)??0,H=[...R.jobs].sort((e,t)=>(t.createdAt??0)-(e.createdAt??0));return(0,j.jsxs)(`div`,{children:[k&&(0,j.jsx)(u,{onRetry:P}),(0,j.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(c,{"aria-label":`Back to queues`,onClick:()=>n(`/queues`),children:(0,j.jsx)(l,{className:`size-4`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`font-mono text-2xl font-bold tracking-tight text-fg`,children:e}),(0,j.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3`,children:[(0,j.jsx)(g,{label:z.paused?`Paused`:`Active`,tone:z.paused?`amber`:`green`}),(0,j.jsx)(g,{label:`Live`,tone:`green`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[z.paused?(0,j.jsxs)(d,{variant:`success`,size:`sm`,disabled:i!=null,onClick:()=>F(`resume`,()=>o.resume(e)),children:[(0,j.jsx)(m,{className:`size-3.5`}),` Resume`]}):(0,j.jsxs)(d,{variant:`warning`,size:`sm`,disabled:i!=null,onClick:()=>F(`pause`,()=>o.pause(e)),children:[(0,j.jsx)(f,{className:`size-3.5`}),` Pause`]}),(0,j.jsx)(d,{size:`sm`,disabled:i!=null,onClick:()=>F(`drain`,()=>o.drain(e),`Drain all waiting jobs from "${e}"?`),children:`Drain`}),(0,j.jsx)(d,{variant:`danger`,size:`sm`,disabled:i!=null,onClick:()=>F(`obliterate`,()=>o.obliterate(e),`Obliterate "${e}"? This removes the queue and all its jobs.`),children:`Obliterate`})]})]}),p&&(0,j.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-red-400`,children:p}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,j.jsx)(C,{label:`Waiting`,value:_(B.waiting),tone:`amber`}),(0,j.jsx)(C,{label:`Active`,value:_(B.active),tone:`blue`}),(0,j.jsx)(C,{label:`Completed`,value:_(B.completed),tone:`green`}),(0,j.jsx)(C,{label:`Failed`,value:_(B.failed),tone:B.failed?`red`:`default`}),(0,j.jsx)(C,{label:`Delayed`,value:_(B.delayed),tone:`default`}),(0,j.jsx)(C,{label:`Error Rate`,value:S(V),tone:V>.05?`red`:`green`})]}),(0,j.jsxs)(`div`,{className:`mt-8`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,j.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:`Recent Jobs`}),(0,j.jsxs)(r,{to:`/jobs?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 text-sm text-muted hover:text-fg`,children:[`View all jobs `,(0,j.jsx)(b,{className:`size-3.5`})]})]}),(0,j.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-line bg-surface`,children:(0,j.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,j.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`ID`}),(0,j.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Name`}),(0,j.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,j.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Duration`}),(0,j.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Created`})]})}),(0,j.jsx)(`tbody`,{children:H.length===0?(0,j.jsx)(`tr`,{children:(0,j.jsx)(`td`,{colSpan:5,className:`px-5 py-12 text-center text-sm text-faint`,children:`No recent jobs.`})}):H.map(e=>(0,j.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,j.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.id}),(0,j.jsx)(`td`,{className:`px-5 py-3 text-fg`,children:e.data?.name||`unknown`}),(0,j.jsx)(`td`,{className:`px-5 py-3`,children:(0,j.jsx)(y,{status:String(e.state??e.status??`waiting`)})}),(0,j.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:T(v(e.startedAt,e.completedAt))}),(0,j.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:E(e.createdAt)})]},e.id))})]})})]}),(0,j.jsx)(M,{queue:e})]})}export{R as QueueDetail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{d as n,h as r,r as i,t as a,u as o}from"./react-vendor-B68RYDeC.js";import{C as s,E as c,N as l,S as u,T as d,_ as f,c as p,h as m,j as h,k as g,l as _,m as v,n as y,nt as b,o as x,rt as S,w as C,x as w,y as T}from"./index-CjnfFs1N.js";import{t as E}from"./AreaChart-Dl_9G6GH.js";import{t as D}from"./useThroughputSeries-DMoDDf05.js";import{i as O,n as k,r as ee,t as A}from"./QueueActions-CPo6RJsA.js";var j=e(r(),1),M=a(),N=[`waiting`,`active`,`completed`,`failed`,`delayed`,`paused`],P=[`active`,`waiting`,`completed`,`failed`,`delayed`],F=2e3;function I(){let{name:e=``}=n(),r=o(),[a,I]=(0,j.useState)(!1),[R,z]=(0,j.useState)(null),{data:B,error:V,loading:H,refetch:U}=g((0,j.useCallback)(async()=>{if(!e)return null;let[t,n,r,i]=await Promise.all([b.queueDetail(e,!1),b.getStallConfig(e).catch(()=>null),b.getDlqConfig(e).catch(()=>null),b.jobsList(e,P,12).catch(()=>({ok:!1,jobs:[]}))]);return{queue:e,detail:t,stall:n?.config??null,dlq:r?.config??null,jobs:i.jobs??[]}},[e]),[e]),W=B&&B.queue===e?B:null,[G,K]=(0,j.useState)([]),q=(0,j.useRef)(null);(0,j.useEffect)(()=>{let e=W?.detail?.counts;e&&(q.current=(e.waiting??0)+(e.active??0)+(e.delayed??0))},[W]),(0,j.useEffect)(()=>{q.current=null,K([]);let e=setInterval(()=>{let e=q.current;e!=null&&K(t=>[...t,e].slice(-40))},F);return()=>clearInterval(e)},[e]);let J=(t,n,r)=>{r&&!window.confirm(r)||(I(!0),z(null),n().then(n=>{let r=n?.count,i=`${t}${r==null?` ✓`:`: ${r}`}`;z({ok:!0,text:i}),S.success(i,e),U()}).catch(e=>{let n=e.message;z({ok:!1,text:n}),S.error(`${t} failed`,n)}).finally(()=>I(!1)))},Y=()=>{window.confirm(`Obliterate "${e}"? This removes the queue and all its jobs.`)&&(I(!0),b.obliterate(e).then(()=>{S.success(`Queue obliterated`,e),r(`/queues`)}).catch(e=>{let t=e.message;z({ok:!1,text:t}),S.error(`Obliterate failed`,t),I(!1)}))},X=W?.detail,Z=X?.counts,Q=Z?y(Z.completed??0,Z.failed??0)??0:0,$=D(G);return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(m,{title:(0,M.jsx)(`span`,{className:`font-mono`,children:e}),description:`Full per-queue operations and live backlog.`,live:!0,back:(0,M.jsx)(c,{"aria-label":`Back to queues`,onClick:()=>r(`/queues`),children:(0,M.jsx)(l,{className:`size-4`})}),actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(i,{to:`/jobs?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:[`Jobs `,(0,M.jsx)(h,{className:`size-3.5`})]}),(0,M.jsxs)(i,{to:`/dlq?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:[`DLQ `,(0,M.jsx)(h,{className:`size-3.5`})]}),(0,M.jsx)(d,{variant:`danger`,size:`sm`,disabled:a,onClick:Y,children:`Obliterate`})]})}),V&&(0,M.jsx)(u,{onRetry:U}),H&&!W&&!V?(0,M.jsx)(w,{label:`Loading ${e}…`}):!X||!Z?!V&&(0,M.jsx)(T,{title:`Queue not found`,hint:`No queue named "${e}" exists — it may have been obliterated, or the link is stale.`,action:(0,M.jsx)(i,{to:`/queues`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Back to queues`})}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-3`,children:[(0,M.jsx)(f,{label:X.paused?`Paused`:`Active`,tone:X.paused?`amber`:`green`}),R&&(0,M.jsx)(`span`,{role:`status`,className:R.ok?`text-xs text-success`:`text-xs text-danger`,children:R.text})]}),(0,M.jsx)(`div`,{className:`mb-6 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6`,children:N.map(e=>(0,M.jsx)(v,{label:e,value:p(Z[e]),tone:e===`failed`&&Z.failed?`red`:`default`,compact:!0},e))}),(0,M.jsxs)(s,{className:`mb-6`,children:[(0,M.jsx)(C,{title:`Backlog depth`,action:(0,M.jsx)(`span`,{className:t(`rounded-full px-2 py-0.5 text-[11px] font-medium`,$.draining?`bg-emerald-500/10 text-success`:$.label===`accumulating`?`bg-red-500/10 text-danger`:`bg-surface-2 text-muted`),children:$.label})}),G.length<2?(0,M.jsx)(`p`,{className:`py-6 text-center text-xs text-faint`,children:`Sampling… the backlog trend appears after a few polls.`}):(0,M.jsx)(E,{height:140,ariaLabel:`${e} backlog depth`,series:[{label:`depth`,color:`var(--accent)`,points:G,area:!0}]}),(0,M.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-xs text-faint`,children:[(0,M.jsx)(`span`,{children:`waiting + active + delayed`}),(0,M.jsxs)(`span`,{className:`tnum`,children:[`Error rate `,_(Q)]})]})]}),(0,M.jsx)(A,{queue:e,paused:X.paused,busy:a,run:J}),(0,M.jsx)(k,{queue:e,busy:a,run:J}),(0,M.jsxs)(`div`,{className:`mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[W.stall?(0,M.jsx)(O,{queue:e,config:W.stall,onSaved:()=>{z({ok:!0,text:`Stall config saved ✓`}),S.success(`Stall config saved`,e)}},e):(0,M.jsx)(L,{title:`Stall detection`,onRetry:U}),W.dlq?(0,M.jsx)(ee,{queue:e,config:W.dlq,onSaved:()=>{z({ok:!0,text:`DLQ config saved ✓`}),S.success(`DLQ config saved`,e)}},e):(0,M.jsx)(L,{title:`DLQ policy`,onRetry:U})]}),(0,M.jsxs)(s,{padded:!1,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3`,children:[(0,M.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:`Recent jobs`}),(0,M.jsxs)(i,{to:`/jobs?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 text-sm text-muted hover:text-fg`,children:[`View all `,(0,M.jsx)(h,{className:`size-3.5`})]})]}),(0,M.jsx)(`div`,{className:`overflow-x-auto border-t border-line`,children:(0,M.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`ID`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`State`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Attempts`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Duration`})]})}),(0,M.jsx)(`tbody`,{children:W.jobs.length===0?(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:4,className:`px-5 py-10 text-center text-sm text-faint`,children:`No recent jobs.`})}):W.jobs.map(e=>(0,M.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,M.jsx)(`td`,{className:`px-5 py-3`,children:(0,M.jsx)(i,{to:`/job?id=${encodeURIComponent(e.id)}`,className:`font-mono text-xs text-accent hover:underline`,children:e.id})}),(0,M.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.state??`—`}),(0,M.jsxs)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:[e.attempts??0,` / `,e.maxAttempts??`?`]}),(0,M.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:x(e.startedAt&&e.completedAt?e.completedAt-e.startedAt:void 0)})]},e.id))})]})})]})]})]})}function L({title:e,onRetry:t}){return(0,M.jsxs)(s,{children:[(0,M.jsx)(C,{title:e}),(0,M.jsx)(`p`,{className:`mb-3 text-sm text-muted`,children:`Couldn't load this queue's config.`}),(0,M.jsx)(d,{size:`sm`,onClick:t,children:`Retry`})]})}export{I as QueueDetailPro};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r,u as i}from"./react-vendor-B68RYDeC.js";import{A as a,
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r,u as i}from"./react-vendor-B68RYDeC.js";import{A as a,G as o,J as s,S as c,c as l,h as u,j as d,k as f,m as p,x as m}from"./index-CjnfFs1N.js";import{t as h}from"./Pagination-ByLXrTJL.js";var g=e(n(),1),_=r(),v=20,y={ok:!1,queues:[],total:0,limit:v,offset:0,timestamp:0};function b(){let e=i(),[n,r]=(0,g.useState)(``),[b,x]=(0,g.useState)(0),{data:S,error:C,loading:w,refetch:T}=f(()=>a.queues(v,b*v),[b]),E=S??y,D=(0,g.useMemo)(()=>{let e=E.queues,t=n.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[E,n]);if(w&&!S&&!C)return(0,_.jsx)(m,{label:`Loading queues…`});let O=E.queues.reduce((e,t)=>(e.waiting+=t.waiting,e.active+=t.active,e.delayed+=t.delayed,e.dlq+=t.dlq,e),{waiting:0,active:0,delayed:0,dlq:0});return(0,_.jsxs)(`div`,{children:[C&&(0,_.jsx)(c,{onRetry:T}),(0,_.jsx)(u,{title:`Queues`,description:`${E.total} queues`,live:!0}),(0,_.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,_.jsx)(p,{label:`Waiting`,value:l(O.waiting),tone:`amber`,compact:!0}),(0,_.jsx)(p,{label:`Active`,value:l(O.active),tone:`blue`,compact:!0}),(0,_.jsx)(p,{label:`Delayed`,value:l(O.delayed),tone:`default`,compact:!0}),(0,_.jsx)(p,{label:`DLQ`,value:l(O.dlq),tone:O.dlq?`red`:`default`,compact:!0})]}),(0,_.jsxs)(`div`,{className:`relative mb-4 max-w-sm`,children:[(0,_.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,_.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Search queues…`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),(0,_.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-line bg-surface`,children:(0,_.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Waiting`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Active`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Delayed`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`DLQ`}),(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,_.jsx)(`th`,{className:`w-10 px-5 py-3`})]})}),(0,_.jsx)(`tbody`,{children:D.length===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{colSpan:7,className:`px-5 py-12 text-center text-sm text-faint`,children:n?`No queues match on this page.`:`No queues yet.`})}):D.map(n=>(0,_.jsxs)(`tr`,{onClick:()=>e(`/queues/${encodeURIComponent(n.name)}`),className:`group cursor-pointer border-b border-line last:border-0 transition-colors hover:bg-surface-2/50`,children:[(0,_.jsx)(`td`,{className:`px-5 py-3`,children:(0,_.jsxs)(`span`,{className:`flex items-center gap-2 font-medium text-fg`,children:[(0,_.jsx)(o,{className:`size-4 text-faint`}),n.name]})}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:l(n.waiting)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:l(n.active)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:l(n.delayed)}),(0,_.jsx)(`td`,{className:t(`px-5 py-3 text-right tnum`,n.dlq?`text-red-400`:`text-muted`),children:l(n.dlq)}),(0,_.jsx)(`td`,{className:`px-5 py-3`,children:(0,_.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,n.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-emerald-400`),children:[(0,_.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),n.paused?`Paused`:`Active`]})}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-faint`,children:(0,_.jsx)(d,{className:`size-4 opacity-0 transition-opacity group-hover:opacity-100`})})]},n.name))})]})}),(0,_.jsx)(h,{page:b,pageSize:v,total:E.total,onPageChange:x,label:`queues`})]})}export{b as Queues};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,r,t as i,u as a}from"./react-vendor-B68RYDeC.js";import{E as o,G as s,J as c,S as l,T as u,U as d,W as f,c as p,h as m,j as h,k as g,m as _,nt as v,rt as y,x as b}from"./index-CjnfFs1N.js";import{t as x}from"./Pagination-ByLXrTJL.js";import{t as S}from"./promisePool-Daxkc1OB.js";var C=e(n(),1),w=i(),T=6,E=15,D=[[`waiting`,`Waiting`],[`active`,`Active`],[`completed`,`Completed`],[`failed`,`Failed`],[`delayed`,`Delayed`]];function O(){let e=a(),[n,i]=(0,C.useState)(``),[O,k]=(0,C.useState)(0),[A,j]=(0,C.useState)(new Set),[M,N]=(0,C.useState)(!1),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(`desc`),{data:B,error:V,loading:H,refetch:U}=g(()=>v.queuesSummary(),[]),W=B??[],G=e=>{I===e?R===`desc`?z(`asc`):L(null):(L(e),z(`desc`)),k(0)},K=(0,C.useMemo)(()=>{let e=n.trim().toLowerCase(),t=[...e?W.filter(t=>t.name.toLowerCase().includes(e)):W].sort((e,t)=>e.name.localeCompare(t.name));if(I){let e=R===`desc`?-1:1;t.sort((t,n)=>e*(t.counts[I]-n.counts[I]))}return t},[W,n,I,R]),q=(0,C.useMemo)(()=>W.reduce((e,t)=>(e.waiting+=t.counts.waiting,e.active+=t.counts.active,e.failed+=t.counts.failed,e.paused+=+!!t.paused,e),{waiting:0,active:0,failed:0,paused:0}),[W]),J=Math.max(1,Math.ceil(K.length/E)),Y=Math.min(O,J-1),X=K.slice(Y*E,Y*E+E),Z=async e=>{j(t=>new Set(t).add(e.name)),F(null);try{await(e.paused?v.resume(e.name):v.pause(e.name)),F({ok:!0,text:`${e.name} ${e.paused?`resumed`:`paused`} ✓`})}catch(t){F({ok:!1,text:t.message}),y.error(`Failed to ${e.paused?`resume`:`pause`} ${e.name}`,t.message)}finally{j(t=>{let n=new Set(t);return n.delete(e.name),n}),U()}},Q=async e=>{let t=W.filter(t=>e===`pause`?!t.paused:t.paused);if(t.length===0){y.info(`No queues to ${e}`);return}if(!window.confirm(`${e===`pause`?`Pause`:`Resume`} ${t.length} queue(s)?`))return;N(!0),F(null);let n=(await S(t,T,t=>e===`pause`?v.pause(t.name):v.resume(t.name))).filter(e=>e.status===`rejected`).length,r=`${e===`pause`?`Paused`:`Resumed`} ${t.length-n}/${t.length} queues${n?`, ${n} failed`:``}`;F({ok:n===0,text:r}),n===0?y.success(r):y.error(r),N(!1),U()};return H&&!B&&!V?(0,w.jsx)(b,{label:`Loading queues…`}):(0,w.jsxs)(`div`,{children:[(0,w.jsx)(m,{title:`Queues`,description:`${W.length} queues`,live:!0,actions:W.length>0?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(u,{variant:`warning`,size:`sm`,disabled:M||q.paused>=W.length,onClick:()=>Q(`pause`),children:[(0,w.jsx)(d,{className:`size-3.5`}),` Pause all`]}),(0,w.jsxs)(u,{variant:`success`,size:`sm`,disabled:M||q.paused===0,onClick:()=>Q(`resume`),children:[(0,w.jsx)(f,{className:`size-3.5`}),` Resume all`]})]}):void 0}),V&&(0,w.jsx)(l,{onRetry:U}),(0,w.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,w.jsx)(_,{label:`Waiting`,value:p(q.waiting),tone:`amber`,compact:!0}),(0,w.jsx)(_,{label:`Active`,value:p(q.active),tone:`blue`,compact:!0}),(0,w.jsx)(_,{label:`Failed`,value:p(q.failed),tone:q.failed?`red`:`default`,compact:!0}),(0,w.jsx)(_,{label:`Paused`,value:p(q.paused),tone:q.paused?`amber`:`default`,compact:!0})]}),(0,w.jsxs)(`div`,{className:`relative mb-4 max-w-sm`,children:[(0,w.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,w.jsx)(`input`,{value:n,onChange:e=>{i(e.target.value),k(0)},placeholder:`Search queues…`,"aria-label":`Filter queues`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),P&&(0,w.jsx)(`div`,{role:`status`,className:t(`mb-3 text-sm`,P.ok?`text-success`:`text-danger`),children:P.text}),(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,w.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,w.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Queue`}),D.map(([e,t])=>(0,w.jsx)(`th`,{scope:`col`,"aria-sort":I===e?R===`desc`?`descending`:`ascending`:void 0,className:`px-5 py-3 text-right font-medium`,children:(0,w.jsxs)(`button`,{type:`button`,onClick:()=>G(e),className:`inline-flex items-center gap-1 rounded uppercase tracking-wider hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[t,I===e&&(0,w.jsx)(`span`,{"aria-hidden":`true`,children:R===`desc`?`↓`:`↑`})]})},e)),(0,w.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Status`}),(0,w.jsx)(`th`,{scope:`col`,className:`w-24 px-5 py-3 text-right font-medium`,children:`Actions`})]})}),(0,w.jsx)(`tbody`,{children:X.length===0?(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{colSpan:8,className:`px-5 py-12 text-center text-sm text-faint`,children:n?`No queues match your search.`:`No queues yet.`})}):X.map(n=>{let i=A.has(n.name);return(0,w.jsxs)(`tr`,{onClick:()=>e(`/queues/${encodeURIComponent(n.name)}`),className:`group cursor-pointer border-b border-line last:border-0 transition-colors hover:bg-surface-2/50`,children:[(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(r,{to:`/queues/${encodeURIComponent(n.name)}`,onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 rounded font-medium text-fg hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[(0,w.jsx)(s,{className:`size-4 text-faint`}),n.name]})}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-warning`,children:p(n.counts.waiting)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:p(n.counts.active)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-success`,children:p(n.counts.completed)}),(0,w.jsx)(`td`,{className:t(`px-5 py-3 text-right tnum`,n.counts.failed?`text-danger`:`text-muted`),children:p(n.counts.failed)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:p(n.counts.delayed)}),(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,n.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:[(0,w.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),n.paused?`Paused`:`Active`]})}),(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,w.jsx)(o,{"aria-label":n.paused?`Resume queue`:`Pause queue`,disabled:i,onClick:e=>{e.stopPropagation(),Z(n)},children:n.paused?(0,w.jsx)(f,{className:`size-3.5 text-success`}):(0,w.jsx)(d,{className:`size-3.5 text-warning`})}),(0,w.jsx)(h,{className:`size-4 text-faint opacity-0 transition-opacity group-hover:opacity-100`})]})})]},n.name)})})]})}),(0,w.jsx)(x,{page:Y,pageSize:E,total:K.length,onPageChange:k,label:`queues`})]})}export{O as QueuesOverview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-vendor-B68RYDeC.js";import{
|
|
1
|
+
import{t as e}from"./react-vendor-B68RYDeC.js";import{A as t,C as n,S as r,h as i,k as a,w as o,x as s}from"./index-CjnfFs1N.js";var c=e(),l=[[`S3_BACKUP_ENABLED`,`Set to 1 to enable periodic backups`],[`S3_BUCKET`,`Target bucket name`],[`S3_REGION`,`Bucket region (default us-east-1)`],[`S3_ENDPOINT`,`Custom endpoint (for S3-compatible stores)`],[`S3_ACCESS_KEY_ID`,`Access key`],[`S3_SECRET_ACCESS_KEY`,`Secret key`],[`S3_BACKUP_INTERVAL`,`Interval in ms (default 21600000 = 6h)`],[`S3_BACKUP_RETENTION`,`Backups to keep (default 7)`]];function u(){let{data:e,error:u,loading:d,refetch:f}=a(()=>t.storage(),[]);return(0,c.jsxs)(`div`,{children:[u&&(0,c.jsx)(r,{onRetry:f}),(0,c.jsx)(i,{title:`S3 Backup`,description:`SQLite snapshot backups to object storage.`,live:!0}),(0,c.jsx)(`div`,{className:`mb-6 rounded-lg border border-line bg-surface/60 px-4 py-3 text-sm text-muted`,children:`S3 backup runs on the server and is configured via environment variables — it cannot be toggled from the dashboard. The status below reflects the connected server's storage.`}),(0,c.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,c.jsxs)(n,{children:[(0,c.jsx)(o,{title:`Storage status`}),d&&!e&&!u?(0,c.jsx)(s,{}):(0,c.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,c.jsx)(`dt`,{className:`text-muted`,children:`Disk`}),(0,c.jsx)(`dd`,{className:e?.status?.diskFull?`font-medium text-red-400`:`font-medium text-emerald-400`,children:e?.status?.diskFull?`Full`:`Healthy`})]}),(0,c.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,c.jsx)(`dt`,{className:`text-muted`,children:`Path`}),(0,c.jsx)(`dd`,{className:`font-mono text-xs text-fg`,children:String(e?.status?.path??`—`)})]})]})]}),(0,c.jsxs)(n,{children:[(0,c.jsx)(o,{title:`Configuration (server env)`}),(0,c.jsx)(`dl`,{className:`divide-y divide-line text-sm`,children:l.map(([e,t])=>(0,c.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[(0,c.jsx)(`dt`,{className:`font-mono text-xs text-accent/90`,children:e}),(0,c.jsx)(`dd`,{className:`text-right text-xs text-faint`,children:t})]},e))})]})]})]})}export{u as S3Backup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{a as r,o as i}from"./connectionStore-B-hNUqwK.js";import{C as a,T as o,h as s,nt as c,q as l,y as u}from"./index-CjnfFs1N.js";import{a as d,n as f,r as p,t as m}from"./form-C-zZyKfB.js";var h=e(t(),1);function g(e){return{endpoint:e.endpoint,region:e.region,bucket:e.bucket,schedule:e.schedule,pathPrefix:e.pathPrefix}}var _=i()(r(e=>({endpoint:``,region:`us-east-1`,bucket:``,accessKeyId:``,secretAccessKey:``,schedule:`disabled`,pathPrefix:``,set:t=>e(t)}),{name:`bq-dash-s3`,partialize:g})),v=n();function y(){let e=_(),[t,n]=(0,h.useState)(null),r=e.bucket.trim()!==``;return(0,v.jsxs)(`div`,{children:[(0,v.jsx)(s,{title:`S3 Backup`,description:`Automatic backups to S3-compatible storage.`}),(0,v.jsxs)(`div`,{className:`mb-6 flex items-center justify-between rounded-xl border border-line bg-surface px-5 py-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,v.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg bg-surface-2 text-faint`,children:(0,v.jsx)(l,{className:`size-5`})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`font-semibold text-fg`,children:r?`Backup configured`:`No backup configured`}),(0,v.jsx)(`div`,{className:`text-xs text-faint`,children:r?`Target: ${e.bucket}`:`Set up S3 to protect your queue data`})]})]}),(0,v.jsx)(`span`,{className:r?`rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-medium text-success`:`rounded-full bg-amber-500/10 px-3 py-1 text-xs font-medium text-warning`,children:r?`Local draft`:`Configure`})]}),(0,v.jsx)(`div`,{className:`mb-6 rounded-lg border border-line bg-surface/60 px-4 py-2.5 text-xs text-faint`,children:`bunqueue reads S3 backup settings from server environment variables (S3_BUCKET, S3_REGION, …). This form helps you assemble that configuration; it is stored locally in your browser.`}),(0,v.jsxs)(a,{className:`mb-6`,children:[(0,v.jsx)(`h3`,{className:`mb-1 text-base font-semibold text-fg`,children:`Connection Settings`}),(0,v.jsx)(`p`,{className:`mb-4 text-xs text-faint`,children:`Works with AWS S3, Cloudflare R2, MinIO, DigitalOcean Spaces, and any S3-compatible provider.`}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,v.jsx)(m,{label:`Endpoint`,children:(0,v.jsx)(f,{value:e.endpoint,onChange:t=>e.set({endpoint:t.target.value}),placeholder:`https://s3.amazonaws.com`})}),(0,v.jsx)(m,{label:`Region`,children:(0,v.jsx)(f,{value:e.region,onChange:t=>e.set({region:t.target.value}),placeholder:`us-east-1`})}),(0,v.jsx)(`div`,{className:`md:col-span-2`,children:(0,v.jsx)(m,{label:`Bucket name`,children:(0,v.jsx)(f,{value:e.bucket,onChange:t=>e.set({bucket:t.target.value}),placeholder:`my-bunqueue-backups`})})}),(0,v.jsx)(m,{label:`Access key ID`,children:(0,v.jsx)(f,{value:e.accessKeyId,onChange:t=>e.set({accessKeyId:t.target.value}),placeholder:`AKIA…`})}),(0,v.jsx)(m,{label:`Secret access key`,children:(0,v.jsx)(f,{type:`password`,value:e.secretAccessKey,onChange:t=>e.set({secretAccessKey:t.target.value}),placeholder:`••••••••••••••••`})}),(0,v.jsx)(`p`,{className:`-mt-2 text-xs text-faint md:col-span-2`,children:`Keys are kept in memory only and cleared on reload.`}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(p,{children:`Backup schedule`}),(0,v.jsxs)(d,{value:e.schedule,onChange:t=>e.set({schedule:t.target.value}),className:`mt-1.5`,title:`Local note only — actual scheduling requires server-side S3 config`,children:[(0,v.jsx)(`option`,{value:`disabled`,children:`Disabled`}),(0,v.jsx)(`option`,{value:`6h`,children:`Every 6 hours`}),(0,v.jsx)(`option`,{value:`12h`,children:`Every 12 hours`}),(0,v.jsx)(`option`,{value:`24h`,children:`Every 24 hours`})]})]}),(0,v.jsx)(m,{label:`Path prefix (optional)`,children:(0,v.jsx)(f,{value:e.pathPrefix,onChange:t=>e.set({pathPrefix:t.target.value}),placeholder:`backups/production/`})})]}),(0,v.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(o,{onClick:async()=>{n(null);try{let e=await c.storage();n({ok:!e.data?.diskFull,msg:e.data?.diskFull?`Server disk is full`:`Server disk healthy — this does not validate the S3 credentials`})}catch(e){n({ok:!1,msg:e.message})}},children:`Check server storage`}),(0,v.jsx)(o,{disabled:!0,title:`Trigger a manual backup — requires server-side S3 config`,children:`Backup Now`}),(0,v.jsx)(`span`,{className:`text-xs text-faint`,children:`Saved locally as you type (keys excluded).`}),t&&(0,v.jsx)(`span`,{className:t.ok?`text-xs text-success`:`text-xs text-danger`,children:t.msg})]})]}),(0,v.jsxs)(a,{children:[(0,v.jsx)(`h3`,{className:`mb-4 text-base font-semibold text-fg`,children:`Backup History`}),(0,v.jsx)(u,{icon:(0,v.jsx)(l,{}),title:`No backups yet`,hint:`Configure your S3 connection and run a backup to get started.`})]})]})}export{y as S3BackupPro};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{C as i,J as a,K as o,S as s,T as c,U as l,W as u,a as d,d as f,h as p,k as m,nt as h,p as g,r as _,u as v,w as y}from"./index-CjnfFs1N.js";import{i as b,n as x,t as S}from"./form-C-zZyKfB.js";import{t as C}from"./CopyButton-fN1FbSIy.js";var w=e(n(),1),T=r();function E({children:e}){return(0,T.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 text-xs text-fg`,children:e})}function D({agentBase:e}){return(0,T.jsx)(i,{children:(0,T.jsxs)(`details`,{className:`group`,children:[(0,T.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2`,children:[(0,T.jsx)(`span`,{className:`text-base font-semibold text-fg`,children:`How server control works`}),(0,T.jsx)(`span`,{className:`text-xs text-muted transition-transform group-open:rotate-90`,children:`▶`})]}),(0,T.jsxs)(`div`,{className:`mt-4 space-y-4 text-sm leading-relaxed text-muted`,children:[(0,T.jsxs)(`p`,{children:[`A browser can't start or stop an OS process, so the dashboard talks to a small local`,` `,(0,T.jsx)(`span`,{className:`font-medium text-fg`,children:`control agent`}),` (`,(0,T.jsx)(E,{children:e}),`) that supervises the bunqueue server process — start, stop and restart — and streams its logs back here.`]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`mb-1 font-medium text-fg`,children:`Launch & environment`}),(0,T.jsxs)(`p`,{children:[`The agent runs your `,(0,T.jsx)(`span`,{className:`text-fg`,children:`Command`}),` and injects`,` `,(0,T.jsx)(E,{children:`HTTP_PORT`}),`, `,(0,T.jsx)(E,{children:`TCP_PORT`}),` and `,(0,T.jsx)(E,{children:`BUNQUEUE_DATA_PATH`}),` — plus any `,(0,T.jsx)(`span`,{className:`text-fg`,children:`Environment variables`}),` you add — into its environment. The default `,(0,T.jsx)(E,{children:`bunqueue start`}),` needs a globally-installed binary; pointing the command at a local entry (e.g.`,` `,(0,T.jsx)(E,{children:`bun run /path/to/bunqueue/src/main.ts`}),`) works without one.`]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`mb-1 font-medium text-fg`,children:`When changes apply`}),(0,T.jsxs)(`p`,{children:[`Config is editable any time, but `,(0,T.jsx)(`span`,{className:`text-fg`,children:`Command`}),`, ports and data path only take effect on the `,(0,T.jsx)(`span`,{className:`text-fg`,children:`next start/restart`}),` `,`— the running process keeps the config it launched with until then.`]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`mb-1 font-medium text-fg`,children:`Data path`}),(0,T.jsxs)(`p`,{children:[`Relative paths resolve against the `,(0,T.jsx)(`span`,{className:`text-fg`,children:`agent's`}),` working directory. SQLite creates the database `,(0,T.jsx)(`span`,{className:`text-fg`,children:`file`}),` but not its parent `,(0,T.jsx)(`span`,{className:`text-fg`,children:`folder`}),` — if start fails with`,` `,(0,T.jsx)(E,{children:`SQLITE_CANTOPEN`}),`, create the directory first or use a path whose folder already exists.`]})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`mb-1 font-medium text-fg`,children:`Security`}),(0,T.jsxs)(`p`,{children:[`The agent can spawn processes, so it binds `,(0,T.jsx)(E,{children:`127.0.0.1`}),` only, locks CORS to an allowlist (never `,(0,T.jsx)(E,{children:`*`}),`), rejects any disallowed `,(0,T.jsx)(E,{children:`Origin`}),` or`,` `,(0,T.jsx)(E,{children:`Host`}),` with a `,(0,T.jsx)(E,{children:`403`}),` (the latter blocks DNS-rebinding reads), and honours an optional `,(0,T.jsx)(E,{children:`AGENT_TOKEN`}),` on state-changing requests. Keep its port on loopback.`]}),(0,T.jsxs)(`p`,{children:[`If you started the agent with `,(0,T.jsx)(E,{children:`AGENT_TOKEN`}),`, enter that token under`,` `,(0,T.jsx)(`span`,{className:`text-fg`,children:`Settings → Agent token`}),` (or when the lock screen prompts) so start / stop / restart and config changes are authorized.`]})]})]})]})})}var O=0,k=e=>Object.entries(e).map(([e,t])=>({id:O++,key:e,value:t})),A=e=>{let t={};for(let n of e){let e=n.key.trim();e&&(t[e]=n.value)}return t},j=[`AUTH_TOKENS`,`LOG_LEVEL`,`S3_BACKUP_ENABLED`,`S3_BUCKET`,`METRICS_ENABLED`];function M({value:e,onChange:t,disabled:n}){let[r,i]=(0,w.useState)(()=>k(e)),a=e=>{i(e),t(A(e))},o=(e,t)=>a(r.map(n=>n.id===e?{...n,...t}:n)),s=(e=``)=>a([...r,{id:O++,key:e,value:``}]),l=e=>a(r.filter(t=>t.id!==e)),u=new Set(r.map(e=>e.key.trim()).filter(Boolean)),d=r.map(e=>e.key.trim()).filter((e,t,n)=>e&&n.indexOf(e)!==t),f=[...new Set(r.map(e=>e.key.trim()).filter(e=>e&&(/[\s=]/.test(e)||/[a-z]/.test(e))))];return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r.length===0&&(0,T.jsxs)(`p`,{className:`text-xs leading-relaxed text-faint`,children:[`No custom variables. The agent already injects`,` `,(0,T.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-0.5`,children:`HTTP_PORT`}),`,`,` `,(0,T.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-0.5`,children:`TCP_PORT`}),` and`,` `,(0,T.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-0.5`,children:`BUNQUEUE_DATA_PATH`}),`.`]}),r.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`w-2/5 shrink-0`,children:(0,T.jsx)(x,{className:`font-mono`,placeholder:`KEY`,value:e.key,disabled:n,onChange:t=>o(e.id,{key:t.target.value})})}),(0,T.jsx)(`span`,{className:`text-faint`,children:`=`}),(0,T.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,T.jsx)(x,{className:`font-mono`,placeholder:`value`,value:e.value,disabled:n,onChange:t=>o(e.id,{value:t.target.value})})}),(0,T.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.key||`variable`}`,disabled:n,onClick:()=>l(e.id),className:`shrink-0 rounded-md px-2 py-1 text-xs text-faint transition-colors hover:text-danger disabled:opacity-40`,children:`✕`})]},e.id)),d.length>0&&(0,T.jsxs)(`p`,{className:`text-xs text-warning`,children:[`Duplicate key`,d.length>1?`s`:``,` — the last value wins: `,d.join(`, `)]}),f.length>0&&(0,T.jsxs)(`p`,{className:`text-xs text-faint`,children:[`Unusual key`,f.length>1?`s`:``,` — env names are usually UPPER_SNAKE_CASE with no spaces or "=": `,f.join(`, `),`. Saved as-is.`]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,T.jsx)(c,{size:`sm`,variant:`ghost`,disabled:n,onClick:()=>s(),children:`+ Add variable`}),j.filter(e=>!u.has(e)).map(e=>(0,T.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>s(e),className:`rounded-md border border-line bg-surface-2 px-2 py-1 font-mono text-[11px] text-muted transition-colors hover:border-line-strong hover:text-fg disabled:opacity-40`,children:[`+ `,e]},e))]})]})}var N=[`all`,`stdout`,`stderr`,`sys`],P=e=>`${new Date(e).toLocaleTimeString([],{hour12:!1})}.${String(e%1e3).padStart(3,`0`)}`,F=e=>e===`stderr`?`text-danger/90`:e===`sys`?`text-accent/80`:`text-muted`;function I(){let{data:e}=R(),n=(0,w.useMemo)(()=>e?.lines??[],[e]),[r,o]=(0,w.useState)(`all`),[s,c]=(0,w.useState)(``),[l,u]=(0,w.useState)(!0),[d,f]=(0,w.useState)(!1),p=(0,w.useRef)(null),m=(0,w.useMemo)(()=>{let e=s.trim().toLowerCase();return n.map(e=>e.line.includes(`\x1B`)?{...e,line:g(e.line)}:e).filter(t=>(r===`all`||t.stream===r)&&(!e||t.line.toLowerCase().includes(e)))},[n,r,s]);(0,w.useEffect)(()=>{if(!l)return;let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[m.length,l]);let h=(0,w.useMemo)(()=>m.map(e=>d?`${P(e.ts)} [${e.stream}] ${e.line}`:e.line).join(`
|
|
2
|
+
`),[m,d]);return(0,T.jsxs)(i,{padded:!1,className:`overflow-hidden`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line px-4 py-3`,children:[(0,T.jsx)(`h3`,{className:`mr-1 text-base font-semibold text-fg`,children:`Process logs`}),(0,T.jsx)(b,{options:N,value:r,onChange:o}),(0,T.jsxs)(`div`,{className:`relative min-w-40 flex-1`,children:[(0,T.jsx)(a,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint`}),(0,T.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),"aria-label":`Filter log lines`,placeholder:`Filter…`,className:`h-8 w-full rounded-lg border border-line bg-surface-2 pl-8 pr-2 text-xs text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),(0,T.jsx)(L,{on:l,onClick:()=>u(e=>!e),label:`Follow`}),(0,T.jsx)(L,{on:d,onClick:()=>f(e=>!e),label:`Times`}),(0,T.jsx)(C,{value:h}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>{let e=new Blob([h],{type:`text/plain`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`bunqueue-logs-${Date.now()}.log`,n.click(),URL.revokeObjectURL(t)},disabled:m.length===0,className:`rounded-md border border-line bg-surface-2 px-2 py-1 text-xs text-muted transition-colors hover:text-fg disabled:opacity-40`,children:`Download`})]}),(0,T.jsx)(`div`,{ref:p,className:`max-h-80 min-h-40 overflow-y-auto p-4 font-mono text-xs leading-relaxed`,children:m.length===0?(0,T.jsx)(`p`,{className:`text-faint`,children:n.length===0?`No output yet.`:`No lines match the current filter.`}):m.map(e=>(0,T.jsxs)(`div`,{className:t(`whitespace-pre-wrap`,F(e.stream)),children:[d&&(0,T.jsx)(`span`,{className:`mr-2 text-faint`,children:P(e.ts)}),e.line]},e.seq))}),(0,T.jsxs)(`div`,{className:`flex items-center justify-between border-t border-line px-4 py-2 text-[11px] text-faint`,children:[(0,T.jsx)(`span`,{children:m.length===n.length?`${n.length} lines`:`${m.length} of ${n.length} lines`}),(0,T.jsx)(`span`,{children:l?`following tail`:`paused`})]})]})}function L({on:e,onClick:n,label:r}){return(0,T.jsx)(`button`,{type:`button`,onClick:n,"aria-pressed":e,className:t(`rounded-md border px-2 py-1 text-xs transition-colors`,e?`border-accent/40 bg-accent/10 text-accent`:`border-line bg-surface-2 text-muted hover:text-fg`),children:r})}function R(){return m(()=>h.control.logs(),[])}var z={running:{label:`Running`,tone:`text-success`,dot:`bg-emerald-400`},starting:{label:`Starting`,tone:`text-warning`,dot:`bg-amber-400`},stopping:{label:`Stopping`,tone:`text-warning`,dot:`bg-amber-400`},stopped:{label:`Stopped`,tone:`text-danger`,dot:`bg-red-400`}};function B({startedAt:e}){let[,t]=(0,w.useState)(0);return(0,w.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(e)},[]),(0,T.jsx)(T.Fragment,{children:f((Date.now()-e)/1e3)})}function V({label:e,children:t,title:n}){return(0,T.jsxs)(`div`,{className:`min-w-0`,title:n,children:[(0,T.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-faint`,children:e}),(0,T.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-sm text-fg`,children:t})]})}function H({status:e,agentBase:n,transitioning:r,stale:i=!1,vitals:a=null,busy:s,onStart:f,onStop:p,onRestart:m}){let h=e?.status??`stopped`,g=h===`running`,_=z[h]??z.stopped,v=!!e?.healthy&&!i,y=!g&&e?.exitCode!=null&&e.exitCode!==0,b=e?.runningConfig??e?.config??null,x=`http://localhost:${b?.httpPort??6790}`;return(0,T.jsxs)(`section`,{className:`mb-6 overflow-hidden rounded-xl border border-line bg-surface`,children:[(0,T.jsx)(`div`,{className:t(`h-0.5 bg-gradient-to-r to-transparent`,g&&v?`from-emerald-400/80 via-emerald-400/25`:g||r?`from-amber-400/80 via-amber-400/25`:`from-red-400/70 via-red-400/20`)}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-5 p-5 lg:flex-row lg:items-center lg:justify-between`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,T.jsxs)(`span`,{className:`relative flex size-3.5 shrink-0`,children:[g&&v&&(0,T.jsx)(`span`,{className:`absolute inline-flex size-full rounded-full bg-emerald-400 opacity-50 motion-safe:animate-ping`}),(0,T.jsx)(`span`,{className:t(`relative inline-flex size-3.5 rounded-full`,_.dot)})]}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,T.jsx)(`span`,{className:t(`text-2xl font-bold tracking-tight`,_.tone),children:r&&s?`${s}…`:_.label}),e?.version&&(0,T.jsxs)(`span`,{className:`font-mono text-xs text-muted`,children:[`bunqueue v`,e.version]}),y&&(0,T.jsxs)(`span`,{className:`rounded-full bg-red-500/15 px-2 py-0.5 font-mono text-[11px] font-medium text-danger`,children:[`crashed · exit `,e?.exitCode]})]}),(0,T.jsx)(`div`,{className:`mt-1 font-mono text-xs text-muted`,children:i?(0,T.jsxs)(`span`,{className:`text-warning`,children:[`last known: pid `,e?.pid??`—`,` — agent unreachable, state may have changed`]}):g?(0,T.jsxs)(T.Fragment,{children:[v?`healthy`:`waiting for health…`,` · pid `,e?.pid??`—`,` · up`,` `,e?.startedAt?(0,T.jsx)(B,{startedAt:e.startedAt}):`—`]}):`process not running — start it below or point the dashboard at an external server`})]})]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,T.jsxs)(c,{variant:`success`,disabled:g||r||i,onClick:f,children:[(0,T.jsx)(u,{className:`size-4`}),` Start`]}),(0,T.jsxs)(c,{variant:`warning`,disabled:!g||r||i,onClick:p,children:[(0,T.jsx)(l,{className:`size-4`}),` Stop`]}),(0,T.jsxs)(c,{disabled:r||i,onClick:m,children:[(0,T.jsx)(o,{className:`size-4`}),` Restart`]})]})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 border-t border-line bg-surface-2/30 px-5 py-4 md:grid-cols-3 xl:grid-cols-7`,children:[(0,T.jsx)(V,{label:`Memory`,children:a?.memory?.rss==null?(0,T.jsx)(`span`,{className:`text-faint`,children:`—`}):(0,T.jsxs)(`span`,{title:`heap ${a.memory.heapUsed??`?`} / ${a.memory.heapTotal??`?`} MB`,children:[a.memory.rss,` MB rss`]})}),(0,T.jsx)(V,{label:`Connections`,children:a?.connections?`${a.connections.tcp??0} tcp · ${a.connections.ws??0} ws · ${a.connections.sse??0} sse`:(0,T.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,T.jsx)(V,{label:`API endpoint`,title:x,children:g?(0,T.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,T.jsx)(`a`,{href:`${x}/health`,target:`_blank`,rel:`noreferrer`,className:`truncate text-accent hover:underline`,children:x}),(0,T.jsx)(C,{value:x})]}):(0,T.jsx)(`span`,{className:`text-faint`,children:x})}),(0,T.jsx)(V,{label:`Ports`,children:b?`${b.httpPort} http · ${b.tcpPort} tcp`:`—`}),(0,T.jsx)(V,{label:`Started`,children:g&&e?.startedAt?d(e.startedAt):`—`}),(0,T.jsx)(V,{label:`Control agent`,title:n,children:n.replace(/^https?:\/\//,``)}),(0,T.jsx)(V,{label:`Launch command`,title:b?.command,children:b?.command??`—`})]})]})}var U=[{key:`size`,label:`Database`,color:`bg-accent`},{key:`walSize`,label:`WAL`,color:`bg-amber-400`},{key:`shmSize`,label:`SHM`,color:`bg-zinc-500`}];function W({db:e}){let n=e.totalSize||0;return(0,T.jsxs)(i,{children:[(0,T.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between gap-2`,children:[(0,T.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Storage`}),(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e.exists?`${_(n)} on disk`:`not created yet`})]}),(0,T.jsxs)(`p`,{className:`mb-4 flex items-center gap-1.5 truncate font-mono text-xs text-faint`,title:e.path,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.path}),(0,T.jsx)(C,{value:e.path})]}),e.exists&&n>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`flex h-2.5 overflow-hidden rounded-full bg-surface-2`,children:U.map(r=>{let i=e[r.key];return i?(0,T.jsx)(`div`,{className:t(`h-full`,r.color),style:{width:`${i/n*100}%`},title:`${r.label}: ${_(i)}`},r.key):null})}),(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-5 gap-y-1.5 font-mono text-[11px] text-faint`,children:[U.map(n=>(0,T.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,T.jsx)(`span`,{className:t(`size-2 rounded-full`,n.color)}),n.label,` `,(0,T.jsx)(`span`,{className:`text-fg`,children:_(e[n.key])})]},n.key)),e.mtimeMs?(0,T.jsxs)(`span`,{className:`ml-auto`,children:[`written `,v(e.mtimeMs)]}):null]})]}):(0,T.jsx)(`p`,{className:`rounded-lg border border-dashed border-line px-4 py-6 text-center text-sm text-faint`,children:`The database appears here after the first start — SQLite creates the file at the configured data path.`})]})}function G(){let{data:e,error:t,refetch:n}=m(()=>h.control.status(),[]),[r,a]=(0,w.useState)(null),[o,c]=(0,w.useState)(null),l=e?.status===`running`,{data:u}=m(()=>l?h.health():Promise.resolve(null),[l]),d=l?u??null:null,f=d?.connections?` This drops ${d.connections.tcp??0} TCP / ${d.connections.ws??0} WS connections; in-flight jobs are interrupted.`:` In-flight jobs are interrupted.`,g=async(e,t,r)=>{if(!(r&&!window.confirm(r))){a(e),c(null);try{await t(),await n()}catch(e){c(e.message)}finally{a(null)}}};if(t&&!e)return(0,T.jsxs)(`div`,{children:[(0,T.jsx)(p,{title:`Server`,description:`Start, stop and restart the bunqueue server.`}),(0,T.jsx)(s,{message:`Control agent unreachable — server lifecycle controls are unavailable.`,onRetry:n}),(0,T.jsxs)(i,{children:[(0,T.jsx)(y,{title:`Control agent not running`}),(0,T.jsxs)(`p`,{className:`text-sm text-muted`,children:[`The local control agent is unreachable at`,` `,(0,T.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 text-xs`,children:h.agentBase}),`. It manages the bunqueue server process (start / stop / restart). Start it with:`]}),(0,T.jsxs)(`pre`,{className:`mt-3 overflow-x-auto rounded-lg border border-line bg-surface-2 px-3 py-2 text-xs`,children:[`bun start`,` `,`# agent + dashboard together (recommended)`,`
|
|
3
|
+
`,`bun run agent`,` `,`# agent only, if the dashboard is already running`]}),(0,T.jsx)(`p`,{className:`mt-3 text-xs text-faint`,children:`This page reconnects automatically once the agent is up — no reload needed.`})]})]});let _=e?.status??`stopped`,v=_===`running`,b=_===`starting`||_===`stopping`||r!=null,x=t!=null&&e!=null;return(0,T.jsxs)(`div`,{children:[(0,T.jsx)(p,{title:`Server`,description:`Supervise the bunqueue server process — lifecycle, configuration, storage and logs.`}),o&&(0,T.jsx)(`div`,{role:`status`,className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:o}),x&&(0,T.jsx)(`div`,{className:`mb-4 rounded-lg border border-amber-500/20 bg-amber-500/5 px-4 py-2 text-sm text-warning`,children:`Control agent unreachable — showing last known state. Lifecycle actions are disabled until it responds again.`}),(0,T.jsx)(H,{status:e,agentBase:h.agentBase,stale:x,vitals:d,transitioning:b,busy:r,onStart:()=>g(`starting`,()=>h.control.start()),onStop:()=>g(`stopping`,()=>h.control.stop(),`Stop the bunqueue server?${f}`),onRestart:()=>g(`restarting`,()=>h.control.restart(),`Restart the bunqueue server?${f}`)}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,T.jsx)(K,{status:e,onSaved:n,running:v,transitioning:b}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e?.db&&(0,T.jsx)(W,{db:e.db}),(0,T.jsx)(I,{})]})]}),(0,T.jsx)(`div`,{className:`mt-6`,children:(0,T.jsx)(D,{agentBase:h.agentBase})})]})}function K({status:e,onSaved:t,running:n,transitioning:r}){let[a,s]=(0,w.useState)(null),[l,u]=(0,w.useState)(!1),[d,f]=(0,w.useState)(!1),[p,m]=(0,w.useState)(null);(0,w.useEffect)(()=>{e?.config&&!a&&s(e.config)},[e,a]);let g=a??e?.config??null;if(!g)return(0,T.jsx)(i,{children:`Loading…`});let _=e=>s({...g,...e}),v=e?.runningConfig??null,b=(e={})=>JSON.stringify(Object.keys(e).sort().map(t=>[t,e[t]])),C=[];v!=null&&(v.command!==g.command&&C.push(`command`),v.httpPort!==g.httpPort&&C.push(`HTTP port`),v.tcpPort!==g.tcpPort&&C.push(`TCP port`),v.dataPath!==g.dataPath&&C.push(`data path`),b(v.extraEnv)!==b(g.extraEnv)&&C.push(`environment variables`));let E=n&&C.length>0,D=r||d,O=()=>{u(!0),setTimeout(()=>u(!1),2e3)},k=()=>{let e=e=>Number.isInteger(e)&&e>=1&&e<=65535;return e(g.httpPort)?e(g.tcpPort)?g.httpPort===g.tcpPort?`HTTP and TCP ports must differ`:null:`TCP port must be an integer between 1 and 65535`:`HTTP port must be an integer between 1 and 65535`},A=async()=>{let e=k();if(e){m(e);return}m(null);try{await h.control.setConfig(g),O(),t()}catch(e){m(e.message)}};return(0,T.jsxs)(i,{children:[(0,T.jsx)(y,{title:`Configuration`}),(0,T.jsx)(`p`,{className:`mb-3 text-xs text-muted`,children:n?`Ports and data path apply on the next restart — edit freely, then restart.`:`Edit and save; the config is used the next time the server starts.`}),(0,T.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,T.jsx)(S,{label:`Command`,hint:`The exact command the agent runs to launch bunqueue. It receives HTTP_PORT, TCP_PORT and BUNQUEUE_DATA_PATH in its environment. The default needs a global 'bunqueue' binary — or point it at a local entry, e.g. bun run /path/to/bunqueue/src/main.ts.`,children:(0,T.jsx)(x,{value:g.command,disabled:D,onChange:e=>_({command:e.target.value}),placeholder:`bunqueue start`})}),(0,T.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,T.jsx)(S,{label:`HTTP port`,hint:`Dashboard API + SSE.`,children:(0,T.jsx)(x,{type:`number`,min:1,max:65535,value:g.httpPort,disabled:D,onChange:e=>_({httpPort:Number(e.target.value)})})}),(0,T.jsx)(S,{label:`TCP port`,hint:`Binary protocol. Must differ from HTTP.`,children:(0,T.jsx)(x,{type:`number`,min:1,max:65535,value:g.tcpPort,disabled:D,onChange:e=>_({tcpPort:Number(e.target.value)})})})]}),(0,T.jsx)(S,{label:`Data path`,hint:`SQLite database file, relative to the agent's working directory. The parent folder must already exist — SQLite creates the file, not the directory.`,children:(0,T.jsx)(x,{value:g.dataPath,disabled:D,onChange:e=>_({dataPath:e.target.value})})}),(0,T.jsx)(S,{label:`Environment variables`,hint:`Injected into the server process on start, on top of the ports + data path. Applies on the next restart.`,children:(0,T.jsx)(M,{value:g.extraEnv??{},onChange:e=>_({extraEnv:e}),disabled:D})}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsx)(c,{type:`submit`,variant:`accent`,size:`sm`,disabled:D,children:`Save config`}),n&&(0,T.jsxs)(c,{variant:`warning`,size:`sm`,disabled:D,onClick:async()=>{let e=k();if(e){m(e);return}let n=C.length>0?` Changed: ${C.join(`, `)}.`:``;if(window.confirm(`Save configuration and restart the server to apply it?${n}`)){m(null),f(!0);try{await h.control.setConfig(g),await h.control.restart(),O(),t()}catch(e){m(e.message)}finally{f(!1)}}},children:[(0,T.jsx)(o,{className:`size-3.5`}),` Save & restart`]}),E&&!l&&(0,T.jsx)(`span`,{className:`text-xs text-warning`,children:`Restart to apply changes`}),l&&(0,T.jsx)(`span`,{role:`status`,className:`text-xs text-success`,children:`Saved`}),p&&(0,T.jsx)(`span`,{role:`status`,className:`text-xs text-danger`,children:p})]})]})]})}export{G as ServerControl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{i as r}from"./connectionStore-B-hNUqwK.js";import{B as i,C as a,E as o,T as s,Z as c,h as l,w as u}from"./index-CjnfFs1N.js";import{a as d,n as f,t as p}from"./form-C-zZyKfB.js";var m=e(t(),1),h=n(),g=[[`1000`,`1 second`],[`2000`,`2 seconds`],[`3000`,`3 seconds`],[`5000`,`5 seconds`],[`10000`,`10 seconds`]];function _(e){if(e.startsWith(`/`))return!0;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function v(){let{baseUrl:e,token:t,agentToken:n,refreshMs:v,setBaseUrl:y,setToken:b,setAgentToken:x,setRefreshMs:S}=r(),{theme:C,setTheme:w}=c(),[T,E]=(0,m.useState)(!1),[D,O]=(0,m.useState)(null),[k,A]=(0,m.useState)(e),[j,M]=(0,m.useState)(t),[N,P]=(0,m.useState)(n),[F,I]=(0,m.useState)(!1),[L,R]=(0,m.useState)(!1),[z,B]=(0,m.useState)(null),[V,H]=(0,m.useState)(!1);return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(l,{title:`Settings`,description:`Connection and appearance.`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,h.jsxs)(a,{children:[(0,h.jsx)(u,{title:`Connection`}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,h.jsx)(p,{label:`Server URL`,children:(0,h.jsx)(f,{value:k,onChange:e=>{A(e.target.value),B(null)},placeholder:`/api or https://queue.example.com`})}),z&&(0,h.jsx)(`p`,{className:`-mt-2 text-xs text-danger`,children:z}),(0,h.jsxs)(`p`,{className:`-mt-2 text-xs text-faint`,children:[`Use `,(0,h.jsx)(`code`,{className:`font-mono`,children:`/api`}),` in dev (proxied to localhost:6790), or the server origin in production.`]}),(0,h.jsx)(p,{label:`Bearer token (optional)`,hint:`Kept in memory only — re-enter after reload, or set VITE_BUNQUEUE_TOKEN.`,children:(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(f,{type:F?`text`:`password`,value:j,onChange:e=>M(e.target.value),placeholder:`only if AUTH_TOKENS is set`,className:`pr-10`}),(0,h.jsx)(o,{"aria-label":F?`Hide token`:`Show token`,className:`absolute right-0.5 top-1/2 -translate-y-1/2`,onClick:()=>I(e=>!e),children:(0,h.jsx)(i,{className:`size-4`})})]})}),(0,h.jsx)(p,{label:`Agent token (optional)`,hint:`Only if the control agent runs with AGENT_TOKEN. Memory only — or set VITE_BUNQUEUE_AGENT_TOKEN.`,children:(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(f,{type:L?`text`:`password`,value:N,onChange:e=>P(e.target.value),placeholder:`only if AGENT_TOKEN is set`,className:`pr-10`}),(0,h.jsx)(o,{"aria-label":L?`Hide agent token`:`Show agent token`,className:`absolute right-0.5 top-1/2 -translate-y-1/2`,onClick:()=>R(e=>!e),children:(0,h.jsx)(i,{className:`size-4`})})]})}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,h.jsx)(s,{variant:`accent`,onClick:()=>{let e=k.trim();if(!_(e)){B(`Must be an http(s) URL or a path starting with '/'.`);return}B(null),y(e),b(j),x(N),H(!0),setTimeout(()=>H(!1),2e3)},children:`Save`}),(0,h.jsx)(s,{onClick:async()=>{let e=k.trim().replace(/\/+$/,``);if(!_(e||`/`)){O({ok:!1,msg:`Must be an http(s) URL or a path starting with '/'.`});return}E(!0),O(null);let t=performance.now();try{let n=await fetch(`${e}/health`,{headers:j.trim()?{Authorization:`Bearer ${j.trim()}`}:void 0});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json(),i=Math.round(performance.now()-t);O({ok:r.ok!==!1,msg:`Connected in ${i}ms${r.version?` · bunqueue v${r.version}`:``}`})}catch(e){O({ok:!1,msg:e.message})}finally{E(!1)}},disabled:T,children:T?`Testing…`:`Test connection`}),V&&(0,h.jsx)(`span`,{className:`text-sm text-success`,children:`Saved ✓`}),D&&(0,h.jsx)(`span`,{className:D.ok?`text-sm text-success`:`text-sm text-danger`,children:D.msg})]}),(0,h.jsx)(`p`,{className:`-mt-1 text-xs text-faint`,children:`Test checks the values above as typed. Saving repoints every page at the new server immediately.`})]})]}),(0,h.jsxs)(a,{children:[(0,h.jsx)(u,{title:`Appearance & refresh`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,h.jsx)(p,{label:`Theme`,children:(0,h.jsxs)(d,{value:C,onChange:e=>w(e.target.value),children:[(0,h.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,h.jsx)(`option`,{value:`light`,children:`Light`})]})}),(0,h.jsx)(p,{label:`Refresh interval`,children:(0,h.jsx)(d,{value:String(v),onChange:e=>S(Number(e.target.value)),children:g.map(([e,t])=>(0,h.jsx)(`option`,{value:e,children:t},e))})})]})]})]})]})}export{v as Settings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-vendor-B68RYDeC.js";import{
|
|
1
|
+
import{t as e}from"./react-vendor-B68RYDeC.js";import{A as t,C as n,S as r,c as i,d as a,h as o,k as s,m as c,r as l,w as u,x as d}from"./index-CjnfFs1N.js";var f=e(),p={stats:{waiting:0,active:0,delayed:0,completed:0,dlq:0,totalPushed:0,totalPulled:0,totalCompleted:0,totalFailed:0,uptime:0},memory:{heapUsed:0,heapTotal:0,rss:0},workers:{total:0,active:0},crons:{total:0},storage:{}};function m(){let{data:e,error:m,loading:g,refetch:_}=s(()=>t.overview(),[]);if(g&&!e&&!m)return(0,f.jsx)(d,{label:`Loading usage…`});let{stats:v,memory:y,workers:b,crons:x,storage:S}=e??p;return(0,f.jsxs)(`div`,{children:[(0,f.jsx)(o,{title:`Usage`,description:`Cumulative resource usage on the connected server.`,live:!0}),m&&(0,f.jsx)(r,{onRetry:_}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,f.jsx)(c,{label:`Jobs Pushed`,value:i(v.totalPushed)}),(0,f.jsx)(c,{label:`Jobs Completed`,value:i(v.totalCompleted),tone:`green`}),(0,f.jsx)(c,{label:`Jobs Failed`,value:i(v.totalFailed),tone:v.totalFailed?`red`:`default`}),(0,f.jsx)(c,{label:`Jobs Pulled`,value:i(v.totalPulled),tone:`blue`})]}),(0,f.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,f.jsxs)(n,{children:[(0,f.jsx)(u,{title:`Runtime`}),(0,f.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,f.jsx)(h,{label:`Uptime`,value:a(v.uptime)}),(0,f.jsx)(h,{label:`Heap used`,value:l(y.heapUsed*1024*1024)}),(0,f.jsx)(h,{label:`RSS`,value:l(y.rss*1024*1024)}),(0,f.jsx)(h,{label:`Workers`,value:`${b.active} active / ${b.total}`}),(0,f.jsx)(h,{label:`Cron jobs`,value:String(x.total)})]})]}),(0,f.jsxs)(n,{children:[(0,f.jsx)(u,{title:`Storage`}),(0,f.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,f.jsx)(h,{label:`Status`,value:S.diskFull?`Disk full`:`Healthy`}),(0,f.jsx)(h,{label:`Path`,value:String(S.path??`—`),mono:!0}),S.error?(0,f.jsx)(h,{label:`Error`,value:String(S.error)}):null]})]})]})]})}function h({label:e,value:t,mono:n}){return(0,f.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,f.jsx)(`dt`,{className:`text-muted`,children:e}),(0,f.jsx)(`dd`,{className:n?`font-mono text-xs text-fg`:`font-medium text-fg`,children:t})]})}export{m as Usage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-vendor-B68RYDeC.js";import{C as t,
|
|
1
|
+
import{t as e}from"./react-vendor-B68RYDeC.js";import{C as t,S as n,c as r,d as i,h as a,k as o,l as s,m as c,n as l,nt as u,r as d,u as f,w as p,x as m}from"./index-CjnfFs1N.js";var h=e(),g={overview:{stats:{waiting:0,active:0,delayed:0,completed:0,dlq:0,totalPushed:0,totalPulled:0,totalCompleted:0,totalFailed:0,uptime:0},memory:{heapUsed:0,heapTotal:0,rss:0},crons:{total:0}},storage:{},failedTotal:0};function _(){let{data:e,error:_,loading:y,refetch:b}=o(async()=>{let[e,t,n]=await Promise.all([u.overview(),u.storage(),u.queuesSummary()]),r=n.reduce((e,t)=>e+(t.counts?.failed??0),0);return{overview:e,storage:t.data??{},failedTotal:r}},[]);if(y&&!e&&!_)return(0,h.jsx)(m,{label:`Loading usage…`});let x=e??g,{stats:S,memory:C,crons:w}=x.overview,{storage:T,failedTotal:E}=x,D=l(S.completed,E),O=S.uptime?i(S.uptime/1e3):`—`;return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(a,{title:`Usage`,description:`Cumulative resource usage on the connected server.`,live:!0}),_&&(0,h.jsx)(n,{onRetry:b}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,h.jsx)(c,{label:`Completed`,value:r(S.completed),tone:`green`}),(0,h.jsx)(c,{label:`Failed`,value:r(E),tone:E?`red`:`default`}),(0,h.jsx)(c,{label:`Waiting`,value:r(S.waiting),tone:`amber`}),(0,h.jsx)(c,{label:`Active`,value:r(S.active),tone:`blue`}),(0,h.jsx)(c,{label:`Error Rate`,value:D==null?`—`:s(D),tone:D==null?`default`:D>.05?`red`:`green`}),(0,h.jsx)(c,{label:`Uptime`,value:O})]}),(0,h.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,h.jsxs)(t,{children:[(0,h.jsx)(p,{title:`Runtime`}),(0,h.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,h.jsx)(v,{label:`Jobs pushed (since restart)`,value:r(S.totalPushed)}),(0,h.jsx)(v,{label:`Jobs pulled (since restart)`,value:r(S.totalPulled)}),(0,h.jsx)(v,{label:`Heap used`,value:d(C.heapUsed*1024*1024)}),(0,h.jsx)(v,{label:`RSS`,value:d(C.rss*1024*1024)}),(0,h.jsx)(v,{label:`Cron jobs`,value:String(w.total)})]})]}),(0,h.jsxs)(t,{children:[(0,h.jsx)(p,{title:`Storage`}),T.diskFull?(0,h.jsxs)(`div`,{className:`rounded-lg border border-red-500/25 bg-red-500/[0.06] px-4 py-3`,children:[(0,h.jsx)(`div`,{className:`font-semibold text-danger`,children:`Disk full — writes suspended`}),T.error&&(0,h.jsx)(`div`,{className:`mt-1 text-xs text-muted`,children:T.error}),T.since!=null&&(0,h.jsxs)(`div`,{className:`mt-1 text-xs text-faint`,children:[`since `,f(T.since)]})]}):(0,h.jsxs)(`div`,{className:`rounded-lg border border-emerald-500/25 bg-emerald-500/[0.06] px-4 py-3`,children:[(0,h.jsx)(`div`,{className:`font-semibold text-success`,children:`Healthy`}),(0,h.jsx)(`div`,{className:`mt-1 text-xs text-faint`,children:`Disk writes are being accepted.`})]})]})]})]})}function v({label:e,value:t}){return(0,h.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,h.jsx)(`dt`,{className:`text-muted`,children:e}),(0,h.jsx)(`dd`,{className:`font-medium text-fg`,children:t})]})}export{_ as UsagePro};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{C as r,E as i,S as a,T as o,V as s,Y as c,c as l,h as u,k as d,nt as f,rt as p,tt as m,u as h,w as g,x as _,y as v}from"./index-CjnfFs1N.js";import{n as y,o as b,t as x}from"./form-C-zZyKfB.js";import{t as S}from"./Pagination-ByLXrTJL.js";var C=e(t(),1),w=n();function T(){let{data:e,error:t,loading:n,refetch:o}=d(()=>f.webhooks(),[]),m=e?.data?.webhooks??[],[y,x]=(0,C.useState)(0),T=Math.max(1,Math.ceil(m.length/15)),D=Math.min(y,T-1),[O,k]=(0,C.useState)(null),A=async e=>{k(null);try{await e(),o()}catch(e){k(e.message)}},[j,M]=(0,C.useState)({}),N=async(e,t)=>{M(n=>({...n,[e]:t}));try{await f.setWebhookEnabled(e,t),await o()}catch(e){p.error(`Webhook toggle failed`,e.message)}finally{M(t=>{let{[e]:n,...r}=t;return r})}};return(0,w.jsxs)(`div`,{children:[(0,w.jsx)(u,{title:`Webhooks`,description:`HTTP callbacks fired on job events.`,live:!0}),t&&(0,w.jsx)(a,{onRetry:o}),O&&(0,w.jsx)(`div`,{role:`status`,className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:O}),(0,w.jsxs)(r,{className:`mb-6`,children:[(0,w.jsx)(g,{title:`Add webhook`}),(0,w.jsx)(E,{onAdd:async e=>{await f.addWebhook(e),o()}})]}),n&&!e&&!t?(0,w.jsx)(_,{label:`Loading webhooks…`}):m.length===0?(0,w.jsx)(v,{icon:(0,w.jsx)(s,{}),title:`No webhooks`,hint:`Add one above to receive job-event callbacks.`}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,w.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,w.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`URL`}),(0,w.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Events`}),(0,w.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,w.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Success / Fail`}),(0,w.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Last`}),(0,w.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Enabled`}),(0,w.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,w.jsx)(`tbody`,{children:m.slice(D*15,D*15+15).map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-line last:border-0 align-top hover:bg-surface-2/40`,children:[(0,w.jsx)(`td`,{className:`max-w-xs truncate px-5 py-3 font-mono text-xs text-fg`,children:e.url}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-xs text-muted`,children:e.events.join(`, `)}),(0,w.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queue??`all`}),(0,w.jsxs)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:[(0,w.jsx)(`span`,{className:`text-success`,children:l(e.successCount)}),` / `,(0,w.jsx)(`span`,{className:e.failureCount?`text-danger`:``,children:l(e.failureCount)})]}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:h(e.lastTriggered)}),(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsx)(b,{checked:j[e.id]??e.enabled,label:`${j[e.id]??e.enabled?`Disable`:`Enable`} webhook`,onChange:t=>N(e.id,t)})}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,w.jsx)(i,{"aria-label":`Remove webhook`,onClick:()=>window.confirm(`Remove webhook for ${e.url}?`)&&A(()=>f.removeWebhook(e.id)),children:(0,w.jsx)(c,{className:`size-3.5`})})})]},e.id))})]})}),(0,w.jsx)(S,{page:D,pageSize:15,total:m.length,onPageChange:x,label:`webhooks`})]})]})}function E({onAdd:e}){let[t,n]=(0,C.useState)(``),[r,i]=(0,C.useState)(``),[a,s]=(0,C.useState)(``),[c,l]=(0,C.useState)([`job.completed`,`job.failed`]),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(!1),h=e=>l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),g=async()=>{if(f)return;d(null);let i=t.trim();if(!i||c.length===0){d(`URL and at least one event are required`);return}if(!(()=>{try{return/^https?:$/.test(new URL(i).protocol)}catch{return!1}})()){d(`URL must be a valid http:// or https:// address`);return}p(!0);try{await e({url:t,events:c,queue:r.trim()||void 0,secret:a.trim()||void 0}),n(``),s(``)}catch(e){d(e.message)}finally{p(!1)}};return(0,w.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,w.jsx)(`div`,{className:`md:col-span-1`,children:(0,w.jsx)(x,{label:`URL`,children:(0,w.jsx)(y,{value:t,onChange:e=>n(e.target.value),placeholder:`https://example.com/hook`})})}),(0,w.jsx)(x,{label:`Queue (optional)`,children:(0,w.jsx)(y,{value:r,onChange:e=>i(e.target.value),placeholder:`all queues`})}),(0,w.jsx)(x,{label:`Secret (optional)`,children:(0,w.jsx)(y,{type:`password`,autoComplete:`new-password`,value:a,onChange:e=>s(e.target.value),placeholder:`HMAC signing secret`})})]}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:m.map(e=>(0,w.jsx)(`button`,{type:`button`,"aria-pressed":c.includes(e),onClick:()=>h(e),className:c.includes(e)?`rounded-full bg-accent/15 px-3 py-1 text-xs font-medium text-accent`:`rounded-full border border-line px-3 py-1 text-xs font-medium text-muted hover:text-fg`,children:e},e))}),(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(o,{type:`submit`,variant:`accent`,size:`sm`,disabled:f,children:f?`Adding…`:`Add webhook`}),u&&(0,w.jsx)(`span`,{className:`text-xs text-danger`,children:u})]})]})}export{T as Webhooks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{A as r,S as i,X as a,c as o,h as s,k as c,m as l,u,x as d,y as f}from"./index-CjnfFs1N.js";import{t as p}from"./Pagination-ByLXrTJL.js";var m=e(t(),1),h=n(),g=20,_={workers:{total:0,active:0,list:[],truncated:!1}};function v(){let{data:e,error:t,loading:n,refetch:v}=c(()=>r.overview(),[]),[y,b]=(0,m.useState)(0);if(n&&!e&&!t)return(0,h.jsx)(d,{label:`Loading workers…`});let{workers:x}=e??_,S=Math.max(1,Math.ceil(x.list.length/g)),C=Math.min(y,S-1),w=x.list.slice(C*g,C*g+g);return(0,h.jsxs)(`div`,{children:[t&&(0,h.jsx)(i,{onRetry:v}),(0,h.jsx)(s,{title:`Workers`,description:`Registered workers and their throughput.`,live:!0}),(0,h.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,h.jsx)(l,{label:`Total`,value:o(x.total),compact:!0}),(0,h.jsx)(l,{label:`Active`,value:o(x.active),tone:`green`,compact:!0})]}),x.list.length===0?(0,h.jsx)(f,{icon:(0,h.jsx)(a,{}),title:`No workers registered`,hint:`Workers appear here once they connect and register with the server.`}):(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,h.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,h.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Worker`}),(0,h.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queues`}),(0,h.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Active`}),(0,h.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Processed`}),(0,h.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Failed`}),(0,h.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Last Seen`})]})}),(0,h.jsx)(`tbody`,{children:w.map(e=>(0,h.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,h.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,h.jsx)(`div`,{className:`font-medium text-fg`,children:e.name||`worker`}),(0,h.jsx)(`div`,{className:`font-mono text-[11px] text-faint`,children:e.id})]}),(0,h.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queues.join(`, `)||`—`}),(0,h.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:o(e.activeJobs)}),(0,h.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:o(e.processedJobs)}),(0,h.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:o(e.failedJobs)}),(0,h.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:u(e.lastSeen)})]},e.id))})]})}),x.truncated&&(0,h.jsxs)(`p`,{className:`mt-3 text-xs text-amber-400`,children:[`Showing first `,o(x.list.length),` of `,o(x.total),` `,`workers.`]}),(0,h.jsx)(p,{page:C,pageSize:g,total:x.list.length,onPageChange:b,label:`workers`})]})}export{v as Workers};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{E as i,S as a,X as o,Y as s,c,h as l,k as u,m as d,nt as f,u as p,x as m,y as h}from"./index-CjnfFs1N.js";var g=e(n(),1),_=r(),v=100,y=`No heartbeat recently — derived from lastSeen`;function b(){let{data:e,error:n,loading:r,refetch:b}=u(async()=>(await f.workers()).data?.workers??[],[]),[S,C]=(0,g.useState)(new Set),[w,T]=(0,g.useState)(null),[E,D]=(0,g.useState)(null);if(r&&!e&&!n)return(0,_.jsx)(m,{label:`Loading workers…`});let O=e??[],k=(E?[...O].sort((e,t)=>{let n=E.key===`failed`?e.failedJobs??0:e.lastSeen??0,r=E.key===`failed`?t.failedJobs??0:t.lastSeen??0;return E.dir===`asc`?n-r:r-n}):O).slice(0,v),A=e=>D(t=>t?.key===e?{key:e,dir:t.dir===`desc`?`asc`:`desc`}:{key:e,dir:`desc`}),j=O.filter(e=>e.status===`active`).length,M=O.length-j,N=O.reduce((e,t)=>e+(t.activeJobs??0),0),P=async e=>{if(window.confirm(`Unregister worker "${e.id}"? It can re-register on its next heartbeat.`)){C(t=>new Set(t).add(e.id)),T(null);try{await f.unregisterWorker(e.id),T({ok:!0,text:`Unregistered ${e.id} ✓`})}catch(e){T({ok:!1,text:`Unregister failed: ${e.message}`})}finally{C(t=>{let n=new Set(t);return n.delete(e.id),n}),b()}}};return(0,_.jsxs)(`div`,{children:[(0,_.jsx)(l,{title:`Workers`,description:`Registered workers and their throughput.`,live:!n}),n&&(0,_.jsx)(a,{onRetry:b}),(0,_.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,_.jsx)(d,{label:`Total`,value:c(O.length),compact:!0}),(0,_.jsx)(d,{label:`Active`,value:c(j),tone:`green`,compact:!0}),(0,_.jsx)(`div`,{title:y,children:(0,_.jsx)(d,{label:`Stale`,value:c(M),tone:M?`amber`:`default`,compact:!0})}),(0,_.jsx)(d,{label:`Active Jobs`,value:c(N),tone:`blue`,compact:!0})]}),w&&(0,_.jsx)(`div`,{className:t(`mb-3 text-sm`,w.ok?`text-success`:`text-danger`),children:w.text}),O.length===0?(0,_.jsx)(h,{icon:(0,_.jsx)(o,{}),title:`No workers registered`,hint:`Workers appear here once they connect and register with the server.`}):(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,_.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Worker`}),(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queues`}),(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Active`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Processed`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:(0,_.jsx)(x,{label:`Failed`,active:E?.key===`failed`?E.dir:null,onClick:()=>A(`failed`)})}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:(0,_.jsx)(x,{label:`Last Seen`,active:E?.key===`lastSeen`?E.dir:null,onClick:()=>A(`lastSeen`)})}),(0,_.jsx)(`th`,{className:`w-16 px-5 py-3 text-right font-medium`,children:`Actions`})]})}),(0,_.jsx)(`tbody`,{children:k.map(e=>(0,_.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,_.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,_.jsx)(`div`,{className:`font-medium text-fg`,children:e.name||`worker`}),(0,_.jsx)(`div`,{className:`font-mono text-[11px] text-faint`,children:e.id})]}),(0,_.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queues.join(`, `)||`—`}),(0,_.jsx)(`td`,{className:`px-5 py-3`,children:(0,_.jsx)(`span`,{title:e.status===`active`?void 0:y,className:t(`rounded-full px-2 py-0.5 text-[11px] font-medium`,e.status===`active`?`bg-emerald-500/10 text-success`:`bg-amber-500/10 text-warning`),children:e.status})}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:c(e.activeJobs)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:c(e.processedJobs)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:c(e.failedJobs)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:p(e.lastSeen)}),(0,_.jsx)(`td`,{className:`px-5 py-3`,children:(0,_.jsx)(`div`,{className:`flex justify-end`,children:(0,_.jsx)(i,{"aria-label":`Unregister worker ${e.id}`,disabled:S.has(e.id),onClick:()=>P(e),children:(0,_.jsx)(s,{className:`size-3.5`})})})})]},e.id))})]})}),O.length>v&&(0,_.jsxs)(`p`,{className:`mt-3 text-xs text-warning`,children:[`Showing first `,c(v),` of `,c(O.length),` workers.`]})]})}function x({label:e,active:n,onClick:r}){return(0,_.jsxs)(`button`,{type:`button`,onClick:r,title:`Sort by ${e}`,className:t(`inline-flex items-center gap-1 uppercase tracking-wider transition-colors hover:text-fg`,n?`text-fg`:`text-faint`),children:[e,(0,_.jsx)(`span`,{"aria-hidden":`true`,children:n===`desc`?`↓`:n===`asc`?`↑`:``})]})}export{b as WorkersPro};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CopilotPanel-CZCHTE8m.js","assets/cn-CMFYpumL.js","assets/react-vendor-B68RYDeC.js","assets/form-C-zZyKfB.js","assets/AddJob-D9r_ckWp.js","assets/Benchmark-CYC3PIii.js","assets/connectionStore-B-hNUqwK.js","assets/AreaChart-Dl_9G6GH.js","assets/CopyButton-fN1FbSIy.js","assets/BulkAddJobs-BFjzY7tK.js","assets/CronManager-CU9_cil9.js","assets/Pagination-ByLXrTJL.js","assets/Database-DYlWeDIA.js","assets/Diagnostics-BAfmoJ0e.js","assets/DlqControl-BjeqsueE.js","assets/exportFile-tdUeW5m5.js","assets/DlqPro-vuL9h-Ab.js","assets/promisePool-Daxkc1OB.js","assets/Flows-Czq_GBW2.js","assets/JobInspector-BMi76I46.js","assets/jobActions-CuOdMglt.js","assets/JobsPro-CNgYYpHP.js","assets/LogsPro-BK6dIfm_.js","assets/McpServer-DCTEyxfJ.js","assets/MetricsPro-mUantDrK.js","assets/useThroughputSeries-DMoDDf05.js","assets/QueueControl-DnGbiwVj.js","assets/QueueActions-CPo6RJsA.js","assets/QueueDetailPro-C2faHlWj.js","assets/QueuesOverview-CQdc1MDE.js","assets/S3BackupPro-BgZyvD-0.js","assets/ServerControl-C5Rh0kip.js","assets/UsagePro-xAJXeKjl.js","assets/Webhooks-CxKY1jum.js","assets/WorkersPro-CsGyS9Aq.js","assets/Alerts-D5HU-0Dx.js","assets/Cron-BhZGb_DH.js","assets/Dlq-BPUAPLUg.js","assets/Jobs-I66fxS_x.js","assets/Logs-QacZ07Ig.js","assets/Metrics-Bo_LGDpq.js","assets/Overview-DRa8YOXL.js","assets/QueueDetail-BZQkagxC.js","assets/Queues-DwdrD6Fs.js","assets/S3Backup-9rl71zZ0.js","assets/Settings-DmnnURrE.js","assets/Usage-Df84EVYP.js","assets/Workers-C7btFQcD.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{a as n,c as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./react-vendor-B68RYDeC.js";import{a as h,i as g,n as _,o as v,r as y,t as ee}from"./connectionStore-B-hNUqwK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=e(i(),1),x=s(),te=()=>`${Date.now().toString(36)}${Math.floor(Math.random()*1e6).toString(36)}`;function ne(e){return{channels:e.channels.map(e=>e.type===`email`?e:{...e,target:``}),rules:e.rules}}var re=v()(h(e=>({channels:[],rules:[],addChannel:(t,n)=>e(e=>({channels:[...e.channels,{id:te(),type:t,target:n}]})),removeChannel:t=>e(e=>({channels:e.channels.filter(e=>e.id!==t)})),addRule:t=>e(e=>({rules:[...e.rules,{...t,id:te()}]})),removeRule:t=>e(e=>({rules:e.rules.filter(e=>e.id!==t)})),toggleRule:t=>e(e=>({rules:e.rules.map(e=>e.id===t?{...e,enabled:!e.enabled}:e)}))}),{name:`bq-dash-alerts`,partialize:ne})),ie={error_rate:`error rate`,p99_latency:`p99 latency`,waiting:`waiting jobs`,failed:`failed jobs`,dlq:`DLQ size`},ae=1,S=v(e=>({toasts:[],push:({level:t,title:n,detail:r,ttlMs:i})=>{let a=ae++,o=i??(t===`error`?8e3:4e3);return e(e=>({toasts:[...e.toasts,{id:a,level:t,title:n,detail:r,ttlMs:o}].slice(-5)})),a},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),oe={success:(e,t)=>S.getState().push({level:`success`,title:e,detail:t}),error:(e,t)=>S.getState().push({level:`error`,title:e,detail:t}),info:(e,t)=>S.getState().push({level:`info`,title:e,detail:t})},C=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`BqError`}};async function se(e,t,n,r,i=!0,a=`server`){let o=await fetch(e+t,{...r,headers:{"Content-Type":`application/json`,...n,...r?.headers}});if(!o.ok){let e=`HTTP ${o.status}`;try{let t=await o.json();t?.error&&(e=t.error)}catch{}throw o.status===401&&typeof window<`u`&&window.dispatchEvent(new CustomEvent(`auth:required`,{detail:{scope:a}})),new C(e,o.status)}if(o.status===204)return;let s=await o.text();if(!s)return;let c;try{c=JSON.parse(s)}catch{throw new C(`Invalid JSON response (HTTP ${o.status})`,o.status)}if(i&&c&&typeof c==`object`&&c.ok===!1){let e=c.error;throw new C(e??`Operation failed`,o.status)}return c}var w=(e,t,n=!0)=>se(y(),e,_(),t,n),ce=(globalThis.__BUNQUEUE_AGENT_URL__||`http://localhost:6800`).replace(/\/$/,``),T=(e,t)=>se(ce,e,ee(),t,!0,`agent`),E=e=>encodeURIComponent(e),D=(e,t)=>({method:e,body:t===void 0?void 0:JSON.stringify(t)}),le=[`job.pushed`,`job.started`,`job.completed`,`job.failed`,`job.progress`],O={overview:()=>w(`/dashboard`),queues:(e=500,t=0)=>w(`/dashboard/queues?limit=${e}&offset=${t}`),queuesSummary:()=>w(`/queues/summary`),queueDetail:(e,t=!0)=>w(`/dashboard/queues/${E(e)}?includeJobs=${t}`),stats:()=>w(`/stats`),storage:()=>w(`/storage`),health:()=>w(`/health`,void 0,!1),ping:()=>w(`/ping`),jobsList:(e,t,n=50,r=0)=>{let i=new URLSearchParams;return t?.length&&i.set(`states`,t.join(`,`)),i.set(`limit`,String(n)),i.set(`offset`,String(r)),w(`/queues/${E(e)}/jobs/list?${i}`)},job:e=>w(`/jobs/${E(e)}`),jobByCustomId:e=>w(`/jobs/custom/${E(e)}`),jobResult:e=>w(`/jobs/${E(e)}/result`),jobLogs:e=>w(`/jobs/${E(e)}/logs`),jobChildren:e=>w(`/jobs/${E(e)}/children`),addJob:(e,t)=>w(`/queues/${E(e)}/jobs`,D(`POST`,t)),addJobsBulk:(e,t)=>w(`/queues/${E(e)}/jobs/bulk`,D(`POST`,{jobs:t})),pullBatch:(e,t)=>w(`/queues/${E(e)}/jobs/pull-batch`,D(`POST`,{count:t})),ackBatch:e=>w(`/jobs/ack-batch`,D(`POST`,{ids:e})),cancelJob:e=>w(`/jobs/${E(e)}`,{method:`DELETE`}),promoteJob:e=>w(`/jobs/${E(e)}/promote`,D(`POST`)),discardJob:e=>w(`/jobs/${E(e)}/discard`,D(`POST`)),retryJob:e=>w(`/jobs/${E(e)}/move-to-wait`,D(`POST`)),failJob:(e,t)=>w(`/jobs/${E(e)}/fail`,D(`POST`,{error:t})),updateJobData:(e,t)=>w(`/jobs/${E(e)}/data`,D(`PUT`,{data:t})),changePriority:(e,t)=>w(`/jobs/${E(e)}/priority`,D(`PUT`,{priority:t})),changeDelay:(e,t)=>w(`/jobs/${E(e)}/delay`,D(`PUT`,{delay:t})),moveToDelayed:(e,t)=>w(`/jobs/${E(e)}/move-to-delayed`,D(`POST`,{delay:t})),addJobLog:(e,t,n)=>w(`/jobs/${E(e)}/logs`,D(`POST`,{message:t,level:n})),clearJobLogs:e=>w(`/jobs/${E(e)}/logs`,{method:`DELETE`}),counts:e=>w(`/queues/${E(e)}/counts`),pause:e=>w(`/queues/${E(e)}/pause`,D(`POST`)),resume:e=>w(`/queues/${E(e)}/resume`,D(`POST`)),drain:e=>w(`/queues/${E(e)}/drain`,D(`POST`)),obliterate:e=>w(`/queues/${E(e)}/obliterate`,D(`POST`)),clean:(e,t={})=>w(`/queues/${E(e)}/clean`,D(`POST`,t)),promoteJobs:(e,t)=>w(`/queues/${E(e)}/promote-jobs`,D(`POST`,t==null?void 0:{count:t})),retryCompleted:(e,t)=>w(`/queues/${E(e)}/retry-completed`,D(`POST`,t?{id:t}:void 0)),setRateLimit:(e,t)=>w(`/queues/${E(e)}/rate-limit`,D(`PUT`,{limit:t})),clearRateLimit:e=>w(`/queues/${E(e)}/rate-limit`,{method:`DELETE`}),setConcurrency:(e,t)=>w(`/queues/${E(e)}/concurrency`,D(`PUT`,{concurrency:t})),clearConcurrency:e=>w(`/queues/${E(e)}/concurrency`,{method:`DELETE`}),getStallConfig:e=>w(`/queues/${E(e)}/stall-config`),setStallConfig:(e,t)=>w(`/queues/${E(e)}/stall-config`,D(`PUT`,{config:t})),getDlqConfig:e=>w(`/queues/${E(e)}/dlq-config`),setDlqConfig:(e,t)=>w(`/queues/${E(e)}/dlq-config`,D(`PUT`,{config:t})),dlq:(e,t=100,n=0)=>w(`/queues/${E(e)}/dlq?limit=${t}&offset=${n}`),dlqStats:e=>w(`/queues/${E(e)}/dlq/stats`),retryDlq:(e,t)=>w(`/queues/${E(e)}/dlq/retry`,D(`POST`,t?{jobId:t}:void 0)),purgeDlq:e=>w(`/queues/${E(e)}/dlq/purge`,D(`POST`)),crons:()=>w(`/crons`),createCron:e=>w(`/crons`,D(`POST`,e)),deleteCron:e=>w(`/crons/${E(e)}`,{method:`DELETE`}),webhooks:()=>w(`/webhooks`),addWebhook:e=>w(`/webhooks`,D(`POST`,e)),removeWebhook:e=>w(`/webhooks/${E(e)}`,{method:`DELETE`}),setWebhookEnabled:(e,t)=>w(`/webhooks/${E(e)}/enabled`,D(`PUT`,{enabled:t})),workers:()=>w(`/workers`),unregisterWorker:e=>w(`/workers/${E(e)}`,{method:`DELETE`}),eventsUrl:e=>y()+(e?`/events/queues/${E(e)}`:`/events`),db:{info:()=>T(`/db/info`),tables:()=>T(`/db/tables`),schema:e=>T(`/db/tables/${E(e)}/schema`),rows:(e,t=50,n=0,r,i=`asc`,a)=>T(`/db/tables/${E(e)}?limit=${t}&offset=${n}`+(r?`&orderBy=${E(r)}&dir=${i}`:``)+(a?.value?`&fcol=${E(a.column)}&fop=${a.op}&fval=${E(a.value)}`:``)),cell:(e,t,n)=>T(`/db/tables/${E(e)}/cell?rowid=${t}&column=${E(n)}`),query:e=>T(`/db/query`,D(`POST`,{sql:e}))},agentBase:ce,control:{status:()=>T(`/control/status`),start:()=>T(`/control/start`,{method:`POST`}),stop:()=>T(`/control/stop`,{method:`POST`}),restart:()=>T(`/control/restart`,{method:`POST`}),logs:()=>T(`/control/logs`),getConfig:()=>T(`/control/config`),setConfig:e=>T(`/control/config`,D(`PUT`,e))}},ue=15e3,de=6e4,fe=v(e=>({breaching:[],setBreaching:t=>e({breaching:t})}));async function pe(){if(typeof Notification>`u`)return`denied`;if(Notification.permission===`granted`)return`granted`;try{return await Notification.requestPermission()}catch{return`denied`}}function me(e,t,n){switch(t){case`>=`:return e>=n;case`>`:return e>n;case`<=`:return e<=n;case`<`:return e<n;default:return!1}}var he=(e,t)=>{let n=e+t;return n>0?t/n*100:0};function ge(e,t){let n=e.queue.trim();switch(e.metric){case`waiting`:return t.summary?n?t.summary.find(e=>e.name===n)?.counts.waiting??null:t.summary.reduce((e,t)=>e+t.counts.waiting,0):null;case`failed`:return t.summary?n?t.summary.find(e=>e.name===n)?.counts.failed??null:t.summary.reduce((e,t)=>e+t.counts.failed,0):null;case`dlq`:return t.queues?n?t.queues.find(e=>e.name===n)?.dlq??null:t.queues.reduce((e,t)=>e+(t.dlq??0),0):null;case`error_rate`:if(!t.summary)return null;if(n){let e=t.summary.find(e=>e.name===n);return e?he(e.counts.completed,e.counts.failed):null}return he(t.summary.reduce((e,t)=>e+t.counts.completed,0),t.summary.reduce((e,t)=>e+t.counts.failed,0));case`p99_latency`:{let e=t.overview?.latency?.percentiles;if(!e)return null;let n=Object.values(e).map(e=>e.p99).filter(e=>Number.isFinite(e));return n.length?Math.max(...n):null}default:return null}}function _e(e){let t=`${e.queue||`All queues`}: ${e.metricLabel} ${e.operator} ${e.threshold} (now ${Math.round(e.value)})`;if(oe.error(`Alert: ${e.ruleName}`,t),typeof Notification<`u`&&Notification.permission===`granted`)try{new Notification(`bunqueue alert: ${e.ruleName}`,{body:t,tag:e.ruleId})}catch{}}function ve(){let e=re(e=>e.rules),t=fe(e=>e.setBreaching),n=(0,b.useRef)(new Map),r=(0,b.useRef)(new Map),i=(0,b.useRef)(new Map),a=e.filter(e=>e.enabled).map(e=>`${e.id}:${e.metric}:${e.operator}:${e.threshold}:${e.queue}`).join(`|`);(0,b.useEffect)(()=>{if(!a){t([]),n.current.clear(),r.current.clear(),i.current.clear();return}let e=!1,o=!1,s=async()=>{if(!o){o=!0;try{let[a,o,s]=await Promise.all([O.queuesSummary().catch(()=>null),O.queues().catch(()=>null),O.overview().catch(()=>null)]);if(e||!s)return;let c={summary:a,queues:o?.queues??null,overview:s},l=Date.now(),u=[],d=re.getState().rules.filter(e=>e.enabled),f=new Set(d.map(e=>e.id));for(let e of d){let t=ge(e,c);if(t==null)continue;let a=me(t,e.operator,e.threshold),o=n.current.get(e.id)??!1;if(a){let n=o?i.current.get(e.id)??l:l;i.current.set(e.id,n);let a={ruleId:e.id,ruleName:e.name,metricLabel:ie[e.metric],operator:e.operator,threshold:e.threshold,value:t,queue:e.queue,at:n};u.push(a);let s=l-(r.current.get(e.id)??0)>de;!o&&s&&(_e(a),r.current.set(e.id,l))}else i.current.delete(e.id);n.current.set(e.id,a)}for(let e of[...n.current.keys()])f.has(e)||(n.current.delete(e),r.current.delete(e),i.current.delete(e));t(u)}finally{o=!1}}};s();let c=setInterval(s,ue);return()=>{e=!0,clearInterval(c)}},[a,t])}function ye(){return ve(),null}var k=p();function be(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(`server`),[i,a]=(0,b.useState)(``),o=g(e=>e.baseUrl),s=g(e=>e.setToken),c=g(e=>e.setAgentToken),l=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=e=>{let n=e.detail?.scope;r(n===`agent`?`agent`:`server`),t(!0)};return window.addEventListener(`auth:required`,e),()=>window.removeEventListener(`auth:required`,e)},[]),(0,b.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>l.current?.focus());return()=>cancelAnimationFrame(t)},[e]),e?(0,k.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4`,children:(0,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let r=i.trim();r&&(n===`agent`?c(r):s(r),a(``),t(!1))},role:`dialog`,"aria-modal":`true`,"aria-label":`Authentication required`,className:`w-full max-w-sm rounded-xl border border-line-strong bg-surface p-6 shadow-2xl`,children:[(0,k.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:`Authentication required`}),n===`agent`?(0,k.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`The control agent at `,(0,k.jsx)(`span`,{className:`break-all font-mono text-fg`,children:O.agentBase}),` `,`rejected the request (401). Enter its`,` `,(0,k.jsx)(`span`,{className:`font-mono text-fg`,children:`AGENT_TOKEN`}),` to continue.`]}):(0,k.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`The server at `,(0,k.jsx)(`span`,{className:`break-all font-mono text-fg`,children:o}),` rejected the request (401). Enter its bearer token to continue.`]}),(0,k.jsx)(`input`,{ref:l,type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:n===`agent`?`AGENT_TOKEN`:`Bearer token`,"aria-label":n===`agent`?`Agent token`:`Bearer token`,autoComplete:`off`,className:`mt-4 w-full rounded-lg border border-line bg-surface-2 px-3 py-2 text-sm text-fg outline-none placeholder:text-faint focus-visible:ring-2 focus-visible:ring-accent/50`}),(0,k.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,k.jsx)(d,{to:`/settings`,onClick:()=>t(!1),className:`text-xs text-muted underline-offset-2 hover:text-fg hover:underline`,children:`Open Settings instead`}),(0,k.jsx)(`button`,{type:`submit`,disabled:!i.trim(),className:`rounded-lg bg-accent px-4 py-2 text-sm font-medium text-accent-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 disabled:opacity-50`,children:`Unlock`})]})]})}):null}function A(e){typeof document<`u`&&(document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e)}var j=v()(h((e,t)=>({theme:`dark`,toggle:()=>{let n=t().theme===`dark`?`light`:`dark`;A(n),e({theme:n})},setTheme:t=>{A(t),e({theme:t})}}),{name:`bq-dash-theme`,onRehydrateStorage:()=>e=>{e&&A(e.theme)}}));function xe(){A(j.getState().theme)}function M({children:e,...t}){return(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...t,children:e})}var Se=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M3 3v18h18`}),(0,k.jsx)(`rect`,{x:`7`,y:`12`,width:`3`,height:`6`}),(0,k.jsx)(`rect`,{x:`12`,y:`8`,width:`3`,height:`10`}),(0,k.jsx)(`rect`,{x:`17`,y:`5`,width:`3`,height:`13`})]}),N=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,k.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,k.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,k.jsx)(`line`,{x1:`3`,y1:`6`,x2:`3.01`,y2:`6`}),(0,k.jsx)(`line`,{x1:`3`,y1:`12`,x2:`3.01`,y2:`12`}),(0,k.jsx)(`line`,{x1:`3`,y1:`18`,x2:`3.01`,y2:`18`})]}),P=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`rect`,{x:`2`,y:`7`,width:`20`,height:`14`,rx:`2`}),(0,k.jsx)(`path`,{d:`M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`})]}),F=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z`}),(0,k.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,k.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),Ce=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,k.jsx)(`polyline`,{points:`12 7 12 12 15 14`})]}),we=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M3 3v18h18`}),(0,k.jsx)(`path`,{d:`m19 9-5 5-4-4-3 3`})]}),I=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`8`,rx:`2`}),(0,k.jsx)(`rect`,{x:`4`,y:`14`,width:`16`,height:`6`,rx:`2`}),(0,k.jsx)(`line`,{x1:`8`,y1:`8`,x2:`8.01`,y2:`8`}),(0,k.jsx)(`line`,{x1:`8`,y1:`17`,x2:`8.01`,y2:`17`})]}),Te=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9`}),(0,k.jsx)(`path`,{d:`M13.73 21a2 2 0 0 1-3.46 0`})]}),Ee=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`line`,{x1:`8`,y1:`6`,x2:`21`,y2:`6`}),(0,k.jsx)(`line`,{x1:`8`,y1:`12`,x2:`21`,y2:`12`}),(0,k.jsx)(`line`,{x1:`8`,y1:`18`,x2:`21`,y2:`18`}),(0,k.jsx)(`path`,{d:`M3 6h.01M3 12h.01M3 18h.01`})]}),De=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M12 20V10`}),(0,k.jsx)(`path`,{d:`M18 20V4`}),(0,k.jsx)(`path`,{d:`M6 20v-4`})]}),Oe=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`ellipse`,{cx:`12`,cy:`5`,rx:`8`,ry:`3`}),(0,k.jsx)(`path`,{d:`M4 5v6c0 1.66 3.58 3 8 3s8-1.34 8-3V5`}),(0,k.jsx)(`path`,{d:`M4 11v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6`})]}),ke=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,k.jsx)(`path`,{d:`M3 10h18`}),(0,k.jsx)(`path`,{d:`M9 10v10`})]}),Ae=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,k.jsx)(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z`})]}),je=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,k.jsx)(`path`,{d:`M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41`})]}),Me=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z`})}),Ne=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`polyline`,{points:`15 18 9 12 15 6`})}),Pe=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),Fe=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})}),Ie=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`}),(0,k.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`})]}),Le=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,k.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]}),Re=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`polyline`,{points:`23 4 23 10 17 10`}),(0,k.jsx)(`polyline`,{points:`1 20 1 14 7 14`}),(0,k.jsx)(`path`,{d:`M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15`})]}),ze=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,k.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),Be=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z`}),(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),L=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),Ve=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,k.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}),He=e=>(0,k.jsx)(M,{...e,children:(0,k.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),Ue=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,k.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]}),We=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,k.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),Ge=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,k.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,k.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]}),Ke=e=>(0,k.jsxs)(M,{...e,children:[(0,k.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,k.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,k.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]}),qe=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};async function R(e,t,n=!0){let r=await fetch(y()+e,{...t,headers:{"Content-Type":`application/json`,..._(),...t?.headers}});if(!r.ok){let e=`HTTP ${r.status}`;try{let t=await r.json();t?.error&&(e=t.error)}catch{}throw new qe(e,r.status)}if(r.status===204)return;let i=await r.json();if(n&&i&&typeof i==`object`&&i.ok===!1){let e=i.error;throw new qe(e??`Operation failed`,r.status)}return i}var z=e=>encodeURIComponent(e),B=(e,t)=>R(e,{method:`POST`,body:t?JSON.stringify(t):void 0}),Je=(e,t)=>R(e,{method:`PUT`,body:t?JSON.stringify(t):void 0}),V=e=>R(e,{method:`DELETE`}),H={overview:()=>R(`/dashboard`),queues:(e=200,t=0)=>R(`/dashboard/queues?limit=${e}&offset=${t}`),queueDetail:(e,t=!0)=>R(`/dashboard/queues/${z(e)}?includeJobs=${t}`),stats:()=>R(`/stats`),storage:()=>R(`/storage`,void 0,!1),health:()=>R(`/health`,void 0,!1),jobsList:(e,t={})=>{let n=new URLSearchParams;return t.states?.length&&n.set(`states`,t.states.join(`,`)),n.set(`limit`,String(t.limit??50)),n.set(`offset`,String(t.offset??0)),R(`/queues/${z(e)}/jobs/list?${n.toString()}`)},job:e=>R(`/jobs/${z(e)}`),cancelJob:e=>V(`/jobs/${z(e)}`),promoteJob:e=>B(`/jobs/${z(e)}/promote`),retryJob:e=>B(`/jobs/${z(e)}/move-to-wait`),pause:e=>B(`/queues/${z(e)}/pause`),resume:e=>B(`/queues/${z(e)}/resume`),drain:e=>B(`/queues/${z(e)}/drain`),obliterate:e=>B(`/queues/${z(e)}/obliterate`),clean:(e,t=0,n=1e3)=>B(`/queues/${z(e)}/clean`,{grace:t,limit:n}),retryCompleted:e=>B(`/queues/${z(e)}/retry-completed`),setRateLimit:(e,t)=>Je(`/queues/${z(e)}/rate-limit`,{limit:t}),clearRateLimit:e=>V(`/queues/${z(e)}/rate-limit`),setConcurrency:(e,t)=>Je(`/queues/${z(e)}/concurrency`,{concurrency:t}),clearConcurrency:e=>V(`/queues/${z(e)}/concurrency`),dlq:(e,t=50,n=0)=>R(`/queues/${z(e)}/dlq?limit=${t}&offset=${n}`),dlqStats:e=>R(`/queues/${z(e)}/dlq/stats`),retryDlq:e=>B(`/queues/${z(e)}/dlq/retry`),purgeDlq:e=>B(`/queues/${z(e)}/dlq/purge`),crons:()=>R(`/crons`),deleteCron:e=>V(`/crons/${z(e)}`),workers:()=>R(`/workers`),eventsUrl:e=>y()+(e?`/events/queues/${z(e)}`:`/events`)};function Ye(e){let t=!0;return()=>t?(t=!1,!0):!e()}function U(e,t=[],n={}){let r=g(e=>e.refreshMs),i=n.intervalMs??r,[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(!0),d=(0,b.useRef)(e);d.current=e;let f=(0,b.useRef)(!0),p=(0,b.useRef)(0),m=(0,b.useRef)(void 0),h=(0,b.useRef)(!0),_=(0,b.useRef)(!1),v=(0,b.useCallback)(async()=>{let e=++p.current;try{let t=await d.current();if(!f.current||e!==p.current)return;let n;try{n=JSON.stringify(t)}catch{n=String(Math.random())}n!==m.current&&(m.current=n,o(t)),_.current&&(_.current=!1,c(null))}catch(t){if(!f.current||e!==p.current)return;_.current=!0,c(t)}finally{f.current&&e===p.current&&h.current&&(h.current=!1,u(!1))}},[]);return(0,b.useEffect)(()=>{f.current=!0,m.current=void 0,h.current=!0,u(!0),_.current&&(_.current=!1,c(null));let e=null,t=!1,n=()=>typeof document<`u`&&document.hidden,r=Ye(n),a=async()=>{t||(r()&&await v(),!t&&(e=setTimeout(a,i)))};a();let o=()=>{!n()&&!t&&v()};return typeof document<`u`&&document.addEventListener(`visibilitychange`,o),()=>{t=!0,f.current=!1,e&&clearTimeout(e),typeof document<`u`&&document.removeEventListener(`visibilitychange`,o)}},[i,v,...t]),{data:a,error:s,loading:l,refreshing:l,refetch:v}}function Xe(){let e=g(e=>e.baseUrl),t=e===`/api`?`localhost:6790`:e.replace(/^https?:\/\//,``);return(0,k.jsxs)(`div`,{className:`mx-3 mb-3 flex items-center gap-2.5 rounded-lg border border-line bg-surface px-3 py-2`,children:[(0,k.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-accent to-fuchsia-600 text-[11px] font-bold text-white`,children:`bq`}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`div`,{className:`truncate text-xs font-medium text-fg`,children:`bunqueue`}),(0,k.jsx)(`div`,{className:`truncate font-mono text-[10px] text-faint`,title:e,children:t})]}),(0,k.jsx)(d,{to:`/settings`,"aria-label":`Settings`,className:`text-faint transition-colors hover:text-fg`,children:(0,k.jsx)(Ae,{className:`size-4`})})]})}var Ze=[{section:null,items:[{to:`/`,label:`Overview`,icon:Se,end:!0}]},{section:`Queues`,items:[{to:`/queues`,label:`Queues`,icon:N},{to:`/jobs`,label:`Jobs`,icon:P},{to:`/dlq`,label:`Dead Letter Queue`,icon:F},{to:`/cron`,label:`Cron Jobs`,icon:Ce},{to:`/flows`,label:`Flows`,icon:Ue}]},{section:`Monitoring`,items:[{to:`/metrics`,label:`Metrics`,icon:we},{to:`/workers`,label:`Workers`,icon:I},{to:`/logs`,label:`Logs`,icon:Ee},{to:`/alerts`,label:`Alerts`,icon:Te}]},{section:`Control`,items:[{to:`/server`,label:`Server`,icon:I},{to:`/add-job`,label:`Add Job`,icon:P},{to:`/jobs/bulk-add`,label:`Bulk Add`,icon:P},{to:`/job`,label:`Job Inspector`,icon:Be},{to:`/queue-control`,label:`Queue Control`,icon:N},{to:`/dlq-control`,label:`DLQ Control`,icon:F},{to:`/webhooks`,label:`Webhooks`,icon:L},{to:`/diagnostics`,label:`Diagnostics`,icon:we},{to:`/benchmark`,label:`Benchmark`,icon:L}]},{section:`Management`,items:[{to:`/database`,label:`Database`,icon:ke},{to:`/mcp`,label:`MCP`,icon:L},{to:`/usage`,label:`Usage`,icon:De},{to:`/s3`,label:`S3 Backup`,icon:Oe},{to:`/settings`,label:`Settings`,icon:Ae}]}];function Qe(){let e=g(e=>e.baseUrl),{data:n,error:r,loading:i}=U(async()=>({ok:(await H.health()).ok}),[],{intervalMs:15e3}),a=!r&&n!=null&&n.ok!==!1,o=e.replace(/^https?:\/\//,``)||`local`;return(0,k.jsxs)(`div`,{className:`mx-3 mb-4 flex items-center gap-2 rounded-lg border border-line bg-surface px-3 py-1.5`,children:[(0,k.jsx)(`span`,{className:t(`size-1.5 rounded-full`,i?`bg-zinc-500`:a?`bg-emerald-400`:`bg-red-400`),title:i?`connecting`:a?`connected`:`offline`}),(0,k.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted`,title:e,children:o}),(0,k.jsx)(`span`,{className:`sr-only`,children:i?`connecting`:a?`connected`:`offline`})]})}function $e(){let e=j(e=>e.theme),t=j(e=>e.toggle),n=e===`dark`;return(0,k.jsxs)(`button`,{type:`button`,onClick:t,className:`mx-3 mb-3 flex items-center gap-3 rounded-lg px-3 py-2 text-sm text-muted transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[n?(0,k.jsx)(je,{className:`size-4`}):(0,k.jsx)(Me,{className:`size-4`}),n?`Light Mode`:`Dark Mode`]})}function et({open:e=!1,onClose:n}){return(0,k.jsxs)(k.Fragment,{children:[e&&(0,k.jsx)(`button`,{type:`button`,"aria-label":`Close navigation`,onClick:n,className:`fixed inset-0 z-40 bg-black/50 lg:hidden`}),(0,k.jsxs)(`aside`,{className:t(`flex w-60 shrink-0 flex-col border-r border-line bg-sidebar`,`fixed inset-y-0 left-0 z-50 transition-[transform,visibility] lg:static lg:z-auto lg:translate-x-0`,e?`translate-x-0`:`-translate-x-full lg:translate-x-0 invisible lg:visible`),children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-5`,children:[(0,k.jsx)(`span`,{className:`text-lg font-bold tracking-tight text-fg`,children:`bunqueue`}),(0,k.jsx)(`span`,{className:`rounded-md bg-accent/15 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-accent`,children:`dash`}),(0,k.jsx)(`span`,{title:`Beta — under active development`,className:`rounded-md bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-warning`,children:`beta`})]}),(0,k.jsx)(`nav`,{className:`flex-1 overflow-y-auto px-3 pb-4`,children:Ze.map(e=>(0,k.jsxs)(`div`,{className:`mb-4`,children:[e.section&&(0,k.jsx)(`div`,{className:`px-2 pb-2 pt-1 text-[10px] font-semibold uppercase tracking-wider text-faint`,children:e.section}),(0,k.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.items.map(({to:e,label:n,icon:r,end:i})=>(0,k.jsx)(a,{to:e,end:i,className:({isActive:e})=>t(`group relative flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,e?`bg-surface-2 text-fg`:`text-muted hover:bg-surface-2/60 hover:text-fg`),children:({isActive:e})=>(0,k.jsxs)(k.Fragment,{children:[e&&(0,k.jsx)(`span`,{className:`absolute inset-y-1.5 left-0 w-0.5 rounded-full bg-accent`}),(0,k.jsx)(r,{className:`size-[18px] shrink-0`}),(0,k.jsx)(`span`,{className:`truncate`,children:n})]})},e))})]},e.section??`root`))}),(0,k.jsx)(Qe,{}),(0,k.jsx)($e,{}),(0,k.jsx)(Xe,{})]})]})}var tt=`https://egeominotti.github.io/bunqueue-dashboard/docs/`;function nt(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(0),o=m(),s=j(e=>e.toggle),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useMemo)(()=>{let e=Ze.flatMap(e=>e.items.map(t=>({id:`nav:${t.to}`,label:t.label,hint:e.section??`Home`,run:()=>o(t.to)}))),t=[{id:`act:theme`,label:`Toggle theme (dark / light)`,hint:`Action`,run:s},{id:`act:docs`,label:`Open documentation`,hint:`Action`,run:()=>window.open(tt,`_blank`,`noopener`)}];return[...e,...t]},[o,s]),d=(0,b.useMemo)(()=>{let e=n.trim().toLowerCase();return e?u.filter(t=>`${t.label} ${t.hint}`.toLowerCase().includes(e)):u},[u,n]);(0,b.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))},n=()=>t(!0);return window.addEventListener(`keydown`,e),window.addEventListener(`command-palette:open`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`command-palette:open`,n)}},[]),(0,b.useEffect)(()=>{if(!e)return;let t=document.activeElement;r(``),a(0);let n=requestAnimationFrame(()=>c.current?.focus());return()=>{cancelAnimationFrame(n),t?.focus?.()}},[e]),(0,b.useEffect)(()=>{l.current?.querySelector(`[data-idx="${i}"]`)?.scrollIntoView({block:`nearest`})},[i]);let f=(0,b.useCallback)(()=>t(!1),[]),p=(0,b.useCallback)(e=>{e&&(e.run(),t(!1))},[]);return e?(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center p-4 pt-[12vh]`,children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":`Close command palette`,onClick:f,className:`fixed inset-0 bg-black/50`}),(0,k.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:`relative z-10 w-full max-w-lg overflow-hidden rounded-xl border border-line-strong bg-surface shadow-2xl`,children:[(0,k.jsx)(`input`,{ref:c,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),f()):e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,d.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),p(d[i]))},placeholder:`Search pages and actions…`,"aria-label":`Search pages and actions`,className:`w-full border-b border-line bg-transparent px-4 py-3 text-sm text-fg outline-none placeholder:text-faint`}),(0,k.jsxs)(`ul`,{ref:l,className:`max-h-80 overflow-y-auto py-2`,"aria-label":`Results`,children:[d.length===0&&(0,k.jsx)(`li`,{className:`px-4 py-6 text-center text-sm text-faint`,children:`No matches`}),d.map((e,t)=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-idx":t,onMouseEnter:()=>a(t),onClick:()=>p(e),className:`flex w-full items-center justify-between gap-3 px-4 py-2 text-left text-sm transition-colors ${t===i?`bg-accent/15 text-fg`:`text-muted`}`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:e.label}),(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-faint`,children:e.hint})]})},e.id))]}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-t border-line px-4 py-2 text-xs text-faint`,children:[(0,k.jsx)(`span`,{children:`↑↓ navigate · ↵ open · esc close`}),(0,k.jsx)(`span`,{className:`font-mono`,children:`⌘K`})]})]})]}):null}var W=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}`,G=new Map,K=(e,t,n)=>e.map(e=>e.id===t?n(e):e);function rt(e){return{config:{provider:e.config.provider,baseURL:e.config.baseURL,model:e.config.model}}}var q=v()(h(e=>({open:!1,config:{provider:`anthropic`,baseURL:``,model:`claude-opus-4-8`,apiKey:``},messages:[],pending:[],busy:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open})),setConfig:t=>e(e=>({config:{...e.config,...t}})),clear:()=>{for(let e of G.values())e(!1);G.clear(),e({messages:[],pending:[]})},cancelPending:()=>{for(let e of G.values())e(!1);G.clear(),e({pending:[]})},setBusy:t=>e({busy:t}),addUser:t=>e(e=>({messages:[...e.messages,{id:W(),role:`user`,content:t}]})),startAssistant:()=>{let t=W();return e(e=>({messages:[...e.messages,{id:t,role:`assistant`,content:``,tools:[]}]})),t},appendAssistant:(t,n)=>e(e=>({messages:K(e.messages,t,e=>({...e,content:e.content+n}))})),finishAssistant:(t,n)=>e(e=>({messages:K(e.messages,t,e=>({...e,error:!!n?.error,content:n?.error?e.content||n.error:e.content}))})),addTool:(t,n)=>e(e=>({messages:K(e.messages,t,e=>({...e,tools:[...e.tools??[],n]}))})),updateTool:(t,n,r)=>e(e=>({messages:K(e.messages,t,e=>({...e,tools:(e.tools??[]).map(e=>e.id===n?{...e,...r}:e)}))})),requestConfirm:t=>new Promise(n=>{let r=W();G.set(r,n),e(e=>({pending:[...e.pending,{...t,id:r}]}))}),resolveConfirm:(t,n)=>{let r=G.get(t);r&&(G.delete(t),r(n)),e(e=>({pending:e.pending.filter(e=>e.id!==t)}))}}),{name:`bq-dash-copilot`,partialize:e=>rt(e),merge:(e,t)=>{let n=e??{};return{...t,config:{...t.config,...n.config??{},apiKey:``}}}})),it=(0,b.lazy)(()=>u(()=>import(`./CopilotPanel-CZCHTE8m.js`).then(e=>({default:e.CopilotPanel})),__vite__mapDeps([0,1,2,3])));function at({className:e}){return(0,k.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:[(0,k.jsx)(`path`,{d:`M12 3l1.9 4.6L18.5 9.5 13.9 11.4 12 16l-1.9-4.6L5.5 9.5l4.6-1.9L12 3z`,fill:`currentColor`}),(0,k.jsx)(`path`,{d:`M19 14l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8.8-2z`,fill:`currentColor`,opacity:`0.7`})]})}function ot(){let e=q(e=>e.open),t=q(e=>e.setOpen);return(0,k.jsxs)(k.Fragment,{children:[!e&&(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t(!0),className:`fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2.5 text-sm font-medium text-fg shadow-lg transition-colors hover:border-accent/50 hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,"aria-label":`Open Copilot`,children:[(0,k.jsx)(at,{className:`size-4 text-accent`}),`Copilot`,(0,k.jsx)(`span`,{className:`rounded bg-accent/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-accent`,children:`beta`})]}),e&&(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`div`,{className:`fixed inset-y-0 right-0 z-[60] flex w-full max-w-md items-center justify-center border-l border-line bg-surface text-sm text-muted`,children:`Loading Copilot…`}),children:(0,k.jsx)(it,{})})]})}var st={default:`border border-line bg-surface-2 text-fg hover:bg-surface-2/70 hover:border-line-strong`,ghost:`text-muted hover:text-fg hover:bg-surface-2`,accent:`bg-accent text-accent-fg hover:opacity-90 border border-transparent`,danger:`border border-red-500/30 text-danger hover:bg-red-500/10 hover:border-red-500/50`,warning:`border border-amber-500/30 text-warning hover:bg-amber-500/10 hover:border-amber-500/50`,success:`bg-emerald-500 text-white hover:bg-emerald-500/90 border border-transparent`},ct={sm:`h-8 px-3 text-xs gap-1.5`,md:`h-9 px-4 text-sm gap-2`};function lt({children:e,variant:n=`default`,size:r=`md`,className:i,...a}){return(0,k.jsx)(`button`,{type:`button`,className:t(`inline-flex items-center justify-center rounded-lg font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,`disabled:cursor-not-allowed disabled:opacity-50`,st[n],ct[r],i),...a,children:e})}function ut({children:e,className:n,variant:r=`ghost`,...i}){return(0,k.jsx)(`button`,{type:`button`,className:t(`inline-flex size-8 items-center justify-center rounded-lg transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,`disabled:cursor-not-allowed disabled:opacity-50`,st[r],n),...i,children:e})}function J({children:e,className:n,padded:r=!0}){return(0,k.jsx)(`div`,{className:t(`rounded-xl border border-line bg-surface`,r&&`p-5`,n),children:e})}function dt({title:e,action:t,icon:n}){return(0,k.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,k.jsxs)(`h3`,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[n,e]}),t]})}function ft({className:e}){return(0,k.jsx)(`span`,{className:t(`inline-block size-4 animate-spin rounded-full border-2 border-current border-t-transparent`,e),role:`status`,"aria-label":`Loading`})}function pt({label:e=`Loading…`}){return(0,k.jsxs)(`div`,{className:`flex items-center justify-center gap-3 py-16 text-sm text-muted`,children:[(0,k.jsx)(ft,{}),e]})}function mt({icon:e,title:t,hint:n,action:r}){return(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-line py-14 text-center`,children:[e&&(0,k.jsx)(`div`,{className:`text-faint [&>svg]:size-8`,children:e}),(0,k.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t}),n&&(0,k.jsx)(`div`,{className:`max-w-sm text-xs text-faint`,children:n}),r&&(0,k.jsx)(`div`,{className:`mt-2`,children:r})]})}function ht({onRetry:e,message:t=`Not connected to the bunqueue server — showing empty data.`}){return(0,k.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-amber-500/25 bg-amber-500/[0.06] px-4 py-2.5 text-sm`,children:[(0,k.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-amber-400`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`text-amber-300/90 light:text-amber-700`,children:t}),e&&(0,k.jsx)(`button`,{type:`button`,onClick:e,className:`ml-auto shrink-0 rounded-md border border-amber-500/30 px-2.5 py-1 text-xs font-medium text-amber-200 light:text-amber-700 hover:border-amber-400/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:`Retry`})]})}function gt({error:e,onRetry:t}){return(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-red-500/20 bg-red-500/5 py-14 text-center`,children:[(0,k.jsx)(`div`,{className:`text-sm font-medium text-danger`,children:`Something went wrong`}),(0,k.jsx)(`div`,{className:`max-w-md text-xs text-faint`,children:e.message}),t&&(0,k.jsx)(`button`,{type:`button`,onClick:t,className:`mt-1 rounded-lg border border-line bg-surface-2 px-3 py-1.5 text-xs font-medium text-fg hover:border-line-strong`,children:`Retry`})]})}var _t=class extends b.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught an error`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){let{error:e}=this.state;return e?(0,k.jsx)(`div`,{className:`flex min-h-screen items-center justify-center p-6`,children:(0,k.jsxs)(J,{className:`w-full max-w-lg`,children:[(0,k.jsx)(gt,{error:e}),(0,k.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,k.jsx)(lt,{onClick:()=>window.location.reload(),children:`Reload`})})]})}):this.props.children}},vt={success:{bar:`bg-emerald-500`,title:`text-success`},error:{bar:`bg-red-500`,title:`text-danger`},info:{bar:`bg-accent`,title:`text-accent`}};function yt({toast:e,dismiss:n}){(0,b.useEffect)(()=>{let t=window.setTimeout(()=>n(e.id),e.ttlMs);return()=>window.clearTimeout(t)},[e.id,e.ttlMs,n]);let r=vt[e.level];return(0,k.jsxs)(`div`,{className:`pointer-events-auto flex w-80 max-w-[calc(100vw-2rem)] overflow-hidden rounded-lg border border-line bg-surface shadow-lg`,children:[(0,k.jsx)(`span`,{className:t(`w-1 shrink-0`,r.bar),"aria-hidden":`true`}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 px-3 py-2.5`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`div`,{className:t(`text-sm font-medium`,r.title),children:e.title}),e.detail&&(0,k.jsx)(`div`,{className:`mt-0.5 break-words text-xs text-muted`,children:e.detail})]}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),"aria-label":`Dismiss notification`,className:`-mr-1 shrink-0 rounded p-0.5 text-faint hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:(0,k.jsx)(Ve,{className:`size-4`})})]})]})}function bt(){let e=S(e=>e.toasts),t=S(e=>e.dismiss);return e.length===0?null:(0,k.jsx)(`section`,{className:`pointer-events-none fixed bottom-4 right-4 z-[60] flex flex-col gap-2`,"aria-label":`Notifications`,"aria-live":`polite`,children:e.map(e=>(0,k.jsx)(yt,{toast:e,dismiss:t},e.id))})}function Y(){if(typeof window>`u`)return!1;let{search:e,hash:t}=window.location;return new URLSearchParams(e).has(`demo`)||t.replace(/^#/,``)===`demo`}var xt=Y(),St={"/":`Overview`,"/queues":`Queues`,"/jobs":`Jobs`,"/dlq":`Dead Letter Queue`,"/cron":`Cron Jobs`,"/flows":`Flows`,"/metrics":`Metrics`,"/workers":`Workers`,"/logs":`Logs`,"/server":`Server`,"/add-job":`Add Job`,"/jobs/bulk-add":`Bulk Add Jobs`,"/job":`Job Inspector`,"/queue-control":`Queue Control`,"/dlq-control":`DLQ Control`,"/webhooks":`Webhooks`,"/diagnostics":`Diagnostics`,"/alerts":`Alerts`,"/benchmark":`Benchmark`,"/database":`Database`,"/mcp":`MCP`,"/usage":`Usage`,"/s3":`S3 Backup`,"/settings":`Settings`,"/overview-classic":`Overview (classic)`,"/queues-classic":`Queues (classic)`,"/jobs-classic":`Jobs (classic)`,"/dlq-classic":`DLQ (classic)`,"/metrics-classic":`Metrics (classic)`,"/logs-classic":`Logs (classic)`,"/s3-classic":`S3 Backup (classic)`};function Ct(e){if(St[e])return St[e];if(e.startsWith(`/queues/`)){let t=e.slice(8);try{t=decodeURIComponent(t)}catch{}return`${t} · Queue`}return`bunqueue`}function wt({onMenu:e}){let{pathname:t}=o();return(0,k.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 items-center justify-between gap-3 border-b border-line bg-bg/80 px-4 backdrop-blur sm:px-6 lg:px-8`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":`Open navigation`,onClick:e,className:`-ml-1 flex size-9 shrink-0 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 lg:hidden`,children:(0,k.jsx)(Ge,{className:`size-5`})}),(0,k.jsxs)(`div`,{className:`truncate text-sm text-muted`,children:[(0,k.jsx)(`span`,{className:`text-faint`,children:Ct(t)}),(0,k.jsx)(`span`,{className:`mx-2 hidden text-faint sm:inline`,children:`·`}),(0,k.jsx)(`span`,{className:`hidden text-faint sm:inline`,children:`bunqueue`})]})]}),(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[xt&&(0,k.jsxs)(`span`,{title:`Showing canned sample data. No real bunqueue server is connected.`,className:`hidden items-center gap-1.5 rounded-full border border-accent/40 bg-accent/10 px-2.5 py-1 text-xs font-medium text-accent sm:inline-flex`,children:[(0,k.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`}),`Live demo`]}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>window.dispatchEvent(new Event(`command-palette:open`)),title:`Command palette`,"aria-label":`Open command palette`,className:`flex size-9 shrink-0 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 sm:hidden`,children:(0,k.jsx)(ze,{className:`size-5`})}),(0,k.jsxs)(`button`,{type:`button`,onClick:()=>window.dispatchEvent(new Event(`command-palette:open`)),title:`Command palette (⌘K)`,"aria-label":`Open command palette`,className:`hidden items-center gap-2 rounded-lg border border-line px-2.5 py-1.5 text-xs text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 sm:flex`,children:[(0,k.jsx)(`span`,{children:`Search`}),(0,k.jsx)(`kbd`,{className:`rounded border border-line bg-surface-2 px-1 font-mono text-[10px]`,children:`⌘K`})]}),(0,k.jsx)(d,{to:`/settings`,title:`Settings`,"aria-label":`Open settings`,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-accent to-fuchsia-600 text-xs font-bold text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:`bq`})]})]})}function Tt(){let[e,t]=(0,b.useState)(!1),{pathname:n,key:r}=o();return(0,b.useEffect)(()=>t(!1),[n]),(0,b.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e]),(0,k.jsx)(_t,{children:(0,k.jsxs)(`div`,{className:`flex h-screen overflow-hidden bg-bg text-fg`,children:[(0,k.jsx)(`a`,{href:`#main`,className:`sr-only rounded-md bg-accent px-3 py-2 text-sm font-medium text-accent-fg shadow-lg focus:not-sr-only focus:absolute focus:left-4 focus:top-3 focus:z-50`,children:`Skip to content`}),(0,k.jsx)(et,{open:e,onClose:()=>t(!1)}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,k.jsx)(wt,{onMenu:()=>t(!0)}),(0,k.jsx)(`main`,{id:`main`,tabIndex:-1,className:`flex-1 overflow-y-auto px-4 py-5 outline-none sm:px-6 lg:px-8 lg:py-6`,children:(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`div`,{className:`p-2 text-sm text-muted`,children:`Loading…`}),children:(0,k.jsx)(_t,{resetKey:r,children:(0,k.jsx)(l,{})})})})]}),(0,k.jsx)(nt,{}),(0,k.jsx)(be,{}),(0,k.jsx)(ot,{}),(0,k.jsx)(bt,{}),(0,k.jsx)(ye,{})]})})}var Et={completed:`text-success bg-emerald-500/10`,active:`text-blue-400 light:text-blue-700 bg-blue-500/10`,failed:`text-danger bg-red-500/10`,waiting:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,prioritized:`text-violet-400 light:text-violet-700 bg-violet-500/10`,delayed:`text-warning bg-amber-500/10`,paused:`text-orange-400 light:text-orange-700 bg-orange-500/10`,"waiting-children":`text-cyan-400 light:text-cyan-700 bg-cyan-500/10`,stalled:`text-orange-400 light:text-orange-700 bg-orange-500/10`,enqueued:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,started:`text-blue-400 light:text-blue-700 bg-blue-500/10`,finished:`text-success bg-emerald-500/10`,retry:`text-warning bg-amber-500/10`,cancelled:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`,default:`text-zinc-400 light:text-zinc-600 bg-zinc-500/10`};function Dt({status:e}){return(0,k.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium capitalize`,Et[(e||``).toLowerCase()]??Et.default),children:[(0,k.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),e||`unknown`]})}function Ot({label:e,tone:n=`green`}){return(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted`,children:[(0,k.jsx)(`span`,{className:t(`size-1.5 rounded-full`,n===`green`?`bg-emerald-400`:n===`amber`?`bg-amber-400`:n===`red`?`bg-red-400`:`bg-zinc-400`)}),e]})}function kt({title:e,description:t,live:n,actions:r,back:i}){return(0,k.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-start gap-3`,children:[i,(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight text-fg`,children:e}),n&&(0,k.jsx)(Ot,{label:`Live`,tone:`green`})]}),t&&(0,k.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t})]})]}),r&&(0,k.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:r})]})}var At={default:`text-fg`,green:`text-success`,red:`text-danger`,blue:`text-blue-400 light:text-blue-700`,amber:`text-warning`,accent:`text-accent`};function X({label:e,value:n,tone:r=`default`,hint:i,compact:a}){return(0,k.jsxs)(`div`,{className:t(`rounded-xl border border-line bg-surface`,a?`px-4 py-3`:`px-5 py-4`),children:[(0,k.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:e}),(0,k.jsx)(`div`,{className:t(`mt-2 font-semibold tnum`,a?`text-xl`:`text-3xl`,At[r]),children:n}),i!=null&&(0,k.jsx)(`div`,{className:`mt-1 text-xs text-faint`,children:i})]})}var jt=new Intl.NumberFormat(`de-DE`),Mt=new Intl.DateTimeFormat(`it-IT`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function Z(e){return e==null||!Number.isFinite(e)?`0`:jt.format(e)}function Nt(e,t=2){return e==null||!Number.isFinite(e)?`0%`:`${(e*100).toFixed(t)}%`}function Pt(e,t){let n=e+t;return n>0?t/n:null}function Ft(e){if(e==null||!Number.isFinite(e))return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:Mt.format(t)}function It(e,t=Date.now()){if(e==null||!Number.isFinite(e))return`—`;let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Lt(e){if(e==null||!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<59.95)return`${t.toFixed(1)}s`;let n=Math.round(t);return`${Math.floor(n/60)}m ${n%60}s`}function Rt(e,t){if(e==null||t==null)return;let n=t-e;return n>=0?n:void 0}function zt(e){if(e==null||!Number.isFinite(e))return`—`;let t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=[];return n&&a.push(`${n}d`),(r||n)&&a.push(`${r}h`),a.push(`${i}m`),a.join(` `)}function Bt(e){return e==null||!Number.isFinite(e)?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Vt(e){return e==null||!Number.isFinite(e)?`—`:e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(+(e<10))}ms`}var Ht=/(?:\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b[@-Z\\^_])/g;function Ut(e){return e.replace(Ht,``)}function Wt(e){if(e==null||!Number.isFinite(e))return`—`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(r===0?0:1)} ${t[r]}`}function Gt(e){return!0}function Kt(e){let t=`message`,n,r=[];for(let i of e.split(`
|
|
3
|
+
`)){if(!i||i.startsWith(`:`))continue;let e=i.indexOf(`:`),a=e===-1?i:i.slice(0,e),o=e===-1?``:i.slice(e+1).replace(/^ /,``);a===`event`?t=o:a===`data`?r.push(o):a===`id`&&(n=o)}if(r.length===0)return null;let i=r.join(`
|
|
4
|
+
`),a=i;try{a=JSON.parse(i)}catch{}return{id:n,event:t,data:a}}async function qt(e,t,n){let r=await fetch(e,{headers:{Accept:`text/event-stream`,..._()},signal:n});if(!r.ok||!r.body)throw Error(`SSE connect failed: HTTP ${r.status}`);let i=r.body.getReader(),a=new TextDecoder,o=``;try{for(;;){let{done:e,value:n}=await i.read();if(e)break;o+=a.decode(n,{stream:!0});let r;for(;(r=o.indexOf(`
|
|
5
|
+
|
|
6
|
+
`))!==-1||(r=o.indexOf(`\r
|
|
7
|
+
\r
|
|
8
|
+
`))!==-1;){let e=o[r]===`\r`,n=o.slice(0,r);o=o.slice(r+(e?4:2));let i=Kt(n.replace(/\r/g,``));i&&t(i)}}}finally{i.releaseLock()}}var Q={total:0,completed:0,failed:0,waiting:0,active:0},Jt=250;function Yt(e){let t=e.includes(`:`)?e.split(`:`)[1]:e;switch(t){case`pushed`:case`added`:return`waiting`;case`pulled`:return`active`;case`progress`:return`active`;default:return t}}function Xt(e){let t=g(e=>e.baseUrl),n=g(e=>e.token),[r,i]=(0,b.useState)([]),[a,o]=(0,b.useState)(Q),[s,c]=(0,b.useState)(0),[l,u]=(0,b.useState)(!1),d=(0,b.useRef)([]),f=(0,b.useRef)([]),p=(0,b.useRef)({...Q});return(0,b.useEffect)(()=>{let t=new AbortController,n=0,r=!1;i([]),o(Q),d.current=[],f.current=[],p.current={...Q};let a=e=>new Promise(n=>{let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t.signal.removeEventListener(`abort`,r),n()},e);t.signal.addEventListener(`abort`,r,{once:!0})}),s=e=>{if(Gt(e)&&u(!0),!e.event.startsWith(`job:`))return;let t=e.data??{},r=Yt(e.event),i={seq:++n,event:e.event,queue:t.queue,jobId:t.jobId,name:t.name,status:r,timestamp:t.timestamp??Date.now(),error:t.error,progress:t.progress};f.current.push(i);let a=p.current;a.total+=1,r===`completed`?a.completed+=1:r===`failed`?a.failed+=1:r===`waiting`?a.waiting+=1:r===`active`&&(a.active+=1),d.current.push(Date.now())};(async()=>{for(;!r;){try{await qt(H.eventsUrl(e),s,t.signal)}catch{}if(r)break;u(!1),await a(2e3)}})();let c=setInterval(()=>{if(f.current.length){let e=f.current;f.current=[],e.reverse(),i(t=>[...e,...t].slice(0,Jt))}let e=p.current;e.total&&(p.current={...Q},o(t=>({total:t.total+e.total,completed:t.completed+e.completed,failed:t.failed+e.failed,waiting:t.waiting+e.waiting,active:t.active+e.active})))},150);return()=>{r=!0,t.abort(),clearInterval(c),u(!1)}},[e,t,n]),(0,b.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();d.current=d.current.filter(t=>e-t<5e3),c(d.current.length/5)},1e3);return()=>clearInterval(e)},[]),{events:r,counters:a,throughput:s,connected:l}}var Zt={overview:{stats:{waiting:0,active:0,delayed:0,completed:0,dlq:0,totalPushed:0,totalPulled:0,totalCompleted:0,totalFailed:0,uptime:0},throughput:{pushPerSec:0,pullPerSec:0,completePerSec:0,failPerSec:0},memory:{heapUsed:0,heapTotal:0,rss:0},crons:{total:0}},queuesTotal:0,details:[],failedTotal:0},Qt=100;function $t(){let e=g(e=>e.baseUrl),n=(0,b.useRef)(null),{data:r,error:i,loading:a,refetch:o}=U(async()=>{let[e,t]=await Promise.all([O.overview(),O.queuesSummary()]),r=[...t].sort((e,t)=>(t.counts?.failed??0)-(e.counts?.failed??0)||(t.counts?.waiting??0)-(e.counts?.waiting??0)).slice(0,6).map(e=>({name:e.name,paused:e.paused,counts:e.counts})),i=t.reduce((e,t)=>e+(t.counts?.failed??0),0);return n.current=Date.now(),{overview:e,queuesTotal:t.length,details:r,failedTotal:i}},[]);if(a&&!r&&!i)return(0,k.jsx)(pt,{label:`Loading overview…`});let{overview:s,queuesTotal:c,details:l,failedTotal:u}=r??Zt,{stats:f,throughput:p,memory:m,crons:h}=s,_=Pt(f.completed,u),v=e===`/api`?`localhost:6790`:e.replace(/^https?:\/\//,``),y=f.uptime?zt(f.uptime/1e3):`—`,ee=Wt(m.rss*1024*1024),x=!!i;return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(kt,{title:`Overview`,description:`Real-time system health at a glance.`,live:!0}),i&&(0,k.jsx)(ht,{onRetry:o}),(0,k.jsxs)(`div`,{className:t(`mb-6 flex flex-wrap items-center justify-between gap-y-2 rounded-xl border px-5 py-4`,x?`border-amber-500/25 bg-amber-500/[0.06]`:`border-emerald-500/25 bg-emerald-500/[0.06]`),children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,k.jsxs)(`span`,{className:`relative flex size-2.5`,children:[!x&&(0,k.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-emerald-400 opacity-60`}),(0,k.jsx)(`span`,{className:t(`relative inline-flex size-2.5 rounded-full`,x?`bg-amber-400`:`bg-emerald-400`)})]}),(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`div`,{className:t(`font-semibold`,x?`text-warning`:`text-success`),children:x?`Connection lost — showing last known data`:`bunqueue server connected`}),(0,k.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted`,children:[v,` · uptime `,y,` · `,ee,` RAM`,x&&(0,k.jsxs)(k.Fragment,{children:[` `,`· last updated `,n.current?It(n.current):`never`]})]})]})]}),(0,k.jsx)(`span`,{className:t(`rounded-full px-3 py-1 text-xs font-medium`,x?`bg-amber-500/15 text-warning`:`bg-emerald-500/15 text-success`),children:x?`Stale`:`Online`})]}),(0,k.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,k.jsx)(X,{label:`Error Rate`,value:_==null?`—`:Nt(_),tone:_==null?`default`:_>.05?`red`:`green`,hint:`failed / processed`}),(0,k.jsx)(X,{label:`Failed`,value:Z(u),tone:u?`red`:`default`,hint:`recorded across queues`}),(0,k.jsx)(X,{label:`DLQ`,value:Z(f.dlq),tone:f.dlq?`red`:`default`,hint:`dead-lettered jobs`})]}),(0,k.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,k.jsx)(X,{label:`Completed`,value:Z(f.completed),tone:`green`,compact:!0}),(0,k.jsx)(X,{label:`Active`,value:Z(f.active),tone:`blue`,compact:!0}),(0,k.jsx)(X,{label:`Waiting`,value:Z(f.waiting),tone:f.waiting>Qt?`amber`:`default`,compact:!0}),(0,k.jsx)(X,{label:`Push/sec`,value:p.pushPerSec.toFixed(1),tone:`accent`,hint:`${Bt(f.totalPushed)} since restart`,compact:!0}),(0,k.jsx)(X,{label:`Pull/sec`,value:p.pullPerSec.toFixed(1),tone:`accent`,hint:`${Bt(f.totalPulled)} since restart`,compact:!0}),(0,k.jsx)(X,{label:`Queues`,value:Z(c),hint:`${h.total} cron active`,compact:!0})]}),(0,k.jsxs)(`div`,{className:`mt-8`,children:[(0,k.jsx)(tn,{title:`Queue Health — most loaded`,to:`/queues`}),l.length===0?(0,k.jsx)(J,{children:(0,k.jsx)(`p`,{className:`py-4 text-center text-sm text-faint`,children:`No queues yet.`})}):(0,k.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:l.map(e=>(0,k.jsxs)(d,{to:`/queues/${encodeURIComponent(e.name)}`,className:`rounded-xl border border-line bg-surface p-4 transition-colors hover:border-line-strong`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`truncate font-mono text-sm font-medium text-accent`,children:e.name}),(0,k.jsx)(`span`,{className:t(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:e.paused?`paused`:`active`})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs text-faint`,children:[(0,k.jsx)($,{label:`W`,value:e.counts?.waiting,tone:`text-warning`}),(0,k.jsx)($,{label:`A`,value:e.counts?.active,tone:`text-blue-400`}),(0,k.jsx)($,{label:`C`,value:e.counts?.completed,tone:`text-success`}),(0,k.jsx)($,{label:`F`,value:e.counts?.failed,tone:`text-danger`})]})]},e.name))})]}),(0,k.jsx)(en,{})]})}function en(){let{events:e,connected:n}=Xt();return(0,k.jsxs)(`div`,{className:`mt-8`,children:[(0,k.jsx)(tn,{title:`Recent Activity`,to:`/logs`}),(0,k.jsxs)(J,{padded:!1,children:[!n&&e.length>0&&(0,k.jsx)(`p`,{className:`border-b border-line px-5 py-2 text-xs text-warning`,children:`Event stream disconnected — reconnecting…`}),e.length===0?(0,k.jsx)(`p`,{className:`py-8 text-center text-sm text-faint`,children:n?`Waiting for live activity…`:`Connecting to the event stream…`}):(0,k.jsx)(`ul`,{className:`divide-y divide-line`,children:e.slice(0,8).map(e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between px-5 py-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:t(`size-2 rounded-full`,nn(e.status))}),(0,k.jsxs)(`div`,{className:`text-sm`,children:[(0,k.jsx)(`span`,{className:`font-mono font-medium text-fg`,children:e.queue||`—`}),(0,k.jsx)(`span`,{className:`text-faint`,children:` · `}),(0,k.jsx)(`span`,{className:`font-mono text-xs text-faint`,children:e.jobId?e.jobId.slice(0,8):`—`}),(0,k.jsx)(`span`,{className:`text-faint`,children:` · `}),(0,k.jsx)(`span`,{className:`capitalize text-muted`,children:e.status})]})]}),(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:It(e.timestamp)})]},e.seq))})]})]})}function tn({title:e,to:t}){return(0,k.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,k.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:e}),(0,k.jsxs)(d,{to:t,className:`flex items-center gap-1 text-sm text-muted hover:text-fg`,children:[`View All `,(0,k.jsx)(Ue,{className:`size-3.5`})]})]})}function $({label:e,value:n,tone:r}){return(0,k.jsxs)(`span`,{children:[e,` `,(0,k.jsx)(`span`,{className:t(`tnum font-semibold`,r),children:n==null?`—`:Z(n)})]})}function nn(e){switch(e){case`completed`:return`bg-emerald-400`;case`failed`:return`bg-red-400`;case`active`:return`bg-blue-400`;case`waiting`:return`bg-amber-400`;default:return`bg-accent`}}function rn(){return(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-24 text-center`,children:[(0,k.jsx)(`div`,{className:`text-5xl font-bold text-faint`,children:`404`}),(0,k.jsx)(`p`,{className:`text-sm text-muted`,children:`This page does not exist.`}),(0,k.jsx)(d,{to:`/`,className:`rounded-lg border border-line bg-surface-2 px-4 py-2 text-sm font-medium text-fg hover:border-line-strong`,children:`Back to Overview`})]})}var an=(0,b.lazy)(()=>u(()=>import(`./AddJob-D9r_ckWp.js`).then(e=>({default:e.AddJob})),__vite__mapDeps([4,1,2,3]))),on=(0,b.lazy)(()=>u(()=>import(`./Benchmark-CYC3PIii.js`).then(e=>({default:e.Benchmark})),__vite__mapDeps([5,1,2,6,3,7,8]))),sn=(0,b.lazy)(()=>u(()=>import(`./BulkAddJobs-BFjzY7tK.js`).then(e=>({default:e.BulkAddJobs})),__vite__mapDeps([9,1,2,3]))),cn=(0,b.lazy)(()=>u(()=>import(`./CronManager-CU9_cil9.js`).then(e=>({default:e.CronManager})),__vite__mapDeps([10,1,2,3,11]))),ln=(0,b.lazy)(()=>u(()=>import(`./Database-DYlWeDIA.js`).then(e=>({default:e.Database})),__vite__mapDeps([12,1,2,3,11,8]))),un=(0,b.lazy)(()=>u(()=>import(`./Diagnostics-BAfmoJ0e.js`).then(e=>({default:e.Diagnostics})),__vite__mapDeps([13,1,2]))),dn=(0,b.lazy)(()=>u(()=>import(`./DlqControl-BjeqsueE.js`).then(e=>({default:e.DlqControl})),__vite__mapDeps([14,1,2,3,11,8,15]))),fn=(0,b.lazy)(()=>u(()=>import(`./DlqPro-vuL9h-Ab.js`).then(e=>({default:e.DlqPro})),__vite__mapDeps([16,1,2,3,11,15,17]))),pn=(0,b.lazy)(()=>u(()=>import(`./Flows-Czq_GBW2.js`).then(e=>({default:e.Flows})),__vite__mapDeps([18,1,2]))),mn=(0,b.lazy)(()=>u(()=>import(`./JobInspector-BMi76I46.js`).then(e=>({default:e.JobInspector})),__vite__mapDeps([19,1,2,3,8,15,20]))),hn=(0,b.lazy)(()=>u(()=>import(`./JobsPro-CNgYYpHP.js`).then(e=>({default:e.JobsPro})),__vite__mapDeps([21,1,2,3,11,15,20]))),gn=(0,b.lazy)(()=>u(()=>import(`./LogsPro-BK6dIfm_.js`).then(e=>({default:e.LogsPro})),__vite__mapDeps([22,1,2,3,11,8]))),_n=(0,b.lazy)(()=>u(()=>import(`./McpServer-DCTEyxfJ.js`).then(e=>({default:e.McpServer})),__vite__mapDeps([23,2,1,8]))),vn=(0,b.lazy)(()=>u(()=>import(`./MetricsPro-mUantDrK.js`).then(e=>({default:e.MetricsPro})),__vite__mapDeps([24,1,2,11,7,25]))),yn=(0,b.lazy)(()=>u(()=>import(`./QueueControl-DnGbiwVj.js`).then(e=>({default:e.QueueControl})),__vite__mapDeps([26,1,2,3,27]))),bn=(0,b.lazy)(()=>u(()=>import(`./QueueDetailPro-C2faHlWj.js`).then(e=>({default:e.QueueDetailPro})),__vite__mapDeps([28,1,2,7,25,27,3]))),xn=(0,b.lazy)(()=>u(()=>import(`./QueuesOverview-CQdc1MDE.js`).then(e=>({default:e.QueuesOverview})),__vite__mapDeps([29,1,2,11,17]))),Sn=(0,b.lazy)(()=>u(()=>import(`./S3BackupPro-BgZyvD-0.js`).then(e=>({default:e.S3BackupPro})),__vite__mapDeps([30,1,2,6,3]))),Cn=(0,b.lazy)(()=>u(()=>import(`./ServerControl-C5Rh0kip.js`).then(e=>({default:e.ServerControl})),__vite__mapDeps([31,1,2,3,8]))),wn=(0,b.lazy)(()=>u(()=>import(`./UsagePro-xAJXeKjl.js`).then(e=>({default:e.UsagePro})),__vite__mapDeps([32,2,1]))),Tn=(0,b.lazy)(()=>u(()=>import(`./Webhooks-CxKY1jum.js`).then(e=>({default:e.Webhooks})),__vite__mapDeps([33,1,2,3,11]))),En=(0,b.lazy)(()=>u(()=>import(`./WorkersPro-CsGyS9Aq.js`).then(e=>({default:e.WorkersPro})),__vite__mapDeps([34,1,2]))),Dn=(0,b.lazy)(()=>u(()=>import(`./Alerts-D5HU-0Dx.js`).then(e=>({default:e.Alerts})),__vite__mapDeps([35,1,2,3]))),On=(0,b.lazy)(()=>u(()=>import(`./Cron-BhZGb_DH.js`).then(e=>({default:e.Cron})),__vite__mapDeps([36,1,2,11]))),kn=(0,b.lazy)(()=>u(()=>import(`./Dlq-BPUAPLUg.js`).then(e=>({default:e.Dlq})),__vite__mapDeps([37,1,2,3,11]))),An=(0,b.lazy)(()=>u(()=>import(`./Jobs-I66fxS_x.js`).then(e=>({default:e.Jobs})),__vite__mapDeps([38,1,2,3]))),jn=(0,b.lazy)(()=>u(()=>import(`./Logs-QacZ07Ig.js`).then(e=>({default:e.Logs})),__vite__mapDeps([39,1,2,3,11]))),Mn=(0,b.lazy)(()=>u(()=>import(`./Metrics-Bo_LGDpq.js`).then(e=>({default:e.Metrics})),__vite__mapDeps([40,2,1]))),Nn=(0,b.lazy)(()=>u(()=>import(`./Overview-DRa8YOXL.js`).then(e=>({default:e.Overview})),__vite__mapDeps([41,2,1]))),Pn=(0,b.lazy)(()=>u(()=>import(`./QueueDetail-BZQkagxC.js`).then(e=>({default:e.QueueDetail})),__vite__mapDeps([42,1,2,3]))),Fn=(0,b.lazy)(()=>u(()=>import(`./Queues-DwdrD6Fs.js`).then(e=>({default:e.Queues})),__vite__mapDeps([43,1,2,11]))),In=(0,b.lazy)(()=>u(()=>import(`./S3Backup-9rl71zZ0.js`).then(e=>({default:e.S3Backup})),__vite__mapDeps([44,2,1]))),Ln=(0,b.lazy)(()=>u(()=>import(`./Settings-DmnnURrE.js`).then(e=>({default:e.Settings})),__vite__mapDeps([45,1,2,6,3]))),Rn=(0,b.lazy)(()=>u(()=>import(`./Usage-Df84EVYP.js`).then(e=>({default:e.Usage})),__vite__mapDeps([46,2,1]))),zn=(0,b.lazy)(()=>u(()=>import(`./Workers-C7btFQcD.js`).then(e=>({default:e.Workers})),__vite__mapDeps([47,1,2,11])));function Bn(){return(0,k.jsx)(r,{children:(0,k.jsxs)(f,{element:(0,k.jsx)(Tt,{}),children:[(0,k.jsx)(f,{path:`/`,element:(0,k.jsx)($t,{})}),(0,k.jsx)(f,{path:`/overview-classic`,element:(0,k.jsx)(Nn,{})}),(0,k.jsx)(f,{path:`/queues`,element:(0,k.jsx)(xn,{})}),(0,k.jsx)(f,{path:`/queues-classic`,element:(0,k.jsx)(Fn,{})}),(0,k.jsx)(f,{path:`/queues/:name`,element:(0,k.jsx)(bn,{})}),(0,k.jsx)(f,{path:`/queues-classic/:name`,element:(0,k.jsx)(Pn,{})}),(0,k.jsx)(f,{path:`/jobs`,element:(0,k.jsx)(hn,{})}),(0,k.jsx)(f,{path:`/jobs-classic`,element:(0,k.jsx)(An,{})}),(0,k.jsx)(f,{path:`/dlq`,element:(0,k.jsx)(fn,{})}),(0,k.jsx)(f,{path:`/dlq-classic`,element:(0,k.jsx)(kn,{})}),(0,k.jsx)(f,{path:`/cron`,element:(0,k.jsx)(cn,{})}),(0,k.jsx)(f,{path:`/cron-classic`,element:(0,k.jsx)(On,{})}),(0,k.jsx)(f,{path:`/flows`,element:(0,k.jsx)(pn,{})}),(0,k.jsx)(f,{path:`/metrics`,element:(0,k.jsx)(vn,{})}),(0,k.jsx)(f,{path:`/metrics-classic`,element:(0,k.jsx)(Mn,{})}),(0,k.jsx)(f,{path:`/workers`,element:(0,k.jsx)(En,{})}),(0,k.jsx)(f,{path:`/workers-classic`,element:(0,k.jsx)(zn,{})}),(0,k.jsx)(f,{path:`/logs`,element:(0,k.jsx)(gn,{})}),(0,k.jsx)(f,{path:`/logs-classic`,element:(0,k.jsx)(jn,{})}),(0,k.jsx)(f,{path:`/server`,element:(0,k.jsx)(Cn,{})}),(0,k.jsx)(f,{path:`/add-job`,element:(0,k.jsx)(an,{})}),(0,k.jsx)(f,{path:`/jobs/bulk-add`,element:(0,k.jsx)(sn,{})}),(0,k.jsx)(f,{path:`/job`,element:(0,k.jsx)(mn,{})}),(0,k.jsx)(f,{path:`/queue-control`,element:(0,k.jsx)(yn,{})}),(0,k.jsx)(f,{path:`/cron-manager`,element:(0,k.jsx)(n,{to:`/cron`,replace:!0})}),(0,k.jsx)(f,{path:`/dlq-control`,element:(0,k.jsx)(dn,{})}),(0,k.jsx)(f,{path:`/webhooks`,element:(0,k.jsx)(Tn,{})}),(0,k.jsx)(f,{path:`/diagnostics`,element:(0,k.jsx)(un,{})}),(0,k.jsx)(f,{path:`/alerts`,element:(0,k.jsx)(Dn,{})}),(0,k.jsx)(f,{path:`/benchmark`,element:(0,k.jsx)(on,{})}),(0,k.jsx)(f,{path:`/database`,element:(0,k.jsx)(ln,{})}),(0,k.jsx)(f,{path:`/mcp`,element:(0,k.jsx)(_n,{})}),(0,k.jsx)(f,{path:`/usage`,element:(0,k.jsx)(wn,{})}),(0,k.jsx)(f,{path:`/usage-classic`,element:(0,k.jsx)(Rn,{})}),(0,k.jsx)(f,{path:`/s3`,element:(0,k.jsx)(Sn,{})}),(0,k.jsx)(f,{path:`/s3-classic`,element:(0,k.jsx)(In,{})}),(0,k.jsx)(f,{path:`/settings`,element:(0,k.jsx)(Ln,{})}),(0,k.jsx)(f,{path:`*`,element:(0,k.jsx)(rn,{})})]})})}xe();var Vn=document.getElementById(`root`);if(!Vn)throw Error(`Root element #root not found`);function Hn(){(0,x.createRoot)(Vn).render((0,k.jsx)(b.StrictMode,{children:(0,k.jsx)(c,{basename:`/`,children:(0,k.jsx)(Bn,{})})}))}Y()?u(()=>import(`./install-Bo6DRivH.js`).then(e=>e.installDemo()),[]).catch(()=>{}).finally(Hn):Hn();export{fe as $,H as A,Be as B,J as C,q as D,ut as E,Ve as F,N as G,Ee as H,We as I,ze as J,Re as K,Ce as L,He as M,Ne as N,Ye as O,Pe as P,pe as Q,F as R,ht as S,lt as T,Ie as U,L as V,Fe as W,I as X,Le as Y,j as Z,Ot as _,Ft as a,re as at,gt as b,Z as c,zt as d,C as et,Rt as f,Dt as g,kt as h,Bt as i,ie as it,Ue as j,U as k,Nt as l,X as m,Pt as n,O as nt,Lt as o,Ut as p,Oe as q,Wt as r,oe as rt,Vt as s,Xt as t,le as tt,It as u,Y as v,dt as w,pt as x,mt as y,Ke as z};
|