@bull-board/ui
Version:
A Dashboard UI built on top of bull or bullmq.
1 lines • 5.17 kB
JavaScript
;(self.webpackChunk_bull_board_ui=self.webpackChunk_bull_board_ui||[]).push([["92324"],{96274:function(e,a,i){i.d(a,{n:()=>s});let s={latest:"latest",active:"active",waiting:"waiting",waitingChildren:"waiting-children",prioritized:"prioritized",completed:"completed",failed:"failed",delayed:"delayed",paused:"paused"}},70927:function(e,a,i){i.d(a,{Z:()=>t});var s=i(52322),l=i(6277);i(2784);let t=e=>{let{children:a,className:i}=e;return(0,s.jsx)("div",{className:(0,l.Z)("card-xqyZlH",i),children:a})}},76108:function(e,a,i){i.d(a,{z:()=>l});var s=i(52322);i(2784);let l=()=>(0,s.jsx)("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 192 512",children:(0,s.jsx)("path",{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"})})},42210:function(e,a,i){i.d(a,{f:()=>l});var s=i(52322);i(2784);let l=()=>(0,s.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:(0,s.jsx)("path",{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"})})},63649:function(e,a,i){i.d(a,{o:()=>l});var s=i(52322);i(2784);let l=()=>(0,s.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:(0,s.jsx)("path",{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"})})},7499:function(e,a,i){i.r(a),i.d(a,{OverviewPage:()=>E});var s=i(52322);i(2784);var l=i(59382),t=i(47933),r=i(35252),n=i(70927),d=i(6277);function c(e){return e.split("-").map((e,a)=>a>0?`${e[0].toUpperCase()}${e.slice(1)}`:e).join("")}let u={stats:"stats-rA0n5N",progressBar:"progressBar-kqLFX9",bar:"bar-aiypOU",waiting:"waiting-q0vfA9",waitingChildren:"waitingChildren-S11OYM",prioritized:"prioritized-jTAxmN",completed:"completed-Bjjsoj",failed:"failed-L8BZmZ",active:"active-Aj24DJ",delayed:"delayed-huK85t",paused:"paused-xuACK2"},o=e=>{let{queue:a}=e,{t:i}=(0,l.$G)(),n=a.statuses.reduce((e,i)=>e+(a.counts[i]||0),0);return(0,s.jsxs)("div",{className:u.stats,children:[(0,s.jsx)("div",{className:u.progressBar,children:a.statuses.filter(e=>a.counts[e]>0).map(e=>{let l=a.counts[e];return(0,s.jsx)(t.rU,{to:r.O.queuePage(a.name,{[a.name]:e}),role:"progressbar",style:{width:`${l/n*100}%`},"aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":n,className:(0,d.Z)(u[c(e)],u.bar),title:i(`QUEUE.STATUS.${e.toUpperCase()}`),children:l},e)})}),(0,s.jsx)("div",{children:i("DASHBOARD.JOBS_COUNT",{count:n})})]})},h=e=>{let{queue:a}=e;return(0,s.jsxs)(n.Z,{className:"queueCard-YHG6yO",children:[(0,s.jsx)("div",{children:(0,s.jsx)(t.OL,{to:r.O.queuePage(a.name),className:"link-xZr7yB",children:a.displayName})}),(0,s.jsx)(o,{queue:a})]})};var v=i(96274);let p=[v.n.active,v.n.waiting,v.n.waitingChildren,v.n.prioritized,v.n.completed,v.n.failed,v.n.delayed,v.n.paused],x={legend:"legend-dQr9_P",active:"active-XAIIq_",waiting:"waiting-_PMvwD",waitingChildren:"waitingChildren-IOCmW6",prioritized:"prioritized-fjvq3d",failed:"failed-vDGeD0",completed:"completed-vKG3Gj",delayed:"delayed-sJhMjD",paused:"paused-Fn6oB3"};var j=i(75394);let g=()=>{let{t:e}=(0,l.$G)(),a=(0,j.a)();return(0,s.jsx)("ul",{className:x.legend,children:p.map(i=>{let l=e(`QUEUE.STATUS.${i.toUpperCase()}`).toLocaleUpperCase(),n=a.get("status")===i;return(0,s.jsx)("li",{className:x[c(i)],children:(0,s.jsx)(t.OL,{to:r.O.dashboardPage(n?void 0:i),activeClassName:x.active,isActive:()=>n,children:(0,s.jsx)("span",{title:l,children:l})})},i)})})};var m=i(2575);let w={overview:"overview-zcxjH0",message:"message-FeVnqw",header:"header-J4iuAc"};var f=i(74407),C=i(83576),U=i(64890),A=i(76108),N=i(42210),O=i(63649);let z=e=>{let{actions:a,queues:i}=e,{t}=(0,l.$G)();if(!i)return null;let r=i.every(e=>e.isPaused);return(0,s.jsxs)(f.fC,{children:[(0,s.jsx)(f.xz,{asChild:!0,children:(0,s.jsx)(C.z,{children:(0,s.jsx)(A.z,{})})}),(0,s.jsx)(f.Uv,{children:(0,s.jsx)(U.N,{align:"end",children:r?(0,s.jsxs)(f.ck,{onClick:a.resumeAll,children:[(0,s.jsx)(O.o,{}),t("QUEUE.ACTIONS.RESUME_ALL")]}):(0,s.jsxs)(f.ck,{onClick:a.pauseAll,children:[(0,s.jsx)(N.f,{}),t("QUEUE.ACTIONS.PAUSE_ALL")]})})})]})},E=()=>{let{t:e}=(0,l.$G)(),{actions:a,queues:i}=(0,m.y)(),n=(0,j.a)();a.pollQueues();let d=n.get("status"),c=(null==i?void 0:i.filter(e=>!d||e.counts[d]>0))||[];return(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:w.header,children:[(0,s.jsx)(g,{}),(0,s.jsx)(z,{actions:a,queues:i})]}),c.length>0&&(0,s.jsx)("ul",{className:w.overview,children:c.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(h,{queue:e})},e.name))}),0===c.length&&!!d&&(0,s.jsx)("div",{className:w.message,children:(0,s.jsx)(l.cC,{t:e,i18nKey:"DASHBOARD.NO_FILTERED_MESSAGE",values:{status:e(`QUEUE.STATUS.${d.toUpperCase()}`)},components:{lnk:(0,s.jsx)(t.OL,{to:r.O.dashboardPage()})}})})]})}}}]);