bunqueue-dashboard 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/.vite/manifest.json +65 -81
- package/dist/assets/{AddJob-B6DB3nLS.js → AddJob-kPPv3bPb.js} +2 -2
- package/dist/assets/{Alerts-CWgn7JKK.js → Alerts-DyA39_uq.js} +1 -1
- package/dist/assets/Benchmark-B3KDk7ue.js +1 -0
- package/dist/assets/{BulkAddJobs-D5A-56qh.js → BulkAddJobs-tL300nBi.js} +2 -2
- package/dist/assets/{CopilotPanel-C4u8nJMr.js → CopilotPanel-PMVR2Cd3.js} +1 -1
- package/dist/assets/{Cron-D8Cl1VQg.js → Cron-C_gbmPNI.js} +1 -1
- package/dist/assets/{CronManager-DkpnKkUk.js → CronManager-DC9YMFWw.js} +1 -1
- package/dist/assets/{Database-BmdixnFB.js → Database-LKuDZO6v.js} +3 -3
- package/dist/assets/{Diagnostics-DNCcEQZe.js → Diagnostics-02P8kK0A.js} +1 -1
- package/dist/assets/Dlq-Bz22b8rz.js +1 -0
- package/dist/assets/DlqControl-bZK1IQiC.js +1 -0
- package/dist/assets/{DlqPro-CkDrvA_m.js → DlqPro-7QuH6aNZ.js} +1 -1
- package/dist/assets/{Flows-tVpaOy-A.js → Flows-DpehOAzf.js} +1 -1
- package/dist/assets/JobInspector-D9cxknvv.js +2 -0
- package/dist/assets/{Jobs-CBoU-CeR.js → Jobs-DHJqAWws.js} +1 -1
- package/dist/assets/JobsPro-COyxqkNn.js +1 -0
- package/dist/assets/{Logs-BWq4h_tj.js → Logs-DoaPBM7P.js} +1 -1
- package/dist/assets/LogsPro-CnAAAWPH.js +1 -0
- package/dist/assets/{McpServer-DZD7-dyS.js → McpServer-XBSHRJpK.js} +2 -2
- package/dist/assets/{Metrics-Cu1CHLHF.js → Metrics-qqHBt5Mq.js} +1 -1
- package/dist/assets/MetricsPro-1p0Rpacn.js +1 -0
- package/dist/assets/{Overview-BSqH2VRL.js → Overview-DWCFawq-.js} +1 -1
- package/dist/assets/{Pagination-C-6yLcP3.js → Pagination-vdXIy1LL.js} +1 -1
- package/dist/assets/{QueueActions-Dhy0KXjr.js → QueueActions-CzenZmRB.js} +1 -1
- package/dist/assets/{QueueControl-2x3FDkR9.js → QueueControl-BNW57gvM.js} +1 -1
- package/dist/assets/{QueueDetail-Nfc8Zu5b.js → QueueDetail-w7VUvfk9.js} +1 -1
- package/dist/assets/QueueDetailPro-C6Ztytkp.js +1 -0
- package/dist/assets/{Queues-JsB6NujG.js → Queues-Bie4azaQ.js} +1 -1
- package/dist/assets/QueuesOverview-BUTDdZ1o.js +1 -0
- package/dist/assets/{S3Backup-CLizitSQ.js → S3Backup-BFA23J_Y.js} +1 -1
- package/dist/assets/{S3BackupPro-CoSFg6KF.js → S3BackupPro-I_YK8ufb.js} +1 -1
- package/dist/assets/ServerControl-CuAmFqD3.js +3 -0
- package/dist/assets/{Settings-Czzagq5p.js → Settings-BOTyxPXb.js} +1 -1
- package/dist/assets/{Usage-DGv7A2XQ.js → Usage-DP6SPxu5.js} +1 -1
- package/dist/assets/UsagePro-DteL5Ez5.js +1 -0
- package/dist/assets/{Webhooks-C0ByRD8k.js → Webhooks-LwgtwNkr.js} +1 -1
- package/dist/assets/{Workers-BB9o9IJ6.js → Workers-C-5dO7Go.js} +1 -1
- package/dist/assets/WorkersPro-DFhuR9f0.js +1 -0
- package/dist/assets/index-D9IOUE5C.js +8 -0
- package/dist/assets/index-KoYkT_4d.css +1 -0
- package/dist/assets/{useThroughputSeries-lWDIzQ4F.js → useThroughputSeries-D-_zB_EP.js} +1 -1
- package/dist/index.html +31 -3
- package/dist/og.png +0 -0
- package/package.json +15 -7
- package/scripts/embedded.gen.ts +108 -108
- package/dist/assets/Benchmark-C6eJlf21.js +0 -1
- package/dist/assets/CopyButton-B2gM7BeT.js +0 -1
- package/dist/assets/Dlq-ChFKsJwc.js +0 -1
- package/dist/assets/DlqControl-C0RX-JRF.js +0 -1
- package/dist/assets/JobInspector-B6RmHnFF.js +0 -2
- package/dist/assets/JobsPro-WiZ3UHGN.js +0 -1
- package/dist/assets/LogsPro-Bf9Ihrkj.js +0 -1
- package/dist/assets/MetricsPro-Bs-Rwic_.js +0 -1
- package/dist/assets/QueueDetailPro-CnuNbKyk.js +0 -1
- package/dist/assets/QueuesOverview-BB8UL0nT.js +0 -1
- package/dist/assets/ServerControl-DcP14j8m.js +0 -3
- package/dist/assets/UsagePro-Cre49W5i.js +0 -1
- package/dist/assets/WorkersPro-DgjEEM9Y.js +0 -1
- package/dist/assets/index-BovL_it0.css +0 -1
- package/dist/assets/index-Dlr2PaZ6.js +0 -8
package/README.md
CHANGED
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
# bunqueue dashboard
|
|
6
6
|
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
**The only queue dashboard that also _runs_ the server.** Monitor and control queues, jobs, DLQ,
|
|
8
|
+
cron, webhooks, workers, and a live activity stream for a [bunqueue](https://bunqueue.dev) server
|
|
9
|
+
(a fast, Redis-free, Bun-native background-job queue), plus **start / stop / restart of the server
|
|
10
|
+
process itself**, all from one place.
|
|
11
|
+
|
|
12
|
+
For Bun developers and AI-agent builders running bunqueue who want to _operate_ their queue, not just watch it.
|
|
10
13
|
|
|
11
14
|
### [▶ Try the live demo](https://egeominotti.github.io/bunqueue-dashboard/)
|
|
12
15
|
|
package/dist/.vite/manifest.json
CHANGED
|
@@ -7,17 +7,8 @@
|
|
|
7
7
|
"_react-vendor-B68RYDeC.js"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"
|
|
11
|
-
"file": "assets/
|
|
12
|
-
"name": "CopyButton",
|
|
13
|
-
"imports": [
|
|
14
|
-
"_cn-CMFYpumL.js",
|
|
15
|
-
"_react-vendor-B68RYDeC.js",
|
|
16
|
-
"index.html"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"_Pagination-C-6yLcP3.js": {
|
|
20
|
-
"file": "assets/Pagination-C-6yLcP3.js",
|
|
10
|
+
"_Pagination-vdXIy1LL.js": {
|
|
11
|
+
"file": "assets/Pagination-vdXIy1LL.js",
|
|
21
12
|
"name": "Pagination",
|
|
22
13
|
"imports": [
|
|
23
14
|
"_cn-CMFYpumL.js",
|
|
@@ -25,8 +16,8 @@
|
|
|
25
16
|
"index.html"
|
|
26
17
|
]
|
|
27
18
|
},
|
|
28
|
-
"_QueueActions-
|
|
29
|
-
"file": "assets/QueueActions-
|
|
19
|
+
"_QueueActions-CzenZmRB.js": {
|
|
20
|
+
"file": "assets/QueueActions-CzenZmRB.js",
|
|
30
21
|
"name": "QueueActions",
|
|
31
22
|
"imports": [
|
|
32
23
|
"_cn-CMFYpumL.js",
|
|
@@ -74,8 +65,8 @@
|
|
|
74
65
|
"_cn-CMFYpumL.js"
|
|
75
66
|
]
|
|
76
67
|
},
|
|
77
|
-
"_useThroughputSeries-
|
|
78
|
-
"file": "assets/useThroughputSeries-
|
|
68
|
+
"_useThroughputSeries-D-_zB_EP.js": {
|
|
69
|
+
"file": "assets/useThroughputSeries-D-_zB_EP.js",
|
|
79
70
|
"name": "useThroughputSeries",
|
|
80
71
|
"imports": [
|
|
81
72
|
"_cn-CMFYpumL.js",
|
|
@@ -84,7 +75,7 @@
|
|
|
84
75
|
]
|
|
85
76
|
},
|
|
86
77
|
"index.html": {
|
|
87
|
-
"file": "assets/index-
|
|
78
|
+
"file": "assets/index-D9IOUE5C.js",
|
|
88
79
|
"name": "index",
|
|
89
80
|
"src": "index.html",
|
|
90
81
|
"isEntry": true,
|
|
@@ -133,7 +124,7 @@
|
|
|
133
124
|
"src/lib/demo/install.ts"
|
|
134
125
|
],
|
|
135
126
|
"css": [
|
|
136
|
-
"assets/index-
|
|
127
|
+
"assets/index-KoYkT_4d.css"
|
|
137
128
|
],
|
|
138
129
|
"assets": [
|
|
139
130
|
"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",
|
|
@@ -159,7 +150,7 @@
|
|
|
159
150
|
"src": "node_modules/@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2"
|
|
160
151
|
},
|
|
161
152
|
"src/components/copilot/CopilotPanel.tsx": {
|
|
162
|
-
"file": "assets/CopilotPanel-
|
|
153
|
+
"file": "assets/CopilotPanel-PMVR2Cd3.js",
|
|
163
154
|
"name": "CopilotPanel",
|
|
164
155
|
"src": "src/components/copilot/CopilotPanel.tsx",
|
|
165
156
|
"isDynamicEntry": true,
|
|
@@ -177,7 +168,7 @@
|
|
|
177
168
|
"isDynamicEntry": true
|
|
178
169
|
},
|
|
179
170
|
"src/pages/Alerts.tsx": {
|
|
180
|
-
"file": "assets/Alerts-
|
|
171
|
+
"file": "assets/Alerts-DyA39_uq.js",
|
|
181
172
|
"name": "Alerts",
|
|
182
173
|
"src": "src/pages/Alerts.tsx",
|
|
183
174
|
"isDynamicEntry": true,
|
|
@@ -189,7 +180,7 @@
|
|
|
189
180
|
]
|
|
190
181
|
},
|
|
191
182
|
"src/pages/Cron.tsx": {
|
|
192
|
-
"file": "assets/Cron-
|
|
183
|
+
"file": "assets/Cron-C_gbmPNI.js",
|
|
193
184
|
"name": "Cron",
|
|
194
185
|
"src": "src/pages/Cron.tsx",
|
|
195
186
|
"isDynamicEntry": true,
|
|
@@ -197,11 +188,11 @@
|
|
|
197
188
|
"_cn-CMFYpumL.js",
|
|
198
189
|
"_react-vendor-B68RYDeC.js",
|
|
199
190
|
"index.html",
|
|
200
|
-
"_Pagination-
|
|
191
|
+
"_Pagination-vdXIy1LL.js"
|
|
201
192
|
]
|
|
202
193
|
},
|
|
203
194
|
"src/pages/Dlq.tsx": {
|
|
204
|
-
"file": "assets/Dlq-
|
|
195
|
+
"file": "assets/Dlq-Bz22b8rz.js",
|
|
205
196
|
"name": "Dlq",
|
|
206
197
|
"src": "src/pages/Dlq.tsx",
|
|
207
198
|
"isDynamicEntry": true,
|
|
@@ -210,11 +201,11 @@
|
|
|
210
201
|
"_react-vendor-B68RYDeC.js",
|
|
211
202
|
"index.html",
|
|
212
203
|
"_form-C-zZyKfB.js",
|
|
213
|
-
"_Pagination-
|
|
204
|
+
"_Pagination-vdXIy1LL.js"
|
|
214
205
|
]
|
|
215
206
|
},
|
|
216
207
|
"src/pages/Jobs.tsx": {
|
|
217
|
-
"file": "assets/Jobs-
|
|
208
|
+
"file": "assets/Jobs-DHJqAWws.js",
|
|
218
209
|
"name": "Jobs",
|
|
219
210
|
"src": "src/pages/Jobs.tsx",
|
|
220
211
|
"isDynamicEntry": true,
|
|
@@ -226,7 +217,7 @@
|
|
|
226
217
|
]
|
|
227
218
|
},
|
|
228
219
|
"src/pages/Logs.tsx": {
|
|
229
|
-
"file": "assets/Logs-
|
|
220
|
+
"file": "assets/Logs-DoaPBM7P.js",
|
|
230
221
|
"name": "Logs",
|
|
231
222
|
"src": "src/pages/Logs.tsx",
|
|
232
223
|
"isDynamicEntry": true,
|
|
@@ -235,11 +226,11 @@
|
|
|
235
226
|
"_react-vendor-B68RYDeC.js",
|
|
236
227
|
"index.html",
|
|
237
228
|
"_form-C-zZyKfB.js",
|
|
238
|
-
"_Pagination-
|
|
229
|
+
"_Pagination-vdXIy1LL.js"
|
|
239
230
|
]
|
|
240
231
|
},
|
|
241
232
|
"src/pages/Metrics.tsx": {
|
|
242
|
-
"file": "assets/Metrics-
|
|
233
|
+
"file": "assets/Metrics-qqHBt5Mq.js",
|
|
243
234
|
"name": "Metrics",
|
|
244
235
|
"src": "src/pages/Metrics.tsx",
|
|
245
236
|
"isDynamicEntry": true,
|
|
@@ -249,7 +240,7 @@
|
|
|
249
240
|
]
|
|
250
241
|
},
|
|
251
242
|
"src/pages/Overview.tsx": {
|
|
252
|
-
"file": "assets/Overview-
|
|
243
|
+
"file": "assets/Overview-DWCFawq-.js",
|
|
253
244
|
"name": "Overview",
|
|
254
245
|
"src": "src/pages/Overview.tsx",
|
|
255
246
|
"isDynamicEntry": true,
|
|
@@ -259,7 +250,7 @@
|
|
|
259
250
|
]
|
|
260
251
|
},
|
|
261
252
|
"src/pages/QueueDetail.tsx": {
|
|
262
|
-
"file": "assets/QueueDetail-
|
|
253
|
+
"file": "assets/QueueDetail-w7VUvfk9.js",
|
|
263
254
|
"name": "QueueDetail",
|
|
264
255
|
"src": "src/pages/QueueDetail.tsx",
|
|
265
256
|
"isDynamicEntry": true,
|
|
@@ -271,7 +262,7 @@
|
|
|
271
262
|
]
|
|
272
263
|
},
|
|
273
264
|
"src/pages/Queues.tsx": {
|
|
274
|
-
"file": "assets/Queues-
|
|
265
|
+
"file": "assets/Queues-Bie4azaQ.js",
|
|
275
266
|
"name": "Queues",
|
|
276
267
|
"src": "src/pages/Queues.tsx",
|
|
277
268
|
"isDynamicEntry": true,
|
|
@@ -279,11 +270,11 @@
|
|
|
279
270
|
"_cn-CMFYpumL.js",
|
|
280
271
|
"_react-vendor-B68RYDeC.js",
|
|
281
272
|
"index.html",
|
|
282
|
-
"_Pagination-
|
|
273
|
+
"_Pagination-vdXIy1LL.js"
|
|
283
274
|
]
|
|
284
275
|
},
|
|
285
276
|
"src/pages/S3Backup.tsx": {
|
|
286
|
-
"file": "assets/S3Backup-
|
|
277
|
+
"file": "assets/S3Backup-BFA23J_Y.js",
|
|
287
278
|
"name": "S3Backup",
|
|
288
279
|
"src": "src/pages/S3Backup.tsx",
|
|
289
280
|
"isDynamicEntry": true,
|
|
@@ -293,7 +284,7 @@
|
|
|
293
284
|
]
|
|
294
285
|
},
|
|
295
286
|
"src/pages/Settings.tsx": {
|
|
296
|
-
"file": "assets/Settings-
|
|
287
|
+
"file": "assets/Settings-BOTyxPXb.js",
|
|
297
288
|
"name": "Settings",
|
|
298
289
|
"src": "src/pages/Settings.tsx",
|
|
299
290
|
"isDynamicEntry": true,
|
|
@@ -306,7 +297,7 @@
|
|
|
306
297
|
]
|
|
307
298
|
},
|
|
308
299
|
"src/pages/Usage.tsx": {
|
|
309
|
-
"file": "assets/Usage-
|
|
300
|
+
"file": "assets/Usage-DP6SPxu5.js",
|
|
310
301
|
"name": "Usage",
|
|
311
302
|
"src": "src/pages/Usage.tsx",
|
|
312
303
|
"isDynamicEntry": true,
|
|
@@ -316,7 +307,7 @@
|
|
|
316
307
|
]
|
|
317
308
|
},
|
|
318
309
|
"src/pages/Workers.tsx": {
|
|
319
|
-
"file": "assets/Workers-
|
|
310
|
+
"file": "assets/Workers-C-5dO7Go.js",
|
|
320
311
|
"name": "Workers",
|
|
321
312
|
"src": "src/pages/Workers.tsx",
|
|
322
313
|
"isDynamicEntry": true,
|
|
@@ -324,11 +315,11 @@
|
|
|
324
315
|
"_cn-CMFYpumL.js",
|
|
325
316
|
"_react-vendor-B68RYDeC.js",
|
|
326
317
|
"index.html",
|
|
327
|
-
"_Pagination-
|
|
318
|
+
"_Pagination-vdXIy1LL.js"
|
|
328
319
|
]
|
|
329
320
|
},
|
|
330
321
|
"src/pages/control/AddJob.tsx": {
|
|
331
|
-
"file": "assets/AddJob-
|
|
322
|
+
"file": "assets/AddJob-kPPv3bPb.js",
|
|
332
323
|
"name": "AddJob",
|
|
333
324
|
"src": "src/pages/control/AddJob.tsx",
|
|
334
325
|
"isDynamicEntry": true,
|
|
@@ -340,7 +331,7 @@
|
|
|
340
331
|
]
|
|
341
332
|
},
|
|
342
333
|
"src/pages/control/Benchmark.tsx": {
|
|
343
|
-
"file": "assets/Benchmark-
|
|
334
|
+
"file": "assets/Benchmark-B3KDk7ue.js",
|
|
344
335
|
"name": "Benchmark",
|
|
345
336
|
"src": "src/pages/control/Benchmark.tsx",
|
|
346
337
|
"isDynamicEntry": true,
|
|
@@ -350,12 +341,11 @@
|
|
|
350
341
|
"_connectionStore-B-hNUqwK.js",
|
|
351
342
|
"index.html",
|
|
352
343
|
"_form-C-zZyKfB.js",
|
|
353
|
-
"_AreaChart-Dl_9G6GH.js"
|
|
354
|
-
"_CopyButton-B2gM7BeT.js"
|
|
344
|
+
"_AreaChart-Dl_9G6GH.js"
|
|
355
345
|
]
|
|
356
346
|
},
|
|
357
347
|
"src/pages/control/BulkAddJobs.tsx": {
|
|
358
|
-
"file": "assets/BulkAddJobs-
|
|
348
|
+
"file": "assets/BulkAddJobs-tL300nBi.js",
|
|
359
349
|
"name": "BulkAddJobs",
|
|
360
350
|
"src": "src/pages/control/BulkAddJobs.tsx",
|
|
361
351
|
"isDynamicEntry": true,
|
|
@@ -367,7 +357,7 @@
|
|
|
367
357
|
]
|
|
368
358
|
},
|
|
369
359
|
"src/pages/control/CronManager.tsx": {
|
|
370
|
-
"file": "assets/CronManager-
|
|
360
|
+
"file": "assets/CronManager-DC9YMFWw.js",
|
|
371
361
|
"name": "CronManager",
|
|
372
362
|
"src": "src/pages/control/CronManager.tsx",
|
|
373
363
|
"isDynamicEntry": true,
|
|
@@ -376,11 +366,11 @@
|
|
|
376
366
|
"_react-vendor-B68RYDeC.js",
|
|
377
367
|
"index.html",
|
|
378
368
|
"_form-C-zZyKfB.js",
|
|
379
|
-
"_Pagination-
|
|
369
|
+
"_Pagination-vdXIy1LL.js"
|
|
380
370
|
]
|
|
381
371
|
},
|
|
382
372
|
"src/pages/control/Database.tsx": {
|
|
383
|
-
"file": "assets/Database-
|
|
373
|
+
"file": "assets/Database-LKuDZO6v.js",
|
|
384
374
|
"name": "Database",
|
|
385
375
|
"src": "src/pages/control/Database.tsx",
|
|
386
376
|
"isDynamicEntry": true,
|
|
@@ -389,12 +379,11 @@
|
|
|
389
379
|
"_react-vendor-B68RYDeC.js",
|
|
390
380
|
"index.html",
|
|
391
381
|
"_form-C-zZyKfB.js",
|
|
392
|
-
"_Pagination-
|
|
393
|
-
"_CopyButton-B2gM7BeT.js"
|
|
382
|
+
"_Pagination-vdXIy1LL.js"
|
|
394
383
|
]
|
|
395
384
|
},
|
|
396
385
|
"src/pages/control/Diagnostics.tsx": {
|
|
397
|
-
"file": "assets/Diagnostics-
|
|
386
|
+
"file": "assets/Diagnostics-02P8kK0A.js",
|
|
398
387
|
"name": "Diagnostics",
|
|
399
388
|
"src": "src/pages/control/Diagnostics.tsx",
|
|
400
389
|
"isDynamicEntry": true,
|
|
@@ -405,7 +394,7 @@
|
|
|
405
394
|
]
|
|
406
395
|
},
|
|
407
396
|
"src/pages/control/DlqControl.tsx": {
|
|
408
|
-
"file": "assets/DlqControl-
|
|
397
|
+
"file": "assets/DlqControl-bZK1IQiC.js",
|
|
409
398
|
"name": "DlqControl",
|
|
410
399
|
"src": "src/pages/control/DlqControl.tsx",
|
|
411
400
|
"isDynamicEntry": true,
|
|
@@ -414,13 +403,12 @@
|
|
|
414
403
|
"_react-vendor-B68RYDeC.js",
|
|
415
404
|
"index.html",
|
|
416
405
|
"_form-C-zZyKfB.js",
|
|
417
|
-
"_Pagination-
|
|
418
|
-
"_CopyButton-B2gM7BeT.js",
|
|
406
|
+
"_Pagination-vdXIy1LL.js",
|
|
419
407
|
"_exportFile-tdUeW5m5.js"
|
|
420
408
|
]
|
|
421
409
|
},
|
|
422
410
|
"src/pages/control/DlqPro.tsx": {
|
|
423
|
-
"file": "assets/DlqPro-
|
|
411
|
+
"file": "assets/DlqPro-7QuH6aNZ.js",
|
|
424
412
|
"name": "DlqPro",
|
|
425
413
|
"src": "src/pages/control/DlqPro.tsx",
|
|
426
414
|
"isDynamicEntry": true,
|
|
@@ -429,13 +417,13 @@
|
|
|
429
417
|
"_react-vendor-B68RYDeC.js",
|
|
430
418
|
"index.html",
|
|
431
419
|
"_form-C-zZyKfB.js",
|
|
432
|
-
"_Pagination-
|
|
420
|
+
"_Pagination-vdXIy1LL.js",
|
|
433
421
|
"_exportFile-tdUeW5m5.js",
|
|
434
422
|
"_promisePool-Daxkc1OB.js"
|
|
435
423
|
]
|
|
436
424
|
},
|
|
437
425
|
"src/pages/control/Flows.tsx": {
|
|
438
|
-
"file": "assets/Flows-
|
|
426
|
+
"file": "assets/Flows-DpehOAzf.js",
|
|
439
427
|
"name": "Flows",
|
|
440
428
|
"src": "src/pages/control/Flows.tsx",
|
|
441
429
|
"isDynamicEntry": true,
|
|
@@ -446,7 +434,7 @@
|
|
|
446
434
|
]
|
|
447
435
|
},
|
|
448
436
|
"src/pages/control/JobInspector.tsx": {
|
|
449
|
-
"file": "assets/JobInspector-
|
|
437
|
+
"file": "assets/JobInspector-D9cxknvv.js",
|
|
450
438
|
"name": "JobInspector",
|
|
451
439
|
"src": "src/pages/control/JobInspector.tsx",
|
|
452
440
|
"isDynamicEntry": true,
|
|
@@ -455,13 +443,12 @@
|
|
|
455
443
|
"_react-vendor-B68RYDeC.js",
|
|
456
444
|
"index.html",
|
|
457
445
|
"_form-C-zZyKfB.js",
|
|
458
|
-
"_CopyButton-B2gM7BeT.js",
|
|
459
446
|
"_exportFile-tdUeW5m5.js",
|
|
460
447
|
"_jobActions-CuOdMglt.js"
|
|
461
448
|
]
|
|
462
449
|
},
|
|
463
450
|
"src/pages/control/JobsPro.tsx": {
|
|
464
|
-
"file": "assets/JobsPro-
|
|
451
|
+
"file": "assets/JobsPro-COyxqkNn.js",
|
|
465
452
|
"name": "JobsPro",
|
|
466
453
|
"src": "src/pages/control/JobsPro.tsx",
|
|
467
454
|
"isDynamicEntry": true,
|
|
@@ -470,13 +457,13 @@
|
|
|
470
457
|
"_react-vendor-B68RYDeC.js",
|
|
471
458
|
"index.html",
|
|
472
459
|
"_form-C-zZyKfB.js",
|
|
473
|
-
"_Pagination-
|
|
460
|
+
"_Pagination-vdXIy1LL.js",
|
|
474
461
|
"_exportFile-tdUeW5m5.js",
|
|
475
462
|
"_jobActions-CuOdMglt.js"
|
|
476
463
|
]
|
|
477
464
|
},
|
|
478
465
|
"src/pages/control/LogsPro.tsx": {
|
|
479
|
-
"file": "assets/LogsPro-
|
|
466
|
+
"file": "assets/LogsPro-CnAAAWPH.js",
|
|
480
467
|
"name": "LogsPro",
|
|
481
468
|
"src": "src/pages/control/LogsPro.tsx",
|
|
482
469
|
"isDynamicEntry": true,
|
|
@@ -485,23 +472,21 @@
|
|
|
485
472
|
"_react-vendor-B68RYDeC.js",
|
|
486
473
|
"index.html",
|
|
487
474
|
"_form-C-zZyKfB.js",
|
|
488
|
-
"_Pagination-
|
|
489
|
-
"_CopyButton-B2gM7BeT.js"
|
|
475
|
+
"_Pagination-vdXIy1LL.js"
|
|
490
476
|
]
|
|
491
477
|
},
|
|
492
478
|
"src/pages/control/McpServer.tsx": {
|
|
493
|
-
"file": "assets/McpServer-
|
|
479
|
+
"file": "assets/McpServer-XBSHRJpK.js",
|
|
494
480
|
"name": "McpServer",
|
|
495
481
|
"src": "src/pages/control/McpServer.tsx",
|
|
496
482
|
"isDynamicEntry": true,
|
|
497
483
|
"imports": [
|
|
498
484
|
"_react-vendor-B68RYDeC.js",
|
|
499
|
-
"index.html"
|
|
500
|
-
"_CopyButton-B2gM7BeT.js"
|
|
485
|
+
"index.html"
|
|
501
486
|
]
|
|
502
487
|
},
|
|
503
488
|
"src/pages/control/MetricsPro.tsx": {
|
|
504
|
-
"file": "assets/MetricsPro-
|
|
489
|
+
"file": "assets/MetricsPro-1p0Rpacn.js",
|
|
505
490
|
"name": "MetricsPro",
|
|
506
491
|
"src": "src/pages/control/MetricsPro.tsx",
|
|
507
492
|
"isDynamicEntry": true,
|
|
@@ -509,13 +494,13 @@
|
|
|
509
494
|
"_cn-CMFYpumL.js",
|
|
510
495
|
"_react-vendor-B68RYDeC.js",
|
|
511
496
|
"index.html",
|
|
512
|
-
"_Pagination-
|
|
497
|
+
"_Pagination-vdXIy1LL.js",
|
|
513
498
|
"_AreaChart-Dl_9G6GH.js",
|
|
514
|
-
"_useThroughputSeries-
|
|
499
|
+
"_useThroughputSeries-D-_zB_EP.js"
|
|
515
500
|
]
|
|
516
501
|
},
|
|
517
502
|
"src/pages/control/QueueControl.tsx": {
|
|
518
|
-
"file": "assets/QueueControl-
|
|
503
|
+
"file": "assets/QueueControl-BNW57gvM.js",
|
|
519
504
|
"name": "QueueControl",
|
|
520
505
|
"src": "src/pages/control/QueueControl.tsx",
|
|
521
506
|
"isDynamicEntry": true,
|
|
@@ -524,11 +509,11 @@
|
|
|
524
509
|
"_react-vendor-B68RYDeC.js",
|
|
525
510
|
"index.html",
|
|
526
511
|
"_form-C-zZyKfB.js",
|
|
527
|
-
"_QueueActions-
|
|
512
|
+
"_QueueActions-CzenZmRB.js"
|
|
528
513
|
]
|
|
529
514
|
},
|
|
530
515
|
"src/pages/control/QueueDetailPro.tsx": {
|
|
531
|
-
"file": "assets/QueueDetailPro-
|
|
516
|
+
"file": "assets/QueueDetailPro-C6Ztytkp.js",
|
|
532
517
|
"name": "QueueDetailPro",
|
|
533
518
|
"src": "src/pages/control/QueueDetailPro.tsx",
|
|
534
519
|
"isDynamicEntry": true,
|
|
@@ -537,12 +522,12 @@
|
|
|
537
522
|
"_react-vendor-B68RYDeC.js",
|
|
538
523
|
"index.html",
|
|
539
524
|
"_AreaChart-Dl_9G6GH.js",
|
|
540
|
-
"_useThroughputSeries-
|
|
541
|
-
"_QueueActions-
|
|
525
|
+
"_useThroughputSeries-D-_zB_EP.js",
|
|
526
|
+
"_QueueActions-CzenZmRB.js"
|
|
542
527
|
]
|
|
543
528
|
},
|
|
544
529
|
"src/pages/control/QueuesOverview.tsx": {
|
|
545
|
-
"file": "assets/QueuesOverview-
|
|
530
|
+
"file": "assets/QueuesOverview-BUTDdZ1o.js",
|
|
546
531
|
"name": "QueuesOverview",
|
|
547
532
|
"src": "src/pages/control/QueuesOverview.tsx",
|
|
548
533
|
"isDynamicEntry": true,
|
|
@@ -550,12 +535,12 @@
|
|
|
550
535
|
"_cn-CMFYpumL.js",
|
|
551
536
|
"_react-vendor-B68RYDeC.js",
|
|
552
537
|
"index.html",
|
|
553
|
-
"_Pagination-
|
|
538
|
+
"_Pagination-vdXIy1LL.js",
|
|
554
539
|
"_promisePool-Daxkc1OB.js"
|
|
555
540
|
]
|
|
556
541
|
},
|
|
557
542
|
"src/pages/control/S3BackupPro.tsx": {
|
|
558
|
-
"file": "assets/S3BackupPro-
|
|
543
|
+
"file": "assets/S3BackupPro-I_YK8ufb.js",
|
|
559
544
|
"name": "S3BackupPro",
|
|
560
545
|
"src": "src/pages/control/S3BackupPro.tsx",
|
|
561
546
|
"isDynamicEntry": true,
|
|
@@ -568,7 +553,7 @@
|
|
|
568
553
|
]
|
|
569
554
|
},
|
|
570
555
|
"src/pages/control/ServerControl.tsx": {
|
|
571
|
-
"file": "assets/ServerControl-
|
|
556
|
+
"file": "assets/ServerControl-CuAmFqD3.js",
|
|
572
557
|
"name": "ServerControl",
|
|
573
558
|
"src": "src/pages/control/ServerControl.tsx",
|
|
574
559
|
"isDynamicEntry": true,
|
|
@@ -576,12 +561,11 @@
|
|
|
576
561
|
"_cn-CMFYpumL.js",
|
|
577
562
|
"_react-vendor-B68RYDeC.js",
|
|
578
563
|
"index.html",
|
|
579
|
-
"_form-C-zZyKfB.js"
|
|
580
|
-
"_CopyButton-B2gM7BeT.js"
|
|
564
|
+
"_form-C-zZyKfB.js"
|
|
581
565
|
]
|
|
582
566
|
},
|
|
583
567
|
"src/pages/control/UsagePro.tsx": {
|
|
584
|
-
"file": "assets/UsagePro-
|
|
568
|
+
"file": "assets/UsagePro-DteL5Ez5.js",
|
|
585
569
|
"name": "UsagePro",
|
|
586
570
|
"src": "src/pages/control/UsagePro.tsx",
|
|
587
571
|
"isDynamicEntry": true,
|
|
@@ -591,7 +575,7 @@
|
|
|
591
575
|
]
|
|
592
576
|
},
|
|
593
577
|
"src/pages/control/Webhooks.tsx": {
|
|
594
|
-
"file": "assets/Webhooks-
|
|
578
|
+
"file": "assets/Webhooks-LwgtwNkr.js",
|
|
595
579
|
"name": "Webhooks",
|
|
596
580
|
"src": "src/pages/control/Webhooks.tsx",
|
|
597
581
|
"isDynamicEntry": true,
|
|
@@ -600,11 +584,11 @@
|
|
|
600
584
|
"_react-vendor-B68RYDeC.js",
|
|
601
585
|
"index.html",
|
|
602
586
|
"_form-C-zZyKfB.js",
|
|
603
|
-
"_Pagination-
|
|
587
|
+
"_Pagination-vdXIy1LL.js"
|
|
604
588
|
]
|
|
605
589
|
},
|
|
606
590
|
"src/pages/control/WorkersPro.tsx": {
|
|
607
|
-
"file": "assets/WorkersPro-
|
|
591
|
+
"file": "assets/WorkersPro-DFhuR9f0.js",
|
|
608
592
|
"name": "WorkersPro",
|
|
609
593
|
"src": "src/pages/control/WorkersPro.tsx",
|
|
610
594
|
"isDynamicEntry": true,
|
|
@@ -1,3 +1,3 @@
|
|
|
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{
|
|
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{A as a,C as o,S as s,h as c,nt as l,rt as u,w as d}from"./index-D9IOUE5C.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}=a(()=>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
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)(
|
|
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)(c,{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)(s,{children:[(0,g.jsx)(o,{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)(s,{children:[(0,g.jsx)(o,{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)(d,{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 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{$ as r,
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-B68RYDeC.js";import{$ as r,N as i,Q as a,S as o,T as s,Y as c,at as l,h as u,it as d,u as f,v as p,w as m}from"./index-D9IOUE5C.js";import{a as h,n as g,o as _,t as v}from"./form-C-zZyKfB.js";var y=e(t(),1),b=n(),x=[`email`,`webhook`,`slack`],S=Object.keys(d),C=[`>=`,`>`,`<=`,`<`],w={error_rate:{unit:`% (0–100)`,placeholder:`e.g. 5`},p99_latency:{unit:`ms`,placeholder:`e.g. 250`},waiting:{unit:`jobs`,placeholder:`e.g. 100`},failed:{unit:`jobs`,placeholder:`e.g. 10`},dlq:{unit:`jobs`,placeholder:`e.g. 1`}},T=`bunqueue OSS has no delivery backend — alerts fire as in-app toast + desktop notification only`;function E(){return typeof Notification>`u`?`unsupported`:Notification.permission}function D(){let{channels:e,rules:t,addChannel:n,removeChannel:h,addRule:g,removeRule:v,toggleRule:x}=l(),S=r(e=>e.breaching),[C,w]=(0,y.useState)(!1),[D,A]=(0,y.useState)(E);return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(u,{title:`Alerts`,description:`Threshold rules evaluated live in your browser.`,live:!0,actions:(0,b.jsxs)(b.Fragment,{children:[D===`granted`?(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm text-success`,children:[(0,b.jsx)(i,{className:`size-4`}),` Desktop alerts on`]}):D===`unsupported`?(0,b.jsx)(`span`,{className:`text-sm text-faint`,children:`Notifications unsupported`}):D===`denied`?(0,b.jsx)(`span`,{className:`text-sm text-faint`,children:`Desktop alerts blocked — allow notifications in browser settings`}):(0,b.jsx)(m,{size:`sm`,onClick:async()=>{A(await a())},children:`Enable desktop notifications`}),(0,b.jsx)(m,{variant:`accent`,size:`sm`,onClick:()=>w(e=>!e),children:`+ Create Alert Rule`})]})}),(0,b.jsx)(`div`,{className:`mb-6 rounded-lg border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-amber-400/90`,children:`Rules are evaluated in this browser while a tab is open (even backgrounded), raising an in-app toast and — if enabled — a desktop notification. bunqueue OSS has no alerting backend, so email/webhook/slack delivery still needs your own monitoring or hosted bunqueue Cloud.`}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Triggered Alerts`}),S.length===0?(0,b.jsx)(p,{icon:(0,b.jsx)(i,{}),title:`No triggered alerts`,hint:t.some(e=>e.enabled)?`All enabled rules are within their thresholds.`:`No enabled rules yet. Create one below.`}):(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-danger/30 bg-red-500/5`,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:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(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:`Current`}),(0,b.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Since`})]})}),(0,b.jsx)(`tbody`,{children:S.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-danger`,children:e.ruleName}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[e.metricLabel,` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-fg`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right tnum font-semibold text-danger`,children:Math.round(e.value*100)/100}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:f(e.at)})]},e.ruleId))})]})})]}),(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Notification Channels`}),(0,b.jsxs)(o,{children:[e.length===0?(0,b.jsx)(`p`,{className:`mb-4 text-sm text-faint`,children:`No channels yet. Add one below.`}):(0,b.jsx)(`ul`,{className:`mb-4 divide-y divide-line`,children:e.map(e=>(0,b.jsxs)(`li`,{className:`flex items-center justify-between py-2.5`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`text-sm font-medium capitalize text-fg`,children:e.type}),e.target?(0,b.jsx)(`div`,{className:`font-mono text-xs text-faint`,children:e.target}):(0,b.jsx)(`div`,{className:`text-xs italic text-warning`,children:`target not persisted (secret) — remove and re-add to restore it`})]}),(0,b.jsx)(s,{"aria-label":`Remove channel`,onClick:()=>h(e.id),children:(0,b.jsx)(c,{className:`size-3.5`})})]},e.id))}),(0,b.jsx)(O,{onAdd:n})]})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsx)(`h2`,{className:`mb-3 text-lg font-semibold text-fg`,children:`Alert Rules`}),C&&(0,b.jsx)(o,{className:`mb-4`,children:(0,b.jsx)(k,{onAdd:e=>{g(e),w(!1)}})}),t.length===0?(0,b.jsx)(p,{title:`No alert rules`,hint:`Create a rule to be notified when a threshold is crossed.`}):(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:`Rule`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Condition`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Channel`}),(0,b.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,b.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,b.jsx)(`tbody`,{children:t.map(e=>(0,b.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,b.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,b.jsxs)(`td`,{className:`px-5 py-3 text-muted`,children:[d[e.metric],` `,e.operator,` `,(0,b.jsx)(`span`,{className:`font-semibold text-accent`,children:e.threshold})]}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-muted`,children:e.queue||`All queues`}),(0,b.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,b.jsx)(`span`,{className:`rounded-md bg-surface-2 px-2 py-0.5 text-xs capitalize text-muted`,children:e.channel}),(0,b.jsx)(`span`,{className:`ml-1.5 text-[10px] uppercase tracking-wider text-faint`,title:T,children:`not wired`})]}),(0,b.jsx)(`td`,{className:`px-5 py-3`,children:(0,b.jsx)(_,{checked:e.enabled,onChange:()=>x(e.id),label:`Enabled`})}),(0,b.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,b.jsx)(s,{"aria-label":`Delete rule`,onClick:()=>v(e.id),children:(0,b.jsx)(c,{className:`size-3.5`})})})]},e.id))})]})})]})]})}function O({onAdd:e}){let[t,n]=(0,y.useState)(`email`),[r,i]=(0,y.useState)(``);return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,b.jsx)(`div`,{className:`w-36`,children:(0,b.jsx)(v,{label:`Type`,children:(0,b.jsx)(h,{value:t,onChange:e=>n(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})})}),(0,b.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,b.jsx)(v,{label:t===`email`?`Email address`:`URL`,children:(0,b.jsx)(g,{value:r,onChange:e=>i(e.target.value),placeholder:t===`email`?`ops@example.com`:`https://hooks…`})})}),(0,b.jsx)(m,{variant:`accent`,disabled:!r,onClick:()=>{e(t,r),i(``)},children:`Add channel`})]})}function k({onAdd:e}){let[t,n]=(0,y.useState)(``),[r,i]=(0,y.useState)(`error_rate`),[a,o]=(0,y.useState)(`>=`),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(``),[f,p]=(0,y.useState)(`email`);return(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-6`,children:[(0,b.jsx)(v,{label:`Name`,children:(0,b.jsx)(g,{value:t,onChange:e=>n(e.target.value),placeholder:`High error rate`})}),(0,b.jsx)(v,{label:`Metric`,children:(0,b.jsx)(h,{value:r,onChange:e=>i(e.target.value),children:S.map(e=>(0,b.jsx)(`option`,{value:e,children:d[e]},e))})}),(0,b.jsx)(v,{label:`Operator`,children:(0,b.jsx)(h,{value:a,onChange:e=>o(e.target.value),children:C.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(v,{label:`Threshold`,hint:w[r].unit,children:(0,b.jsx)(g,{type:`number`,value:s,onChange:e=>c(e.target.value),placeholder:w[r].placeholder})}),(0,b.jsx)(v,{label:`Queue (optional)`,hint:r===`p99_latency`?`global only — latency is not per queue`:void 0,children:(0,b.jsx)(g,{value:l,onChange:e=>u(e.target.value),disabled:r===`p99_latency`,placeholder:r===`p99_latency`?`Global`:`All queues`,className:`disabled:cursor-not-allowed disabled:opacity-40`})}),(0,b.jsx)(v,{label:`Channel`,hint:`delivery not wired — in-app only`,children:(0,b.jsx)(h,{value:f,onChange:e=>p(e.target.value),children:x.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(`div`,{className:`col-span-full`,children:(0,b.jsx)(m,{variant:`accent`,disabled:!t||!s,onClick:()=>e({name:t,metric:r,operator:a,threshold:Number(s),queue:r===`p99_latency`?``:l,channel:f,enabled:!0}),children:`Save rule`})})]})}export{D as Alerts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{h as n,t as r}from"./react-vendor-B68RYDeC.js";import{r as i}from"./connectionStore-B-hNUqwK.js";import{A as a,C as o,O as s,S as c,U as l,W as u,c as d,h as f,m as p,nt as m,r as h,s as g,w as _}from"./index-D9IOUE5C.js";import{i as v,n as y,o as b,t as x}from"./form-C-zZyKfB.js";import{t as S}from"./AreaChart-Dl_9G6GH.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)(c,{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)(_,{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)(_,{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:d(e.pushed)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:d(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:g(e.p95)}),(0,P.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:g(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),p=(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=p.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 m.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,p.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 m.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 m.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=M(e)}if(t.length>0){b>0&&await j(b,()=>!u.current);try{await m.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}=a(()=>m.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 ${d(q.waiting??0)} waiting / ${d(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 m.clean(t,{state:n,limit:w.total})}catch(t){e=t.message}let n=await m.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 ${g(O.etaMs)}`:`finishing…`:s===`stopped`?`stopped early`:s===`done`?`complete`:``;return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(f,{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)(_,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stopping…`]}):j?(0,P.jsxs)(_,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,P.jsx)(l,{className:`size-3.5`}),` Stop`]}):(0,P.jsxs)(_,{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)(u,{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)(c,{className:`lg:col-span-1`,children:[(0,P.jsx)(o,{title:`Configuration`}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,P.jsx)(x,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,P.jsx)(y,{value:e.queue,disabled:j,onChange:e=>M(`queue`,e.target.value)})}),(0,P.jsx)(x,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,P.jsx)(v,{options:B,value:e.mode,onChange:e=>M(`mode`,e),disabled:j})}),e.mode===`count`?(0,P.jsx)(x,{label:`Total jobs`,hint:`max ${d(w.total)}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.total,value:e.total,disabled:j,onChange:I(`total`)})}):(0,P.jsx)(x,{label:`Duration (s)`,hint:`max ${w.durationS}s`,children:(0,P.jsx)(y,{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)(x,{label:`Producers`,hint:`parallel, max ${w.producers}`,children:(0,P.jsx)(y,{type:`number`,min:e.mode===`duration`?0:1,max:w.producers,value:e.producers,disabled:j,onChange:I(`producers`)})}),(0,P.jsx)(x,{label:`Push batch`,hint:`jobs/req, max ${w.batch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.batch,value:e.batch,disabled:j,onChange:I(`batch`)})}),(0,P.jsx)(x,{label:`Payload`,hint:`bytes/job, max ${d(w.payload)}`,children:(0,P.jsx)(y,{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)(x,{label:`Workers`,hint:`0 = produce only, max ${w.workers}`,children:(0,P.jsx)(y,{type:`number`,min:0,max:w.workers,value:e.workers,disabled:j,onChange:I(`workers`)})}),(0,P.jsx)(x,{label:`Pull batch`,hint:`jobs/pull, max ${w.workerBatch}`,children:(0,P.jsx)(y,{type:`number`,min:1,max:w.workerBatch,value:e.workerBatch,disabled:j,onChange:I(`workerBatch`)})}),(0,P.jsx)(x,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,P.jsx)(y,{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)(b,{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)(b,{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)(_,{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 — ${d(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)(c,{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)(p,{label:`Pushed`,value:d(O.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(O.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Push/sec`,value:N(O.pushPerSec),compact:!0}),(0,P.jsx)(p,{label:`Done/sec`,value:N(O.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Elapsed`,value:g(O.elapsedMs),compact:!0}),(0,P.jsx)(p,{label:`Active workers`,value:`${O.activeWorkers}/${re}`,tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Data`,value:h(k?.bytes??O.bytes),compact:!0}),(0,P.jsx)(p,{label:`Errors`,value:d((k?.pushFailed??O.pushFailed)+(k?.ackFailed??O.ackFailed)),tone:O.pushFailed+O.ackFailed?`red`:`default`,compact:!0})]})]}),(0,P.jsxs)(c,{children:[(0,P.jsx)(o,{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)(S,{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)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{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)(p,{label:`Pushed`,value:d(k.pushed),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(k.completed),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Duration`,value:g(k.durationMs),compact:!0}),(0,P.jsx)(p,{label:`Avg push/s`,value:N(k.pushPerSec),tone:`accent`,compact:!0}),(0,P.jsx)(p,{label:`Avg done/s`,value:N(k.donePerSec),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Data rate`,value:`${h(k.mbPerSec)}/s`,compact:!0}),(0,P.jsx)(p,{label:`Push p95`,value:g(k.p95),compact:!0}),(0,P.jsx)(p,{label:`Push p99`,value:g(k.p99),compact:!0})]}),(0,P.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,g(k.avg),` · p50 `,g(k.p50),` · p95`,` `,g(k.p95),` · p99 `,g(k.p99),` · max `,g(k.max),`.`,k.error?` First error: ${k.error}`:``]})]}),(0,P.jsxs)(c,{className:`mt-6`,children:[(0,P.jsx)(o,{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)(p,{label:`Waiting`,value:d(q.waiting??0),tone:`amber`,compact:!0}),(0,P.jsx)(p,{label:`Active`,value:d(q.active??0),tone:`blue`,compact:!0}),(0,P.jsx)(p,{label:`Completed`,value:d(q.completed??0),tone:`green`,compact:!0}),(0,P.jsx)(p,{label:`Failed`,value:d(q.failed??0),tone:q.failed?`red`:`default`,compact:!0}),(0,P.jsx)(p,{label:`Delayed`,value:d(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};
|