bunqueue-dashboard 0.0.26 → 0.0.28

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.
Files changed (66) hide show
  1. package/README.md +6 -3
  2. package/dist/.vite/manifest.json +66 -82
  3. package/dist/assets/AddJob-BWQUAkBR.js +3 -0
  4. package/dist/assets/{Alerts-CWgn7JKK.js → Alerts-B0xnP5CV.js} +1 -1
  5. package/dist/assets/Benchmark-Dw6Adnj6.js +1 -0
  6. package/dist/assets/{BulkAddJobs-D5A-56qh.js → BulkAddJobs-DAdNpGRo.js} +2 -2
  7. package/dist/assets/{CopilotPanel-C4u8nJMr.js → CopilotPanel-Bpxw4K9a.js} +1 -1
  8. package/dist/assets/{Cron-D8Cl1VQg.js → Cron-CV32TamV.js} +1 -1
  9. package/dist/assets/CronManager-BEaa7wiR.js +1 -0
  10. package/dist/assets/{Database-BmdixnFB.js → Database-ehv_cEQ2.js} +3 -3
  11. package/dist/assets/Diagnostics-CorlmvKz.js +1 -0
  12. package/dist/assets/Dlq-Ctk9zeER.js +1 -0
  13. package/dist/assets/DlqControl-CIsg8otQ.js +1 -0
  14. package/dist/assets/{DlqPro-CkDrvA_m.js → DlqPro-Bw3yQpGs.js} +1 -1
  15. package/dist/assets/{Flows-tVpaOy-A.js → Flows-rrvRgRtA.js} +1 -1
  16. package/dist/assets/JobInspector-C7vAErSx.js +2 -0
  17. package/dist/assets/{Jobs-CBoU-CeR.js → Jobs-5faPmBs1.js} +1 -1
  18. package/dist/assets/JobsPro-BOkJw2tF.js +1 -0
  19. package/dist/assets/{Logs-BWq4h_tj.js → Logs-BFVWi8D3.js} +1 -1
  20. package/dist/assets/LogsPro-CkwTCyHD.js +1 -0
  21. package/dist/assets/{McpServer-DZD7-dyS.js → McpServer-Bs9xBhXn.js} +2 -2
  22. package/dist/assets/{Metrics-Cu1CHLHF.js → Metrics-cYFyZR3N.js} +1 -1
  23. package/dist/assets/MetricsPro-DFQhOiMq.js +1 -0
  24. package/dist/assets/{Overview-BSqH2VRL.js → Overview-CtPFwJ89.js} +1 -1
  25. package/dist/assets/{Pagination-C-6yLcP3.js → Pagination-C_ycPjHn.js} +1 -1
  26. package/dist/assets/{QueueActions-Dhy0KXjr.js → QueueActions-BIJ-MHWn.js} +1 -1
  27. package/dist/assets/{QueueControl-2x3FDkR9.js → QueueControl-OXvmyeYT.js} +1 -1
  28. package/dist/assets/{QueueDetail-Nfc8Zu5b.js → QueueDetail-DJZ30jtl.js} +1 -1
  29. package/dist/assets/QueueDetailPro-DwOCQfIi.js +1 -0
  30. package/dist/assets/{Queues-JsB6NujG.js → Queues-j0iVmzXB.js} +1 -1
  31. package/dist/assets/QueuesOverview-LFhAaVxQ.js +1 -0
  32. package/dist/assets/{S3Backup-CLizitSQ.js → S3Backup-B02cXBEq.js} +1 -1
  33. package/dist/assets/{S3BackupPro-CoSFg6KF.js → S3BackupPro-k_zofIyL.js} +1 -1
  34. package/dist/assets/ServerControl-P8h0f0HD.js +3 -0
  35. package/dist/assets/{Settings-Czzagq5p.js → Settings-BE7LB_rx.js} +1 -1
  36. package/dist/assets/{Usage-DGv7A2XQ.js → Usage-DRq_sm9A.js} +1 -1
  37. package/dist/assets/UsagePro-CaEgDStT.js +1 -0
  38. package/dist/assets/{Webhooks-C0ByRD8k.js → Webhooks-DUtMCoyF.js} +1 -1
  39. package/dist/assets/{Workers-BB9o9IJ6.js → Workers-DPryLaxE.js} +1 -1
  40. package/dist/assets/WorkersPro-DlHDhoV4.js +1 -0
  41. package/dist/assets/index-BxYFC0LS.js +8 -0
  42. package/dist/assets/index-mF63w920.css +1 -0
  43. package/dist/assets/{install-Bo6DRivH.js → install-DhTYJCUC.js} +1 -1
  44. package/dist/assets/{useThroughputSeries-lWDIzQ4F.js → useThroughputSeries-BuNc_qkH.js} +1 -1
  45. package/dist/index.html +31 -3
  46. package/dist/og.png +0 -0
  47. package/package.json +15 -7
  48. package/scripts/embedded.gen.ts +106 -106
  49. package/dist/assets/AddJob-B6DB3nLS.js +0 -3
  50. package/dist/assets/Benchmark-C6eJlf21.js +0 -1
  51. package/dist/assets/CopyButton-B2gM7BeT.js +0 -1
  52. package/dist/assets/CronManager-DkpnKkUk.js +0 -1
  53. package/dist/assets/Diagnostics-DNCcEQZe.js +0 -1
  54. package/dist/assets/Dlq-ChFKsJwc.js +0 -1
  55. package/dist/assets/DlqControl-C0RX-JRF.js +0 -1
  56. package/dist/assets/JobInspector-B6RmHnFF.js +0 -2
  57. package/dist/assets/JobsPro-WiZ3UHGN.js +0 -1
  58. package/dist/assets/LogsPro-Bf9Ihrkj.js +0 -1
  59. package/dist/assets/MetricsPro-Bs-Rwic_.js +0 -1
  60. package/dist/assets/QueueDetailPro-CnuNbKyk.js +0 -1
  61. package/dist/assets/QueuesOverview-BB8UL0nT.js +0 -1
  62. package/dist/assets/ServerControl-DcP14j8m.js +0 -3
  63. package/dist/assets/UsagePro-Cre49W5i.js +0 -1
  64. package/dist/assets/WorkersPro-DgjEEM9Y.js +0 -1
  65. package/dist/assets/index-BovL_it0.css +0 -1
  66. package/dist/assets/index-Dlr2PaZ6.js +0 -8
@@ -1,121 +1,121 @@
1
1
  // @ts-nocheck
2
2
  // AUTO-GENERATED by scripts/gen-embed.ts — do not edit, not committed.
3
3
  import f0 from "../dist/.vite/manifest.json" with { type: 'file' };
4
- import f1 from "../dist/favicon.svg" with { type: 'file' };
5
- import f2 from "../dist/assets/form-C-zZyKfB.js" with { type: 'file' };
6
- import f3 from "../dist/assets/Alerts-CWgn7JKK.js" with { type: 'file' };
7
- import f4 from "../dist/assets/Logs-BWq4h_tj.js" with { type: 'file' };
8
- import f5 from "../dist/assets/AddJob-B6DB3nLS.js" with { type: 'file' };
9
- import f6 from "../dist/assets/QueuesOverview-BB8UL0nT.js" with { type: 'file' };
10
- import f7 from "../dist/assets/install-Bo6DRivH.js" with { type: 'file' };
4
+ import f1 from "../dist/og.png" with { type: 'file' };
5
+ import f2 from "../dist/favicon.svg" with { type: 'file' };
6
+ import f3 from "../dist/assets/form-C-zZyKfB.js" with { type: 'file' };
7
+ import f4 from "../dist/assets/Benchmark-Dw6Adnj6.js" with { type: 'file' };
8
+ import f5 from "../dist/assets/CopilotPanel-Bpxw4K9a.js" with { type: 'file' };
9
+ import f6 from "../dist/assets/Jobs-5faPmBs1.js" with { type: 'file' };
10
+ import f7 from "../dist/assets/MetricsPro-DFQhOiMq.js" with { type: 'file' };
11
11
  import f8 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
12
12
  import f9 from "../dist/assets/connectionStore-B-hNUqwK.js" with { type: 'file' };
13
- import f10 from "../dist/assets/Database-BmdixnFB.js" with { type: 'file' };
14
- import f11 from "../dist/assets/QueueDetail-Nfc8Zu5b.js" with { type: 'file' };
15
- import f12 from "../dist/assets/CopilotPanel-C4u8nJMr.js" with { type: 'file' };
16
- import f13 from "../dist/assets/LogsPro-Bf9Ihrkj.js" with { type: 'file' };
17
- import f14 from "../dist/assets/index-BovL_it0.css" with { type: 'file' };
18
- import f15 from "../dist/assets/UsagePro-Cre49W5i.js" with { type: 'file' };
19
- import f16 from "../dist/assets/BulkAddJobs-D5A-56qh.js" with { type: 'file' };
20
- import f17 from "../dist/assets/Dlq-ChFKsJwc.js" with { type: 'file' };
21
- import f18 from "../dist/assets/Cron-D8Cl1VQg.js" with { type: 'file' };
13
+ import f10 from "../dist/assets/Queues-j0iVmzXB.js" with { type: 'file' };
14
+ import f11 from "../dist/assets/useThroughputSeries-BuNc_qkH.js" with { type: 'file' };
15
+ import f12 from "../dist/assets/QueueActions-BIJ-MHWn.js" with { type: 'file' };
16
+ import f13 from "../dist/assets/QueueDetail-DJZ30jtl.js" with { type: 'file' };
17
+ import f14 from "../dist/assets/index-mF63w920.css" with { type: 'file' };
18
+ import f15 from "../dist/assets/QueueControl-OXvmyeYT.js" with { type: 'file' };
19
+ import f16 from "../dist/assets/Diagnostics-CorlmvKz.js" with { type: 'file' };
20
+ import f17 from "../dist/assets/Logs-BFVWi8D3.js" with { type: 'file' };
21
+ import f18 from "../dist/assets/S3BackupPro-k_zofIyL.js" with { type: 'file' };
22
22
  import f19 from "../dist/assets/AreaChart-Dl_9G6GH.js" with { type: 'file' };
23
- import f20 from "../dist/assets/QueueDetailPro-CnuNbKyk.js" with { type: 'file' };
24
- import f21 from "../dist/assets/ServerControl-DcP14j8m.js" with { type: 'file' };
25
- import f22 from "../dist/assets/S3BackupPro-CoSFg6KF.js" with { type: 'file' };
26
- import f23 from "../dist/assets/S3Backup-CLizitSQ.js" with { type: 'file' };
27
- import f24 from "../dist/assets/jobActions-CuOdMglt.js" with { type: 'file' };
28
- import f25 from "../dist/assets/Usage-DGv7A2XQ.js" with { type: 'file' };
29
- import f26 from "../dist/assets/useThroughputSeries-lWDIzQ4F.js" with { type: 'file' };
30
- import f27 from "../dist/assets/JobInspector-B6RmHnFF.js" with { type: 'file' };
31
- import f28 from "../dist/assets/exportFile-tdUeW5m5.js" with { type: 'file' };
32
- import f29 from "../dist/assets/CronManager-DkpnKkUk.js" with { type: 'file' };
33
- import f30 from "../dist/assets/Flows-tVpaOy-A.js" with { type: 'file' };
34
- import f31 from "../dist/assets/cn-CMFYpumL.js" with { type: 'file' };
35
- import f32 from "../dist/assets/react-vendor-B68RYDeC.js" with { type: 'file' };
36
- import f33 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
37
- import f34 from "../dist/assets/DlqPro-CkDrvA_m.js" with { type: 'file' };
38
- import f35 from "../dist/assets/Queues-JsB6NujG.js" with { type: 'file' };
39
- import f36 from "../dist/assets/Settings-Czzagq5p.js" with { type: 'file' };
40
- import f37 from "../dist/assets/promisePool-Daxkc1OB.js" with { type: 'file' };
41
- import f38 from "../dist/assets/Workers-BB9o9IJ6.js" with { type: 'file' };
42
- import f39 from "../dist/assets/JobsPro-WiZ3UHGN.js" with { type: 'file' };
43
- import f40 from "../dist/assets/DlqControl-C0RX-JRF.js" with { type: 'file' };
44
- import f41 from "../dist/assets/Overview-BSqH2VRL.js" with { type: 'file' };
45
- import f42 from "../dist/assets/Jobs-CBoU-CeR.js" with { type: 'file' };
46
- import f43 from "../dist/assets/MetricsPro-Bs-Rwic_.js" with { type: 'file' };
47
- import f44 from "../dist/assets/QueueControl-2x3FDkR9.js" with { type: 'file' };
48
- import f45 from "../dist/assets/CopyButton-B2gM7BeT.js" with { type: 'file' };
49
- import f46 from "../dist/assets/Diagnostics-DNCcEQZe.js" with { type: 'file' };
50
- import f47 from "../dist/assets/McpServer-DZD7-dyS.js" with { type: 'file' };
51
- import f48 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
52
- import f49 from "../dist/assets/Webhooks-C0ByRD8k.js" with { type: 'file' };
53
- import f50 from "../dist/assets/Benchmark-C6eJlf21.js" with { type: 'file' };
54
- import f51 from "../dist/assets/Pagination-C-6yLcP3.js" with { type: 'file' };
55
- import f52 from "../dist/assets/QueueActions-Dhy0KXjr.js" with { type: 'file' };
56
- import f53 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
57
- import f54 from "../dist/assets/Metrics-Cu1CHLHF.js" with { type: 'file' };
58
- import f55 from "../dist/assets/index-Dlr2PaZ6.js" with { type: 'file' };
59
- import f56 from "../dist/assets/WorkersPro-DgjEEM9Y.js" with { type: 'file' };
23
+ import f20 from "../dist/assets/ServerControl-P8h0f0HD.js" with { type: 'file' };
24
+ import f21 from "../dist/assets/Metrics-cYFyZR3N.js" with { type: 'file' };
25
+ import f22 from "../dist/assets/QueuesOverview-LFhAaVxQ.js" with { type: 'file' };
26
+ import f23 from "../dist/assets/jobActions-CuOdMglt.js" with { type: 'file' };
27
+ import f24 from "../dist/assets/Overview-CtPFwJ89.js" with { type: 'file' };
28
+ import f25 from "../dist/assets/DlqControl-CIsg8otQ.js" with { type: 'file' };
29
+ import f26 from "../dist/assets/Dlq-Ctk9zeER.js" with { type: 'file' };
30
+ import f27 from "../dist/assets/exportFile-tdUeW5m5.js" with { type: 'file' };
31
+ import f28 from "../dist/assets/install-DhTYJCUC.js" with { type: 'file' };
32
+ import f29 from "../dist/assets/cn-CMFYpumL.js" with { type: 'file' };
33
+ import f30 from "../dist/assets/react-vendor-B68RYDeC.js" with { type: 'file' };
34
+ import f31 from "../dist/assets/Flows-rrvRgRtA.js" with { type: 'file' };
35
+ import f32 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
36
+ import f33 from "../dist/assets/Webhooks-DUtMCoyF.js" with { type: 'file' };
37
+ import f34 from "../dist/assets/S3Backup-B02cXBEq.js" with { type: 'file' };
38
+ import f35 from "../dist/assets/AddJob-BWQUAkBR.js" with { type: 'file' };
39
+ import f36 from "../dist/assets/Workers-DPryLaxE.js" with { type: 'file' };
40
+ import f37 from "../dist/assets/WorkersPro-DlHDhoV4.js" with { type: 'file' };
41
+ import f38 from "../dist/assets/promisePool-Daxkc1OB.js" with { type: 'file' };
42
+ import f39 from "../dist/assets/Database-ehv_cEQ2.js" with { type: 'file' };
43
+ import f40 from "../dist/assets/LogsPro-CkwTCyHD.js" with { type: 'file' };
44
+ import f41 from "../dist/assets/DlqPro-Bw3yQpGs.js" with { type: 'file' };
45
+ import f42 from "../dist/assets/Pagination-C_ycPjHn.js" with { type: 'file' };
46
+ import f43 from "../dist/assets/BulkAddJobs-DAdNpGRo.js" with { type: 'file' };
47
+ import f44 from "../dist/assets/UsagePro-CaEgDStT.js" with { type: 'file' };
48
+ import f45 from "../dist/assets/QueueDetailPro-DwOCQfIi.js" with { type: 'file' };
49
+ import f46 from "../dist/assets/Cron-CV32TamV.js" with { type: 'file' };
50
+ import f47 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
51
+ import f48 from "../dist/assets/index-BxYFC0LS.js" with { type: 'file' };
52
+ import f49 from "../dist/assets/McpServer-Bs9xBhXn.js" with { type: 'file' };
53
+ import f50 from "../dist/assets/JobInspector-C7vAErSx.js" with { type: 'file' };
54
+ import f51 from "../dist/assets/CronManager-BEaa7wiR.js" with { type: 'file' };
55
+ import f52 from "../dist/assets/Alerts-B0xnP5CV.js" with { type: 'file' };
56
+ import f53 from "../dist/assets/Settings-BE7LB_rx.js" with { type: 'file' };
57
+ import f54 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
58
+ import f55 from "../dist/assets/Usage-DRq_sm9A.js" with { type: 'file' };
59
+ import f56 from "../dist/assets/JobsPro-BOkJw2tF.js" with { type: 'file' };
60
60
  import f57 from "../dist/index.html" with { type: 'file' };
61
61
 
62
62
  export const ASSETS: Record<string, string> = {
63
63
  "/.vite/manifest.json": f0,
64
- "/favicon.svg": f1,
65
- "/assets/form-C-zZyKfB.js": f2,
66
- "/assets/Alerts-CWgn7JKK.js": f3,
67
- "/assets/Logs-BWq4h_tj.js": f4,
68
- "/assets/AddJob-B6DB3nLS.js": f5,
69
- "/assets/QueuesOverview-BB8UL0nT.js": f6,
70
- "/assets/install-Bo6DRivH.js": f7,
64
+ "/og.png": f1,
65
+ "/favicon.svg": f2,
66
+ "/assets/form-C-zZyKfB.js": f3,
67
+ "/assets/Benchmark-Dw6Adnj6.js": f4,
68
+ "/assets/CopilotPanel-Bpxw4K9a.js": f5,
69
+ "/assets/Jobs-5faPmBs1.js": f6,
70
+ "/assets/MetricsPro-DFQhOiMq.js": f7,
71
71
  "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f8,
72
72
  "/assets/connectionStore-B-hNUqwK.js": f9,
73
- "/assets/Database-BmdixnFB.js": f10,
74
- "/assets/QueueDetail-Nfc8Zu5b.js": f11,
75
- "/assets/CopilotPanel-C4u8nJMr.js": f12,
76
- "/assets/LogsPro-Bf9Ihrkj.js": f13,
77
- "/assets/index-BovL_it0.css": f14,
78
- "/assets/UsagePro-Cre49W5i.js": f15,
79
- "/assets/BulkAddJobs-D5A-56qh.js": f16,
80
- "/assets/Dlq-ChFKsJwc.js": f17,
81
- "/assets/Cron-D8Cl1VQg.js": f18,
73
+ "/assets/Queues-j0iVmzXB.js": f10,
74
+ "/assets/useThroughputSeries-BuNc_qkH.js": f11,
75
+ "/assets/QueueActions-BIJ-MHWn.js": f12,
76
+ "/assets/QueueDetail-DJZ30jtl.js": f13,
77
+ "/assets/index-mF63w920.css": f14,
78
+ "/assets/QueueControl-OXvmyeYT.js": f15,
79
+ "/assets/Diagnostics-CorlmvKz.js": f16,
80
+ "/assets/Logs-BFVWi8D3.js": f17,
81
+ "/assets/S3BackupPro-k_zofIyL.js": f18,
82
82
  "/assets/AreaChart-Dl_9G6GH.js": f19,
83
- "/assets/QueueDetailPro-CnuNbKyk.js": f20,
84
- "/assets/ServerControl-DcP14j8m.js": f21,
85
- "/assets/S3BackupPro-CoSFg6KF.js": f22,
86
- "/assets/S3Backup-CLizitSQ.js": f23,
87
- "/assets/jobActions-CuOdMglt.js": f24,
88
- "/assets/Usage-DGv7A2XQ.js": f25,
89
- "/assets/useThroughputSeries-lWDIzQ4F.js": f26,
90
- "/assets/JobInspector-B6RmHnFF.js": f27,
91
- "/assets/exportFile-tdUeW5m5.js": f28,
92
- "/assets/CronManager-DkpnKkUk.js": f29,
93
- "/assets/Flows-tVpaOy-A.js": f30,
94
- "/assets/cn-CMFYpumL.js": f31,
95
- "/assets/react-vendor-B68RYDeC.js": f32,
96
- "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f33,
97
- "/assets/DlqPro-CkDrvA_m.js": f34,
98
- "/assets/Queues-JsB6NujG.js": f35,
99
- "/assets/Settings-Czzagq5p.js": f36,
100
- "/assets/promisePool-Daxkc1OB.js": f37,
101
- "/assets/Workers-BB9o9IJ6.js": f38,
102
- "/assets/JobsPro-WiZ3UHGN.js": f39,
103
- "/assets/DlqControl-C0RX-JRF.js": f40,
104
- "/assets/Overview-BSqH2VRL.js": f41,
105
- "/assets/Jobs-CBoU-CeR.js": f42,
106
- "/assets/MetricsPro-Bs-Rwic_.js": f43,
107
- "/assets/QueueControl-2x3FDkR9.js": f44,
108
- "/assets/CopyButton-B2gM7BeT.js": f45,
109
- "/assets/Diagnostics-DNCcEQZe.js": f46,
110
- "/assets/McpServer-DZD7-dyS.js": f47,
111
- "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f48,
112
- "/assets/Webhooks-C0ByRD8k.js": f49,
113
- "/assets/Benchmark-C6eJlf21.js": f50,
114
- "/assets/Pagination-C-6yLcP3.js": f51,
115
- "/assets/QueueActions-Dhy0KXjr.js": f52,
116
- "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f53,
117
- "/assets/Metrics-Cu1CHLHF.js": f54,
118
- "/assets/index-Dlr2PaZ6.js": f55,
119
- "/assets/WorkersPro-DgjEEM9Y.js": f56,
83
+ "/assets/ServerControl-P8h0f0HD.js": f20,
84
+ "/assets/Metrics-cYFyZR3N.js": f21,
85
+ "/assets/QueuesOverview-LFhAaVxQ.js": f22,
86
+ "/assets/jobActions-CuOdMglt.js": f23,
87
+ "/assets/Overview-CtPFwJ89.js": f24,
88
+ "/assets/DlqControl-CIsg8otQ.js": f25,
89
+ "/assets/Dlq-Ctk9zeER.js": f26,
90
+ "/assets/exportFile-tdUeW5m5.js": f27,
91
+ "/assets/install-DhTYJCUC.js": f28,
92
+ "/assets/cn-CMFYpumL.js": f29,
93
+ "/assets/react-vendor-B68RYDeC.js": f30,
94
+ "/assets/Flows-rrvRgRtA.js": f31,
95
+ "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f32,
96
+ "/assets/Webhooks-DUtMCoyF.js": f33,
97
+ "/assets/S3Backup-B02cXBEq.js": f34,
98
+ "/assets/AddJob-BWQUAkBR.js": f35,
99
+ "/assets/Workers-DPryLaxE.js": f36,
100
+ "/assets/WorkersPro-DlHDhoV4.js": f37,
101
+ "/assets/promisePool-Daxkc1OB.js": f38,
102
+ "/assets/Database-ehv_cEQ2.js": f39,
103
+ "/assets/LogsPro-CkwTCyHD.js": f40,
104
+ "/assets/DlqPro-Bw3yQpGs.js": f41,
105
+ "/assets/Pagination-C_ycPjHn.js": f42,
106
+ "/assets/BulkAddJobs-DAdNpGRo.js": f43,
107
+ "/assets/UsagePro-CaEgDStT.js": f44,
108
+ "/assets/QueueDetailPro-DwOCQfIi.js": f45,
109
+ "/assets/Cron-CV32TamV.js": f46,
110
+ "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f47,
111
+ "/assets/index-BxYFC0LS.js": f48,
112
+ "/assets/McpServer-Bs9xBhXn.js": f49,
113
+ "/assets/JobInspector-C7vAErSx.js": f50,
114
+ "/assets/CronManager-BEaa7wiR.js": f51,
115
+ "/assets/Alerts-B0xnP5CV.js": f52,
116
+ "/assets/Settings-BE7LB_rx.js": f53,
117
+ "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f54,
118
+ "/assets/Usage-DRq_sm9A.js": f55,
119
+ "/assets/JobsPro-BOkJw2tF.js": f56,
120
120
  "/index.html": f57,
121
121
  };
@@ -1,3 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,l as n,r,t as i}from"./react-vendor-B68RYDeC.js";import{C as a,T as o,h as s,k as c,nt as l,rt as u,w as d}from"./index-Dlr2PaZ6.js";import{n as f,o as p,t as m}from"./form-C-zZyKfB.js";var h=e(t(),1),g=i(),_=e=>e==null?``:String(e);function v(){let{data:e}=c(()=>l.queues(),[],{intervalMs:3e4}),t=n().state?.clone,i=t?.options??{},[p,v]=(0,h.useState)(t?.queue??``),[b,x]=(0,h.useState)(t?.dataText??`{
2
- "hello": "world"
3
- }`),[S,C]=(0,h.useState)(`1`),[w,T]=(0,h.useState)(_(i.priority)),[E,D]=(0,h.useState)(``),[O,k]=(0,h.useState)(``),[A,j]=(0,h.useState)(_(i.maxAttempts)),[M,N]=(0,h.useState)(_(i.backoff)),[P,F]=(0,h.useState)(_(i.timeout)),[I,L]=(0,h.useState)(``),[R,z]=(0,h.useState)(i.removeOnComplete??!1),[B,V]=(0,h.useState)(i.removeOnFail??!1),[H,U]=(0,h.useState)(!1),[W,G]=(0,h.useState)(!1),[K,q]=(0,h.useState)(!1),[J,Y]=(0,h.useState)(null),[X,Z]=(0,h.useState)(null),Q=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},$=async()=>{if(Y(null),Z(null),!p.trim()){Y({ok:!1,msg:`Choose a queue`});return}let e;try{e=JSON.parse(b)}catch(e){Z(`Invalid JSON: ${e.message}`);return}let t=Q(E);if(O.trim()){let e=new Date(O).getTime();if(!Number.isFinite(e)){Y({ok:!1,msg:`Run at is not a valid date/time`});return}t=Math.max(0,e-Date.now())}let n={data:e,priority:Q(w),delay:t,maxAttempts:Q(A),backoff:Q(M),timeout:Q(P),jobId:I.trim()||void 0,removeOnComplete:R||void 0,removeOnFail:B||void 0,durable:H||void 0,lifo:W||void 0},r=Q(S)??1;if(!Number.isInteger(r)||r<1){Y({ok:!1,msg:`Count must be an integer of at least 1`});return}if(r>1e4){Y({ok:!1,msg:`Count must be 10000 or fewer`});return}q(!0);try{if(r===1){let e=await l.addJob(p,n);Y({ok:!0,msg:`Created job ${e.id}`}),u.success(`Job created`,`${p} · ${e.id}`)}else{let e=await l.addJobsBulk(p,Array.from({length:r},()=>n)),t=new Set(e.ids).size;Y({ok:!0,msg:`Created ${t} job${t===1?``:`s`}`}),u.success(`Created ${t} job${t===1?``:`s`}`,`in ${p}`)}}catch(e){Y({ok:!1,msg:e.message}),u.error(`Add job failed`,e.message)}finally{q(!1)}};return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(s,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,g.jsx)(r,{to:`/jobs/bulk-add`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Bulk import`})}),t&&(0,g.jsx)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/[0.06] px-4 py-2 text-sm text-accent`,children:`Pre-filled from an existing job. Review the data and options, then enqueue a fresh job.`}),(0,g.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),$()},children:[(0,g.jsxs)(a,{children:[(0,g.jsx)(d,{title:`Job`}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,g.jsxs)(m,{label:`Queue`,children:[(0,g.jsx)(f,{list:`queue-options`,value:p,onChange:e=>v(e.target.value),placeholder:`queue name (existing or new)`}),(0,g.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,g.jsx)(`option`,{value:e.name},e.name))})]}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(m,{label:`Data (JSON)`,children:(0,g.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value),onBlur:()=>{try{JSON.parse(b),Z(null)}catch(e){Z(`Invalid JSON: ${e.message}`)}},spellCheck:!1,rows:7,className:`w-full rounded-lg border border-line bg-surface-2 p-3 font-mono text-sm text-fg focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})}),X&&(0,g.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:X})]})]})]}),(0,g.jsxs)(a,{children:[(0,g.jsx)(d,{title:`Options`}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,g.jsx)(m,{label:`Priority`,children:(0,g.jsx)(f,{type:`number`,value:w,onChange:e=>T(e.target.value),placeholder:`0`})}),(0,g.jsx)(m,{label:`Delay (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:E,onChange:e=>D(e.target.value),placeholder:`0`,disabled:O.trim()!==``})}),(0,g.jsx)(m,{label:`Run at`,hint:O.trim()?`Overrides Delay — derived from this time (local time).`:`(local time)`,children:(0,g.jsx)(f,{type:`datetime-local`,value:O,onChange:e=>k(e.target.value)})}),(0,g.jsx)(m,{label:`Max attempts`,hint:`blank = server default`,children:(0,g.jsx)(f,{type:`number`,min:1,value:A,onChange:e=>j(e.target.value),placeholder:`3`})}),(0,g.jsx)(m,{label:`Backoff (ms)`,hint:`blank = server default`,children:(0,g.jsx)(f,{type:`number`,min:0,value:M,onChange:e=>N(e.target.value),placeholder:`1000`})}),(0,g.jsx)(m,{label:`Timeout (ms)`,children:(0,g.jsx)(f,{type:`number`,min:0,value:P,onChange:e=>F(e.target.value),placeholder:`—`})}),(0,g.jsx)(m,{label:`Custom job ID`,children:(0,g.jsx)(f,{value:I,onChange:e=>L(e.target.value),placeholder:`idempotency key`})})]}),(0,g.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,g.jsx)(y,{label:`removeOnComplete`,checked:R,onChange:z}),(0,g.jsx)(y,{label:`removeOnFail`,checked:B,onChange:V}),(0,g.jsx)(y,{label:`durable`,checked:H,onChange:U}),(0,g.jsx)(y,{label:`lifo`,checked:W,onChange:G})]})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,g.jsx)(`div`,{className:`w-28`,children:(0,g.jsx)(m,{label:`Count`,hint:`1–10000`,children:(0,g.jsx)(f,{type:`number`,min:1,value:S,onChange:e=>C(e.target.value)})})}),(0,g.jsx)(o,{type:`submit`,variant:`accent`,disabled:K,children:K?`Adding…`:`Add job`}),J&&(0,g.jsx)(`span`,{role:`status`,className:J.ok?`text-sm text-success`:`text-sm text-danger`,children:J.msg})]})]})]})}function y({label:e,checked:t,onChange:n}){return(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(p,{checked:t,onChange:n,label:e}),(0,g.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}export{v as AddJob};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{r as i}from"./connectionStore-B-hNUqwK.js";import{C as a,T as o,U as s,W as c,c as l,h as u,k as d,m as f,nt as p,r as m,s as h,w as g}from"./index-Dlr2PaZ6.js";import{i as _,n as v,o as y,t as b}from"./form-C-zZyKfB.js";import{t as x}from"./AreaChart-Dl_9G6GH.js";import{t as S}from"./CopyButton-B2gM7BeT.js";var C=e(n(),1),w={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},T={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},E={Smoke:{mode:`count`,total:200,batch:50,producers:2,workers:1,workerBatch:50,processMs:0},Standard:{mode:`count`,total:5e3,batch:100,producers:4,workers:4,workerBatch:100,processMs:5},Stress:{mode:`count`,total:5e4,batch:500,producers:16,workers:16,workerBatch:200,processMs:0},Soak:{mode:`duration`,durationS:30,batch:100,producers:4,workers:8,workerBatch:100,processMs:10}},D=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,O=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,k=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),A=e=>new Promise(t=>setTimeout(t,e)),j=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await A(Math.min(100,Math.max(0,n-performance.now())))},M=e=>e instanceof Error?e.message:String(e),N=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,P=r();function F({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,P.jsxs)(a,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(S,{value:n}),(0,P.jsx)(o,{size:`sm`,variant:`ghost`,onClick:()=>{let e=new Blob([n],{type:`application/json`}),t=URL.createObjectURL(e),r=document.createElement(`a`);r.href=t,r.download=`benchmark-history-${Date.now()}.json`,r.click(),URL.revokeObjectURL(t)},children:`Export JSON`}),(0,P.jsx)(o,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,P.jsx)(`div`,{className:`overflow-x-auto`,children:(0,P.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,P.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,P.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,P.jsx)(`tbody`,{children:e.map(e=>(0,P.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,P.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:l(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:l(e.completed)}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[N(e.pushPerSec),`/s`]}),(0,P.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[N(e.donePerSec),`/s`]}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:h(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:h(e.durationMs)})]},e.id))})]})})]})}var I={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},L=()=>({pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,assigned:0,startedAt:0,pushLat:[],activeWorkers:0,error:null,lastAt:0,lastPushed:0,lastDone:0,pushSeries:[],doneSeries:[]}),R=0;function z(){let[e,t]=(0,C.useState)(`idle`),[n,r]=(0,C.useState)(I),[i,a]=(0,C.useState)(null),[o,s]=(0,C.useState)([]),[c,l]=(0,C.useState)(null),u=(0,C.useRef)(!1),d=(0,C.useRef)(!1),f=(0,C.useRef)(!1),m=(0,C.useRef)(null),h=(0,C.useRef)(`idle`);h.current=e;let g=(0,C.useRef)(L());return(0,C.useEffect)(()=>()=>{u.current=!0},[]),(0,C.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=m.current;if(c&&c.mode===`count`){let t=D(c.total,1,w.total);if(h.current===`draining`){let r=e.doneSeries.slice(-10),i=r.length?r.reduce((e,t)=>e+t,0)/r.length:0;i<=0&&n>0&&(i=e.completed/(n/1e3)),i>0&&(s=Math.max(0,t-e.completed)/i*1e3)}else a>0&&(s=Math.max(0,t-e.pushed)/a*1e3)}else c&&c.mode===`duration`&&(s=Math.max(0,D(c.durationS,1,w.durationS)*1e3-n));r({pushed:e.pushed,completed:e.completed,pushFailed:e.pushFailed,ackFailed:e.ackFailed,bytes:e.bytes,elapsedMs:n,pushPerSec:a,donePerSec:o,activeWorkers:e.activeWorkers,pushSeries:e.pushSeries,doneSeries:e.doneSeries,etaMs:s,error:e.error})},200);return()=>clearInterval(t)},[e]),{phase:e,live:n,summary:i,history:o,runCfg:c,run:async e=>{if(!d.current){d.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...I,error:`Queue name is required.`}),t(`error`);return}try{await p.overview()}catch(e){r({...I,error:`Server unreachable — start it on the Server page first. (${M(e)})`}),t(`error`);return}let i=D(e.total,1,w.total),o=D(e.durationS,1,w.durationS)*1e3,c=D(e.batch,1,w.batch),d=D(e.producers,e.mode===`duration`?0:1,w.producers),_=D(e.payload,0,w.payload),v=D(e.workers,0,w.workers),y=D(e.workerBatch,1,w.workerBatch),b=D(e.processMs,0,w.processMs);u.current=!1,f.current=!1,m.current=e,l(e),g.current=L(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...I}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,C=async()=>{for(;!u.current;){let t;if(e.mode===`count`){if(g.current.assigned>=i)break;t=Math.min(c,i-g.current.assigned)}else{if(performance.now()>=S)break;t=c}let r=g.current.assigned;g.current.assigned+=t;let a=k(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await p.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=M(e)}g.current.pushLat.push(performance.now()-o)}},T=async()=>{for(;!u.current&&!(e.mode===`duration`&&performance.now()>=S||e.mode===`count`&&g.current.completed>=i);){g.current.activeWorkers++;let t=[];try{try{t=(await p.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await p.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=M(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&f.current)break;await A(50)}}},E=Array.from({length:d},C),N=Array.from({length:v},T),P=Promise.all(E).then(()=>{f.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let F=g.current,z=performance.now()-F.startedAt,B=z/1e3||1,V=[...F.pushLat].sort((e,t)=>e-t),H={pushed:F.pushed,completed:F.completed,pushFailed:F.pushFailed,ackFailed:F.ackFailed,bytes:F.bytes,durationMs:z,pushPerSec:F.pushed/B,donePerSec:F.completed/B,mbPerSec:F.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:O(V,50),p95:O(V,95),p99:O(V,99),max:V.length?V[V.length-1]:0,error:F.error};a(H),r(e=>({...e,pushed:F.pushed,completed:F.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++R,at:Date.now(),mode:e.mode,producers:d,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{d.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(I),t(`idle`)},clearHistory:()=>s([])}}var B=[`count`,`duration`],V=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],H=e=>({...e,total:String(e.total),durationS:String(e.durationS),batch:String(e.batch),producers:String(e.producers),payload:String(e.payload),workers:String(e.workers),workerBatch:String(e.workerBatch),processMs:String(e.processMs)}),U=e=>({...e,total:Number(e.total),durationS:Number(e.durationS),batch:Number(e.batch),producers:Number(e.producers),payload:Number(e.payload),workers:Number(e.workers),workerBatch:Number(e.workerBatch),processMs:Number(e.processMs)});function W(){let[e,n]=(0,C.useState)(()=>H(T)),r=z(),{phase:S,live:O,summary:k,history:A}=r,j=S===`running`||S===`draining`||S===`stopping`,M=(e,t)=>n(n=>({...n,[e]:t})),I=e=>t=>M(e,t.target.value),L=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=V.includes(t)?String(r):r;return n}),[R,W]=(0,C.useState)(T.queue);(0,C.useEffect)(()=>{let t=setTimeout(()=>W(e.queue.trim()||T.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=d(()=>p.counts(R),[R],{intervalMs:1e3}),q=ee?.counts??null,[J,Y]=(0,C.useState)(!1),[X,Z]=(0,C.useState)(null),ne=async()=>{let t=e.queue.trim();if(J||!t)return;let n=q&&R===t?` Currently ${l(q.waiting??0)} waiting / ${l(q.completed??0)} completed.`:``;if(window.confirm(`Remove benchmark jobs from "${t}"?${n}`)){Y(!0),Z(null);try{let e=null;for(let n of[`waiting`,`completed`,`failed`,`delayed`])try{await p.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await p.counts(t).catch(t=>(e=t.message,null));Z(n==null?{error:e??`server unreachable — could not verify`}:{remaining:n.counts?.active??0})}finally{Y(!1)}}},Q=r.runCfg??U(e),$=D(Q.total,1,w.total),re=D(Q.workers,0,w.workers),ie=Q.mode===`count`&&(j||k)?Math.min(100,O.pushed/$*100):0,ae=Q.mode===`count`&&(j||k)?Math.min(100,O.completed/$*100):0,oe=Q.mode===`duration`?Math.min(100,O.elapsedMs/(D(Q.durationS,1,w.durationS)*1e3)*100):0,se=S===`running`?Q.mode===`duration`?`Running…`:`Producing…`:S===`draining`?`Draining…`:S===`stopping`?`Stopping…`:S===`error`?`Error`:k?`Result`:`Ready`,ce=(S===`running`||S===`draining`)&&O.etaMs!=null?O.etaMs>0?`ETA ${h(O.etaMs)}`:`finishing…`:S===`stopped`?`stopped early`:S===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(u,{title:`Benchmark`,description:`Drive real load against the server — producers bulk-enqueue jobs while simulated workers pull, process and ack them. Throughput is measured client-side; the queue genuinely fills and drains.`,actions:S===`stopping`?(0,P.jsxs)(o,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(o,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(s,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(o,{variant:`success`,size:`sm`,onClick:()=>{let t=U(e),n=t.queue.trim()||T.queue;window.confirm(`Enqueue real jobs into "${n}" on ${i()}?`)&&r.run(t)},children:[(0,P.jsx)(c,{className:`size-3.5`}),` Run benchmark`]})}),O.error&&(0,P.jsx)(`div`,{className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:O.error}),(0,P.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(E).map(e=>(0,P.jsx)(`button`,{type:`button`,disabled:j,onClick:()=>L(E[e]),className:`rounded-md border border-line bg-surface-2 px-2.5 py-1 text-xs text-muted transition-colors hover:border-line-strong hover:text-fg disabled:opacity-40`,children:e},e))]}),(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,P.jsxs)(a,{className:`lg:col-span-1`,children:[(0,P.jsx)(g,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(b,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(v,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(b,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(_,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(b,{label:`Total jobs`,hint:`max ${l(w.total)}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(b,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.durationS,value:e.durationS,disabled:j,onChange:I(`durationS`)})}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(b,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(v,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(b,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(b,{label:`Payload`,hint:`bytes/job, max ${l(w.payload)}`,children:(0,P.jsx)(v,{type:`number`,min:0,max:w.payload,value:e.payload,disabled:j,onChange:I(`payload`)})})]}),(0,P.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,P.jsx)(b,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(v,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(b,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(v,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(b,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(v,{type:`number`,min:0,max:w.processMs,value:e.processMs,disabled:j,onChange:I(`processMs`)})})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(y,{checked:e.durable,onChange:e=>M(`durable`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,P.jsx)(y,{checked:e.removeOnComplete,onChange:e=>M(`removeOnComplete`,e),disabled:j}),(0,P.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,P.jsx)(o,{variant:`ghost`,size:`sm`,disabled:j||J,onClick:ne,children:J?`Cleaning…`:`Clean queue`}),X&&(`error`in X?(0,P.jsxs)(`span`,{className:`text-xs text-danger`,children:[`Clean unverified — `,X.error]}):(0,P.jsx)(`span`,{className:t(`text-xs`,X.remaining>0?`text-warning`:`text-success`),children:X.remaining>0?`Cleaned — ${l(X.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`}))]})]})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,P.jsxs)(a,{children:[(0,P.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:se}),(0,P.jsx)(`span`,{className:`text-xs text-faint`,children:ce})]}),(0,P.jsx)(G,{label:Q.mode===`duration`?`Elapsed`:`Produced`,pct:Q.mode===`duration`?oe:ie,tone:`accent`}),re>0&&Q.mode===`count`&&(0,P.jsx)(G,{label:`Completed`,pct:ae,tone:`emerald`}),(0,P.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,P.jsx)(f,{label:`Pushed`,value:l(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(f,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Elapsed`,value:h(O.elapsedMs),compact:!0}),(0,P.jsx)(f,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Data`,value:m(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(f,{label:`Errors`,value:l((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(a,{children:[(0,P.jsx)(g,{title:`Throughput`}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,P.jsx)(x,{series:[{label:`Push/sec`,color:`#38bdf8`,points:O.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:O.doneSeries,area:!0}]}),(0,P.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,P.jsx)(K,{color:`#38bdf8`,label:`Push/sec`,value:O.pushPerSec}),(0,P.jsx)(K,{color:`#34d399`,label:`Done/sec`,value:O.donePerSec})]})]})]})]}),k&&(0,P.jsxs)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{title:`Summary`}),(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,P.jsx)(f,{label:`Pushed`,value:l(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Duration`,value:h(k.durationMs),compact:!0}),(0,P.jsx)(f,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(f,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Data rate`,value:`${m(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(f,{label:`Push p95`,value:h(k.p95),compact:!0}),(0,P.jsx)(f,{label:`Push p99`,value:h(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,h(k.avg),` · p50 `,h(k.p50),` · p95`,` `,h(k.p95),` · p99 `,h(k.p99),` · max `,h(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(a,{className:`mt-6`,children:[(0,P.jsx)(g,{title:`Server queue: ${R}`,action:te?(0,P.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,P.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),q?(0,P.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,P.jsx)(f,{label:`Waiting`,value:l(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(f,{label:`Active`,value:l(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(f,{label:`Completed`,value:l(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(f,{label:`Failed`,value:l(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(f,{label:`Delayed`,value:l(q.delayed??0),compact:!0})]}):(0,P.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,P.jsx)(F,{history:A,onClear:r.clearHistory})]})}function G({label:e,pct:n,tone:r}){return(0,P.jsxs)(`div`,{className:`mb-2`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,P.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,P.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function K({color:e,label:t,value:n}){return(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,P.jsxs)(`span`,{className:`text-fg`,children:[N(n),`/s`]})]})}export{W as Benchmark};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{F as i,I as a,M as o}from"./index-Dlr2PaZ6.js";var s=e(n(),1),c=r();function l(e){try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function u({value:e,className:n}){let[r,u]=(0,s.useState)(`idle`),d=(0,s.useRef)(null);return(0,s.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),(0,c.jsx)(`button`,{type:`button`,onClick:async()=>{let t=!1;if(navigator.clipboard)try{await navigator.clipboard.writeText(e),t=!0}catch{}t||=l(e),u(t?`copied`:`failed`),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>u(`idle`),1500)},"aria-label":`Copy to clipboard`,title:r===`failed`?`Copy failed`:`Copy to clipboard`,className:t(`inline-flex size-6 shrink-0 items-center justify-center rounded-md text-faint transition-colors hover:bg-surface-2 hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,n),children:r===`copied`?(0,c.jsx)(o,{className:`size-3.5 text-success`}):r===`failed`?(0,c.jsx)(i,{className:`size-3.5 text-danger`}):(0,c.jsx)(a,{className:`size-3.5`})})}export{u as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{C as i,E as a,L as o,S as s,T as c,Y as l,a as u,c as d,h as f,k as p,nt as m,rt as h,w as g,x as _,y as v}from"./index-Dlr2PaZ6.js";import{i as y,n as b,o as x,t as S}from"./form-C-zZyKfB.js";import{t as C}from"./Pagination-C-6yLcP3.js";var w=e(n(),1),T=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`],E=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function D(e,t,n,r){let i=e===`*`||/^\*\/\d+$/.test(e),a=new Set;for(let i of e.split(`,`)){let e=i.trim().toLowerCase();if(e===``)return null;let o=e.match(/^(.+)\/(\d+)$/),s=o?Number(o[2]):1,c=o?o[1]:e;if(s<1)return null;let l,u;if(c===`*`)l=t,u=n;else if(c.includes(`-`)){let[e,t]=c.split(`-`),n=O(e,r),i=O(t,r);if(n==null||i==null)return null;l=n,u=i}else{let e=O(c,r);if(e==null)return null;l=e,u=o?n:e}if(l<t||u>n||l>u)return null;for(let e=l;e<=u;e+=s)a.add(e)}return a.size?{values:a,star:i}:null}function O(e,t){let n=e.trim().toLowerCase();if(n===``)return null;if(t){let e=t.indexOf(n.slice(0,3));if(e!==-1)return e}return/^\d+$/.test(n)?Number(n):null}function k(e,t,n){let r=e.trim().split(/\s+/);if(r.length!==5)return{valid:!1,error:`Expected 5 fields (min hour day month weekday), got ${r.length}.`,runs:[]};let i=D(r[0],0,59),a=D(r[1],0,23),o=D(r[2],1,31),s=D(r[3],1,12,T),c=D(r[4],0,7,E);if(!i||!a||!o||!s||!c)return{valid:!1,error:`Invalid field syntax.`,runs:[]};let l=new Set;for(let e of c.values)l.add(e===7?0:e);let u={values:l,star:c.star},d=e=>{let t=o.values.has(e.getDate()),n=u.values.has(e.getDay());return o.star||u.star?t&&n:t||n},f=[],p=new Date(n);p.setSeconds(0,0),p.setMinutes(p.getMinutes()+1);for(let e=0;e<22e5&&f.length<t;e++){if(!s.values.has(p.getMonth()+1)){p.setMonth(p.getMonth()+1,1),p.setHours(0,0,0,0);continue}if(!d(p)){p.setDate(p.getDate()+1),p.setHours(0,0,0,0);continue}if(!a.values.has(p.getHours())){p.setHours(p.getHours()+1,0,0,0);continue}if(!i.values.has(p.getMinutes())){p.setMinutes(p.getMinutes()+1,0,0);continue}f.push(p.getTime()),p.setMinutes(p.getMinutes()+1,0,0)}return{valid:!0,runs:f}}var A=r();function j(){let{data:e,error:t,loading:n,refetch:r}=p(()=>m.crons(),[]),c=e?.crons??[],[y,b]=(0,w.useState)(0),x=Math.max(1,Math.ceil(c.length/15)),S=Math.min(y,x-1),[T,E]=(0,w.useState)(null),D=async e=>{if(window.confirm(`Delete cron "${e}"?`)){E(null);try{await m.deleteCron(e),h.success(`Cron deleted`,e),r()}catch(e){E(e.message),h.error(`Delete cron failed`,e.message)}}};return(0,A.jsxs)(`div`,{children:[t&&(0,A.jsx)(s,{onRetry:r}),(0,A.jsx)(f,{title:`Cron Manager`,description:`Schedule and manage repeatable jobs.`,live:!0}),T&&(0,A.jsx)(`div`,{role:`status`,className:`mb-4 rounded-lg border border-red-500/20 bg-red-500/5 px-4 py-2 text-sm text-danger`,children:T}),(0,A.jsxs)(i,{className:`mb-6`,children:[(0,A.jsx)(g,{title:`Create schedule`}),(0,A.jsx)(N,{onCreate:async e=>{await m.createCron(e),h.success(`Cron created`,e.name),r()}})]}),n&&!e&&!t?(0,A.jsx)(_,{label:`Loading crons…`}):c.length===0?(0,A.jsx)(v,{icon:(0,A.jsx)(o,{}),title:`No scheduled jobs`,hint:`Create one above.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,A.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Name`}),(0,A.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Queue`}),(0,A.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Schedule`}),(0,A.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Next Run`}),(0,A.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Runs`}),(0,A.jsx)(`th`,{scope:`col`,className:`w-12 px-5 py-3`})]})}),(0,A.jsx)(`tbody`,{children:c.slice(S*15,S*15+15).map(e=>(0,A.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,A.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,A.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queue}),(0,A.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.schedule??(e.repeatEvery?`every ${e.repeatEvery}ms`:`—`)}),(0,A.jsx)(`td`,{className:`px-5 py-3 text-faint`,children:u(e.nextRun)}),(0,A.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:d(e.executions)}),(0,A.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,A.jsx)(a,{"aria-label":`Delete cron`,onClick:()=>D(e.name),children:(0,A.jsx)(l,{className:`size-3.5`})})})]},e.name))})]})}),(0,A.jsx)(C,{page:S,pageSize:15,total:c.length,onPageChange:b,label:`crons`})]})]})}function M(e){let t=Number(e);if(!Number.isInteger(t)||t<=0)return null;if(t<1e3)return`every ${t}ms`;for(let[e,n]of[[864e5,`d`],[36e5,`h`],[6e4,`m`],[1e3,`s`]])if(t>=e){let r=t/e;return`${Number.isInteger(r)?``:`≈ `}every ${Math.round(r*10)/10}${n}`}return null}function N({onCreate:e}){let[n,r]=(0,w.useState)(``),[i,a]=(0,w.useState)(``),[o,s]=(0,w.useState)(`cron`),[l,d]=(0,w.useState)(``),[f,p]=(0,w.useState)(``),[m,h]=(0,w.useState)(`{}`),[g,_]=(0,w.useState)(!1),[v,C]=(0,w.useState)(``),[T,E]=(0,w.useState)(``),[D,O]=(0,w.useState)(!1),[j,N]=(0,w.useState)(!1),[P,F]=(0,w.useState)(null),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(!1),B=(0,w.useMemo)(()=>o!==`cron`||!l.trim()?null:k(l.trim(),3,Date.now()),[o,l]),V=async()=>{if(I)return;if(F(null),z(!1),!n.trim()||!i.trim()){F(`Name and queue are required`);return}let t={};try{t=m.trim()?JSON.parse(m):{}}catch{F(`Data is not valid JSON`);return}let a={name:n,queue:i,data:t};if(o===`cron`){if(!l.trim()){F(`Cron expression required`);return}if(B&&!B.valid){F(B.error??`Invalid cron expression`);return}a.schedule=l.trim()}else{let e=Number(f);if(!Number.isInteger(e)||e<=0){F(`Interval must be a whole number of milliseconds greater than 0`);return}a.repeatEvery=e}v.trim()&&(a.timezone=v.trim());let s=Number(T);T.trim()!==``&&Number.isFinite(s)&&(a.priority=s),D&&(a.preventOverlap=!0),j&&(a.skipIfNoWorker=!0),L(!0);try{await e(a),r(``),d(``),p(``),z(!0),setTimeout(()=>z(!1),3e3)}catch(e){F(e.message)}finally{L(!1)}};return(0,A.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),V()},children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,A.jsx)(S,{label:`Name`,children:(0,A.jsx)(b,{value:n,onChange:e=>r(e.target.value),placeholder:`daily-report`})}),(0,A.jsx)(S,{label:`Queue`,children:(0,A.jsx)(b,{value:i,onChange:e=>a(e.target.value),placeholder:`reports`})})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,A.jsx)(y,{options:[`cron`,`every`],value:o,onChange:s}),o===`cron`?(0,A.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,A.jsx)(S,{label:`Cron expression`,children:(0,A.jsx)(b,{value:l,onChange:e=>d(e.target.value),placeholder:`0 9 * * *`})})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`w-40`,children:(0,A.jsx)(S,{label:`Every (ms)`,children:(0,A.jsx)(b,{type:`number`,value:f,onChange:e=>p(e.target.value),placeholder:`30000`})})}),f.trim()!==``&&(0,A.jsx)(`span`,{className:t(`pb-2 text-xs`,M(f)?`text-muted`:`text-danger`),children:M(f)??`not a valid interval`})]})]}),o===`cron`&&l.trim()&&B&&(0,A.jsx)(`div`,{className:`rounded-lg border border-line bg-surface-2 px-3 py-2 text-xs`,children:B.valid?B.runs.length?(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,A.jsxs)(`span`,{className:`text-faint`,children:[`Next runs`,v.trim()?` (local)`:``,`:`]}),B.runs.map(e=>(0,A.jsx)(`span`,{className:`font-mono text-muted`,children:u(e)},e)),v.trim()&&(0,A.jsxs)(`span`,{className:`text-faint`,children:[`— server evaluates in `,v.trim()]})]}):(0,A.jsx)(`span`,{className:`text-warning`,children:`Valid, but no runs in the next few years.`}):(0,A.jsx)(`span`,{className:`text-danger`,children:B.error})}),(0,A.jsx)(S,{label:`Data (JSON)`,children:(0,A.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),rows:3,spellCheck:!1,className:`w-full rounded-lg border border-line bg-surface-2 px-3 py-2 font-mono text-sm text-fg placeholder:text-faint transition-colors focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),className:`text-xs font-medium text-muted hover:text-fg`,children:g?`− Hide advanced`:`+ Advanced options`}),g&&(0,A.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(S,{label:`Timezone (IANA)`,hint:`e.g. Europe/Rome. Default: server timezone.`,children:(0,A.jsx)(b,{value:v,onChange:e=>C(e.target.value),placeholder:`Europe/Rome`})}),(0,A.jsx)(S,{label:`Priority`,children:(0,A.jsx)(b,{type:`number`,value:T,onChange:e=>E(e.target.value),placeholder:`0`})}),(0,A.jsxs)(`div`,{className:`col-span-2 flex flex-wrap gap-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(x,{checked:D,onChange:O,label:`prevent overlap`}),(0,A.jsx)(`span`,{className:`text-sm text-muted`,children:`prevent overlap`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(x,{checked:j,onChange:N,label:`skip if no worker`}),(0,A.jsx)(`span`,{className:`text-sm text-muted`,children:`skip if no worker`})]})]})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(c,{type:`submit`,variant:`accent`,size:`sm`,disabled:I,children:I?`Creating…`:`Create`}),P&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-danger`,children:P}),R&&(0,A.jsx)(`span`,{role:`status`,className:`text-xs text-success`,children:`Cron created ✓`})]})]})}export{j as CronManager};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{C as r,S as i,T as a,c as o,d as s,h as c,k as l,m as u,nt as d,r as f,w as p,x as m}from"./index-Dlr2PaZ6.js";var h=e(t(),1),g=n(),_={health:{},storage:null,stats:null};function v(){let{data:e,error:t,loading:n,refetch:v}=l(async()=>{let[e,t,n]=await Promise.all([d.health(),d.storage().catch(()=>null),d.stats().catch(()=>null)]);return{health:e,storage:t,stats:n}},[]),[x,S]=(0,h.useState)(null),C=async()=>{S(`…`);let e=performance.now();try{await d.ping(),S(`${Math.round(performance.now()-e)} ms`)}catch{S(`unreachable`)}};if(n&&!e&&!t)return(0,g.jsx)(m,{label:`Loading diagnostics…`});let w=e??_,T=w.health,E=w.storage?.data,D=w.stats?.stats;return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(c,{title:`Diagnostics`,description:`Server health, storage, memory and connections.`,live:!t}),t&&(0,g.jsx)(i,{onRetry:v}),(0,g.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,g.jsx)(u,{label:`Status`,value:T.status??(T.ok?`healthy`:`degraded`),tone:T.ok?`green`:`red`,compact:!0}),(0,g.jsx)(u,{label:`Version`,value:T.version?`v${T.version}`:`—`,compact:!0}),(0,g.jsx)(u,{label:`Uptime`,value:s(T.uptime),compact:!0}),(0,g.jsx)(u,{label:`Disk`,value:E?.diskFull?`Full`:`Healthy`,tone:E?.diskFull?`red`:`green`,compact:!0})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,g.jsxs)(r,{children:[(0,g.jsx)(p,{title:`Connectivity`,action:(0,g.jsxs)(a,{size:`sm`,onClick:C,children:[`Ping`,x?` · ${x}`:``]})}),(0,g.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,g.jsx)(y,{k:`WebSocket clients`,v:String(T.connections?.ws??0)}),(0,g.jsx)(y,{k:`SSE clients`,v:String(T.connections?.sse??0)}),(0,g.jsx)(y,{k:`Storage error`,v:E?.error?String(E.error):`none`})]})]}),(0,g.jsxs)(r,{children:[(0,g.jsx)(p,{title:`Memory`}),(0,g.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,g.jsx)(b,{k:`Heap used`,v:f((T.memory?.heapUsed??0)*1024*1024)}),(0,g.jsx)(b,{k:`Heap total`,v:f((T.memory?.heapTotal??0)*1024*1024)}),(0,g.jsx)(b,{k:`RSS`,v:f((T.memory?.rss??0)*1024*1024)})]})]})]}),D&&(0,g.jsxs)(r,{className:`mt-6`,children:[(0,g.jsx)(p,{title:`Totals since restart`}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,g.jsx)(b,{k:`Pushed`,v:o(D.totalPushed)}),(0,g.jsx)(b,{k:`Pulled`,v:o(D.totalPulled)}),(0,g.jsx)(b,{k:`Completed`,v:o(D.totalCompleted)}),(0,g.jsx)(b,{k:`Failed`,v:o(D.totalFailed)})]})]})]})}function y({k:e,v:t}){return(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,g.jsx)(`dt`,{className:`text-muted`,children:e}),(0,g.jsx)(`dd`,{className:`font-medium text-fg`,children:t})]})}function b({k:e,v:t}){return(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-faint`,children:e}),(0,g.jsx)(`div`,{className:`mt-1 text-lg font-semibold tnum text-fg`,children:t})]})}export{v as Diagnostics};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{A as r,R as i,S as a,T as o,c as s,h as c,k as l,m as u,u as d,x as f,y as p}from"./index-Dlr2PaZ6.js";import{a as m}from"./form-C-zZyKfB.js";import{t as h}from"./Pagination-C-6yLcP3.js";var g=e(t(),1),_=n(),v=25;function y(){let[e,t]=(0,g.useState)(``),[n,y]=(0,g.useState)(0),[b,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(null),{data:w}=l(()=>r.queues(500),[],{intervalMs:3e4});(0,g.useEffect)(()=>{e||!w?.queues?.length||t((w.queues.find(e=>e.dlq>0)??w.queues[0]).name)},[w,e]);let{data:T,error:E,loading:D,refetch:O}=l((0,g.useCallback)(async()=>{if(!e)return{entries:[],total:0};let t=await r.dlq(e,v,n*v);return{entries:t.entries??[],total:t.total??t.entries?.length??0}},[e,n]),[e,n]),k=async(t,n)=>{if(window.confirm(`${t} the dead letter queue for "${e}"?`)){x(!0),C(null);try{await n(),C(`${t} done`),O()}catch(e){C(e.message)}finally{x(!1)}}},A=T?.entries??[];return(0,_.jsxs)(`div`,{children:[E&&(0,_.jsx)(a,{onRetry:O}),(0,_.jsx)(c,{title:`Dead Letter Queue`,description:`Jobs that exhausted their retries.`,live:!0,actions:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(o,{size:`sm`,disabled:!e||b,onClick:()=>k(`Retry`,()=>r.retryDlq(e)),children:`Retry all`}),(0,_.jsx)(o,{variant:`danger`,size:`sm`,disabled:!e||b,onClick:()=>k(`Purge`,()=>r.purgeDlq(e)),children:`Purge`})]})}),(0,_.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-3`,children:[(0,_.jsx)(`div`,{className:`w-56`,children:(0,_.jsx)(m,{value:e,onChange:e=>{t(e.target.value),y(0)},children:(w?.queues??[]).map(e=>(0,_.jsxs)(`option`,{value:e.name,children:[e.name,` `,e.dlq?`(${e.dlq})`:``]},e.name))})}),(0,_.jsx)(`div`,{className:`w-40`,children:(0,_.jsx)(u,{label:`DLQ Entries`,value:s(T?.total),tone:T?.total?`red`:`default`,compact:!0})}),S&&(0,_.jsx)(`span`,{className:`text-xs text-muted`,children:S})]}),D&&!T&&!E?(0,_.jsx)(f,{label:`Loading DLQ…`}):A.length===0?(0,_.jsx)(p,{icon:(0,_.jsx)(i,{}),title:`Dead letter queue is empty`,hint:`Jobs land here after exhausting their retry attempts.`}):(0,_.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,_.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Job ID`}),(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Name`}),(0,_.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Reason`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Attempts`}),(0,_.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Failed`})]})}),(0,_.jsx)(`tbody`,{children:A.map((e,t)=>(0,_.jsxs)(`tr`,{className:`border-b border-line last:border-0 align-top hover:bg-surface-2/40`,children:[(0,_.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.jobId??e.id}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-fg`,children:e.name||`unknown`}),(0,_.jsx)(`td`,{className:`max-w-md px-5 py-3 text-xs text-red-400/90`,children:String(e.reason||e.error||`—`)}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:Array.isArray(e.attempts)?e.attempts.length:e.attempts??`—`}),(0,_.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:d(e.failedAt??e.enteredAt)})]},e.jobId??e.id??t))})]})}),T&&(0,_.jsx)(h,{page:n,pageSize:v,total:T.total,onPageChange:y,label:`entries`})]})}export{y as Dlq};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,r,t as i}from"./react-vendor-B68RYDeC.js";import{B as a,E as o,J as s,K as c,P as l,R as u,S as d,T as f,a as p,c as m,h,k as g,m as _,nt as v,o as y,rt as b,u as x,x as S,y as C,z as w}from"./index-Dlr2PaZ6.js";import{a as T}from"./form-C-zZyKfB.js";import{t as E}from"./Pagination-C-6yLcP3.js";import{t as D}from"./CopyButton-B2gM7BeT.js";import{t as O}from"./exportFile-tdUeW5m5.js";var k=e(n(),1),A=i(),j=25,M=e=>`${e.job.id}-${e.enteredAt}`;function N(){let[e,t]=(0,k.useState)(``),[n,r]=(0,k.useState)(0),[i,a]=(0,k.useState)(`all`),[o,l]=(0,k.useState)(``),[p,y]=(0,k.useState)(new Set),[D,N]=(0,k.useState)(!1),[F,I]=(0,k.useState)(null),{data:L}=g(()=>v.queues(),[],{intervalMs:3e4});(0,k.useEffect)(()=>{e||!L?.queues?.length||t((L.queues.find(e=>e.dlq>0)??L.queues[0]).name)},[L,e]);let{data:R,error:z,loading:B,refetch:V}=g((0,k.useCallback)(async()=>{if(!e)return{queue:e,page:n,entries:[],total:0,stats:null};let[t,r]=await Promise.all([v.dlq(e,j,n*j),v.dlqStats(e).catch(()=>null)]);return{queue:e,page:n,entries:t.entries??[],total:t.total??0,stats:r?.stats??null}},[e,n]),[e,n]),H=R&&R.queue===e&&R.page===n?R:null;(0,k.useEffect)(()=>{if(!H)return;let e=Math.max(0,Math.ceil((H.total??0)/j)-1);n>e&&r(e)},[H,n]),(0,k.useEffect)(()=>{y(new Set)},[e,n]);let U=async(t,n,r)=>{if(!(r&&!window.confirm(r))){N(!0),I(null);try{let r=(await n())?.count??0,i=`${t} ${m(r)} ${r===1?`entry`:`entries`}`;I({ok:!0,text:i}),b.success(i,e),V()}catch(e){let n=e.message;I({ok:!1,text:n}),b.error(`${t.replace(/ed$/,``)} failed`,n)}finally{N(!1)}}},W=H?.stats?.byReason??{},G=(0,k.useMemo)(()=>Object.keys(W).filter(e=>W[e]>0),[W]),K=(0,k.useMemo)(()=>[...G].sort((e,t)=>(W[t]??0)-(W[e]??0))[0],[G,W]),q=H?.entries??[],J=(0,k.useMemo)(()=>{let e=q;i!==`all`&&(e=e.filter(e=>e.reason===i));let t=o.trim().toLowerCase();return t&&(e=e.filter(e=>e.job.id.toLowerCase().includes(t))),[...e].sort((e,t)=>t.enteredAt-e.enteredAt)},[q,i,o]),Y=i!==`all`||o.trim()!==``,X=(H?.total??0)>j,Z=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(h,{title:`DLQ Control`,description:`Inspect, triage, and replay one queue's dead-lettered jobs.`,live:!0,actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(f,{size:`sm`,disabled:!e||!J.length,onClick:()=>{if(J.length===0){b.info(`Nothing to export`);return}O(`dlq-${e}`,J.map(e=>({jobId:e.job.id,reason:e.reason,error:e.error??``,attempts:e.job.attempts??e.attempts?.length??``,enteredAt:new Date(e.enteredAt).toISOString()})),[`jobId`,`reason`,`error`,`attempts`,`enteredAt`])},children:[(0,A.jsx)(w,{className:`size-3.5`}),` Export`]}),(0,A.jsxs)(f,{size:`sm`,disabled:!e||D||!H?.total,onClick:()=>U(`Retried`,()=>v.retryDlq(e),`Retry all ${H?.total??0} DLQ entries for "${e}"?`),children:[(0,A.jsx)(c,{className:`size-3.5`}),` Retry all`]}),(0,A.jsx)(f,{variant:`danger`,size:`sm`,disabled:!e||D||!H?.total,onClick:()=>{let t=window.prompt(`Purge all ${H?.total??0} DLQ entries for "${e}"? This cannot be undone.\n\nType the queue name to confirm:`);if(t!=null){if(t.trim()!==e){I({ok:!1,text:`Purge cancelled — queue name did not match.`});return}U(`Purged`,()=>v.purgeDlq(e))}},children:`Purge`})]})}),z&&(0,A.jsx)(d,{onRetry:V}),(0,A.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,A.jsx)(_,{label:`Entries`,value:m(H?.total),tone:H?.total?`red`:`green`,hint:H?.total?K?`top: ${K}`:void 0:`queue is clean`,compact:!0}),(0,A.jsx)(_,{label:`Failure types`,value:H?.stats?m(G.length):`—`,hint:`distinct reasons`,compact:!0}),(0,A.jsx)(_,{label:`Pending retry`,value:H?.stats?m(H.stats.pendingRetry??0):`—`,tone:H?.stats?.pendingRetry?`amber`:`default`,hint:`auto-retry queued`,compact:!0}),(0,A.jsx)(_,{label:`Oldest entry`,value:H?.stats?.oldestEntry?x(H.stats.oldestEntry):`—`,hint:`time in DLQ`,compact:!0})]}),(0,A.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`w-56`,children:(0,A.jsx)(T,{value:e,"aria-label":`Queue`,onChange:e=>{t(e.target.value),r(0),a(`all`),l(``),I(null)},children:(L?.queues??[]).map(e=>(0,A.jsxs)(`option`,{value:e.name,children:[e.name,` `,e.dlq?`(${e.dlq})`:``]},e.name))})}),(0,A.jsx)(`div`,{className:`w-44`,children:(0,A.jsxs)(T,{value:i,"aria-label":`Filter by reason`,onChange:e=>a(e.target.value),children:[(0,A.jsx)(`option`,{value:`all`,children:`All reasons`}),G.map(e=>(0,A.jsxs)(`option`,{value:e,children:[e,` (`,W[e],`)`]},e))]})}),(0,A.jsxs)(`div`,{className:`relative min-w-40 flex-1`,children:[(0,A.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,A.jsx)(`input`,{value:o,onChange:e=>l(e.target.value),placeholder:X?`Filter this page by job ID…`:`Filter by job ID…`,"aria-label":`Filter by job ID`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),F&&(0,A.jsx)(`span`,{role:`status`,className:F.ok?`text-sm text-success`:`text-sm text-danger`,children:F.text})]}),B&&!H&&!z?(0,A.jsx)(S,{label:`Loading DLQ…`}):J.length===0?(0,A.jsx)(C,{icon:(0,A.jsx)(u,{}),title:Y?`No matches`:`Dead letter queue is empty`,hint:Y?X?`No entries on this page match your filter — filters are page-scoped. Try another page or clear them.`:`No entries match your filter. Clear it to see all entries.`:`Failed jobs that exhaust their retries land here.`}):(0,A.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,A.jsx)(`th`,{className:`w-8 py-3 pl-4`}),(0,A.jsx)(`th`,{className:`px-3 py-3 font-medium`,children:`Job ID`}),(0,A.jsx)(`th`,{className:`px-3 py-3 font-medium`,children:`Reason`}),(0,A.jsx)(`th`,{className:`px-3 py-3 font-medium`,children:`Error`}),(0,A.jsx)(`th`,{className:`px-3 py-3 text-right font-medium`,children:`Attempts`}),(0,A.jsx)(`th`,{className:`px-3 py-3 text-right font-medium`,children:`Entered`}),(0,A.jsx)(`th`,{className:`w-20 px-4 py-3`})]})}),(0,A.jsx)(`tbody`,{children:J.map(t=>{let n=M(t);return(0,A.jsx)(P,{entry:t,isOpen:p.has(n),busy:D,onToggle:()=>Z(n),onRetry:()=>U(`Retried`,()=>v.retryDlq(e,t.job.id),`Retry job ${t.job.id.slice(0,8)}… from "${e}"?`),attempts:t.attempts??[]},n)})})]})}),H&&(0,A.jsx)(E,{page:n,pageSize:j,total:H.total,onPageChange:r,label:`entries`})]})}function P({entry:e,isOpen:n,busy:i,onToggle:s,onRetry:u,attempts:d}){let f=e;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`tr`,{className:`border-b border-line align-top last:border-0 hover:bg-surface-2/40`,children:[(0,A.jsx)(`td`,{className:`py-3 pl-4`,children:(0,A.jsx)(o,{"aria-label":n?`Collapse details`:`Expand details`,"aria-expanded":n,onClick:s,children:(0,A.jsx)(l,{className:t(`size-3.5 transition-transform`,n&&`rotate-90`)})})}),(0,A.jsx)(`td`,{className:`px-3 py-3`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(r,{to:`/job?id=${encodeURIComponent(f.job.id)}`,className:`max-w-[14rem] truncate font-mono text-xs text-accent hover:underline`,title:f.job.id,children:f.job.id}),(0,A.jsx)(D,{value:f.job.id})]})}),(0,A.jsx)(`td`,{className:`px-3 py-3`,children:(0,A.jsx)(`span`,{className:`inline-block rounded-md bg-red-500/10 px-2 py-0.5 text-xs text-danger`,children:f.reason})}),(0,A.jsx)(`td`,{className:`px-3 py-3`,children:(0,A.jsx)(`span`,{className:`block max-w-md truncate text-xs text-danger/80`,title:f.error??``,children:f.error||`—`})}),(0,A.jsx)(`td`,{className:`px-3 py-3 text-right tnum text-muted`,children:f.job.attempts??d.length}),(0,A.jsx)(`td`,{className:`px-3 py-3 text-right text-faint`,title:p(f.enteredAt),children:x(f.enteredAt)}),(0,A.jsx)(`td`,{className:`px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,A.jsx)(r,{to:`/job?id=${encodeURIComponent(f.job.id)}`,children:(0,A.jsx)(o,{"aria-label":`Inspect job`,children:(0,A.jsx)(a,{className:`size-3.5`})})}),(0,A.jsx)(o,{"aria-label":`Retry job`,disabled:i,onClick:u,children:(0,A.jsx)(c,{className:`size-3.5`})})]})})]}),n&&(0,A.jsxs)(`tr`,{className:`border-b border-line bg-surface-2/30 last:border-0`,children:[(0,A.jsx)(`td`,{}),(0,A.jsxs)(`td`,{colSpan:6,className:`px-3 pb-4 pt-1`,children:[f.error&&(0,A.jsxs)(`div`,{className:`mb-3`,children:[(0,A.jsx)(`div`,{className:`mb-1 text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Error`}),(0,A.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap rounded-lg bg-surface p-3 font-mono text-xs text-danger/90`,children:f.error})]}),(0,A.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[11px] font-medium uppercase tracking-wider text-faint`,children:[`Failure history`,typeof f.retryCount==`number`&&f.retryCount>0&&(0,A.jsxs)(`span`,{className:`rounded-full bg-surface px-2 py-0.5 text-[10px] normal-case text-muted`,children:[`retried `,f.retryCount,`×`]})]}),d.length===0?(0,A.jsx)(`p`,{className:`text-xs text-faint`,children:`No per-attempt history recorded.`}):(0,A.jsx)(`ol`,{className:`space-y-1.5`,children:d.map(e=>(0,A.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 rounded-lg border border-line bg-surface px-3 py-2 text-xs`,children:[(0,A.jsxs)(`span`,{className:`font-medium text-fg`,children:[`Attempt `,e.attempt]}),(0,A.jsx)(`span`,{className:`text-faint`,title:p(e.failedAt),children:x(e.failedAt)}),e.duration!=null&&(0,A.jsx)(`span`,{className:`tnum text-muted`,children:y(e.duration)}),e.reason&&(0,A.jsx)(`span`,{className:`rounded bg-red-500/10 px-1.5 text-danger`,children:e.reason}),e.error&&(0,A.jsx)(`span`,{className:`w-full truncate text-danger/70`,children:e.error})]},`${e.attempt}-${e.failedAt}`))})]})]})]})}export{N as DlqControl};
@@ -1,2 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{f as t,h as n,r,t as i}from"./react-vendor-B68RYDeC.js";import{C as a,E as o,J as s,T as c,a as l,et as u,g as d,h as f,nt as p,o as m,w as h,x as g,y as _,z as v}from"./index-Dlr2PaZ6.js";import{a as y,n as b}from"./form-C-zZyKfB.js";import{t as x}from"./CopyButton-B2gM7BeT.js";import{n as S}from"./exportFile-tdUeW5m5.js";import{t as C}from"./jobActions-CuOdMglt.js";var w=e(n(),1);function T(e){let t={};return typeof e.priority==`number`&&(t.priority=e.priority),typeof e.maxAttempts==`number`&&(t.maxAttempts=e.maxAttempts),typeof e.backoff==`number`&&(t.backoff=e.backoff),typeof e.timeout==`number`&&(t.timeout=e.timeout),typeof e.removeOnComplete==`boolean`&&(t.removeOnComplete=e.removeOnComplete),typeof e.removeOnFail==`boolean`&&(t.removeOnFail=e.removeOnFail),{clone:{queue:e.queue??``,dataText:JSON.stringify(e.data??{},null,2),options:t}}}var E=i();function ee({job:e,busy:t,act:n}){let r=C(e.state),i=r.cancel||r.discard||r.promote||r.retryActive||r.retryDlq||r.requeueCompleted||r.setPriority||r.setDelay||r.fail||r.moveToDelayed;return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Actions`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r.promote&&(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>n(`Promote`,()=>p.promoteJob(e.id)),children:`Promote (run now)`}),r.retryActive&&(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>n(`Retry`,()=>p.retryJob(e.id)),children:`Retry (move to waiting)`}),r.retryDlq&&(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>n(`Retry`,()=>p.retryDlq(e.queue??``,e.id)),children:`Retry from DLQ`}),r.requeueCompleted&&(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>n(`Requeue`,()=>p.retryCompleted(e.queue??``,e.id)),children:`Requeue`}),r.moveToDelayed&&(0,E.jsx)(D,{label:`Move to delayed (ms)`,cta:`To delayed`,disabled:t,onSubmit:t=>n(`Move to delayed`,()=>p.moveToDelayed(e.id,t))}),r.discard&&(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>n(`Discard`,()=>p.discardJob(e.id)),children:`Discard (to DLQ)`}),r.setPriority&&(0,E.jsx)(D,{label:`Set priority`,cta:`Set`,disabled:t,onSubmit:t=>n(`Priority`,()=>p.changePriority(e.id,t))}),r.setDelay&&(0,E.jsx)(D,{label:`Set delay (ms)`,cta:`Delay`,disabled:t,onSubmit:t=>n(`Delay`,()=>p.changeDelay(e.id,t))}),r.fail&&(0,E.jsx)(O,{label:`Fail reason (optional)`,cta:`Fail`,variant:`warning`,disabled:t,onSubmit:t=>n(`Fail`,()=>p.failJob(e.id,t||void 0),`Force-fail this active job?`)}),r.cancel&&(0,E.jsx)(c,{variant:`danger`,size:`sm`,disabled:t,onClick:()=>n(`Cancel`,()=>p.cancelJob(e.id),`Cancel and remove job ${e.id}?`),children:`Cancel (delete)`}),!i&&(0,E.jsxs)(`p`,{className:`text-xs text-faint`,children:[`No actions available for a job in state "`,e.state??`unknown`,`".`]})]})]})}function D({label:e,cta:t,disabled:n,onSubmit:r}){let[i,a]=(0,w.useState)(``);return(0,E.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),!n&&i.trim()!==``&&r(Number(i))},children:[(0,E.jsx)(b,{type:`number`,value:i,onChange:e=>a(e.target.value),placeholder:e,"aria-label":e,className:`h-8 text-xs`}),(0,E.jsx)(c,{type:`submit`,size:`sm`,disabled:n||i.trim()===``,children:t})]})}function O({label:e,cta:t,disabled:n,variant:r=`default`,onSubmit:i}){let[a,o]=(0,w.useState)(``);return(0,E.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),!n&&(i(a),o(``))},children:[(0,E.jsx)(b,{value:a,onChange:e=>o(e.target.value),placeholder:e,"aria-label":e,className:`h-8 text-xs`}),(0,E.jsx)(c,{type:`submit`,size:`sm`,variant:r,disabled:n,children:t})]})}var k=36e5,A=10;function j(e){let t=e.maxAttempts??0,n=e.attempts??0,r=e.backoffConfig,i=r?.maxDelay??k,a=r?.delay??e.backoff??1e3,o=[];for(let e=n;e<t&&o.length<A;e++){let t=r?.type===`fixed`?a:a*2**e;o.push({attempt:e+1,delayMs:Math.min(t,i)})}return o}function M({job:e}){let t=e.maxAttempts??0,n=e.attempts??0;if(t<=1)return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Backoff`}),(0,E.jsxs)(`p`,{className:`text-xs text-faint`,children:[`No retries configured (max attempts = `,t||1,`).`]})]});if(n>=t)return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Backoff schedule`}),(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`Max attempts reached — no further retries will be scheduled.`})]});let r=e.backoffConfig,i=r?r.type:`exponential (default)`,o=t-n,s=j(e);return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Backoff schedule`,action:(0,E.jsxs)(`span`,{className:`text-xs capitalize text-faint`,children:[i,r?.maxDelay?` · cap ${m(r.maxDelay)}`:``]})}),(0,E.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:s.map(e=>(0,E.jsxs)(`li`,{className:`flex items-center justify-between text-sm`,children:[(0,E.jsxs)(`span`,{className:`text-muted`,children:[`Attempt `,e.attempt,` / `,t]}),(0,E.jsxs)(`span`,{className:`font-mono text-xs text-fg`,children:[`~`,m(e.delayMs)]})]},e.attempt))}),o>A&&(0,E.jsxs)(`p`,{className:`mt-2 text-[11px] text-faint`,children:[`Showing next `,A,` of `,o,` remaining attempts.`]}),(0,E.jsxs)(`p`,{className:`mt-2 text-[11px] text-faint`,children:[`Approximate — the server applies ±`,r?.type===`fixed`?`20`:`50`,`% jitter at retry time, capped at `,m(r?.maxDelay??k),`.`]})]})}function N({jobId:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(!1),[o,s]=(0,w.useState)(!1),[l,u]=(0,w.useState)(void 0),[d,f]=(0,w.useState)(null),m=async()=>{s(!0),f(null);try{u((await p.jobChildren(e)).data?.values),i(!0)}catch(e){f(e.message)}finally{s(!1)}},g=()=>{let e=!t;n(e),e&&!r&&!o&&m()},_=l&&typeof l==`object`?Array.isArray(l)?l.length:Object.keys(l).length:0;return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Child values`,action:(0,E.jsx)(c,{size:`sm`,variant:`ghost`,onClick:g,children:t?`Hide`:`Show`})}),t?o?(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`Loading child values…`}):d?(0,E.jsx)(`p`,{className:`text-xs text-danger`,children:d}):_===0?(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`No child values available.`}):(0,E.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-lg bg-surface-2 p-3 font-mono text-xs text-muted`,children:JSON.stringify(l,null,2)}):(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`Resolved return values from this flow job's children.`})]})}function P({data:e,busy:t,onSave:n}){let[r,i]=(0,w.useState)(()=>JSON.stringify(e??null,null,2)),[o,s]=(0,w.useState)(null),l=(0,w.useRef)(r);return(0,w.useEffect)(()=>{let t=JSON.stringify(e??null,null,2);t!==l.current&&(l.current=t,i(t),s(null))},[e]),(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Data`,action:(0,E.jsx)(c,{size:`sm`,disabled:t,onClick:()=>{let e;try{e=JSON.parse(r)}catch(e){s(`Invalid JSON: ${e.message}`);return}s(null),n(e)},children:`Save data`})}),(0,E.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),spellCheck:!1,rows:8,className:`w-full resize-y rounded-lg border border-line bg-surface-2 p-3 font-mono text-xs text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`}),o&&(0,E.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:o})]})}function F({jobId:e}){let[t,n]=(0,w.useState)([]),[r,i]=(0,w.useState)(0),[o,s]=(0,w.useState)(!1),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(``),[m,g]=(0,w.useState)(`info`),[_,v]=(0,w.useState)(!1),x=(0,w.useCallback)(async()=>{s(!0),u(null);try{let t=await p.jobLogs(e);n(t.data?.logs??[]),i(t.data?.count??0)}catch(e){u(e.message)}finally{s(!1)}},[e]);(0,w.useEffect)(()=>{x()},[x]);let S=async()=>{if(_)return;let t=d.trim();if(t){v(!0),u(null);try{await p.addJobLog(e,t,m),f(``),await x()}catch(e){u(e.message)}finally{v(!1)}}};return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Logs`,action:(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`font-mono text-xs text-faint`,children:r}),(0,E.jsx)(c,{size:`sm`,variant:`ghost`,disabled:o||_,onClick:x,children:`Refresh`}),(0,E.jsx)(c,{size:`sm`,variant:`danger`,disabled:_||t.length===0,onClick:async()=>{if(window.confirm(`Clear all logs for this job?`)){v(!0),u(null);try{await p.clearJobLogs(e),await x()}catch(e){u(e.message)}finally{v(!1)}}},children:`Clear logs`})]})}),l&&(0,E.jsx)(`p`,{className:`mb-2 text-xs text-danger`,children:l}),t.length===0?(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`No log lines recorded for this job.`}):(0,E.jsx)(`ol`,{className:`flex max-h-64 flex-col gap-1 overflow-auto rounded-lg bg-surface-2 p-3`,children:t.map((e,t)=>(0,E.jsx)(`li`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-muted`,children:typeof e==`string`?e:JSON.stringify(e)},t))}),(0,E.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,E.jsx)(b,{value:d,onChange:e=>f(e.target.value),onKeyDown:e=>e.key===`Enter`&&S(),placeholder:`Add a log line…`,className:`h-8 flex-1 text-xs`}),(0,E.jsxs)(y,{value:m,onChange:e=>g(e.target.value),className:`h-8 w-24 text-xs`,children:[(0,E.jsx)(`option`,{value:`info`,children:`info`}),(0,E.jsx)(`option`,{value:`warn`,children:`warn`}),(0,E.jsx)(`option`,{value:`error`,children:`error`})]}),(0,E.jsx)(c,{size:`sm`,disabled:_||d.trim()===``,onClick:S,children:`Add`})]})]})}function I({timeline:e}){let t=e??[];return(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Timeline`}),t.length===0?(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`No state transitions recorded yet.`}):(0,E.jsx)(`ol`,{className:`flex flex-col gap-0`,children:t.map((e,t)=>(0,E.jsxs)(`li`,{className:`border-b border-line/60 py-2 last:border-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(d,{status:e.state}),e.attempt!=null&&(0,E.jsxs)(`span`,{className:`font-mono text-[11px] text-faint`,children:[`attempt `,e.attempt]})]}),(0,E.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:l(e.timestamp)})]}),(e.worker||e.error)&&(0,E.jsxs)(`div`,{className:`mt-1 pl-0.5`,children:[e.worker&&(0,E.jsx)(`div`,{className:`font-mono text-[11px] text-faint`,children:e.worker}),e.error&&(0,E.jsx)(`div`,{className:`mt-0.5 text-xs text-danger/90`,children:e.error})]})]},t))})]})}function te(e){let t=e.timeline??[];for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.state===`failed`&&n.error)return{message:n.error,attempt:n.attempt,timestamp:n.timestamp}}return null}function L(){let[e,n]=t(),[i,o]=(0,w.useState)(e.get(`id`)??``),[b,C]=(0,w.useState)(`id`),[D,O]=(0,w.useState)(null),[k,A]=(0,w.useState)({fetched:!1,value:void 0}),[j,L]=(0,w.useState)(!1),[ie,z]=(0,w.useState)(!1),[B,V]=(0,w.useState)(null),[H,U]=(0,w.useState)(!1),W=(0,w.useRef)(0),G=async(e,t=b,r=!1)=>{let i=e.trim();if(!i)return;let a=++W.current;L(!0),z(!1),r||V(null);try{let e=(await(t===`custom`?p.jobByCustomId(i):p.job(i))).job;if(!e){if(a!==W.current)return;O(null),A({fetched:!1,value:void 0}),z(!0),n({},{replace:!0});return}let r=e.state===`completed`?await p.jobResult(e.id).catch(()=>null):null;if(a!==W.current)return;O(e),o(t===`custom`?e.id:i),n({id:e.id},{replace:!0}),A(r?{fetched:!0,value:r.result}:{fetched:!1,value:void 0})}catch(e){if(a!==W.current)return;e instanceof u&&(e.status===404||/not found/i.test(e.message))?(O(null),A({fetched:!1,value:void 0}),z(!0),n({},{replace:!0})):V({ok:!1,text:e.message})}finally{a===W.current&&L(!1)}},K=e.get(`id`);(0,w.useEffect)(()=>{K&&K!==D?.id&&G(K,`id`)},[K,D?.id]);let q=async(e,t,r)=>{if(!(r&&!window.confirm(r))&&D){U(!0),V(null);try{await t(),V({ok:!0,text:`${e} ✓`}),e===`Cancel`?(O(null),A({fetched:!1,value:void 0}),n({},{replace:!0})):await G(D.id,`id`,!0)}catch(e){V({ok:!1,text:e.message})}finally{U(!1)}}},J=D?.state,Y=D?te(D):null,X=(D?.stacktrace?.length??0)>0,Z=(D?.childrenIds?.length??0)>0,Q=J===`failed`,$=D&&(Y||X)?(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Error`}),Y&&(0,E.jsxs)(`div`,{className:`mb-3`,children:[(0,E.jsx)(`p`,{className:`text-sm text-danger`,children:Y.message}),(0,E.jsxs)(`p`,{className:`mt-1 text-[11px] text-faint`,children:[Y.attempt==null?``:`Attempt ${Y.attempt} · `,l(Y.timestamp)]})]}),X&&(0,E.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap rounded-lg bg-surface-2 p-3 font-mono text-xs text-danger/90`,children:D.stacktrace?.join(`
2
- `)})]}):null;return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(f,{title:`Job Inspector`,description:`Look up any job by ID and drive its full lifecycle.`,actions:D?(0,E.jsxs)(E.Fragment,{children:[(Z||D.parentId)&&(0,E.jsx)(r,{to:`/flows?root=${encodeURIComponent(D.id)}`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`View flow`}),(0,E.jsx)(r,{to:`/add-job`,state:T(D),title:`Enqueue a new job pre-filled from this one`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Clone`}),(0,E.jsxs)(c,{size:`sm`,onClick:()=>S(`job-${D.id}`,k.fetched?{...D,result:k.value}:D),children:[(0,E.jsx)(v,{className:`size-3.5`}),` Download JSON`]})]}):void 0}),(0,E.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-2`,children:[(0,E.jsxs)(y,{value:b,"aria-label":`Lookup mode`,onChange:e=>C(e.target.value),className:`w-40`,children:[(0,E.jsx)(`option`,{value:`id`,children:`By job ID`}),(0,E.jsx)(`option`,{value:`custom`,children:`By custom ID`})]}),(0,E.jsxs)(`div`,{className:`relative min-w-56 flex-1`,children:[(0,E.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,E.jsx)(`input`,{value:i,"aria-label":b===`custom`?`Custom job ID`:`Job ID`,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===`Enter`&&G(i),placeholder:b===`custom`?`custom / idempotency id — Enter to look up`:`job id (UUID) — Enter to look up`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 font-mono text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),(0,E.jsx)(c,{variant:`accent`,disabled:j,onClick:()=>G(i),children:`Look up`})]}),B&&(0,E.jsx)(`div`,{role:`status`,className:B.ok?`mb-4 text-sm text-success`:`mb-4 text-sm text-danger`,children:B.text}),j&&!D?(0,E.jsx)(g,{label:`Loading job…`}):ie?(0,E.jsx)(_,{title:`Job not found`,hint:`Check the ID, or the job may have been removed.`}):D?(0,E.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,E.jsxs)(a,{children:[(0,E.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,E.jsx)(`div`,{className:`truncate font-mono text-sm text-fg`,children:D.id}),(0,E.jsx)(x,{value:D.id})]}),(0,E.jsx)(`div`,{className:`mt-1 font-mono text-xs text-faint`,children:D.queue})]}),(0,E.jsx)(d,{status:J??`waiting`})]}),(0,E.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-6 gap-y-2 text-sm sm:grid-cols-3`,children:[(0,E.jsx)(R,{k:`Priority`,v:String(D.priority??0)}),(0,E.jsx)(R,{k:`Attempts`,v:`${D.attempts??0} / ${D.maxAttempts??`?`}`}),(0,E.jsx)(R,{k:`Progress`,v:`${D.progress??0}%`}),(0,E.jsx)(R,{k:`Created`,v:l(D.createdAt)}),(0,E.jsx)(R,{k:`Started`,v:l(D.startedAt??void 0)}),(0,E.jsx)(R,{k:`Completed`,v:l(D.completedAt??void 0)}),(0,E.jsx)(R,{k:`Duration`,v:m(D.startedAt&&D.completedAt?D.completedAt-D.startedAt:void 0)}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`text-[11px] uppercase tracking-wider text-faint`,children:`Custom ID`}),(0,E.jsxs)(`dd`,{className:`flex items-center gap-1 text-fg`,children:[(0,E.jsx)(`span`,{className:`truncate font-mono`,children:D.customId??`—`}),D.customId&&(0,E.jsx)(x,{value:D.customId})]})]})]})]}),Q&&$,(0,E.jsx)(P,{data:D.data,busy:H,onSave:e=>q(`Data`,()=>p.updateJobData(D.id,e))}),J===`completed`&&(0,E.jsxs)(a,{children:[(0,E.jsx)(h,{title:`Result`,action:k.fetched&&k.value!==void 0&&k.value!==null?(0,E.jsx)(re,{value:k.value,filename:`job-${D.id}-result`}):void 0}),k.fetched&&k.value!==void 0&&k.value!==null?(0,E.jsx)(ne,{value:k.value}):(0,E.jsx)(`p`,{className:`text-xs text-faint`,children:`No result stored for this job.`})]}),!Q&&$,(0,E.jsx)(F,{jobId:D.id},`logs-${D.id}`),Z&&(0,E.jsx)(N,{jobId:D.id},`children-${D.id}`),(0,E.jsx)(I,{timeline:D.timeline}),(0,E.jsx)(M,{job:D})]}),(0,E.jsx)(`div`,{className:`order-first lg:order-none`,children:(0,E.jsx)(ee,{job:D,busy:H,act:q})})]}):(0,E.jsx)(_,{title:`No job loaded`,hint:`Enter a job ID above to inspect it.`})]})}function R({k:e,v:t}){return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`dt`,{className:`text-[11px] uppercase tracking-wider text-faint`,children:e}),(0,E.jsx)(`dd`,{className:`text-fg`,children:t})]})}function ne({value:e}){return(0,E.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-lg bg-surface-2 p-3 font-mono text-xs text-muted`,children:JSON.stringify(e??null,null,2)})}function re({value:e,filename:t}){return(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,E.jsx)(x,{value:JSON.stringify(e??null,null,2)}),(0,E.jsx)(o,{"aria-label":`Download JSON`,title:`Download JSON`,onClick:()=>S(t,e??null),children:(0,E.jsx)(v,{className:`size-3.5`})})]})}export{L as JobInspector};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{f as n,h as r,r as i,t as a}from"./react-vendor-B68RYDeC.js";import{B as o,E as s,F as ee,J as c,K as l,S as u,T as d,W as te,Y as ne,a as re,c as ie,g as ae,h as oe,k as f,l as se,m as p,n as ce,nt as m,o as le,rt as h,x as ue,z as g}from"./index-Dlr2PaZ6.js";import{a as de,i as fe}from"./form-C-zZyKfB.js";import{t as pe}from"./Pagination-C-6yLcP3.js";import{t as _}from"./exportFile-tdUeW5m5.js";import{t as v}from"./jobActions-CuOdMglt.js";var y=e(r(),1),b=a(),x=[`all`,`waiting`,`active`,`completed`,`failed`],S=25;function me(e=0){return e>=10?{t:`HIGH`,c:`text-warning`}:e>=1?{t:`MEDIUM`,c:`text-blue-400`}:{t:`LOW`,c:`text-faint`}}function C(e){let t=v(e.state);return t.retryActive?m.retryJob(e.id):t.retryDlq?m.retryDlq(e.queue??``,e.id):Promise.reject(Error(`"${e.state??`unknown`}" is not retryable`))}function w(){let[e,r]=n(),[a,w]=(0,y.useState)(e.get(`queue`)??``),[T,he]=(0,y.useState)(()=>{let t=e.get(`status`);return t&&x.includes(t)?t:`all`}),[E,ge]=(0,y.useState)(``),[D,O]=(0,y.useState)(0),[k,A]=(0,y.useState)(new Set),[_e,j]=(0,y.useState)(new Set),[M,N]=(0,y.useState)(!1),[P,F]=(0,y.useState)(null),{data:I}=f(()=>m.queuesSummary(),[],{intervalMs:3e4}),{data:ve}=f(()=>m.overview(),[],{intervalMs:1e4});(0,y.useEffect)(()=>{!a&&I?.length&&w(I[0].name)},[I,a]);let L=`${a}|${T}|${D}`,{data:R,error:z,loading:ye,refetch:B}=f((0,y.useCallback)(async()=>{if(!a)return{view:L,jobs:[]};let e=T===`all`?void 0:[T];return{view:L,jobs:((await m.jobsList(a,e,S,D*S)).jobs??[]).map(e=>({...e,queue:e.queue??a}))}},[a,T,D,L]),[a,T,D]),V=R&&R.view===L?R.jobs:null,be=(V?.length??0)===S,H=(0,y.useMemo)(()=>{let e=E.trim().toLowerCase();return e?(V??[]).filter(t=>t.id.toLowerCase().includes(e)):V??[]},[V,E]),U=ve?.stats,W=(0,y.useMemo)(()=>(I??[]).reduce((e,t)=>e+(t.counts?.failed??0),0),[I]),G=U?ce(U.completed,W):null,K=e=>U?ie(e):`—`,q=()=>O(0),J=(e,t)=>{let n={};e&&(n.queue=e),t!==`all`&&(n.status=t),r(n,{replace:!0})};(0,y.useEffect)(()=>{A(new Set)},[a,T,D]);let xe=e=>A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),Y=H.length>0&&H.every(e=>k.has(e.id)),Se=()=>A(()=>Y?new Set:new Set(H.map(e=>e.id))),X=async(e,t,n,r)=>{if(!(r&&!window.confirm(r))){j(t=>new Set(t).add(e.id)),F(null);try{await n(),F({ok:!0,text:`${t} ✓`}),h.success(`${t} ✓`,e.id)}catch(e){F({ok:!1,text:`${t} failed: ${e.message}`}),h.error(`${t} failed`,e.message)}finally{j(t=>{let n=new Set(t);return n.delete(e.id),n}),B()}}},Z=async(e,t,n)=>{let r=H.filter(e=>k.has(e.id));if(r.length===0||n&&!window.confirm(n(r.length)))return;N(!0),F(null);let i=await Promise.allSettled(r.map(t)),a=i.filter(e=>e.status===`fulfilled`).length,o=i.length-a,s=`${e}: ${a} succeeded${o?`, ${o} not eligible / failed`:``}`;F({ok:o===0,text:s}),o===0?h.success(s):h.error(s),A(new Set),N(!1),B()},Q=H.filter(e=>k.has(e.id)),$={retry:Q.some(e=>{let t=v(e.state);return t.retryActive||t.retryDlq}),promote:Q.some(e=>v(e.state).promote),requeue:Q.some(e=>v(e.state).requeueCompleted),fail:Q.some(e=>v(e.state).fail),cancel:Q.some(e=>v(e.state).cancel)};return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(oe,{title:`Jobs Explorer`,description:`Browse, inspect, and manage individual jobs.`,live:!0,actions:(0,b.jsxs)(d,{size:`sm`,disabled:!V||H.length===0,onClick:()=>{if(H.length===0){h.info(`No jobs to export on this page`);return}let e=H.map(e=>({id:e.id,queue:e.queue??a,state:e.state??``,priority:e.priority??0,attempts:e.attempts??0,maxAttempts:e.maxAttempts??``,createdAt:e.createdAt?new Date(e.createdAt).toISOString():``,durationMs:e.startedAt&&e.completedAt?e.completedAt-e.startedAt:``}));_(`jobs-${a}-${T}`,e,[`id`,`queue`,`state`,`priority`,`attempts`,`maxAttempts`,`createdAt`,`durationMs`])},children:[(0,b.jsx)(g,{className:`size-3.5`}),` Export CSV`]})}),(0,b.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,b.jsx)(p,{label:`Total`,value:K((U?.completed??0)+W+(U?.waiting??0)+(U?.active??0)+(U?.delayed??0)),hint:`all queues`,compact:!0}),(0,b.jsx)(p,{label:`Waiting`,value:K(U?.waiting),tone:`amber`,compact:!0}),(0,b.jsx)(p,{label:`Active`,value:K(U?.active),tone:`blue`,compact:!0}),(0,b.jsx)(p,{label:`Completed`,value:K(U?.completed),tone:`green`,compact:!0}),(0,b.jsx)(p,{label:`Failed`,value:K(W),tone:W?`red`:`default`,compact:!0}),(0,b.jsx)(p,{label:`Error Rate`,value:G==null?`—`:se(G),tone:G==null?`default`:G>.05?`red`:`green`,compact:!0})]}),(0,b.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,b.jsx)(`div`,{className:`w-48`,children:(0,b.jsx)(de,{value:a,"aria-label":`Queue`,onChange:e=>{w(e.target.value),q(),J(e.target.value,T)},children:(I??[]).map(e=>(0,b.jsx)(`option`,{value:e.name,children:e.name},e.name))})}),(0,b.jsx)(fe,{options:x,value:T,onChange:e=>{he(e),q(),J(a,e)}}),(0,b.jsxs)(`div`,{className:`relative ml-auto min-w-56 flex-1 md:max-w-xs`,children:[(0,b.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,b.jsx)(`input`,{value:E,onChange:e=>ge(e.target.value),placeholder:`Filter this page by ID…`,"aria-label":`Filter by job ID`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]})]}),k.size>0&&(0,b.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2 rounded-lg border border-line bg-surface-2 px-4 py-2 text-sm`,children:[(0,b.jsxs)(`span`,{className:`mr-1 text-muted`,children:[k.size,` selected`]}),$.retry&&(0,b.jsx)(d,{size:`sm`,disabled:M,onClick:()=>Z(`Retry`,C),children:`Retry selected`}),$.promote&&(0,b.jsx)(d,{size:`sm`,disabled:M,onClick:()=>Z(`Promote`,e=>v(e.state).promote?m.promoteJob(e.id):Promise.reject(Error(`"${e.state??`unknown`}" is not delayed`))),children:`Promote selected`}),$.requeue&&(0,b.jsx)(d,{size:`sm`,disabled:M,onClick:()=>Z(`Requeue`,e=>v(e.state).requeueCompleted?m.retryCompleted(e.queue??``,e.id):Promise.reject(Error(`"${e.state??`unknown`}" is not completed`))),children:`Requeue selected`}),$.fail&&(0,b.jsx)(d,{variant:`warning`,size:`sm`,disabled:M,onClick:()=>Z(`Fail`,e=>v(e.state).fail?m.failJob(e.id):Promise.reject(Error(`"${e.state??`unknown`}" is not active`)),e=>`Force-fail ${e} job(s)?`),children:`Fail selected`}),$.cancel&&(0,b.jsx)(d,{variant:`danger`,size:`sm`,disabled:M,onClick:()=>Z(`Cancel`,e=>v(e.state).cancel?m.cancelJob(e.id):Promise.reject(Error(`"${e.state??`unknown`}" cannot be cancelled`)),e=>`Cancel ${e} job(s)? This cannot be undone.`),children:`Cancel selected`}),!$.retry&&!$.promote&&!$.requeue&&!$.fail&&!$.cancel&&(0,b.jsx)(`span`,{className:`text-xs text-faint`,children:`No actions apply to the selected job states.`})]}),P&&(0,b.jsx)(`div`,{role:`status`,className:t(`mb-3 text-sm`,P.ok?`text-success`:`text-danger`),children:P.text}),z&&(0,b.jsx)(u,{onRetry:B}),ye&&!V&&!z?(0,b.jsx)(ue,{label:`Loading jobs…`}):(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm`,children:[(0,b.jsx)(`span`,{className:`text-faint`,children:`Jobs in queue`}),(0,b.jsx)(`span`,{className:`rounded-md bg-surface-2 px-2 py-0.5 font-mono text-xs text-fg`,children:a})]}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{scope:`col`,className:`w-10 px-5 py-3`,children:(0,b.jsx)(`input`,{type:`checkbox`,checked:Y,onChange:Se,"aria-label":`Select all jobs on page`,className:`accent-accent`})}),(0,b.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Job ID`}),(0,b.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Priority`}),(0,b.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Created`}),(0,b.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Duration`}),(0,b.jsx)(`th`,{scope:`col`,className:`w-28 px-5 py-3 text-right font-medium`,children:`Actions`})]})}),(0,b.jsx)(`tbody`,{children:H.length===0?(0,b.jsx)(`tr`,{children:(0,b.jsx)(`td`,{colSpan:7,className:`px-5 py-12 text-center text-sm text-faint`,children:E.trim()?`No jobs on this page match your ID filter.`:a?`No jobs found.`:`Select a queue.`})}):H.map(e=>{let n=me(e.priority),r=v(e.state),a=_e.has(e.id);return(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(`input`,{type:`checkbox`,checked:k.has(e.id),onChange:()=>xe(e.id),"aria-label":`Select job ${e.id}`,className:`accent-accent`})}),(0,b.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-accent/90`,children:(0,b.jsx)(`span`,{className:`block max-w-[16rem] truncate`,title:e.id,children:e.id})}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(ae,{status:String(e.state??`waiting`)})}),(0,b.jsx)(`td`,{className:t(`px-5 py-3 text-xs font-semibold`,n.c),children:n.t}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:re(e.createdAt)}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:le(e.startedAt&&e.completedAt?e.completedAt-e.startedAt:void 0)}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,b.jsx)(i,{to:`/job?id=${encodeURIComponent(e.id)}`,children:(0,b.jsx)(s,{"aria-label":`Inspect job`,children:(0,b.jsx)(o,{className:`size-3.5`})})}),r.promote&&(0,b.jsx)(s,{"aria-label":`Promote job`,disabled:a,onClick:()=>X(e,`Promote`,()=>m.promoteJob(e.id)),children:(0,b.jsx)(te,{className:`size-3.5`})}),(r.retryActive||r.retryDlq)&&(0,b.jsx)(s,{"aria-label":`Retry job`,disabled:a,onClick:()=>X(e,`Retry`,()=>C(e)),children:(0,b.jsx)(l,{className:`size-3.5`})}),r.requeueCompleted&&(0,b.jsx)(s,{"aria-label":`Requeue job`,disabled:a,onClick:()=>X(e,`Requeue`,()=>m.retryCompleted(e.queue??``,e.id)),children:(0,b.jsx)(l,{className:`size-3.5`})}),r.fail&&(0,b.jsx)(s,{"aria-label":`Fail job`,disabled:a,onClick:()=>X(e,`Fail`,()=>m.failJob(e.id),`Force-fail this active job?`),children:(0,b.jsx)(ee,{className:`size-3.5`})}),r.cancel&&(0,b.jsx)(s,{"aria-label":`Cancel job`,disabled:a,onClick:()=>X(e,`Cancel`,()=>m.cancelJob(e.id),`Cancel this job?`),children:(0,b.jsx)(ne,{className:`size-3.5`})})]})})]},e.id)})})]})}),(0,b.jsx)(pe,{page:D,pageSize:S,hasNext:be,onPageChange:O,label:`jobs`})]})]})}export{w as JobsPro};
@@ -1 +0,0 @@
1
- import{r as e}from"./cn-CMFYpumL.js";import{h as t,r as n,t as r}from"./react-vendor-B68RYDeC.js";import{J as i,S as a,T as o,c as s,g as c,h as l,k as u,m as d,nt as f,t as p,u as m}from"./index-Dlr2PaZ6.js";import{a as h,i as g}from"./form-C-zZyKfB.js";import{t as _}from"./Pagination-C-6yLcP3.js";import{t as v}from"./CopyButton-B2gM7BeT.js";var y=e(t(),1),b=r(),x=`__all__`,S=[`all`,`waiting`,`active`,`completed`,`failed`],C=10,w=250;function T(){let[e,t]=(0,y.useState)(x),[r,T]=(0,y.useState)(`all`),[E,D]=(0,y.useState)(``),[O,k]=(0,y.useState)(0),[A,j]=(0,y.useState)(null),M=A!==null,{data:N,error:P,refetch:F}=u(()=>f.queues(),[],{intervalMs:3e4}),{events:I,counters:L,throughput:R,connected:z}=p(e===x?void 0:e),B=(0,y.useMemo)(()=>{let e=A??I,t=E.trim().toLowerCase();return e.filter(e=>r!==`all`&&e.status!==r?!1:t?(e.jobId??``).toLowerCase().includes(t)||(e.queue??``).toLowerCase().includes(t):!0)},[I,A,r,E]),V=M?Math.max(0,(I[0]?.seq??0)-(A[0]?.seq??0)):0;(0,y.useEffect)(()=>k(0),[e,r,E]),(0,y.useEffect)(()=>j(null),[e]);let H=O*C,U=B.slice(H,H+C);return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(l,{title:`Activity Logs`,description:`Real-time job activity across all queues.`,live:z&&!M}),P&&(0,b.jsx)(a,{onRetry:F}),(0,b.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-6`,children:[(0,b.jsx)(d,{label:`Total Events`,value:s(L.total),compact:!0}),(0,b.jsx)(d,{label:`Completed`,value:s(L.completed),tone:`green`,compact:!0}),(0,b.jsx)(d,{label:`Failed`,value:s(L.failed),tone:L.failed?`red`:`default`,compact:!0}),(0,b.jsx)(d,{label:`Waiting`,value:s(L.waiting),tone:`amber`,compact:!0}),(0,b.jsx)(d,{label:`Active`,value:s(L.active),tone:`blue`,compact:!0}),(0,b.jsx)(d,{label:`Throughput`,value:`${R.toFixed(1)}/s`,tone:`accent`,compact:!0})]}),(0,b.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,b.jsx)(`div`,{className:`w-48`,children:(0,b.jsxs)(h,{"aria-label":`Filter by queue`,value:e,onChange:e=>t(e.target.value),children:[(0,b.jsx)(`option`,{value:x,children:`All Queues`}),(N?.queues??[]).map(e=>(0,b.jsx)(`option`,{value:e.name,children:e.name},e.name))]})}),(0,b.jsx)(g,{options:S,value:r,onChange:T}),(0,b.jsx)(o,{size:`sm`,variant:M?`warning`:`default`,onClick:()=>j(M?null:I),title:M?`Resume applying live events to the list`:`Freeze the visible list while the stream keeps buffering`,children:M?`Resume${V?` — ${s(V)} new`:``}`:`Following · Pause`}),(0,b.jsxs)(`div`,{className:`relative ml-auto min-w-56 flex-1 md:max-w-xs`,children:[(0,b.jsx)(i,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,b.jsx)(`input`,{"aria-label":`Search by job ID or queue`,value:E,onChange:e=>D(e.target.value),placeholder:`Search by job ID or queue…`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]})]}),(0,b.jsxs)(`p`,{className:`-mt-2 mb-4 text-xs text-faint`,children:[`Search and filters cover the last `,w,` streamed events held in this browser.`]}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Event`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Timestamp`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`ID`})]})}),(0,b.jsx)(`tbody`,{children:U.length===0?(0,b.jsx)(`tr`,{children:(0,b.jsx)(`td`,{colSpan:5,className:`px-5 py-12 text-center text-sm text-faint`,children:z?I.length>0?`No events match the current filters.`:`Waiting for activity…`:`Connecting to the event stream…`})}):U.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(c,{status:e.status})}),(0,b.jsxs)(`td`,{className:`px-5 py-3 font-mono text-xs text-fg`,children:[e.event,e.status===`failed`&&e.error&&(0,b.jsx)(`div`,{className:`mt-0.5 max-w-64 truncate text-[11px] text-danger`,title:e.error,children:e.error})]}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(`span`,{className:`rounded-md bg-surface-2 px-2 py-0.5 font-mono text-xs text-muted`,children:e.queue||`—`})}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,title:new Date(e.timestamp).toISOString(),children:m(e.timestamp)}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right font-mono text-xs text-faint`,children:e.jobId?(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,b.jsx)(n,{to:`/job?id=${encodeURIComponent(e.jobId)}`,className:`text-accent hover:underline`,children:e.jobId}),(0,b.jsx)(v,{value:e.jobId})]}):`—`})]},e.seq))})]})}),(0,b.jsx)(_,{page:O,pageSize:C,total:B.length,onPageChange:k,label:`events`})]})}export{T as LogsPro};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{C as i,S as a,c as o,d as s,h as c,i as l,k as u,l as d,m as f,n as p,nt as m,w as h,x as g}from"./index-Dlr2PaZ6.js";import{t as _}from"./Pagination-C-6yLcP3.js";import{t as v}from"./AreaChart-Dl_9G6GH.js";import{n as y,t as b}from"./useThroughputSeries-lWDIzQ4F.js";var x=e(n(),1),S=r(),C=[`-60s`,`-45s`,`-30s`,`-15s`,`now`],w=15,T=[`push`,`pull`,`ack`],E=100,D={stats:{waiting:0,active:0,delayed:0,completed:0,dlq:0,totalPushed:0,totalPulled:0,totalCompleted:0,totalFailed:0,uptime:0},throughput:{pushPerSec:0,pullPerSec:0,completePerSec:0,failPerSec:0},latency:{averages:{},percentiles:{}}};function O(){let e=y(60),[n,r]=(0,x.useState)(0),{data:O,error:M,loading:N,refetch:P}=u(async()=>({details:await m.queuesSummary()}),[]),F=O?.details??[],I=Math.max(1,Math.ceil(F.length/w)),L=Math.min(n,I-1),R=(0,x.useMemo)(()=>F.slice(L*w,L*w+w),[F,L]),z=(0,x.useMemo)(()=>F.reduce((e,t)=>e+(t.counts?.failed??0),0),[F]);if(N&&!O&&!M)return(0,S.jsx)(g,{label:`Loading metrics…`});let{stats:B,throughput:V,latency:H}=e.latest??D,U=p(B.completed,z),W=b(e.depth),G=e.depth.length?e.depth[e.depth.length-1]:0;return(0,S.jsxs)(`div`,{children:[(0,S.jsx)(c,{title:`Metrics`,description:`Real-time performance telemetry for your queues.`,live:!M}),M&&(0,S.jsx)(a,{onRetry:P}),(0,S.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,S.jsx)(f,{label:`Total Completed`,value:l(B.completed),tone:`green`,hint:`recorded jobs`}),(0,S.jsx)(f,{label:`Total Failed`,value:o(z),tone:z?`red`:`default`,hint:`recorded jobs`}),(0,S.jsx)(f,{label:`Push/sec`,value:V.pushPerSec.toFixed(1),tone:`accent`,hint:`jobs/sec`}),(0,S.jsx)(f,{label:`Pull/sec`,value:V.pullPerSec.toFixed(1),tone:`accent`,hint:`jobs/sec`})]}),(0,S.jsxs)(i,{className:`mb-6`,children:[(0,S.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Live Throughput`}),(0,S.jsx)(`p`,{className:`text-xs text-faint`,children:`Real-time jobs per second (rolling 60s window)`})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,S.jsx)(A,{color:`#ec4899`,label:`Pushed`,value:V.pushPerSec}),(0,S.jsx)(A,{color:`#34d399`,label:`Completed`,value:V.completePerSec}),(0,S.jsx)(A,{color:`#f87171`,label:`Failed`,value:V.failPerSec})]})]}),(0,S.jsx)(v,{xLabels:C,series:[{label:`Pushed`,color:`#ec4899`,points:e.push,area:!0},{label:`Completed`,color:`#34d399`,points:e.complete},{label:`Failed`,color:`#f87171`,points:e.fail}]})]}),(0,S.jsxs)(i,{className:`mb-6`,children:[(0,S.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Queue Depth`}),(0,S.jsx)(`p`,{className:`text-xs text-faint`,children:`Backlog over time (waiting + active + delayed). The trend says whether you're draining or falling behind — more useful than any single gauge.`})]}),(0,S.jsxs)(`div`,{className:`text-right`,children:[(0,S.jsx)(`div`,{className:`tnum text-2xl font-bold text-fg`,children:o(G)}),(0,S.jsx)(`div`,{className:t(`text-xs font-medium`,W.label===`draining`?`text-success`:W.label===`accumulating`?`text-danger`:`text-faint`),children:W.label===`steady`?`steady`:`${W.slope>0?`+`:``}${W.slope.toFixed(1)}/s · ${W.label}`})]})]}),(0,S.jsx)(v,{xLabels:C,ariaLabel:`queue depth chart`,series:[{label:`Depth`,color:W.draining?`#34d399`:`#f59e0b`,points:e.depth,area:!0}]})]}),(0,S.jsxs)(`div`,{className:`mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,S.jsxs)(i,{children:[(0,S.jsx)(h,{title:`Error Rate`}),(0,S.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Failed as percentage of total processed`}),(0,S.jsxs)(`div`,{className:`flex items-center justify-around`,children:[(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(`div`,{className:t(`text-3xl font-bold tnum`,U!=null&&U>.05?`text-danger`:`text-fg`),children:U==null?`—`:d(U)}),(0,S.jsx)(`div`,{className:`text-xs text-faint`,children:`error rate`})]}),(0,S.jsxs)(`div`,{className:`text-center`,children:[(0,S.jsx)(`div`,{className:t(`text-3xl font-bold tnum`,U==null?`text-fg`:`text-success`),children:U==null?`—`:d(1-U)}),(0,S.jsx)(`div`,{className:`text-xs text-faint`,children:`success rate`})]})]}),U==null?(0,S.jsx)(`div`,{className:`mt-4 h-2 overflow-hidden rounded-full bg-surface-2`}):(0,S.jsx)(`div`,{className:`mt-4 h-2 overflow-hidden rounded-full bg-red-500/40`,children:(0,S.jsx)(`div`,{className:`h-full rounded-full bg-emerald-500`,style:{width:`${(1-U)*100}%`}})})]}),(0,S.jsxs)(i,{children:[(0,S.jsx)(h,{title:`Server Overview`}),(0,S.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Current server-wide statistics`}),(0,S.jsxs)(`dl`,{className:`divide-y divide-line text-sm`,children:[(0,S.jsx)(j,{color:`bg-blue-400`,label:`Queued`,value:o(B.waiting)}),(0,S.jsx)(j,{color:`bg-accent`,label:`Processing`,value:o(B.active)}),(0,S.jsx)(j,{color:`bg-amber-400`,label:`Delayed`,value:o(B.delayed)}),(0,S.jsx)(j,{color:`bg-red-400`,label:`Dead Letter`,value:o(B.dlq)}),(0,S.jsx)(j,{color:`bg-zinc-500`,label:`Pushed (since restart)`,value:l(B.totalPushed)}),(0,S.jsx)(j,{color:`bg-zinc-500`,label:`Pulled (since restart)`,value:l(B.totalPulled)}),(0,S.jsx)(j,{color:`bg-emerald-400`,label:`Uptime`,value:s(B.uptime/1e3)})]})]})]}),(0,S.jsxs)(i,{className:`mb-6`,padded:!1,children:[(0,S.jsxs)(`div`,{className:`border-b border-line px-5 py-4`,children:[(0,S.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Operation Latency`}),(0,S.jsx)(`p`,{className:`text-xs text-faint`,children:`TCP round-trip per operation (p50 / p95 / p99, milliseconds)`})]}),(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,S.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Operation`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Avg`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`p50`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`p95`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`p99`})]})}),(0,S.jsx)(`tbody`,{children:T.map(e=>{let n=H?.percentiles?.[e],r=H?.averages?.[`${e}Ms`];return(0,S.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,S.jsx)(`td`,{className:`px-5 py-3 font-medium capitalize text-fg`,children:e}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:k(r)}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:k(n?.p50)}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:k(n?.p95)}),(0,S.jsx)(`td`,{className:t(`px-5 py-3 text-right tnum`,(n?.p99??0)>E?`text-warning`:`text-muted`),children:k(n?.p99)})]},e)})})]})})]}),(0,S.jsxs)(i,{padded:!1,children:[(0,S.jsxs)(`div`,{className:`border-b border-line px-5 py-4`,children:[(0,S.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Per-Queue Metrics`}),(0,S.jsx)(`p`,{className:`text-xs text-faint`,children:`Job counts breakdown by queue`})]}),(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,S.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,S.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Waiting`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Active`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Completed`}),(0,S.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Failed`})]})}),(0,S.jsx)(`tbody`,{children:R.length===0?(0,S.jsx)(`tr`,{children:(0,S.jsx)(`td`,{colSpan:6,className:`px-5 py-12 text-center text-sm text-faint`,children:`No queues yet.`})}):R.map(e=>(0,S.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,S.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-accent`,children:e.name}),(0,S.jsx)(`td`,{className:`px-5 py-3`,children:(0,S.jsx)(`span`,{className:t(`rounded-full px-2 py-0.5 text-[11px] font-medium`,e.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:e.paused?`paused`:`active`})}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-warning`,children:o(e.counts.waiting)}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:o(e.counts.active)}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-success`,children:o(e.counts.completed)}),(0,S.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-danger`,children:o(e.counts.failed)})]},e.name))})]})}),(0,S.jsx)(`div`,{className:`px-5 pb-4`,children:(0,S.jsx)(_,{page:L,pageSize:w,total:F.length,onPageChange:r,label:`queues`})})]})]})}function k(e){return e==null||!Number.isFinite(e)?`—`:`${e<10?e.toFixed(1):Math.round(e)}ms`}function A({color:e,label:t,value:n}){return(0,S.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,S.jsxs)(`span`,{className:`text-fg`,children:[n.toFixed(1),`/s`]})]})}function j({color:e,label:n,value:r}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-2.5`,children:[(0,S.jsxs)(`dt`,{className:`flex items-center gap-2 text-muted`,children:[(0,S.jsx)(`span`,{className:t(`size-2 rounded-full`,e)}),n]}),(0,S.jsx)(`dd`,{className:`font-semibold tnum text-fg`,children:r})]})}export{O as MetricsPro};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{d as n,h as r,r as i,t as a,u as o}from"./react-vendor-B68RYDeC.js";import{C as s,E as c,N as l,S as u,T as d,_ as f,c as p,h as m,j as h,k as g,l as _,m as v,n as y,nt as b,o as x,rt as S,w as C,x as w,y as T}from"./index-Dlr2PaZ6.js";import{t as E}from"./AreaChart-Dl_9G6GH.js";import{t as D}from"./useThroughputSeries-lWDIzQ4F.js";import{i as O,n as k,r as ee,t as A}from"./QueueActions-Dhy0KXjr.js";var j=e(r(),1),M=a(),N=[`waiting`,`active`,`completed`,`failed`,`delayed`,`paused`],P=[`active`,`waiting`,`completed`,`failed`,`delayed`],F=2e3;function I(){let{name:e=``}=n(),r=o(),[a,I]=(0,j.useState)(!1),[R,z]=(0,j.useState)(null),{data:B,error:V,loading:H,refetch:U}=g((0,j.useCallback)(async()=>{if(!e)return null;let[t,n,r,i]=await Promise.all([b.queueDetail(e,!1),b.getStallConfig(e).catch(()=>null),b.getDlqConfig(e).catch(()=>null),b.jobsList(e,P,12).catch(()=>({ok:!1,jobs:[]}))]);return{queue:e,detail:t,stall:n?.config??null,dlq:r?.config??null,jobs:i.jobs??[]}},[e]),[e]),W=B&&B.queue===e?B:null,[G,K]=(0,j.useState)([]),q=(0,j.useRef)(null);(0,j.useEffect)(()=>{let e=W?.detail?.counts;e&&(q.current=(e.waiting??0)+(e.active??0)+(e.delayed??0))},[W]),(0,j.useEffect)(()=>{q.current=null,K([]);let e=setInterval(()=>{let e=q.current;e!=null&&K(t=>[...t,e].slice(-40))},F);return()=>clearInterval(e)},[e]);let J=(t,n,r)=>{r&&!window.confirm(r)||(I(!0),z(null),n().then(n=>{let r=n?.count,i=`${t}${r==null?` ✓`:`: ${r}`}`;z({ok:!0,text:i}),S.success(i,e),U()}).catch(e=>{let n=e.message;z({ok:!1,text:n}),S.error(`${t} failed`,n)}).finally(()=>I(!1)))},Y=()=>{window.confirm(`Obliterate "${e}"? This removes the queue and all its jobs.`)&&(I(!0),b.obliterate(e).then(()=>{S.success(`Queue obliterated`,e),r(`/queues`)}).catch(e=>{let t=e.message;z({ok:!1,text:t}),S.error(`Obliterate failed`,t),I(!1)}))},X=W?.detail,Z=X?.counts,Q=Z?y(Z.completed??0,Z.failed??0)??0:0,$=D(G);return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(m,{title:(0,M.jsx)(`span`,{className:`font-mono`,children:e}),description:`Full per-queue operations and live backlog.`,live:!0,back:(0,M.jsx)(c,{"aria-label":`Back to queues`,onClick:()=>r(`/queues`),children:(0,M.jsx)(l,{className:`size-4`})}),actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(i,{to:`/jobs?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:[`Jobs `,(0,M.jsx)(h,{className:`size-3.5`})]}),(0,M.jsxs)(i,{to:`/dlq?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:[`DLQ `,(0,M.jsx)(h,{className:`size-3.5`})]}),(0,M.jsx)(d,{variant:`danger`,size:`sm`,disabled:a,onClick:Y,children:`Obliterate`})]})}),V&&(0,M.jsx)(u,{onRetry:U}),H&&!W&&!V?(0,M.jsx)(w,{label:`Loading ${e}…`}):!X||!Z?!V&&(0,M.jsx)(T,{title:`Queue not found`,hint:`No queue named "${e}" exists — it may have been obliterated, or the link is stale.`,action:(0,M.jsx)(i,{to:`/queues`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Back to queues`})}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-center gap-3`,children:[(0,M.jsx)(f,{label:X.paused?`Paused`:`Active`,tone:X.paused?`amber`:`green`}),R&&(0,M.jsx)(`span`,{role:`status`,className:R.ok?`text-xs text-success`:`text-xs text-danger`,children:R.text})]}),(0,M.jsx)(`div`,{className:`mb-6 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6`,children:N.map(e=>(0,M.jsx)(v,{label:e,value:p(Z[e]),tone:e===`failed`&&Z.failed?`red`:`default`,compact:!0},e))}),(0,M.jsxs)(s,{className:`mb-6`,children:[(0,M.jsx)(C,{title:`Backlog depth`,action:(0,M.jsx)(`span`,{className:t(`rounded-full px-2 py-0.5 text-[11px] font-medium`,$.draining?`bg-emerald-500/10 text-success`:$.label===`accumulating`?`bg-red-500/10 text-danger`:`bg-surface-2 text-muted`),children:$.label})}),G.length<2?(0,M.jsx)(`p`,{className:`py-6 text-center text-xs text-faint`,children:`Sampling… the backlog trend appears after a few polls.`}):(0,M.jsx)(E,{height:140,ariaLabel:`${e} backlog depth`,series:[{label:`depth`,color:`var(--accent)`,points:G,area:!0}]}),(0,M.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-xs text-faint`,children:[(0,M.jsx)(`span`,{children:`waiting + active + delayed`}),(0,M.jsxs)(`span`,{className:`tnum`,children:[`Error rate `,_(Q)]})]})]}),(0,M.jsx)(A,{queue:e,paused:X.paused,busy:a,run:J}),(0,M.jsx)(k,{queue:e,busy:a,run:J}),(0,M.jsxs)(`div`,{className:`mb-6 grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[W.stall?(0,M.jsx)(O,{queue:e,config:W.stall,onSaved:()=>{z({ok:!0,text:`Stall config saved ✓`}),S.success(`Stall config saved`,e)}},e):(0,M.jsx)(L,{title:`Stall detection`,onRetry:U}),W.dlq?(0,M.jsx)(ee,{queue:e,config:W.dlq,onSaved:()=>{z({ok:!0,text:`DLQ config saved ✓`}),S.success(`DLQ config saved`,e)}},e):(0,M.jsx)(L,{title:`DLQ policy`,onRetry:U})]}),(0,M.jsxs)(s,{padded:!1,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3`,children:[(0,M.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:`Recent jobs`}),(0,M.jsxs)(i,{to:`/jobs?queue=${encodeURIComponent(e)}`,className:`flex items-center gap-1 text-sm text-muted hover:text-fg`,children:[`View all `,(0,M.jsx)(h,{className:`size-3.5`})]})]}),(0,M.jsx)(`div`,{className:`overflow-x-auto border-t border-line`,children:(0,M.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`ID`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`State`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Attempts`}),(0,M.jsx)(`th`,{scope:`col`,className:`px-5 py-3 text-right font-medium`,children:`Duration`})]})}),(0,M.jsx)(`tbody`,{children:W.jobs.length===0?(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:4,className:`px-5 py-10 text-center text-sm text-faint`,children:`No recent jobs.`})}):W.jobs.map(e=>(0,M.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,M.jsx)(`td`,{className:`px-5 py-3`,children:(0,M.jsx)(i,{to:`/job?id=${encodeURIComponent(e.id)}`,className:`font-mono text-xs text-accent hover:underline`,children:e.id})}),(0,M.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.state??`—`}),(0,M.jsxs)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:[e.attempts??0,` / `,e.maxAttempts??`?`]}),(0,M.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:x(e.startedAt&&e.completedAt?e.completedAt-e.startedAt:void 0)})]},e.id))})]})})]})]})]})}function L({title:e,onRetry:t}){return(0,M.jsxs)(s,{children:[(0,M.jsx)(C,{title:e}),(0,M.jsx)(`p`,{className:`mb-3 text-sm text-muted`,children:`Couldn't load this queue's config.`}),(0,M.jsx)(d,{size:`sm`,onClick:t,children:`Retry`})]})}export{I as QueueDetailPro};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,r,t as i,u as a}from"./react-vendor-B68RYDeC.js";import{E as o,G as s,J as c,S as l,T as u,U as d,W as f,c as p,h as m,j as h,k as g,m as _,nt as v,rt as y,x as b}from"./index-Dlr2PaZ6.js";import{t as x}from"./Pagination-C-6yLcP3.js";import{t as S}from"./promisePool-Daxkc1OB.js";var C=e(n(),1),w=i(),T=6,E=15,D=[[`waiting`,`Waiting`],[`active`,`Active`],[`completed`,`Completed`],[`failed`,`Failed`],[`delayed`,`Delayed`]];function O(){let e=a(),[n,i]=(0,C.useState)(``),[O,k]=(0,C.useState)(0),[A,j]=(0,C.useState)(new Set),[M,N]=(0,C.useState)(!1),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(`desc`),{data:B,error:V,loading:H,refetch:U}=g(()=>v.queuesSummary(),[]),W=B??[],G=e=>{I===e?R===`desc`?z(`asc`):L(null):(L(e),z(`desc`)),k(0)},K=(0,C.useMemo)(()=>{let e=n.trim().toLowerCase(),t=[...e?W.filter(t=>t.name.toLowerCase().includes(e)):W].sort((e,t)=>e.name.localeCompare(t.name));if(I){let e=R===`desc`?-1:1;t.sort((t,n)=>e*(t.counts[I]-n.counts[I]))}return t},[W,n,I,R]),q=(0,C.useMemo)(()=>W.reduce((e,t)=>(e.waiting+=t.counts.waiting,e.active+=t.counts.active,e.failed+=t.counts.failed,e.paused+=+!!t.paused,e),{waiting:0,active:0,failed:0,paused:0}),[W]),J=Math.max(1,Math.ceil(K.length/E)),Y=Math.min(O,J-1),X=K.slice(Y*E,Y*E+E),Z=async e=>{j(t=>new Set(t).add(e.name)),F(null);try{await(e.paused?v.resume(e.name):v.pause(e.name)),F({ok:!0,text:`${e.name} ${e.paused?`resumed`:`paused`} ✓`})}catch(t){F({ok:!1,text:t.message}),y.error(`Failed to ${e.paused?`resume`:`pause`} ${e.name}`,t.message)}finally{j(t=>{let n=new Set(t);return n.delete(e.name),n}),U()}},Q=async e=>{let t=W.filter(t=>e===`pause`?!t.paused:t.paused);if(t.length===0){y.info(`No queues to ${e}`);return}if(!window.confirm(`${e===`pause`?`Pause`:`Resume`} ${t.length} queue(s)?`))return;N(!0),F(null);let n=(await S(t,T,t=>e===`pause`?v.pause(t.name):v.resume(t.name))).filter(e=>e.status===`rejected`).length,r=`${e===`pause`?`Paused`:`Resumed`} ${t.length-n}/${t.length} queues${n?`, ${n} failed`:``}`;F({ok:n===0,text:r}),n===0?y.success(r):y.error(r),N(!1),U()};return H&&!B&&!V?(0,w.jsx)(b,{label:`Loading queues…`}):(0,w.jsxs)(`div`,{children:[(0,w.jsx)(m,{title:`Queues`,description:`${W.length} queues`,live:!0,actions:W.length>0?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(u,{variant:`warning`,size:`sm`,disabled:M||q.paused>=W.length,onClick:()=>Q(`pause`),children:[(0,w.jsx)(d,{className:`size-3.5`}),` Pause all`]}),(0,w.jsxs)(u,{variant:`success`,size:`sm`,disabled:M||q.paused===0,onClick:()=>Q(`resume`),children:[(0,w.jsx)(f,{className:`size-3.5`}),` Resume all`]})]}):void 0}),V&&(0,w.jsx)(l,{onRetry:U}),(0,w.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,w.jsx)(_,{label:`Waiting`,value:p(q.waiting),tone:`amber`,compact:!0}),(0,w.jsx)(_,{label:`Active`,value:p(q.active),tone:`blue`,compact:!0}),(0,w.jsx)(_,{label:`Failed`,value:p(q.failed),tone:q.failed?`red`:`default`,compact:!0}),(0,w.jsx)(_,{label:`Paused`,value:p(q.paused),tone:q.paused?`amber`:`default`,compact:!0})]}),(0,w.jsxs)(`div`,{className:`relative mb-4 max-w-sm`,children:[(0,w.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,w.jsx)(`input`,{value:n,onChange:e=>{i(e.target.value),k(0)},placeholder:`Search queues…`,"aria-label":`Filter queues`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),P&&(0,w.jsx)(`div`,{role:`status`,className:t(`mb-3 text-sm`,P.ok?`text-success`:`text-danger`),children:P.text}),(0,w.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,w.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,w.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Queue`}),D.map(([e,t])=>(0,w.jsx)(`th`,{scope:`col`,"aria-sort":I===e?R===`desc`?`descending`:`ascending`:void 0,className:`px-5 py-3 text-right font-medium`,children:(0,w.jsxs)(`button`,{type:`button`,onClick:()=>G(e),className:`inline-flex items-center gap-1 rounded uppercase tracking-wider hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[t,I===e&&(0,w.jsx)(`span`,{"aria-hidden":`true`,children:R===`desc`?`↓`:`↑`})]})},e)),(0,w.jsx)(`th`,{scope:`col`,className:`px-5 py-3 font-medium`,children:`Status`}),(0,w.jsx)(`th`,{scope:`col`,className:`w-24 px-5 py-3 text-right font-medium`,children:`Actions`})]})}),(0,w.jsx)(`tbody`,{children:X.length===0?(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{colSpan:8,className:`px-5 py-12 text-center text-sm text-faint`,children:n?`No queues match your search.`:`No queues yet.`})}):X.map(n=>{let i=A.has(n.name);return(0,w.jsxs)(`tr`,{onClick:()=>e(`/queues/${encodeURIComponent(n.name)}`),className:`group cursor-pointer border-b border-line last:border-0 transition-colors hover:bg-surface-2/50`,children:[(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(r,{to:`/queues/${encodeURIComponent(n.name)}`,onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 rounded font-medium text-fg hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[(0,w.jsx)(s,{className:`size-4 text-faint`}),n.name]})}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-warning`,children:p(n.counts.waiting)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:p(n.counts.active)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-success`,children:p(n.counts.completed)}),(0,w.jsx)(`td`,{className:t(`px-5 py-3 text-right tnum`,n.counts.failed?`text-danger`:`text-muted`),children:p(n.counts.failed)}),(0,w.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:p(n.counts.delayed)}),(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,n.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:[(0,w.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),n.paused?`Paused`:`Active`]})}),(0,w.jsx)(`td`,{className:`px-5 py-3`,children:(0,w.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,w.jsx)(o,{"aria-label":n.paused?`Resume queue`:`Pause queue`,disabled:i,onClick:e=>{e.stopPropagation(),Z(n)},children:n.paused?(0,w.jsx)(f,{className:`size-3.5 text-success`}):(0,w.jsx)(d,{className:`size-3.5 text-warning`})}),(0,w.jsx)(h,{className:`size-4 text-faint opacity-0 transition-opacity group-hover:opacity-100`})]})})]},n.name)})})]})}),(0,w.jsx)(x,{page:Y,pageSize:E,total:K.length,onPageChange:k,label:`queues`})]})}export{O as QueuesOverview};