@pg-boss/dashboard 1.1.1 → 1.1.2
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/build/client/assets/MenuTrigger-CoRd-BqL.js +1 -0
- package/build/client/assets/{_index-9fLquIe1.js → _index-BTx7NRR8.js} +1 -1
- package/build/client/assets/{badge-B5ZugmiV.js → badge-DBD4CzAv.js} +1 -1
- package/build/client/assets/{button-Djse56Dx.js → button-Ba8FWhqs.js} +1 -1
- package/build/client/assets/{chevron-down-B4tDL9Ah.js → chevron-down-CYa4FYmp.js} +1 -1
- package/build/client/assets/chunk-UVKPFVEO-YfSfkVr_.js +26 -0
- package/build/client/assets/{createLucideIcon-B0YqJFaz.js → createLucideIcon-Bt-yXILq.js} +1 -1
- package/build/client/assets/db-link-CU7IJqbq.js +1 -0
- package/build/client/assets/dialog-Dkx42Rkd.js +1 -0
- package/build/client/assets/{entry.client-Szv-xmaE.js → entry.client-DXZUROTm.js} +4 -4
- package/build/client/assets/{error-card-CXoOCvsg.js → error-card-D-uZRy_l.js} +1 -1
- package/build/client/assets/{filter-select-DXyBBVm8.js → filter-select-Tk_CBvrn.js} +1 -1
- package/build/client/assets/{index-x2yWco1W.js → index-DuhoQwUK.js} +1 -1
- package/build/client/assets/{jobs-CM6xcK-O.js → jobs-ouYjIGAi.js} +1 -1
- package/build/client/assets/manifest-72f6b3e9.js +1 -0
- package/build/client/assets/{pagination-C4yyCmBA.js → pagination-BItl293Q.js} +1 -1
- package/build/client/assets/{queues._index-Dn3ieC5d.js → queues._index-_ID9kaow.js} +1 -1
- package/build/client/assets/{queues._name-GrviLLx2.js → queues._name-DwdbQND-.js} +1 -1
- package/build/client/assets/{queues._name.jobs._jobId-s_wYs79w.js → queues._name.jobs._jobId-DrgG3VBb.js} +1 -1
- package/build/client/assets/{queues.create-Ch3Mqw52.js → queues.create-CmVW5UVm.js} +1 -1
- package/build/client/assets/{root-D0qqtdF7.js → root-DDqOT0vL.js} +1 -1
- package/build/client/assets/{schedules-DwnuuhxF.js → schedules-B6ixYsvz.js} +1 -1
- package/build/client/assets/{schedules._name._key-DJn-u3Cm.js → schedules._name._key-CXTVKoOc.js} +1 -1
- package/build/client/assets/{schedules.new-CQuE2Uhz.js → schedules.new-Dmasri9v.js} +1 -1
- package/build/client/assets/{send-DVfuC6NR.js → send-CqR34Z50.js} +1 -1
- package/build/client/assets/{table-CtSLyG7m.js → table-Au2E5mnP.js} +1 -1
- package/build/client/assets/useOpenInteractionType-mgYMZAa8.js +12 -0
- package/build/client/assets/{warnings-DqRQYomb.js → warnings-Dj3qacgN.js} +1 -1
- package/build/server/assets/server-build.js +115 -43
- package/package.json +14 -14
- package/build/client/assets/MenuTrigger-CEHCnGow.js +0 -1
- package/build/client/assets/chunk-LFPYN7LY-Cj1DJmJR.js +0 -26
- package/build/client/assets/db-link-DmvfwdX4.js +0 -1
- package/build/client/assets/dialog-CQzw3QVH.js +0 -1
- package/build/client/assets/manifest-acaa4b8e.js +0 -1
- package/build/client/assets/useOpenInteractionType-Ss_6xZdw.js +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r}from"./chunk-
|
|
1
|
+
import{p as r}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as s}from"./db-link-CU7IJqbq.js";import{C as i,c as n}from"./button-Ba8FWhqs.js";function c({title:t,message:a="Please check your database connection and try again.",backTo:e}){return r.jsx("div",{className:"p-6",children:r.jsx(i,{children:r.jsxs(n,{className:"py-8 text-center",children:[r.jsx("p",{className:"text-red-600 dark:text-red-400 font-medium",children:t}),r.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mt-1",children:a}),e&&r.jsx(s,{to:e.href,className:"inline-block mt-4 text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:e.label})]})})})}export{c as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./chunk-
|
|
1
|
+
import{p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as l}from"./db-link-CU7IJqbq.js";function u({value:a,options:t,onChange:o,className:s}){return e.jsx("select",{value:a??"",onChange:r=>o(r.target.value||null),className:l("px-3 py-2 text-sm rounded-lg shadow-sm","bg-white border border-gray-300 text-gray-900","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2","dark:focus:ring-offset-gray-900",s),children:t.map(r=>e.jsx("option",{value:r.value??"",children:r.label},r.label))})}export{u as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O}from"./chunk-
|
|
1
|
+
import{r as O}from"./chunk-UVKPFVEO-YfSfkVr_.js";var y={exports:{}},n={};var l;function S(){if(l)return n;l=1;var u=O();function g(e){var r="https://react.dev/errors/"+e;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)r+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(g(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},m=Symbol.for("react.portal");function v(e,r,t){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:c==null?null:""+c,children:e,containerInfo:r,implementation:t}}var f=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,r){if(e==="font")return"";if(typeof r=="string")return r==="use-credentials"?r:""}return n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,n.createPortal=function(e,r){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)throw Error(g(299));return v(e,r,null,t)},n.flushSync=function(e){var r=f.T,t=i.p;try{if(f.T=null,i.p=2,e)return e()}finally{f.T=r,i.p=t,i.d.f()}},n.preconnect=function(e,r){typeof e=="string"&&(r?(r=r.crossOrigin,r=typeof r=="string"?r==="use-credentials"?r:"":void 0):r=null,i.d.C(e,r))},n.prefetchDNS=function(e){typeof e=="string"&&i.d.D(e)},n.preinit=function(e,r){if(typeof e=="string"&&r&&typeof r.as=="string"){var t=r.as,c=d(t,r.crossOrigin),s=typeof r.integrity=="string"?r.integrity:void 0,o=typeof r.fetchPriority=="string"?r.fetchPriority:void 0;t==="style"?i.d.S(e,typeof r.precedence=="string"?r.precedence:void 0,{crossOrigin:c,integrity:s,fetchPriority:o}):t==="script"&&i.d.X(e,{crossOrigin:c,integrity:s,fetchPriority:o,nonce:typeof r.nonce=="string"?r.nonce:void 0})}},n.preinitModule=function(e,r){if(typeof e=="string")if(typeof r=="object"&&r!==null){if(r.as==null||r.as==="script"){var t=d(r.as,r.crossOrigin);i.d.M(e,{crossOrigin:t,integrity:typeof r.integrity=="string"?r.integrity:void 0,nonce:typeof r.nonce=="string"?r.nonce:void 0})}}else r==null&&i.d.M(e)},n.preload=function(e,r){if(typeof e=="string"&&typeof r=="object"&&r!==null&&typeof r.as=="string"){var t=r.as,c=d(t,r.crossOrigin);i.d.L(e,t,{crossOrigin:c,integrity:typeof r.integrity=="string"?r.integrity:void 0,nonce:typeof r.nonce=="string"?r.nonce:void 0,type:typeof r.type=="string"?r.type:void 0,fetchPriority:typeof r.fetchPriority=="string"?r.fetchPriority:void 0,referrerPolicy:typeof r.referrerPolicy=="string"?r.referrerPolicy:void 0,imageSrcSet:typeof r.imageSrcSet=="string"?r.imageSrcSet:void 0,imageSizes:typeof r.imageSizes=="string"?r.imageSizes:void 0,media:typeof r.media=="string"?r.media:void 0})}},n.preloadModule=function(e,r){if(typeof e=="string")if(r){var t=d(r.as,r.crossOrigin);i.d.m(e,{as:typeof r.as=="string"&&r.as!=="script"?r.as:void 0,crossOrigin:t,integrity:typeof r.integrity=="string"?r.integrity:void 0})}else i.d.m(e)},n.requestFormReset=function(e){i.d.r(e)},n.unstable_batchedUpdates=function(e,r){return e(r)},n.useFormState=function(e,r,t){return f.H.useFormState(e,r,t)},n.useFormStatus=function(){return f.H.useHostTransitionStatus()},n.version="19.2.4",n}var _;function R(){if(_)return y.exports;_=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(g){console.error(g)}}return u(),y.exports=S(),y.exports}var T=R();export{T as a,R as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as f,B as C,t as P,p as e}from"./chunk-
|
|
1
|
+
import{A as f,B as C,t as P,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as c,J as N,d as T,e as b}from"./db-link-CU7IJqbq.js";import{B as S,C as B,a as w,b as k,c as v}from"./button-Ba8FWhqs.js";import{B as E}from"./badge-DBD4CzAv.js";import{T as J,a as R,b as i,c as t,d as A,e as s}from"./table-Au2E5mnP.js";import{P as D}from"./pagination-BItl293Q.js";import{F}from"./filter-select-Tk_CBvrn.js";import{E as O}from"./error-card-D-uZRy_l.js";const Q=C(function(){return e.jsx(O,{title:"Failed to load jobs"})}),V=f(function({loaderData:m}){const{recentJobs:l,page:h,stateFilter:j,hasNextPage:p,hasPrevPage:g}=m,[d,o]=P(),y=(a,r)=>{const n=new URLSearchParams(d);r?n.set(a,r):n.delete(a),n.delete("page"),o(n)},u=a=>{const r=new URLSearchParams(d);r.set("page",a.toString()),o(r)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Jobs"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"Recently created jobs across all queues"})]}),e.jsx(c,{to:"/send",children:e.jsx(S,{variant:"primary",size:"md",children:"Send Job"})})]}),e.jsxs(B,{children:[e.jsxs(w,{className:"flex flex-row items-center justify-between",children:[e.jsx(k,{children:"Jobs"}),e.jsx(F,{value:j,options:N,onChange:a=>y("state",a)})]}),e.jsx(v,{className:"p-0",children:e.jsxs(J,{children:[e.jsx(R,{children:e.jsxs(i,{children:[e.jsx(t,{children:"ID"}),e.jsx(t,{children:"Queue"}),e.jsx(t,{children:"State"}),e.jsx(t,{children:"Retries"}),e.jsx(t,{children:"Created"})]})}),e.jsx(A,{children:l.length===0?e.jsx(i,{children:e.jsx(s,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:5,children:"No jobs found"})}):l.map(a=>e.jsxs(i,{children:[e.jsx(s,{children:e.jsxs(c,{to:`/queues/${encodeURIComponent(a.name)}/jobs/${a.id}`,className:"font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:[a.id.slice(0,8),"..."]})}),e.jsx(s,{className:"text-gray-700 dark:text-gray-300",children:a.name}),e.jsx(s,{children:e.jsx(E,{variant:T[a.state],size:"sm",children:a.state})}),e.jsxs(s,{className:"text-gray-700 dark:text-gray-300",children:[a.retryCount," / ",a.retryLimit]}),e.jsx(s,{className:"text-gray-500 dark:text-gray-400",children:b(new Date(a.createdOn))})]},a.id))})]})}),e.jsx(D,{page:h,totalPages:null,hasNextPage:p,hasPrevPage:g,onPageChange:u})]})]})});export{Q as ErrorBoundary,V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DXZUROTm.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/index-DuhoQwUK.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DDqOT0vL.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/index-DuhoQwUK.js","/assets/db-link-CU7IJqbq.js","/assets/createLucideIcon-Bt-yXILq.js","/assets/MenuTrigger-CoRd-BqL.js","/assets/useOpenInteractionType-mgYMZAa8.js"],"css":["/assets/root-Bpb4WtY4.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/_index-BTx7NRR8.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/table-Au2E5mnP.js","/assets/error-card-D-uZRy_l.js"],"css":[]},"routes/jobs":{"id":"routes/jobs","parentId":"root","path":"jobs","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/jobs-ouYjIGAi.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/table-Au2E5mnP.js","/assets/pagination-BItl293Q.js","/assets/filter-select-Tk_CBvrn.js","/assets/error-card-D-uZRy_l.js"],"css":[]},"routes/queues._index":{"id":"routes/queues._index","parentId":"root","path":"queues","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._index-_ID9kaow.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/filter-select-Tk_CBvrn.js","/assets/table-Au2E5mnP.js"],"css":[]},"routes/queues.create":{"id":"routes/queues.create","parentId":"root","path":"queues/create","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues.create-CmVW5UVm.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/chevron-down-CYa4FYmp.js","/assets/error-card-D-uZRy_l.js","/assets/createLucideIcon-Bt-yXILq.js"],"css":[]},"routes/queues.$name":{"id":"routes/queues.$name","parentId":"root","path":"queues/:name","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._name-DwdbQND-.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/table-Au2E5mnP.js","/assets/pagination-BItl293Q.js","/assets/filter-select-Tk_CBvrn.js","/assets/dialog-Dkx42Rkd.js","/assets/error-card-D-uZRy_l.js","/assets/chevron-down-CYa4FYmp.js","/assets/createLucideIcon-Bt-yXILq.js","/assets/MenuTrigger-CoRd-BqL.js","/assets/useOpenInteractionType-mgYMZAa8.js","/assets/index-DuhoQwUK.js"],"css":[]},"routes/queues.$name.jobs.$jobId":{"id":"routes/queues.$name.jobs.$jobId","parentId":"root","path":"queues/:name/jobs/:jobId","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._name.jobs._jobId-DrgG3VBb.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/dialog-Dkx42Rkd.js","/assets/error-card-D-uZRy_l.js","/assets/createLucideIcon-Bt-yXILq.js","/assets/useOpenInteractionType-mgYMZAa8.js","/assets/index-DuhoQwUK.js"],"css":[]},"routes/schedules":{"id":"routes/schedules","parentId":"root","path":"schedules","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules-B6ixYsvz.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/table-Au2E5mnP.js","/assets/pagination-BItl293Q.js","/assets/error-card-D-uZRy_l.js"],"css":[]},"routes/schedules.$name.$key":{"id":"routes/schedules.$name.$key","parentId":"root","path":"schedules/:name/:key","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules._name._key-CXTVKoOc.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/dialog-Dkx42Rkd.js","/assets/error-card-D-uZRy_l.js","/assets/createLucideIcon-Bt-yXILq.js","/assets/useOpenInteractionType-mgYMZAa8.js","/assets/index-DuhoQwUK.js"],"css":[]},"routes/schedules.new":{"id":"routes/schedules.new","parentId":"root","path":"schedules/new","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules.new-Dmasri9v.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/error-card-D-uZRy_l.js"],"css":[]},"routes/send":{"id":"routes/send","parentId":"root","path":"send","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/send-CqR34Z50.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/db-link-CU7IJqbq.js","/assets/button-Ba8FWhqs.js","/assets/error-card-D-uZRy_l.js"],"css":[]},"routes/warnings":{"id":"routes/warnings","parentId":"root","path":"warnings","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/warnings-Dj3qacgN.js","imports":["/assets/chunk-UVKPFVEO-YfSfkVr_.js","/assets/button-Ba8FWhqs.js","/assets/badge-DBD4CzAv.js","/assets/table-Au2E5mnP.js","/assets/pagination-BItl293Q.js","/assets/filter-select-Tk_CBvrn.js","/assets/error-card-D-uZRy_l.js","/assets/db-link-CU7IJqbq.js"],"css":[]}},"url":"/assets/manifest-72f6b3e9.js","version":"72f6b3e9"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r}from"./chunk-
|
|
1
|
+
import{p as r}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{B as l}from"./button-Ba8FWhqs.js";import{c as o}from"./db-link-CU7IJqbq.js";function m({page:i,totalPages:s,hasNextPage:e,hasPrevPage:t,onPageChange:n}){return!t&&!e?null:r.jsxs("div",{className:o("flex items-center justify-between px-6 py-4 border-t","border-gray-200 dark:border-gray-800"),children:[r.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Page ",i,s!=null&&` of ${s}`]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(l,{variant:"outline",size:"sm",onClick:()=>n(i-1),disabled:!t,children:"Previous"}),r.jsx(l,{variant:"outline",size:"sm",onClick:()=>n(i+1),disabled:!e,children:"Next"})]})]})}export{m as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as Q,B as T,t as E,a as C,p as e}from"./chunk-
|
|
1
|
+
import{A as Q,B as T,t as E,a as C,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as x,c as S}from"./db-link-CU7IJqbq.js";import{B as y,C as P,c as w}from"./button-Ba8FWhqs.js";import{B as i}from"./badge-DBD4CzAv.js";import{F as R}from"./filter-select-Tk_CBvrn.js";import{T as D,a as F,b as u,c as s,d as U,e as a}from"./table-Au2E5mnP.js";const G=T(function(){return e.jsx("div",{className:"p-6",children:e.jsx(P,{children:e.jsxs(w,{className:"py-8 text-center",children:[e.jsx("p",{className:"text-red-600 dark:text-red-400 font-medium",children:"Failed to load queues"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mt-1",children:"Please check your database connection and try again."}),e.jsx(x,{to:"/",className:"inline-block mt-4 text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:"Back to Dashboard"})]})})})}),J=Q(function({loaderData:L}){const{queues:j,totalCount:f,page:h,totalPages:k,hasNextPage:B,hasPrevPage:z,filter:o,search:n}=L,[m,c]=E(),[g,d]=C.useState(n);C.useEffect(()=>{d(n)},[n]);const v=r=>{const t=new URLSearchParams(m);t.set("page",r.toString()),c(t)},p=r=>{const t=new URLSearchParams(m);r.trim()?t.set("search",r.trim()):t.delete("search"),t.delete("page"),c(t)},N=r=>{const t=new URLSearchParams(m);r==="all"?t.delete("filter"):t.set("filter",r),t.delete("page"),c(t)},A=()=>{c({}),d("")},b=o!=="all"||n,I={all:"All Queues",attention:"Needing Attention",partitioned:"Partitioned"};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Queues"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[f.toLocaleString()," queue",f!==1?"s":""," ",b?"found":"configured"]})]}),e.jsx(x,{to:"/queues/create",children:e.jsx(y,{variant:"primary",size:"md",children:"Create Queue"})})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:"Search queues by name...",value:g,onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&p(g)},className:S("w-full px-4 py-2 pl-10 rounded-lg border shadow-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-500","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-400","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-primary-600","dark:focus:ring-primary-500 dark:focus:border-primary-500")}),e.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),g&&e.jsx("button",{onClick:()=>{d(""),p("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer",children:e.jsx(M,{className:"h-5 w-5"})})]})}),e.jsx(R,{value:o,options:[{value:"all",label:"All Queues"},{value:"attention",label:"Needing Attention"},{value:"partitioned",label:"Partitioned"}],onChange:r=>N(r)})]}),b&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Active filters:"}),o!=="all"&&e.jsxs(i,{variant:"primary",size:"sm",children:[I[o],e.jsx("button",{onClick:()=>N("all"),className:"ml-1 hover:text-primary-700 cursor-pointer",children:"×"})]}),n&&e.jsxs(i,{variant:"primary",size:"sm",children:["Search: ",n,e.jsx("button",{onClick:()=>p(""),className:"ml-1 hover:text-primary-700 cursor-pointer",children:"×"})]}),e.jsx("button",{onClick:A,className:"text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 cursor-pointer",children:"Clear all"})]}),e.jsxs(P,{children:[e.jsx(w,{className:"p-0",children:e.jsxs(D,{children:[e.jsx(F,{children:e.jsxs(u,{children:[e.jsx(s,{children:"Name"}),e.jsx(s,{children:"Policy"}),e.jsx(s,{children:"Storage"}),e.jsx(s,{className:"text-right",children:"Queued"}),e.jsx(s,{className:"text-right",children:"Active"}),e.jsx(s,{className:"text-right",children:"Deferred"}),e.jsx(s,{className:"text-right",children:"Total"}),e.jsx(s,{children:"Dead Letter"}),e.jsx(s,{children:"Status"})]})}),e.jsx(U,{children:j.length===0?e.jsx(u,{children:e.jsx(a,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:9,children:"No queues found"})}):j.map(r=>{const t=(r.warningQueueSize??0)>0&&r.queuedCount>(r.warningQueueSize??0);return e.jsxs(u,{children:[e.jsx(a,{children:e.jsx(x,{to:`/queues/${encodeURIComponent(r.name)}`,className:"font-medium text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.name})}),e.jsx(a,{children:e.jsx(i,{variant:"gray",size:"sm",children:r.policy})}),e.jsx(a,{className:"text-gray-700 dark:text-gray-300",children:r.partition?"Partitioned":"Shared"}),e.jsx(a,{className:"text-right text-gray-700 dark:text-gray-300",children:r.queuedCount.toLocaleString()}),e.jsx(a,{className:"text-right text-gray-700 dark:text-gray-300",children:r.activeCount.toLocaleString()}),e.jsx(a,{className:"text-right text-gray-700 dark:text-gray-300",children:r.deferredCount.toLocaleString()}),e.jsx(a,{className:"text-right text-gray-700 dark:text-gray-300",children:r.totalCount.toLocaleString()}),e.jsx(a,{children:r.deadLetter?e.jsx(x,{to:`/queues/${encodeURIComponent(r.deadLetter)}`,className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.deadLetter}):e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),e.jsx(a,{children:t?e.jsx(i,{variant:"error",size:"sm",dot:!0,children:"Backlogged"}):r.activeCount>0?e.jsx(i,{variant:"success",size:"sm",dot:!0,children:"Processing"}):e.jsx(i,{variant:"gray",size:"sm",dot:!0,children:"Idle"})})]},r.name)})})]})}),k>1&&e.jsxs("div",{className:S("flex items-center justify-between px-6 py-4 border-t","border-gray-200 dark:border-gray-800"),children:[e.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Page ",h," of ",k]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>v(h-1),disabled:!z,children:"Previous"}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>v(h+1),disabled:!B,children:"Next"})]})]})]})]})});function H({className:l}){return e.jsx("svg",{className:l,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})})}function M({className:l}){return e.jsx("svg",{className:l,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})}export{G as ErrorBoundary,J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as I,B as J,t as q,a as B,p as e,H as F}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{D as $,c,e as N,J as _,d as z}from"./db-link-DmvfwdX4.js";import{B as P,C as L,c as M,a as H,b as Q}from"./button-Djse56Dx.js";import{B as R}from"./badge-B5ZugmiV.js";import{T as U,a as V,b as T,c as h,d as W,e as d}from"./table-CtSLyG7m.js";import{P as G}from"./pagination-C4yyCmBA.js";import{F as K}from"./filter-select-DXyBBVm8.js";import{D as X,a as Y,b as Z,c as ee,d as ae,e as re}from"./dialog-CQzw3QVH.js";import{E as te}from"./error-card-CXoOCvsg.js";import{C as se}from"./chevron-down-B4tDL9Ah.js";import{c as E}from"./createLucideIcon-B0YqJFaz.js";import{M as ie,a as ne,b as le,c as oe,d as de,e as v}from"./MenuTrigger-CEHCnGow.js";import"./useOpenInteractionType-Ss_6xZdw.js";import"./index-x2yWco1W.js";const ce=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xe=E("chevron-right",ce);const me=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ge=E("ellipsis",me),Re=J(function(){return e.jsx(te,{title:"Failed to load queue",backTo:{href:"/queues",label:"Back to Queues"}})}),Te=I(function({loaderData:n}){const{queue:a,jobs:t,totalCount:s,page:x,totalPages:m,stateFilter:C,hasNextPage:u,hasPrevPage:p}=n,[j,f]=q(),[y,w]=B.useState(!1),D=(l,o)=>{const g=new URLSearchParams(j);o?g.set(l,o):g.delete(l),g.delete("page"),f(g)},b=l=>{const o=new URLSearchParams(j);o.set("page",l.toString()),f(o)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:a.name}),e.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[e.jsx(R,{variant:"gray",children:a.policy}),a.partition&&e.jsx(R,{variant:"primary",children:"Partitioned"})]})]}),e.jsx($,{to:`/send?queue=${encodeURIComponent(a.name)}`,children:e.jsx(P,{variant:"primary",size:"md",children:"Send Job"})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(k,{label:"Queued",value:a.queuedCount,variant:"gray"}),e.jsx(k,{label:"Active",value:a.activeCount,variant:"gray"}),e.jsx(k,{label:"Deferred",value:a.deferredCount,variant:"gray"}),e.jsx(k,{label:"Total",value:a.totalCount,variant:"gray"})]}),e.jsxs(L,{children:[e.jsxs("button",{onClick:()=>w(!y),className:c("w-full flex items-center justify-between px-6 py-4","text-left hover:bg-gray-50 dark:hover:bg-gray-800/50","transition-colors cursor-pointer"),children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Configuration"}),y?e.jsx(se,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"}):e.jsx(xe,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"})]}),y&&e.jsx(M,{className:"border-t border-gray-200 dark:border-gray-800",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Policy",value:a.policy||"—"}),e.jsx(i,{label:"Storage",value:a.partition?"Partitioned":"Shared"}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Dead Letter"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:a.deadLetter?e.jsx($,{to:`/queues/${a.deadLetter}`,className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:a.deadLetter}):"—"})]}),e.jsx(i,{label:"Warning Threshold",value:a.warningQueueSize||"—"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Retry Limit",value:a.retryLimit??0}),e.jsx(i,{label:"Retry Delay",value:a.retryDelay?`${a.retryDelay}ms`:"—"}),e.jsx(i,{label:"Retry Delay Max",value:a.retryDelayMax?`${a.retryDelayMax}ms`:"—"}),e.jsx(i,{label:"Retry Backoff",value:a.retryBackoff?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Expiration",value:S(a.expireInSeconds)}),e.jsx(i,{label:"Retention",value:S(a.retentionSeconds)}),e.jsx(i,{label:"Deletion",value:S(a.deleteAfterSeconds)})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Created",value:a.createdOn?N(new Date(a.createdOn)):"—"}),e.jsx(i,{label:"Last monitored",value:a.monitorOn?N(new Date(a.monitorOn)):"—"}),e.jsx(i,{label:"Last maintained",value:a.maintainOn?N(new Date(a.maintainOn)):"—"})]})]})})]}),e.jsxs(L,{children:[e.jsxs(H,{className:"flex flex-row items-center justify-between",children:[e.jsxs(Q,{children:["Jobs",s!==null&&` (${s.toLocaleString()})`]}),e.jsx(K,{value:C,options:_,onChange:l=>D("state",l)})]}),e.jsx(M,{className:"p-0",children:e.jsxs(U,{children:[e.jsx(V,{children:e.jsxs(T,{children:[e.jsx(h,{children:"ID"}),e.jsx(h,{children:"State"}),e.jsx(h,{children:"Priority"}),e.jsx(h,{children:"Retries"}),e.jsx(h,{children:"Created"}),e.jsx(h,{children:"Actions"})]})}),e.jsx(W,{children:t.length===0?e.jsx(T,{children:e.jsx(d,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No jobs found"})}):t.map(l=>e.jsx(he,{job:l,queueName:a.name},l.id))})]})}),e.jsx(G,{page:x,totalPages:m,hasNextPage:u,hasPrevPage:p,onPageChange:b})]})]})});function he({job:r,queueName:n}){const a=F(),t=a.state!=="idle",[s,x]=B.useState(null),m=a.data,C=m&&!m.success&&m.affected===0,u=o=>{a.submit({jobId:r.id,intent:o},{method:"post"})},p=(o,g,O,A)=>{x({open:!0,title:g,description:O,confirmLabel:A,intent:o})},j=()=>{s&&(u(s.intent),x(null))},f=r.state==="created"||r.state==="retry"||r.state==="active",y=r.state==="failed",w=r.state==="cancelled",D=r.state!=="active",b=c("flex w-full items-center px-3 py-2 text-sm cursor-pointer","outline-none transition-colors rounded-sm","text-gray-700 data-highlighted:bg-gray-100 data-highlighted:text-gray-900","dark:text-gray-300 dark:data-highlighted:bg-gray-800 dark:data-highlighted:text-gray-100"),l=c("flex w-full items-center px-3 py-2 text-sm cursor-pointer","outline-none transition-colors rounded-sm","text-red-600 data-highlighted:bg-red-50 data-highlighted:text-red-700","dark:text-red-400 dark:data-highlighted:bg-red-950 dark:data-highlighted:text-red-300");return e.jsxs(e.Fragment,{children:[e.jsxs(T,{children:[e.jsx(d,{children:e.jsxs($,{to:`/queues/${n}/jobs/${r.id}`,className:"font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:[r.id.slice(0,8),"..."]})}),e.jsx(d,{children:e.jsx(ue,{state:r.state})}),e.jsx(d,{className:"text-gray-700 dark:text-gray-300",children:r.priority}),e.jsxs(d,{className:"text-gray-700 dark:text-gray-300",children:[r.retryCount," / ",r.retryLimit]}),e.jsx(d,{className:"text-gray-500 dark:text-gray-400",children:N(new Date(r.createdOn))}),e.jsx(d,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[C&&e.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-400",title:m.message,children:"Failed"}),e.jsxs(ie,{children:[e.jsx(ne,{className:c("inline-flex items-center justify-center rounded-md p-1.5","text-gray-500 hover:text-gray-900 hover:bg-gray-100","dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800","focus:outline-none focus:ring-2 focus:ring-primary-500","transition-colors disabled:opacity-50"),disabled:t,"aria-label":"Job actions",children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsx(le,{children:e.jsx(oe,{children:e.jsxs(de,{className:c("min-w-[10rem] rounded-md border p-1 shadow-md z-50","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[y&&e.jsx(v,{className:b,onClick:()=>u("retry"),children:"Retry"}),w&&e.jsx(v,{className:b,onClick:()=>u("resume"),children:"Resume"}),f&&e.jsx(v,{className:l,onClick:()=>p("cancel","Cancel Job",`Are you sure you want to cancel job ${r.id.slice(0,8)}...? This will stop the job from being processed.`,"Cancel Job"),children:"Cancel"}),D&&e.jsx(v,{className:l,onClick:()=>p("delete","Delete Job",`Are you sure you want to delete job ${r.id.slice(0,8)}...? This action cannot be undone.`,"Delete"),children:"Delete"})]})})})]})]})})]}),e.jsx(X,{open:s?.open??!1,onOpenChange:o=>!o&&x(null),children:e.jsxs(Y,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:[e.jsxs(Z,{children:[e.jsx(ee,{children:s?.title}),e.jsx(ae,{className:"mt-2",children:s?.description})]}),e.jsxs(re,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(P,{variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>x(null),children:"Cancel"}),e.jsx(P,{variant:"danger",size:"sm",className:"cursor-pointer",onClick:j,children:s?.confirmLabel})]})]})})]})}function ue({state:r}){return e.jsx(R,{variant:z[r],size:"sm",children:r})}function k({label:r,value:n,variant:a}){const t={primary:"text-primary-600 dark:text-primary-400",success:"text-green-600 dark:text-green-400",warning:"text-amber-600 dark:text-amber-400",gray:"text-gray-600 dark:text-gray-400"};return e.jsxs("div",{className:c("rounded-lg border p-4","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800"),children:[e.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:r}),e.jsx("p",{className:c("text-2xl font-semibold",t[a]),children:n.toLocaleString()})]})}function i({label:r,value:n}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:r}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:n?.toString()||"—"})]})}function S(r){if(!r)return"—";if(r<60)return`${r} seconds`;if(r<3600){const t=Math.floor(r/60);return`${t} ${t===1?"minute":"minutes"}`}if(r<86400){const t=Math.floor(r/3600),s=Math.floor(r%3600/60);return s===0?`${t} ${t===1?"hour":"hours"}`:`${t} ${t===1?"hour":"hours"} ${s} ${s===1?"minute":"minutes"}`}const n=Math.floor(r/86400),a=Math.floor(r%86400/3600);return a===0?`${n} ${n===1?"day":"days"}`:`${n} ${n===1?"day":"days"} ${a} ${a===1?"hour":"hours"}`}export{Re as ErrorBoundary,Te as default};
|
|
1
|
+
import{A as I,B as J,t as q,a as B,p as e,H as F}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as $,c,e as N,J as _,d as z}from"./db-link-CU7IJqbq.js";import{B as P,C as L,c as M,a as H,b as Q}from"./button-Ba8FWhqs.js";import{B as R}from"./badge-DBD4CzAv.js";import{T as U,a as V,b as T,c as h,d as W,e as d}from"./table-Au2E5mnP.js";import{P as G}from"./pagination-BItl293Q.js";import{F as K}from"./filter-select-Tk_CBvrn.js";import{D as X,a as Y,b as Z,c as ee,d as ae,e as re}from"./dialog-Dkx42Rkd.js";import{E as te}from"./error-card-D-uZRy_l.js";import{C as se}from"./chevron-down-CYa4FYmp.js";import{c as E}from"./createLucideIcon-Bt-yXILq.js";import{M as ie,a as ne,b as le,c as oe,d as de,e as v}from"./MenuTrigger-CoRd-BqL.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const ce=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xe=E("chevron-right",ce);const me=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ge=E("ellipsis",me),Re=J(function(){return e.jsx(te,{title:"Failed to load queue",backTo:{href:"/queues",label:"Back to Queues"}})}),Te=I(function({loaderData:n}){const{queue:a,jobs:t,totalCount:s,page:x,totalPages:m,stateFilter:C,hasNextPage:u,hasPrevPage:p}=n,[j,f]=q(),[y,w]=B.useState(!1),D=(l,o)=>{const g=new URLSearchParams(j);o?g.set(l,o):g.delete(l),g.delete("page"),f(g)},b=l=>{const o=new URLSearchParams(j);o.set("page",l.toString()),f(o)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:a.name}),e.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[e.jsx(R,{variant:"gray",children:a.policy}),a.partition&&e.jsx(R,{variant:"primary",children:"Partitioned"})]})]}),e.jsx($,{to:`/send?queue=${encodeURIComponent(a.name)}`,children:e.jsx(P,{variant:"primary",size:"md",children:"Send Job"})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(k,{label:"Queued",value:a.queuedCount,variant:"gray"}),e.jsx(k,{label:"Active",value:a.activeCount,variant:"gray"}),e.jsx(k,{label:"Deferred",value:a.deferredCount,variant:"gray"}),e.jsx(k,{label:"Total",value:a.totalCount,variant:"gray"})]}),e.jsxs(L,{children:[e.jsxs("button",{onClick:()=>w(!y),className:c("w-full flex items-center justify-between px-6 py-4","text-left hover:bg-gray-50 dark:hover:bg-gray-800/50","transition-colors cursor-pointer"),children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Configuration"}),y?e.jsx(se,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"}):e.jsx(xe,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"})]}),y&&e.jsx(M,{className:"border-t border-gray-200 dark:border-gray-800",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Policy",value:a.policy||"—"}),e.jsx(i,{label:"Storage",value:a.partition?"Partitioned":"Shared"}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Dead Letter"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:a.deadLetter?e.jsx($,{to:`/queues/${a.deadLetter}`,className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:a.deadLetter}):"—"})]}),e.jsx(i,{label:"Warning Threshold",value:a.warningQueueSize||"—"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Retry Limit",value:a.retryLimit??0}),e.jsx(i,{label:"Retry Delay",value:a.retryDelay?`${a.retryDelay}ms`:"—"}),e.jsx(i,{label:"Retry Delay Max",value:a.retryDelayMax?`${a.retryDelayMax}ms`:"—"}),e.jsx(i,{label:"Retry Backoff",value:a.retryBackoff?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Expiration",value:S(a.expireInSeconds)}),e.jsx(i,{label:"Retention",value:S(a.retentionSeconds)}),e.jsx(i,{label:"Deletion",value:S(a.deleteAfterSeconds)})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4",children:[e.jsx(i,{label:"Created",value:a.createdOn?N(new Date(a.createdOn)):"—"}),e.jsx(i,{label:"Last monitored",value:a.monitorOn?N(new Date(a.monitorOn)):"—"}),e.jsx(i,{label:"Last maintained",value:a.maintainOn?N(new Date(a.maintainOn)):"—"})]})]})})]}),e.jsxs(L,{children:[e.jsxs(H,{className:"flex flex-row items-center justify-between",children:[e.jsxs(Q,{children:["Jobs",s!==null&&` (${s.toLocaleString()})`]}),e.jsx(K,{value:C,options:_,onChange:l=>D("state",l)})]}),e.jsx(M,{className:"p-0",children:e.jsxs(U,{children:[e.jsx(V,{children:e.jsxs(T,{children:[e.jsx(h,{children:"ID"}),e.jsx(h,{children:"State"}),e.jsx(h,{children:"Priority"}),e.jsx(h,{children:"Retries"}),e.jsx(h,{children:"Created"}),e.jsx(h,{children:"Actions"})]})}),e.jsx(W,{children:t.length===0?e.jsx(T,{children:e.jsx(d,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No jobs found"})}):t.map(l=>e.jsx(he,{job:l,queueName:a.name},l.id))})]})}),e.jsx(G,{page:x,totalPages:m,hasNextPage:u,hasPrevPage:p,onPageChange:b})]})]})});function he({job:r,queueName:n}){const a=F(),t=a.state!=="idle",[s,x]=B.useState(null),m=a.data,C=m&&!m.success&&m.affected===0,u=o=>{a.submit({jobId:r.id,intent:o},{method:"post"})},p=(o,g,O,A)=>{x({open:!0,title:g,description:O,confirmLabel:A,intent:o})},j=()=>{s&&(u(s.intent),x(null))},f=r.state==="created"||r.state==="retry"||r.state==="active",y=r.state==="failed",w=r.state==="cancelled",D=r.state!=="active",b=c("flex w-full items-center px-3 py-2 text-sm cursor-pointer","outline-none transition-colors rounded-sm","text-gray-700 data-highlighted:bg-gray-100 data-highlighted:text-gray-900","dark:text-gray-300 dark:data-highlighted:bg-gray-800 dark:data-highlighted:text-gray-100"),l=c("flex w-full items-center px-3 py-2 text-sm cursor-pointer","outline-none transition-colors rounded-sm","text-red-600 data-highlighted:bg-red-50 data-highlighted:text-red-700","dark:text-red-400 dark:data-highlighted:bg-red-950 dark:data-highlighted:text-red-300");return e.jsxs(e.Fragment,{children:[e.jsxs(T,{children:[e.jsx(d,{children:e.jsxs($,{to:`/queues/${n}/jobs/${r.id}`,className:"font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:[r.id.slice(0,8),"..."]})}),e.jsx(d,{children:e.jsx(ue,{state:r.state})}),e.jsx(d,{className:"text-gray-700 dark:text-gray-300",children:r.priority}),e.jsxs(d,{className:"text-gray-700 dark:text-gray-300",children:[r.retryCount," / ",r.retryLimit]}),e.jsx(d,{className:"text-gray-500 dark:text-gray-400",children:N(new Date(r.createdOn))}),e.jsx(d,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[C&&e.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-400",title:m.message,children:"Failed"}),e.jsxs(ie,{children:[e.jsx(ne,{className:c("inline-flex items-center justify-center rounded-md p-1.5","text-gray-500 hover:text-gray-900 hover:bg-gray-100","dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800","focus:outline-none focus:ring-2 focus:ring-primary-500","transition-colors disabled:opacity-50"),disabled:t,"aria-label":"Job actions",children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsx(le,{children:e.jsx(oe,{children:e.jsxs(de,{className:c("min-w-[10rem] rounded-md border p-1 shadow-md z-50","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[y&&e.jsx(v,{className:b,onClick:()=>u("retry"),children:"Retry"}),w&&e.jsx(v,{className:b,onClick:()=>u("resume"),children:"Resume"}),f&&e.jsx(v,{className:l,onClick:()=>p("cancel","Cancel Job",`Are you sure you want to cancel job ${r.id.slice(0,8)}...? This will stop the job from being processed.`,"Cancel Job"),children:"Cancel"}),D&&e.jsx(v,{className:l,onClick:()=>p("delete","Delete Job",`Are you sure you want to delete job ${r.id.slice(0,8)}...? This action cannot be undone.`,"Delete"),children:"Delete"})]})})})]})]})})]}),e.jsx(X,{open:s?.open??!1,onOpenChange:o=>!o&&x(null),children:e.jsxs(Y,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:[e.jsxs(Z,{children:[e.jsx(ee,{children:s?.title}),e.jsx(ae,{className:"mt-2",children:s?.description})]}),e.jsxs(re,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(P,{variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>x(null),children:"Cancel"}),e.jsx(P,{variant:"danger",size:"sm",className:"cursor-pointer",onClick:j,children:s?.confirmLabel})]})]})})]})}function ue({state:r}){return e.jsx(R,{variant:z[r],size:"sm",children:r})}function k({label:r,value:n,variant:a}){const t={primary:"text-primary-600 dark:text-primary-400",success:"text-green-600 dark:text-green-400",warning:"text-amber-600 dark:text-amber-400",gray:"text-gray-600 dark:text-gray-400"};return e.jsxs("div",{className:c("rounded-lg border p-4","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800"),children:[e.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:r}),e.jsx("p",{className:c("text-2xl font-semibold",t[a]),children:n.toLocaleString()})]})}function i({label:r,value:n}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:r}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:n?.toString()||"—"})]})}function S(r){if(!r)return"—";if(r<60)return`${r} seconds`;if(r<3600){const t=Math.floor(r/60);return`${t} ${t===1?"minute":"minutes"}`}if(r<86400){const t=Math.floor(r/3600),s=Math.floor(r%3600/60);return s===0?`${t} ${t===1?"hour":"hours"}`:`${t} ${t===1?"hour":"hours"} ${s} ${s===1?"minute":"minutes"}`}const n=Math.floor(r/86400),a=Math.floor(r%86400/3600);return a===0?`${n} ${n===1?"day":"days"}`:`${n} ${n===1?"day":"days"} ${a} ${a===1?"hour":"hours"}`}export{Re as ErrorBoundary,Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,p as e,A as k,B as N,H as C}from"./chunk-
|
|
1
|
+
import{a as j,p as e,A as k,B as N,H as C}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as p,c as y,e as m}from"./db-link-CU7IJqbq.js";import{B as x,C as D,a as w,b as B,c as L}from"./button-Ba8FWhqs.js";import{B as I}from"./badge-DBD4CzAv.js";import{D as O,a as T,b as R,c as E,d as S,e as A}from"./dialog-Dkx42Rkd.js";import{E as J}from"./error-card-D-uZRy_l.js";import{c as b}from"./createLucideIcon-Bt-yXILq.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const $=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],z=b("check",$);const _=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],q=b("copy",_);function h({title:o,description:d,confirmLabel:t,confirmVariant:n="primary",triggerVariant:c="ghost",trigger:r,onConfirm:g,disabled:u}){const[s,i]=j.useState(!1),l=()=>{g(),i(!1)};return e.jsxs(O,{open:s,onOpenChange:i,children:[e.jsx(x,{variant:c,size:"sm",disabled:u,onClick:()=>i(!0),className:"cursor-pointer",children:r}),e.jsxs(T,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:[e.jsxs(R,{children:[e.jsx(E,{children:o}),e.jsx(S,{className:"mt-2",children:d})]}),e.jsxs(A,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(x,{variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>i(!1),children:"Cancel"}),e.jsx(x,{variant:n==="danger"?"danger":"primary",size:"sm",className:"cursor-pointer",onClick:l,children:t})]})]})]})}const W=N(function(){return e.jsx(J,{title:"Failed to load job",backTo:{href:"/queues",label:"Back to Queues"}})}),X=k(function({loaderData:d}){const{job:t,queueName:n}=d,c=C(),r=c.state!=="idle",[g,u]=j.useState(!1),s=c.data,i=s&&!s.success&&s.affected===0,l=v=>{c.submit({intent:v},{method:"post"})},f=async()=>{await navigator.clipboard.writeText(t.id),u(!0),setTimeout(()=>u(!1),2e3)};return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:["Job Details - ",n]})}),e.jsxs(D,{children:[e.jsxs(w,{className:"flex flex-row items-center justify-between",children:[e.jsx(B,{children:"Details"}),e.jsxs("div",{className:"flex items-center gap-2",children:[i&&e.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-400",title:s.message,children:"Action failed"}),t.state==="failed"&&e.jsx(x,{variant:"outline",size:"sm",disabled:r,onClick:()=>l("retry"),children:"Retry"}),t.state==="cancelled"&&e.jsx(x,{variant:"outline",size:"sm",disabled:r,onClick:()=>l("resume"),children:"Resume"}),(t.state==="created"||t.state==="retry"||t.state==="active")&&e.jsx(h,{title:"Cancel Job",description:`Are you sure you want to cancel job ${t.id.slice(0,8)}...? This will prevent the job from being processed.`,confirmLabel:"Cancel Job",confirmVariant:"danger",triggerVariant:"outline",trigger:"Cancel",onConfirm:()=>l("cancel"),disabled:r}),t.state!=="active"&&e.jsx(h,{title:"Delete Job",description:`Are you sure you want to delete job ${t.id.slice(0,8)}...? This action cannot be undone.`,confirmLabel:"Delete",confirmVariant:"danger",triggerVariant:"danger",trigger:"Delete",onConfirm:()=>l("delete"),disabled:r})]})]}),e.jsxs(L,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Queue"}),e.jsxs("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100 flex items-center gap-2",children:[e.jsx(p,{to:`/queues/${encodeURIComponent(n)}`,className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:n}),t.policy&&e.jsx(I,{variant:"gray",size:"sm",children:t.policy})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Job ID"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("code",{className:"text-sm font-mono break-all text-gray-900 dark:text-gray-100",children:t.id}),e.jsx("button",{onClick:f,className:y("p-1 rounded-md transition-colors cursor-pointer flex-shrink-0","text-gray-500 hover:text-gray-900 hover:bg-gray-100","dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800"),title:g?"Copied!":"Copy to clipboard",children:g?e.jsx(z,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):e.jsx(q,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"State"}),e.jsx("div",{className:"text-sm text-gray-900 dark:text-gray-100",children:t.state})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Data"}),e.jsx("pre",{className:y("text-sm px-3 py-2 rounded border font-mono overflow-auto max-h-32","bg-gray-50 border-gray-200","dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100"),children:t.data?JSON.stringify(t.data,null,2):"null"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Output"}),e.jsx("pre",{className:y("text-sm px-3 py-2 rounded border font-mono overflow-auto max-h-32","bg-gray-50 border-gray-200","dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100"),children:t.output!==void 0&&t.output!==null?JSON.stringify(t.output,null,2):"—"})]})]}),e.jsx("div",{children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:e.jsx(a,{label:"Priority",value:t.priority})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[e.jsx(a,{label:"Retry Count",value:t.retryCount}),e.jsx(a,{label:"Retry Limit",value:t.retryLimit}),e.jsx(a,{label:"Retry Delay",value:t.retryDelay?`${t.retryDelay}ms`:"—"}),e.jsx(a,{label:"Retry Backoff",value:t.retryBackoff?"Enabled":"Disabled"})]}),(t.singletonKey||t.groupId||t.groupTier||t.deadLetter)&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4",children:[t.singletonKey&&e.jsx(a,{label:"Singleton Key",value:t.singletonKey}),t.groupId&&e.jsx(a,{label:"Group ID",value:t.groupId}),t.groupTier&&e.jsx(a,{label:"Group Tier",value:t.groupTier}),t.deadLetter&&e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Dead Letter"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:e.jsx(p,{to:`/queues/${t.deadLetter}`,className:"text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:t.deadLetter})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-x-6 gap-y-4",children:[e.jsx(a,{label:"Created",value:m(new Date(t.createdOn))}),e.jsx(a,{label:"Start After",value:t.startAfter?m(new Date(t.startAfter)):"—"}),e.jsx(a,{label:"Started",value:t.startedOn?m(new Date(t.startedOn)):"—"}),e.jsx(a,{label:"Completed",value:t.completedOn?m(new Date(t.completedOn)):"—"}),e.jsx(a,{label:"Keep Until",value:t.keepUntil?m(new Date(t.keepUntil)):"—"})]})]})})]})]})]})});function a({label:o,value:d}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:o}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:d?.toString()||"—"})]})}export{W as ErrorBoundary,X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,p as e,A as z,B as R,D as A,x as O,G as P}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as a,D as M}from"./db-link-DmvfwdX4.js";import{B as j,C as T,a as V,b as _,c as U}from"./button-Djse56Dx.js";import{C as G}from"./chevron-down-B4tDL9Ah.js";import{E as H}from"./error-card-CXoOCvsg.js";import"./createLucideIcon-B0YqJFaz.js";const F=d.forwardRef(({className:l,label:c,id:y,...u},x)=>{const s=y||`checkbox-${Math.random().toString(36).substr(2,9)}`;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:s,ref:x,className:a("h-4 w-4 rounded border-gray-300 text-primary-600","focus:ring-2 focus:ring-primary-600 focus:ring-offset-0","dark:border-gray-700 dark:bg-gray-900","dark:checked:bg-primary-600 dark:checked:border-primary-600","cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",l),...u}),c&&e.jsx("label",{htmlFor:s,className:"text-sm text-gray-700 dark:text-gray-300 cursor-pointer select-none",children:c})]})});F.displayName="Checkbox";function C({value:l,onValueChange:c,children:y,className:u}){const[x,s]=d.useState(!1),g=d.useRef(null);d.useEffect(()=>{const t=o=>{g.current&&!g.current.contains(o.target)&&s(!1)};return x&&document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[x]);const n=[],m=t=>{if(Array.isArray(t))t.forEach(m);else if(t&&typeof t=="object"&&"props"in t){const o=t;o.type===i?n.push({value:o.props.value,label:o.props.children}):o.props?.children&&m(o.props.children)}};m(y);const b=n.find(t=>t.value===l);return e.jsxs("div",{ref:g,className:a("relative",u),children:[e.jsxs("button",{type:"button",onClick:()=>s(!x),className:a("flex items-center justify-between w-full px-3 py-2 text-sm rounded-lg shadow-sm","bg-white border border-gray-300 text-gray-900","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100","hover:bg-gray-50 dark:hover:bg-gray-800","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent","cursor-pointer"),children:[e.jsx("span",{className:"truncate text-left",children:b?.label||"Select..."}),e.jsx(G,{className:"h-4 w-4 opacity-50 ml-2 shrink-0"})]}),x&&n.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:n.map(t=>e.jsx("button",{type:"button",onClick:()=>{c(t.value),s(!1)},className:a("w-full text-left px-3 py-2 text-sm","hover:bg-gray-100 dark:hover:bg-gray-800","text-gray-900 dark:text-gray-100","cursor-pointer",t.value===l&&"bg-gray-50 dark:bg-gray-800"),children:t.label},t.value))})]})}function i({value:l,children:c}){return null}const D=({children:l})=>null,L=({children:l}={})=>null,E=({children:l})=>e.jsx(e.Fragment,{children:l}),Z=R(function(){return e.jsx(H,{title:"Failed to load queue creation page",backTo:{href:"/queues",label:"Back to Queues"}})}),ee=z(function({loaderData:c}){const{queues:y}=c,u=A(),s=O().state==="submitting",[g,n]=d.useState(!1),[m,b]=d.useState("standard"),[t,o]=d.useState("shared"),[v,B]=d.useState(!1),[N,w]=d.useState(""),[f,q]=d.useState(""),[Q,h]=d.useState(!1),S=y.filter(r=>r.name.toLowerCase().includes(N.toLowerCase())),I=r=>{q(r),w(r),h(!1),n(!0)},k=P(({currentLocation:r,nextLocation:p})=>g&&!s&&r.pathname!==p.pathname);return d.useEffect(()=>{const r=p=>{g&&!s&&(p.preventDefault(),p.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[g,s]),e.jsxs("div",{className:"space-y-6",children:[k.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(j,{type:"button",variant:"outline",size:"sm",onClick:()=>k.reset(),children:"Stay"}),e.jsx(j,{type:"button",variant:"danger",size:"sm",onClick:()=>k.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Create Queue"}),e.jsxs(T,{children:[e.jsx(V,{children:e.jsx(_,{children:"Queue Configuration"})}),e.jsx(U,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>n(!0),onSubmit:()=>n(!1),children:[u&&"error"in u&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:u.error}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"queueName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"queueName",name:"queueName",required:!0,placeholder:"my-queue",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"policy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Policy"}),e.jsxs(C,{value:m,onValueChange:r=>{b(r),n(!0)},children:[e.jsx(D,{children:e.jsx(L,{})}),e.jsxs(E,{children:[e.jsx(i,{value:"standard",children:"Standard"}),e.jsx(i,{value:"short",children:"Short"}),e.jsx(i,{value:"singleton",children:"Singleton"}),e.jsx(i,{value:"stately",children:"Stately"}),e.jsx(i,{value:"exclusive",children:"Exclusive"}),e.jsx(i,{value:"key_strict_fifo",children:"Key Strict FIFO"})]})]}),e.jsx("input",{type:"hidden",name:"policy",value:m}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Standard supports all features. Other policies restrict job queuing behavior."})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"storage",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Storage"}),e.jsxs(C,{value:t,onValueChange:r=>{o(r),n(!0)},children:[e.jsx(D,{children:e.jsx(L,{})}),e.jsxs(E,{children:[e.jsx(i,{value:"shared",children:"Shared"}),e.jsx(i,{value:"partitioned",children:"Partitioned"})]})]}),e.jsx("input",{type:"hidden",name:"partition",value:t==="partitioned"?"true":"false"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Partitioned creates a dedicated table for this queue"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"deadLetterSearch",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Dead Letter Queue"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"deadLetterSearch",value:N,onChange:r=>{w(r.target.value),h(!0)},onFocus:()=>h(!0),onBlur:()=>setTimeout(()=>h(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"deadLetter",value:f}),Q&&S.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:S.map(r=>e.jsx("button",{type:"button",onClick:()=>I(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),f&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",f]}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Failed jobs will be moved to this queue after all retries"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"warningQueueSize",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Warning Queue Size"}),e.jsx("input",{type:"number",id:"warningQueueSize",name:"warningQueueSize",min:"1",placeholder:"Optional",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Emit warning when queue size exceeds this value"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"2",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryDelay",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Delay (seconds)"}),e.jsx("input",{type:"number",id:"retryDelay",name:"retryDelay",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Backoff"}),e.jsx("div",{className:"py-2 pb-6",children:e.jsx(F,{id:"retryBackoff",name:"retryBackoff",value:"true",checked:v,onChange:r=>{B(r.target.checked),n(!0)},label:"Enable Exponential Backoff"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryDelayMax",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Max Retry Delay (seconds)"}),e.jsx("input",{type:"number",id:"retryDelayMax",name:"retryDelayMax",min:"1",placeholder:"No limit",disabled:!v,className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent","disabled:opacity-50 disabled:cursor-not-allowed")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Only used with exponential backoff"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"900",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 15 minutes (900 seconds)"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retentionSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retention Seconds"}),e.jsx("input",{type:"number",id:"retentionSeconds",name:"retentionSeconds",min:"1",placeholder:"1209600",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 14 days (1209600 seconds)"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"deleteAfterSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Delete After Seconds"}),e.jsx("input",{type:"number",id:"deleteAfterSeconds",name:"deleteAfterSeconds",min:"0",placeholder:"604800",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 7 days (604800 seconds). Set to 0 to never delete."})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(j,{type:"submit",disabled:s,children:s?"Creating...":"Create Queue"}),e.jsx(M,{to:"/queues",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{Z as ErrorBoundary,ee as default};
|
|
1
|
+
import{a as d,p as e,A as z,B as R,D as A,x as O,G as P}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as a,D as M}from"./db-link-CU7IJqbq.js";import{B as j,C as T,a as V,b as _,c as U}from"./button-Ba8FWhqs.js";import{C as G}from"./chevron-down-CYa4FYmp.js";import{E as H}from"./error-card-D-uZRy_l.js";import"./createLucideIcon-Bt-yXILq.js";const F=d.forwardRef(({className:l,label:c,id:y,...u},x)=>{const s=y||`checkbox-${Math.random().toString(36).substr(2,9)}`;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:s,ref:x,className:a("h-4 w-4 rounded border-gray-300 text-primary-600","focus:ring-2 focus:ring-primary-600 focus:ring-offset-0","dark:border-gray-700 dark:bg-gray-900","dark:checked:bg-primary-600 dark:checked:border-primary-600","cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",l),...u}),c&&e.jsx("label",{htmlFor:s,className:"text-sm text-gray-700 dark:text-gray-300 cursor-pointer select-none",children:c})]})});F.displayName="Checkbox";function C({value:l,onValueChange:c,children:y,className:u}){const[x,s]=d.useState(!1),g=d.useRef(null);d.useEffect(()=>{const t=o=>{g.current&&!g.current.contains(o.target)&&s(!1)};return x&&document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[x]);const n=[],m=t=>{if(Array.isArray(t))t.forEach(m);else if(t&&typeof t=="object"&&"props"in t){const o=t;o.type===i?n.push({value:o.props.value,label:o.props.children}):o.props?.children&&m(o.props.children)}};m(y);const b=n.find(t=>t.value===l);return e.jsxs("div",{ref:g,className:a("relative",u),children:[e.jsxs("button",{type:"button",onClick:()=>s(!x),className:a("flex items-center justify-between w-full px-3 py-2 text-sm rounded-lg shadow-sm","bg-white border border-gray-300 text-gray-900","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100","hover:bg-gray-50 dark:hover:bg-gray-800","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent","cursor-pointer"),children:[e.jsx("span",{className:"truncate text-left",children:b?.label||"Select..."}),e.jsx(G,{className:"h-4 w-4 opacity-50 ml-2 shrink-0"})]}),x&&n.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:n.map(t=>e.jsx("button",{type:"button",onClick:()=>{c(t.value),s(!1)},className:a("w-full text-left px-3 py-2 text-sm","hover:bg-gray-100 dark:hover:bg-gray-800","text-gray-900 dark:text-gray-100","cursor-pointer",t.value===l&&"bg-gray-50 dark:bg-gray-800"),children:t.label},t.value))})]})}function i({value:l,children:c}){return null}const D=({children:l})=>null,L=({children:l}={})=>null,E=({children:l})=>e.jsx(e.Fragment,{children:l}),Z=R(function(){return e.jsx(H,{title:"Failed to load queue creation page",backTo:{href:"/queues",label:"Back to Queues"}})}),ee=z(function({loaderData:c}){const{queues:y}=c,u=A(),s=O().state==="submitting",[g,n]=d.useState(!1),[m,b]=d.useState("standard"),[t,o]=d.useState("shared"),[v,B]=d.useState(!1),[N,w]=d.useState(""),[f,q]=d.useState(""),[Q,h]=d.useState(!1),S=y.filter(r=>r.name.toLowerCase().includes(N.toLowerCase())),I=r=>{q(r),w(r),h(!1),n(!0)},k=P(({currentLocation:r,nextLocation:p})=>g&&!s&&r.pathname!==p.pathname);return d.useEffect(()=>{const r=p=>{g&&!s&&(p.preventDefault(),p.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[g,s]),e.jsxs("div",{className:"space-y-6",children:[k.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(j,{type:"button",variant:"outline",size:"sm",onClick:()=>k.reset(),children:"Stay"}),e.jsx(j,{type:"button",variant:"danger",size:"sm",onClick:()=>k.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Create Queue"}),e.jsxs(T,{children:[e.jsx(V,{children:e.jsx(_,{children:"Queue Configuration"})}),e.jsx(U,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>n(!0),onSubmit:()=>n(!1),children:[u&&"error"in u&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:u.error}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"queueName",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"queueName",name:"queueName",required:!0,placeholder:"my-queue",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"policy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Policy"}),e.jsxs(C,{value:m,onValueChange:r=>{b(r),n(!0)},children:[e.jsx(D,{children:e.jsx(L,{})}),e.jsxs(E,{children:[e.jsx(i,{value:"standard",children:"Standard"}),e.jsx(i,{value:"short",children:"Short"}),e.jsx(i,{value:"singleton",children:"Singleton"}),e.jsx(i,{value:"stately",children:"Stately"}),e.jsx(i,{value:"exclusive",children:"Exclusive"}),e.jsx(i,{value:"key_strict_fifo",children:"Key Strict FIFO"})]})]}),e.jsx("input",{type:"hidden",name:"policy",value:m}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Standard supports all features. Other policies restrict job queuing behavior."})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"storage",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Storage"}),e.jsxs(C,{value:t,onValueChange:r=>{o(r),n(!0)},children:[e.jsx(D,{children:e.jsx(L,{})}),e.jsxs(E,{children:[e.jsx(i,{value:"shared",children:"Shared"}),e.jsx(i,{value:"partitioned",children:"Partitioned"})]})]}),e.jsx("input",{type:"hidden",name:"partition",value:t==="partitioned"?"true":"false"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Partitioned creates a dedicated table for this queue"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"deadLetterSearch",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Dead Letter Queue"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"deadLetterSearch",value:N,onChange:r=>{w(r.target.value),h(!0)},onFocus:()=>h(!0),onBlur:()=>setTimeout(()=>h(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"deadLetter",value:f}),Q&&S.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:S.map(r=>e.jsx("button",{type:"button",onClick:()=>I(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),f&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",f]}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Failed jobs will be moved to this queue after all retries"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"warningQueueSize",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Warning Queue Size"}),e.jsx("input",{type:"number",id:"warningQueueSize",name:"warningQueueSize",min:"1",placeholder:"Optional",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Emit warning when queue size exceeds this value"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"2",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryDelay",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Delay (seconds)"}),e.jsx("input",{type:"number",id:"retryDelay",name:"retryDelay",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Backoff"}),e.jsx("div",{className:"py-2 pb-6",children:e.jsx(F,{id:"retryBackoff",name:"retryBackoff",value:"true",checked:v,onChange:r=>{B(r.target.checked),n(!0)},label:"Enable Exponential Backoff"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryDelayMax",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Max Retry Delay (seconds)"}),e.jsx("input",{type:"number",id:"retryDelayMax",name:"retryDelayMax",min:"1",placeholder:"No limit",disabled:!v,className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent","disabled:opacity-50 disabled:cursor-not-allowed")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Only used with exponential backoff"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"900",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 15 minutes (900 seconds)"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retentionSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retention Seconds"}),e.jsx("input",{type:"number",id:"retentionSeconds",name:"retentionSeconds",min:"1",placeholder:"1209600",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 14 days (1209600 seconds)"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"deleteAfterSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Delete After Seconds"}),e.jsx("input",{type:"number",id:"deleteAfterSeconds",name:"deleteAfterSeconds",min:"0",placeholder:"604800",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Default: 7 days (604800 seconds). Set to 0 to never delete."})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(j,{type:"submit",disabled:s,children:s?"Creating...":"Create Queue"}),e.jsx(M,{to:"/queues",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{Z as ErrorBoundary,ee as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-DmvfwdX4.js";import{c as M}from"./createLucideIcon-B0YqJFaz.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-CEHCnGow.js";import"./useOpenInteractionType-Ss_6xZdw.js";import"./index-x2yWco1W.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
|
|
1
|
+
import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-CU7IJqbq.js";import{c as M}from"./createLucideIcon-Bt-yXILq.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-CoRd-BqL.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
|
|
2
2
|
(function() {
|
|
3
3
|
const stored = localStorage.getItem('pg-boss-theme');
|
|
4
4
|
let theme = stored || 'system';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as b,B as f,t as P,p as e}from"./chunk-
|
|
1
|
+
import{A as b,B as f,t as P,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as c,e as l}from"./db-link-CU7IJqbq.js";import{B as N,C as k,a as S,b as T,c as w}from"./button-Ba8FWhqs.js";import{T as B,a as E,b as d,c as r,d as v,e as s}from"./table-Au2E5mnP.js";import{P as D}from"./pagination-BItl293Q.js";import{E as R}from"./error-card-D-uZRy_l.js";const I=f(function(){return e.jsx(R,{title:"Failed to load schedules"})}),K=b(function({loaderData:x}){const{schedules:o,totalCount:n,page:h,totalPages:m,hasNextPage:j,hasPrevPage:p}=x,[g,y]=P(),u=a=>{const t=new URLSearchParams(g);t.set("page",a.toString()),y(t)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Schedules"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"Cron-based job schedules"})]}),e.jsx(c,{to:"/schedules/new",children:e.jsx(N,{variant:"primary",size:"md",className:"cursor-pointer",children:"Schedule Job"})})]}),e.jsxs(k,{children:[e.jsx(S,{children:e.jsxs(T,{children:["Schedules",n!==null&&` (${n.toLocaleString()})`]})}),e.jsx(w,{className:"p-0",children:e.jsxs(B,{children:[e.jsx(E,{children:e.jsxs(d,{children:[e.jsx(r,{children:"Queue"}),e.jsx(r,{children:"Key"}),e.jsx(r,{children:"Cron"}),e.jsx(r,{children:"Timezone"}),e.jsx(r,{children:"Created"}),e.jsx(r,{children:"Updated"})]})}),e.jsx(v,{children:o.length===0?e.jsx(d,{children:e.jsx(s,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No schedules found"})}):o.map(a=>{const t=a.key||"__default__",C=`/schedules/${encodeURIComponent(a.name)}/${encodeURIComponent(t)}`;return e.jsxs(d,{children:[e.jsx(s,{children:e.jsx(c,{to:C,className:"font-medium text-gray-900 dark:text-gray-100",children:a.name})}),e.jsx(s,{children:a.key}),e.jsx(s,{children:e.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:a.cron})}),e.jsx(s,{children:a.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),e.jsx(s,{children:l(new Date(a.createdOn))}),e.jsx(s,{children:l(new Date(a.updatedOn))})]},`${a.name}:${a.key}`)})})]})}),n>0&&e.jsx(D,{page:h,totalPages:m,hasNextPage:j,hasPrevPage:p,onPageChange:u})]})]})});export{I as ErrorBoundary,K as default};
|
package/build/client/assets/{schedules._name._key-DJn-u3Cm.js → schedules._name._key-CXTVKoOc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as h,B as g,a as y,p as e}from"./chunk-
|
|
1
|
+
import{A as h,B as g,a as y,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as u,e as c}from"./db-link-CU7IJqbq.js";import{B as s,C as a,a as d,b as n,c as i}from"./button-Ba8FWhqs.js";import{D as j,a as p,b as f,c as k,d as N,e as b}from"./dialog-Dkx42Rkd.js";import{E as v}from"./error-card-D-uZRy_l.js";import"./createLucideIcon-Bt-yXILq.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const T=g(function(){return e.jsx(v,{title:"Failed to load schedule",backTo:{href:"/schedules",label:"Back to Schedules"}})}),U=h(function({loaderData:o,actionData:l}){const{schedule:r}=o,[m,t]=y.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:[r.name,r.key&&e.jsxs("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:[" (",r.key,")"]})]})}),e.jsx(s,{variant:"danger",size:"md",className:"cursor-pointer",onClick:()=>t(!0),children:"Unschedule"})]}),l?.error&&e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 p-4",children:e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:l.error})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Schedule Configuration"})}),e.jsxs(i,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Queue"}),e.jsx("dd",{className:"mt-1",children:e.jsx(u,{to:`/queues/${encodeURIComponent(r.name)}`,className:"text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.name})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Key"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.key||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Cron Expression"}),e.jsx("dd",{className:"mt-1",children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:r.cron})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Timezone"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"Default"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Created"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.createdOn))})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Updated"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.updatedOn))})]})]})]}),r.data&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Data"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.data,null,2)})})]}),r.options&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Options"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.options,null,2)})})]})]}),e.jsx(j,{open:m,onOpenChange:t,children:e.jsx(p,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:e.jsxs("form",{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"unschedule"}),e.jsxs(f,{children:[e.jsx(k,{children:"Unschedule Job"}),e.jsx(N,{className:"mt-2",children:"Are you sure you want to unschedule? This will stop the recurring job from being created."})]}),e.jsxs(b,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(s,{type:"button",variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>t(!1),children:"Cancel"}),e.jsx(s,{type:"submit",variant:"danger",size:"sm",className:"cursor-pointer",children:"Unschedule"})]})]})})})]})});export{T as ErrorBoundary,U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-
|
|
1
|
+
import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as a,D}from"./db-link-CU7IJqbq.js";import{B as m,C as E,a as F,b as B,c as L}from"./button-Ba8FWhqs.js";import{E as z}from"./error-card-D-uZRy_l.js";const U=v(function(){return e.jsx(z,{title:"Failed to load schedule creation",backTo:{href:"/schedules",label:"Back to Schedules"}})}),P=N(function({loaderData:h,actionData:A}){const l=w(),t=S().state==="submitting",{queues:b}=h,[x,u]=s.useState(""),[n,f]=s.useState(""),[k,o]=s.useState(!1),[i,c]=s.useState(!1),y=b.filter(r=>r.name.toLowerCase().includes(x.toLowerCase())),j=r=>{f(r),u(r),o(!1),c(!0)},g=C(({currentLocation:r,nextLocation:d})=>i&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{i&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[i,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(m,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(m,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"New Schedule"}),e.jsxs(E,{children:[e.jsx(F,{children:e.jsx(B,{children:"Details"})}),e.jsx(L,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>c(!0),onSubmit:()=>c(!1),children:[l&&"error"in l&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:l.error}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:x,onChange:r=>{u(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"name",value:n,required:!0}),k&&y.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:y.map(r=>e.jsx("button",{type:"button",onClick:()=>j(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),n&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",n]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"key",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Schedule Key"}),e.jsx("input",{type:"text",id:"key",name:"key",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"cron",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Cron Expression ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"cron",name:"cron",required:!0,placeholder:"0 8 * * *",className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Format: minute hour day month weekday"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),e.jsx("input",{type:"text",id:"timezone",name:"timezone",placeholder:"UTC",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: IANA timezone (e.g. UTC, America/New_York)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:4,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(m,{type:"submit",disabled:t,className:"cursor-pointer",children:t?"Creating...":"Schedule Job"}),e.jsx(D,{to:"/schedules",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{U as ErrorBoundary,P as default};
|