bunqueue-dashboard 0.0.31 → 0.0.32
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/agent/db.ts +163 -22
- package/agent/dbQueryWorker.ts +14 -6
- package/agent/index.ts +4 -1
- package/agent/manager.ts +97 -12
- package/agent/server.ts +7 -1
- package/dist/.vite/manifest.json +76 -75
- package/dist/assets/AddJob-Dvpp--yq.js +3 -0
- package/dist/assets/{Alerts-70bxf-PT.js → Alerts-CR9jgCCs.js} +1 -1
- package/dist/assets/Benchmark-CkL-Ee-M.js +1 -0
- package/dist/assets/BulkAddJobs-wI6cRZnX.js +5 -0
- package/dist/assets/{CopilotPanel-DZUGIf1q.js → CopilotPanel-DPZV9opm.js} +3 -3
- package/dist/assets/{Cron-ltjSoTjj.js → Cron-gWVkYWad.js} +1 -1
- package/dist/assets/CronManager-BvfW219u.js +1 -0
- package/dist/assets/Database-D2T_ZIGA.js +3 -0
- package/dist/assets/Diagnostics-C2goqq5h.js +1 -0
- package/dist/assets/{Dlq-fZAKwQoC.js → Dlq-Q4TmmZrK.js} +1 -1
- package/dist/assets/{DlqControl-eTrrQCrn.js → DlqControl-C5BfE7Gq.js} +1 -1
- package/dist/assets/{DlqPro-CF79339e.js → DlqPro-ClPNmw-X.js} +1 -1
- package/dist/assets/Flows-DbhMbvSG.js +1 -0
- package/dist/assets/JobInspector-CO_zKjSX.js +2 -0
- package/dist/assets/{Jobs-DEqAc1A5.js → Jobs-D2rDHPM_.js} +1 -1
- package/dist/assets/JobsPro-Drdgdj3s.js +1 -0
- package/dist/assets/{Logs-DBTukPIX.js → Logs-DjwGuRLi.js} +1 -1
- package/dist/assets/{LogsPro-Wl_e6hZM.js → LogsPro-7uTBjPWX.js} +1 -1
- package/dist/assets/{McpServer-CnWJsKw7.js → McpServer-DAklQDB5.js} +1 -1
- package/dist/assets/{Metrics-DzeIhNL-.js → Metrics-Dup9Zinh.js} +1 -1
- package/dist/assets/{MetricsPro-O9eVJSH0.js → MetricsPro-PP3TymeP.js} +1 -1
- package/dist/assets/{Overview-Bnu7rWqt.js → Overview-C7RCDE6r.js} +1 -1
- package/dist/assets/{Pagination-D4ki-pGz.js → Pagination-B9JDi5MI.js} +1 -1
- package/dist/assets/QueueActions-DJTw0h2g.js +1 -0
- package/dist/assets/{QueueControl-DKqEXnkM.js → QueueControl-CxKjUjF-.js} +1 -1
- package/dist/assets/{QueueDetail-DLRow04B.js → QueueDetail-bf2n-r2h.js} +1 -1
- package/dist/assets/{QueueDetailPro-BYmOVd4T.js → QueueDetailPro-C-XLWFBa.js} +1 -1
- package/dist/assets/{Queues-CoyjRFN7.js → Queues-CMQW89J9.js} +1 -1
- package/dist/assets/{QueuesOverview-BeWdJpKi.js → QueuesOverview-x7-akDzf.js} +1 -1
- package/dist/assets/{S3Backup-BaLFgl9d.js → S3Backup-1jAySC9R.js} +1 -1
- package/dist/assets/{S3BackupPro-DJB4oWgz.js → S3BackupPro-BG_0OHW7.js} +1 -1
- package/dist/assets/{ServerControl-_0lVB33E.js → ServerControl-DohTB--h.js} +3 -3
- package/dist/assets/{Settings-zKFJTtnq.js → Settings-CnS5PjNe.js} +1 -1
- package/dist/assets/{Usage-CKGkvl0j.js → Usage-C3H0hMSA.js} +1 -1
- package/dist/assets/{UsagePro-B-TJ6fp4.js → UsagePro-CdnQkP9o.js} +1 -1
- package/dist/assets/Webhooks-CAwVmIEZ.js +1 -0
- package/dist/assets/{Workers-jKhhXl3W.js → Workers-lvujKZwF.js} +1 -1
- package/dist/assets/{WorkersPro-mvY5VX8I.js → WorkersPro-CIJKl7U1.js} +1 -1
- package/dist/assets/{connectionStore-Ci04lJmR.js → connectionStore-DO6xQY7h.js} +1 -1
- package/dist/assets/{exportFile-tdUeW5m5.js → exportFile-C7xhE8Yh.js} +1 -1
- package/dist/assets/{index-DWV3tgrk.css → index-DcVOpnSj.css} +1 -1
- package/dist/assets/index-r1ZMLIZ9.js +8 -0
- package/dist/assets/{install-DhTYJCUC.js → install-BIVfix28.js} +1 -1
- package/dist/assets/useThroughputSeries-CVKzWzdv.js +1 -0
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/scripts/embedded.gen.ts +112 -112
- package/scripts/serve.ts +299 -98
- package/dist/assets/AddJob-CAhdg38n.js +0 -3
- package/dist/assets/Benchmark-CFZ3WCvj.js +0 -1
- package/dist/assets/BulkAddJobs-BzgzpGg_.js +0 -5
- package/dist/assets/CronManager-BcFALDeT.js +0 -1
- package/dist/assets/Database-CV2yt5O2.js +0 -3
- package/dist/assets/Diagnostics-D-EK4GEi.js +0 -1
- package/dist/assets/Flows-Ba8G7mcC.js +0 -1
- package/dist/assets/JobInspector--d_8ca9p.js +0 -2
- package/dist/assets/JobsPro-BcaokZIf.js +0 -1
- package/dist/assets/QueueActions-DHoSkWRz.js +0 -1
- package/dist/assets/Webhooks-C3zmvY-_.js +0 -1
- package/dist/assets/index-BOcegTHa.js +0 -8
- package/dist/assets/useThroughputSeries-Chp5OLx3.js +0 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"_react-vendor-BcouBxpZ.js"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"_Pagination-
|
|
11
|
-
"file": "assets/Pagination-
|
|
10
|
+
"_Pagination-B9JDi5MI.js": {
|
|
11
|
+
"file": "assets/Pagination-B9JDi5MI.js",
|
|
12
12
|
"name": "Pagination",
|
|
13
13
|
"imports": [
|
|
14
14
|
"_cn-CMFYpumL.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"index.html"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"_QueueActions-
|
|
20
|
-
"file": "assets/QueueActions-
|
|
19
|
+
"_QueueActions-DJTw0h2g.js": {
|
|
20
|
+
"file": "assets/QueueActions-DJTw0h2g.js",
|
|
21
21
|
"name": "QueueActions",
|
|
22
22
|
"imports": [
|
|
23
23
|
"_cn-CMFYpumL.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"file": "assets/cn-CMFYpumL.js",
|
|
31
31
|
"name": "cn"
|
|
32
32
|
},
|
|
33
|
-
"_connectionStore-
|
|
34
|
-
"file": "assets/connectionStore-
|
|
33
|
+
"_connectionStore-DO6xQY7h.js": {
|
|
34
|
+
"file": "assets/connectionStore-DO6xQY7h.js",
|
|
35
35
|
"name": "connectionStore",
|
|
36
36
|
"imports": [
|
|
37
37
|
"_cn-CMFYpumL.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"file": "assets/dist-DZL8soAh.js",
|
|
43
43
|
"name": "dist"
|
|
44
44
|
},
|
|
45
|
-
"_exportFile-
|
|
46
|
-
"file": "assets/exportFile-
|
|
45
|
+
"_exportFile-C7xhE8Yh.js": {
|
|
46
|
+
"file": "assets/exportFile-C7xhE8Yh.js",
|
|
47
47
|
"name": "exportFile"
|
|
48
48
|
},
|
|
49
49
|
"_form-DGinTEEb.js": {
|
|
@@ -69,24 +69,25 @@
|
|
|
69
69
|
"_cn-CMFYpumL.js"
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
|
-
"_useThroughputSeries-
|
|
73
|
-
"file": "assets/useThroughputSeries-
|
|
72
|
+
"_useThroughputSeries-CVKzWzdv.js": {
|
|
73
|
+
"file": "assets/useThroughputSeries-CVKzWzdv.js",
|
|
74
74
|
"name": "useThroughputSeries",
|
|
75
75
|
"imports": [
|
|
76
76
|
"_cn-CMFYpumL.js",
|
|
77
77
|
"_react-vendor-BcouBxpZ.js",
|
|
78
|
+
"_connectionStore-DO6xQY7h.js",
|
|
78
79
|
"index.html"
|
|
79
80
|
]
|
|
80
81
|
},
|
|
81
82
|
"index.html": {
|
|
82
|
-
"file": "assets/index-
|
|
83
|
+
"file": "assets/index-r1ZMLIZ9.js",
|
|
83
84
|
"name": "index",
|
|
84
85
|
"src": "index.html",
|
|
85
86
|
"isEntry": true,
|
|
86
87
|
"imports": [
|
|
87
88
|
"_cn-CMFYpumL.js",
|
|
88
89
|
"_react-vendor-BcouBxpZ.js",
|
|
89
|
-
"_connectionStore-
|
|
90
|
+
"_connectionStore-DO6xQY7h.js"
|
|
90
91
|
],
|
|
91
92
|
"dynamicImports": [
|
|
92
93
|
"src/components/copilot/CopilotPanel.tsx",
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
"src/lib/demo/install.ts"
|
|
129
130
|
],
|
|
130
131
|
"css": [
|
|
131
|
-
"assets/index-
|
|
132
|
+
"assets/index-DcVOpnSj.css"
|
|
132
133
|
],
|
|
133
134
|
"assets": [
|
|
134
135
|
"assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2",
|
|
@@ -190,7 +191,7 @@
|
|
|
190
191
|
"src": "node_modules/@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2"
|
|
191
192
|
},
|
|
192
193
|
"src/components/copilot/CopilotPanel.tsx": {
|
|
193
|
-
"file": "assets/CopilotPanel-
|
|
194
|
+
"file": "assets/CopilotPanel-DPZV9opm.js",
|
|
194
195
|
"name": "CopilotPanel",
|
|
195
196
|
"src": "src/components/copilot/CopilotPanel.tsx",
|
|
196
197
|
"isDynamicEntry": true,
|
|
@@ -209,13 +210,13 @@
|
|
|
209
210
|
]
|
|
210
211
|
},
|
|
211
212
|
"src/lib/demo/install.ts": {
|
|
212
|
-
"file": "assets/install-
|
|
213
|
+
"file": "assets/install-BIVfix28.js",
|
|
213
214
|
"name": "install",
|
|
214
215
|
"src": "src/lib/demo/install.ts",
|
|
215
216
|
"isDynamicEntry": true
|
|
216
217
|
},
|
|
217
218
|
"src/pages/Alerts.tsx": {
|
|
218
|
-
"file": "assets/Alerts-
|
|
219
|
+
"file": "assets/Alerts-CR9jgCCs.js",
|
|
219
220
|
"name": "Alerts",
|
|
220
221
|
"src": "src/pages/Alerts.tsx",
|
|
221
222
|
"isDynamicEntry": true,
|
|
@@ -227,7 +228,7 @@
|
|
|
227
228
|
]
|
|
228
229
|
},
|
|
229
230
|
"src/pages/Cron.tsx": {
|
|
230
|
-
"file": "assets/Cron-
|
|
231
|
+
"file": "assets/Cron-gWVkYWad.js",
|
|
231
232
|
"name": "Cron",
|
|
232
233
|
"src": "src/pages/Cron.tsx",
|
|
233
234
|
"isDynamicEntry": true,
|
|
@@ -235,11 +236,11 @@
|
|
|
235
236
|
"_cn-CMFYpumL.js",
|
|
236
237
|
"_react-vendor-BcouBxpZ.js",
|
|
237
238
|
"index.html",
|
|
238
|
-
"_Pagination-
|
|
239
|
+
"_Pagination-B9JDi5MI.js"
|
|
239
240
|
]
|
|
240
241
|
},
|
|
241
242
|
"src/pages/Dlq.tsx": {
|
|
242
|
-
"file": "assets/Dlq-
|
|
243
|
+
"file": "assets/Dlq-Q4TmmZrK.js",
|
|
243
244
|
"name": "Dlq",
|
|
244
245
|
"src": "src/pages/Dlq.tsx",
|
|
245
246
|
"isDynamicEntry": true,
|
|
@@ -248,11 +249,11 @@
|
|
|
248
249
|
"_react-vendor-BcouBxpZ.js",
|
|
249
250
|
"index.html",
|
|
250
251
|
"_form-DGinTEEb.js",
|
|
251
|
-
"_Pagination-
|
|
252
|
+
"_Pagination-B9JDi5MI.js"
|
|
252
253
|
]
|
|
253
254
|
},
|
|
254
255
|
"src/pages/Jobs.tsx": {
|
|
255
|
-
"file": "assets/Jobs-
|
|
256
|
+
"file": "assets/Jobs-D2rDHPM_.js",
|
|
256
257
|
"name": "Jobs",
|
|
257
258
|
"src": "src/pages/Jobs.tsx",
|
|
258
259
|
"isDynamicEntry": true,
|
|
@@ -265,7 +266,7 @@
|
|
|
265
266
|
]
|
|
266
267
|
},
|
|
267
268
|
"src/pages/Logs.tsx": {
|
|
268
|
-
"file": "assets/Logs-
|
|
269
|
+
"file": "assets/Logs-DjwGuRLi.js",
|
|
269
270
|
"name": "Logs",
|
|
270
271
|
"src": "src/pages/Logs.tsx",
|
|
271
272
|
"isDynamicEntry": true,
|
|
@@ -274,11 +275,11 @@
|
|
|
274
275
|
"_react-vendor-BcouBxpZ.js",
|
|
275
276
|
"index.html",
|
|
276
277
|
"_form-DGinTEEb.js",
|
|
277
|
-
"_Pagination-
|
|
278
|
+
"_Pagination-B9JDi5MI.js"
|
|
278
279
|
]
|
|
279
280
|
},
|
|
280
281
|
"src/pages/Metrics.tsx": {
|
|
281
|
-
"file": "assets/Metrics-
|
|
282
|
+
"file": "assets/Metrics-Dup9Zinh.js",
|
|
282
283
|
"name": "Metrics",
|
|
283
284
|
"src": "src/pages/Metrics.tsx",
|
|
284
285
|
"isDynamicEntry": true,
|
|
@@ -288,7 +289,7 @@
|
|
|
288
289
|
]
|
|
289
290
|
},
|
|
290
291
|
"src/pages/Overview.tsx": {
|
|
291
|
-
"file": "assets/Overview-
|
|
292
|
+
"file": "assets/Overview-C7RCDE6r.js",
|
|
292
293
|
"name": "Overview",
|
|
293
294
|
"src": "src/pages/Overview.tsx",
|
|
294
295
|
"isDynamicEntry": true,
|
|
@@ -298,7 +299,7 @@
|
|
|
298
299
|
]
|
|
299
300
|
},
|
|
300
301
|
"src/pages/QueueDetail.tsx": {
|
|
301
|
-
"file": "assets/QueueDetail-
|
|
302
|
+
"file": "assets/QueueDetail-bf2n-r2h.js",
|
|
302
303
|
"name": "QueueDetail",
|
|
303
304
|
"src": "src/pages/QueueDetail.tsx",
|
|
304
305
|
"isDynamicEntry": true,
|
|
@@ -310,7 +311,7 @@
|
|
|
310
311
|
]
|
|
311
312
|
},
|
|
312
313
|
"src/pages/Queues.tsx": {
|
|
313
|
-
"file": "assets/Queues-
|
|
314
|
+
"file": "assets/Queues-CMQW89J9.js",
|
|
314
315
|
"name": "Queues",
|
|
315
316
|
"src": "src/pages/Queues.tsx",
|
|
316
317
|
"isDynamicEntry": true,
|
|
@@ -318,11 +319,11 @@
|
|
|
318
319
|
"_cn-CMFYpumL.js",
|
|
319
320
|
"_react-vendor-BcouBxpZ.js",
|
|
320
321
|
"index.html",
|
|
321
|
-
"_Pagination-
|
|
322
|
+
"_Pagination-B9JDi5MI.js"
|
|
322
323
|
]
|
|
323
324
|
},
|
|
324
325
|
"src/pages/S3Backup.tsx": {
|
|
325
|
-
"file": "assets/S3Backup-
|
|
326
|
+
"file": "assets/S3Backup-1jAySC9R.js",
|
|
326
327
|
"name": "S3Backup",
|
|
327
328
|
"src": "src/pages/S3Backup.tsx",
|
|
328
329
|
"isDynamicEntry": true,
|
|
@@ -332,20 +333,20 @@
|
|
|
332
333
|
]
|
|
333
334
|
},
|
|
334
335
|
"src/pages/Settings.tsx": {
|
|
335
|
-
"file": "assets/Settings-
|
|
336
|
+
"file": "assets/Settings-CnS5PjNe.js",
|
|
336
337
|
"name": "Settings",
|
|
337
338
|
"src": "src/pages/Settings.tsx",
|
|
338
339
|
"isDynamicEntry": true,
|
|
339
340
|
"imports": [
|
|
340
341
|
"_cn-CMFYpumL.js",
|
|
341
342
|
"_react-vendor-BcouBxpZ.js",
|
|
342
|
-
"_connectionStore-
|
|
343
|
+
"_connectionStore-DO6xQY7h.js",
|
|
343
344
|
"index.html",
|
|
344
345
|
"_form-DGinTEEb.js"
|
|
345
346
|
]
|
|
346
347
|
},
|
|
347
348
|
"src/pages/Usage.tsx": {
|
|
348
|
-
"file": "assets/Usage-
|
|
349
|
+
"file": "assets/Usage-C3H0hMSA.js",
|
|
349
350
|
"name": "Usage",
|
|
350
351
|
"src": "src/pages/Usage.tsx",
|
|
351
352
|
"isDynamicEntry": true,
|
|
@@ -355,7 +356,7 @@
|
|
|
355
356
|
]
|
|
356
357
|
},
|
|
357
358
|
"src/pages/Workers.tsx": {
|
|
358
|
-
"file": "assets/Workers-
|
|
359
|
+
"file": "assets/Workers-lvujKZwF.js",
|
|
359
360
|
"name": "Workers",
|
|
360
361
|
"src": "src/pages/Workers.tsx",
|
|
361
362
|
"isDynamicEntry": true,
|
|
@@ -363,11 +364,11 @@
|
|
|
363
364
|
"_cn-CMFYpumL.js",
|
|
364
365
|
"_react-vendor-BcouBxpZ.js",
|
|
365
366
|
"index.html",
|
|
366
|
-
"_Pagination-
|
|
367
|
+
"_Pagination-B9JDi5MI.js"
|
|
367
368
|
]
|
|
368
369
|
},
|
|
369
370
|
"src/pages/control/AddJob.tsx": {
|
|
370
|
-
"file": "assets/AddJob-
|
|
371
|
+
"file": "assets/AddJob-Dvpp--yq.js",
|
|
371
372
|
"name": "AddJob",
|
|
372
373
|
"src": "src/pages/control/AddJob.tsx",
|
|
373
374
|
"isDynamicEntry": true,
|
|
@@ -379,21 +380,21 @@
|
|
|
379
380
|
]
|
|
380
381
|
},
|
|
381
382
|
"src/pages/control/Benchmark.tsx": {
|
|
382
|
-
"file": "assets/Benchmark-
|
|
383
|
+
"file": "assets/Benchmark-CkL-Ee-M.js",
|
|
383
384
|
"name": "Benchmark",
|
|
384
385
|
"src": "src/pages/control/Benchmark.tsx",
|
|
385
386
|
"isDynamicEntry": true,
|
|
386
387
|
"imports": [
|
|
387
388
|
"_cn-CMFYpumL.js",
|
|
388
389
|
"_react-vendor-BcouBxpZ.js",
|
|
389
|
-
"_connectionStore-
|
|
390
|
+
"_connectionStore-DO6xQY7h.js",
|
|
390
391
|
"index.html",
|
|
391
392
|
"_form-DGinTEEb.js",
|
|
392
393
|
"_AreaChart-2gM0YoZT.js"
|
|
393
394
|
]
|
|
394
395
|
},
|
|
395
396
|
"src/pages/control/BulkAddJobs.tsx": {
|
|
396
|
-
"file": "assets/BulkAddJobs-
|
|
397
|
+
"file": "assets/BulkAddJobs-wI6cRZnX.js",
|
|
397
398
|
"name": "BulkAddJobs",
|
|
398
399
|
"src": "src/pages/control/BulkAddJobs.tsx",
|
|
399
400
|
"isDynamicEntry": true,
|
|
@@ -405,7 +406,7 @@
|
|
|
405
406
|
]
|
|
406
407
|
},
|
|
407
408
|
"src/pages/control/CronManager.tsx": {
|
|
408
|
-
"file": "assets/CronManager-
|
|
409
|
+
"file": "assets/CronManager-BvfW219u.js",
|
|
409
410
|
"name": "CronManager",
|
|
410
411
|
"src": "src/pages/control/CronManager.tsx",
|
|
411
412
|
"isDynamicEntry": true,
|
|
@@ -414,11 +415,11 @@
|
|
|
414
415
|
"_react-vendor-BcouBxpZ.js",
|
|
415
416
|
"index.html",
|
|
416
417
|
"_form-DGinTEEb.js",
|
|
417
|
-
"_Pagination-
|
|
418
|
+
"_Pagination-B9JDi5MI.js"
|
|
418
419
|
]
|
|
419
420
|
},
|
|
420
421
|
"src/pages/control/Database.tsx": {
|
|
421
|
-
"file": "assets/Database-
|
|
422
|
+
"file": "assets/Database-D2T_ZIGA.js",
|
|
422
423
|
"name": "Database",
|
|
423
424
|
"src": "src/pages/control/Database.tsx",
|
|
424
425
|
"isDynamicEntry": true,
|
|
@@ -427,11 +428,11 @@
|
|
|
427
428
|
"_react-vendor-BcouBxpZ.js",
|
|
428
429
|
"index.html",
|
|
429
430
|
"_form-DGinTEEb.js",
|
|
430
|
-
"_Pagination-
|
|
431
|
+
"_Pagination-B9JDi5MI.js"
|
|
431
432
|
]
|
|
432
433
|
},
|
|
433
434
|
"src/pages/control/Diagnostics.tsx": {
|
|
434
|
-
"file": "assets/Diagnostics-
|
|
435
|
+
"file": "assets/Diagnostics-C2goqq5h.js",
|
|
435
436
|
"name": "Diagnostics",
|
|
436
437
|
"src": "src/pages/control/Diagnostics.tsx",
|
|
437
438
|
"isDynamicEntry": true,
|
|
@@ -442,7 +443,7 @@
|
|
|
442
443
|
]
|
|
443
444
|
},
|
|
444
445
|
"src/pages/control/DlqControl.tsx": {
|
|
445
|
-
"file": "assets/DlqControl-
|
|
446
|
+
"file": "assets/DlqControl-C5BfE7Gq.js",
|
|
446
447
|
"name": "DlqControl",
|
|
447
448
|
"src": "src/pages/control/DlqControl.tsx",
|
|
448
449
|
"isDynamicEntry": true,
|
|
@@ -451,12 +452,12 @@
|
|
|
451
452
|
"_react-vendor-BcouBxpZ.js",
|
|
452
453
|
"index.html",
|
|
453
454
|
"_form-DGinTEEb.js",
|
|
454
|
-
"_Pagination-
|
|
455
|
-
"_exportFile-
|
|
455
|
+
"_Pagination-B9JDi5MI.js",
|
|
456
|
+
"_exportFile-C7xhE8Yh.js"
|
|
456
457
|
]
|
|
457
458
|
},
|
|
458
459
|
"src/pages/control/DlqPro.tsx": {
|
|
459
|
-
"file": "assets/DlqPro-
|
|
460
|
+
"file": "assets/DlqPro-ClPNmw-X.js",
|
|
460
461
|
"name": "DlqPro",
|
|
461
462
|
"src": "src/pages/control/DlqPro.tsx",
|
|
462
463
|
"isDynamicEntry": true,
|
|
@@ -465,13 +466,13 @@
|
|
|
465
466
|
"_react-vendor-BcouBxpZ.js",
|
|
466
467
|
"index.html",
|
|
467
468
|
"_form-DGinTEEb.js",
|
|
468
|
-
"_Pagination-
|
|
469
|
-
"_exportFile-
|
|
469
|
+
"_Pagination-B9JDi5MI.js",
|
|
470
|
+
"_exportFile-C7xhE8Yh.js",
|
|
470
471
|
"_promisePool-Daxkc1OB.js"
|
|
471
472
|
]
|
|
472
473
|
},
|
|
473
474
|
"src/pages/control/Flows.tsx": {
|
|
474
|
-
"file": "assets/Flows-
|
|
475
|
+
"file": "assets/Flows-DbhMbvSG.js",
|
|
475
476
|
"name": "Flows",
|
|
476
477
|
"src": "src/pages/control/Flows.tsx",
|
|
477
478
|
"isDynamicEntry": true,
|
|
@@ -482,7 +483,7 @@
|
|
|
482
483
|
]
|
|
483
484
|
},
|
|
484
485
|
"src/pages/control/JobInspector.tsx": {
|
|
485
|
-
"file": "assets/JobInspector
|
|
486
|
+
"file": "assets/JobInspector-CO_zKjSX.js",
|
|
486
487
|
"name": "JobInspector",
|
|
487
488
|
"src": "src/pages/control/JobInspector.tsx",
|
|
488
489
|
"isDynamicEntry": true,
|
|
@@ -492,11 +493,11 @@
|
|
|
492
493
|
"index.html",
|
|
493
494
|
"_form-DGinTEEb.js",
|
|
494
495
|
"_jobActions-CuOdMglt.js",
|
|
495
|
-
"_exportFile-
|
|
496
|
+
"_exportFile-C7xhE8Yh.js"
|
|
496
497
|
]
|
|
497
498
|
},
|
|
498
499
|
"src/pages/control/JobsPro.tsx": {
|
|
499
|
-
"file": "assets/JobsPro-
|
|
500
|
+
"file": "assets/JobsPro-Drdgdj3s.js",
|
|
500
501
|
"name": "JobsPro",
|
|
501
502
|
"src": "src/pages/control/JobsPro.tsx",
|
|
502
503
|
"isDynamicEntry": true,
|
|
@@ -505,13 +506,13 @@
|
|
|
505
506
|
"_react-vendor-BcouBxpZ.js",
|
|
506
507
|
"index.html",
|
|
507
508
|
"_form-DGinTEEb.js",
|
|
508
|
-
"_Pagination-
|
|
509
|
+
"_Pagination-B9JDi5MI.js",
|
|
509
510
|
"_jobActions-CuOdMglt.js",
|
|
510
|
-
"_exportFile-
|
|
511
|
+
"_exportFile-C7xhE8Yh.js"
|
|
511
512
|
]
|
|
512
513
|
},
|
|
513
514
|
"src/pages/control/LogsPro.tsx": {
|
|
514
|
-
"file": "assets/LogsPro-
|
|
515
|
+
"file": "assets/LogsPro-7uTBjPWX.js",
|
|
515
516
|
"name": "LogsPro",
|
|
516
517
|
"src": "src/pages/control/LogsPro.tsx",
|
|
517
518
|
"isDynamicEntry": true,
|
|
@@ -520,11 +521,11 @@
|
|
|
520
521
|
"_react-vendor-BcouBxpZ.js",
|
|
521
522
|
"index.html",
|
|
522
523
|
"_form-DGinTEEb.js",
|
|
523
|
-
"_Pagination-
|
|
524
|
+
"_Pagination-B9JDi5MI.js"
|
|
524
525
|
]
|
|
525
526
|
},
|
|
526
527
|
"src/pages/control/McpServer.tsx": {
|
|
527
|
-
"file": "assets/McpServer-
|
|
528
|
+
"file": "assets/McpServer-DAklQDB5.js",
|
|
528
529
|
"name": "McpServer",
|
|
529
530
|
"src": "src/pages/control/McpServer.tsx",
|
|
530
531
|
"isDynamicEntry": true,
|
|
@@ -534,7 +535,7 @@
|
|
|
534
535
|
]
|
|
535
536
|
},
|
|
536
537
|
"src/pages/control/MetricsPro.tsx": {
|
|
537
|
-
"file": "assets/MetricsPro-
|
|
538
|
+
"file": "assets/MetricsPro-PP3TymeP.js",
|
|
538
539
|
"name": "MetricsPro",
|
|
539
540
|
"src": "src/pages/control/MetricsPro.tsx",
|
|
540
541
|
"isDynamicEntry": true,
|
|
@@ -542,13 +543,13 @@
|
|
|
542
543
|
"_cn-CMFYpumL.js",
|
|
543
544
|
"_react-vendor-BcouBxpZ.js",
|
|
544
545
|
"index.html",
|
|
545
|
-
"_Pagination-
|
|
546
|
+
"_Pagination-B9JDi5MI.js",
|
|
546
547
|
"_AreaChart-2gM0YoZT.js",
|
|
547
|
-
"_useThroughputSeries-
|
|
548
|
+
"_useThroughputSeries-CVKzWzdv.js"
|
|
548
549
|
]
|
|
549
550
|
},
|
|
550
551
|
"src/pages/control/QueueControl.tsx": {
|
|
551
|
-
"file": "assets/QueueControl-
|
|
552
|
+
"file": "assets/QueueControl-CxKjUjF-.js",
|
|
552
553
|
"name": "QueueControl",
|
|
553
554
|
"src": "src/pages/control/QueueControl.tsx",
|
|
554
555
|
"isDynamicEntry": true,
|
|
@@ -557,11 +558,11 @@
|
|
|
557
558
|
"_react-vendor-BcouBxpZ.js",
|
|
558
559
|
"index.html",
|
|
559
560
|
"_form-DGinTEEb.js",
|
|
560
|
-
"_QueueActions-
|
|
561
|
+
"_QueueActions-DJTw0h2g.js"
|
|
561
562
|
]
|
|
562
563
|
},
|
|
563
564
|
"src/pages/control/QueueDetailPro.tsx": {
|
|
564
|
-
"file": "assets/QueueDetailPro-
|
|
565
|
+
"file": "assets/QueueDetailPro-C-XLWFBa.js",
|
|
565
566
|
"name": "QueueDetailPro",
|
|
566
567
|
"src": "src/pages/control/QueueDetailPro.tsx",
|
|
567
568
|
"isDynamicEntry": true,
|
|
@@ -570,12 +571,12 @@
|
|
|
570
571
|
"_react-vendor-BcouBxpZ.js",
|
|
571
572
|
"index.html",
|
|
572
573
|
"_AreaChart-2gM0YoZT.js",
|
|
573
|
-
"_useThroughputSeries-
|
|
574
|
-
"_QueueActions-
|
|
574
|
+
"_useThroughputSeries-CVKzWzdv.js",
|
|
575
|
+
"_QueueActions-DJTw0h2g.js"
|
|
575
576
|
]
|
|
576
577
|
},
|
|
577
578
|
"src/pages/control/QueuesOverview.tsx": {
|
|
578
|
-
"file": "assets/QueuesOverview-
|
|
579
|
+
"file": "assets/QueuesOverview-x7-akDzf.js",
|
|
579
580
|
"name": "QueuesOverview",
|
|
580
581
|
"src": "src/pages/control/QueuesOverview.tsx",
|
|
581
582
|
"isDynamicEntry": true,
|
|
@@ -583,25 +584,25 @@
|
|
|
583
584
|
"_cn-CMFYpumL.js",
|
|
584
585
|
"_react-vendor-BcouBxpZ.js",
|
|
585
586
|
"index.html",
|
|
586
|
-
"_Pagination-
|
|
587
|
+
"_Pagination-B9JDi5MI.js",
|
|
587
588
|
"_promisePool-Daxkc1OB.js"
|
|
588
589
|
]
|
|
589
590
|
},
|
|
590
591
|
"src/pages/control/S3BackupPro.tsx": {
|
|
591
|
-
"file": "assets/S3BackupPro-
|
|
592
|
+
"file": "assets/S3BackupPro-BG_0OHW7.js",
|
|
592
593
|
"name": "S3BackupPro",
|
|
593
594
|
"src": "src/pages/control/S3BackupPro.tsx",
|
|
594
595
|
"isDynamicEntry": true,
|
|
595
596
|
"imports": [
|
|
596
597
|
"_cn-CMFYpumL.js",
|
|
597
598
|
"_react-vendor-BcouBxpZ.js",
|
|
598
|
-
"_connectionStore-
|
|
599
|
+
"_connectionStore-DO6xQY7h.js",
|
|
599
600
|
"index.html",
|
|
600
601
|
"_form-DGinTEEb.js"
|
|
601
602
|
]
|
|
602
603
|
},
|
|
603
604
|
"src/pages/control/ServerControl.tsx": {
|
|
604
|
-
"file": "assets/ServerControl-
|
|
605
|
+
"file": "assets/ServerControl-DohTB--h.js",
|
|
605
606
|
"name": "ServerControl",
|
|
606
607
|
"src": "src/pages/control/ServerControl.tsx",
|
|
607
608
|
"isDynamicEntry": true,
|
|
@@ -613,7 +614,7 @@
|
|
|
613
614
|
]
|
|
614
615
|
},
|
|
615
616
|
"src/pages/control/UsagePro.tsx": {
|
|
616
|
-
"file": "assets/UsagePro-
|
|
617
|
+
"file": "assets/UsagePro-CdnQkP9o.js",
|
|
617
618
|
"name": "UsagePro",
|
|
618
619
|
"src": "src/pages/control/UsagePro.tsx",
|
|
619
620
|
"isDynamicEntry": true,
|
|
@@ -623,7 +624,7 @@
|
|
|
623
624
|
]
|
|
624
625
|
},
|
|
625
626
|
"src/pages/control/Webhooks.tsx": {
|
|
626
|
-
"file": "assets/Webhooks-
|
|
627
|
+
"file": "assets/Webhooks-CAwVmIEZ.js",
|
|
627
628
|
"name": "Webhooks",
|
|
628
629
|
"src": "src/pages/control/Webhooks.tsx",
|
|
629
630
|
"isDynamicEntry": true,
|
|
@@ -632,11 +633,11 @@
|
|
|
632
633
|
"_react-vendor-BcouBxpZ.js",
|
|
633
634
|
"index.html",
|
|
634
635
|
"_form-DGinTEEb.js",
|
|
635
|
-
"_Pagination-
|
|
636
|
+
"_Pagination-B9JDi5MI.js"
|
|
636
637
|
]
|
|
637
638
|
},
|
|
638
639
|
"src/pages/control/WorkersPro.tsx": {
|
|
639
|
-
"file": "assets/WorkersPro-
|
|
640
|
+
"file": "assets/WorkersPro-CIJKl7U1.js",
|
|
640
641
|
"name": "WorkersPro",
|
|
641
642
|
"src": "src/pages/control/WorkersPro.tsx",
|
|
642
643
|
"isDynamicEntry": true,
|
|
@@ -0,0 +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-BcouBxpZ.js";import{A as a,C as o,S as s,h as c,nt as l,rt as u,w as ee}from"./index-r1ZMLIZ9.js";import{a as te,n as d,o as f,t as p}from"./form-DGinTEEb.js";var m=e(t(),1),h=i(),g=e=>e==null?``:String(e);function ne(e,t){return e==null?t?{ok:!1,msg:`Backoff strategy needs a base delay in Backoff (ms)`}:{ok:!0,backoff:void 0}:{ok:!0,backoff:t?{type:t,delay:e}:e}}function _(e){return[e.tags?.length?`Tags`:``,e.groupId?`Group ID`:``,e.dependsOn?.length?`Depends on`:``,e.uniqueKey?`Unique key`:``].filter(Boolean)}function re(e,t){return e===t?{ok:!0,msg:`Created ${e} job${e===1?``:`s`}`}:{ok:!1,msg:`Created ${e} of ${t} jobs — ${t-e} were not created (duplicate jobId/uniqueKey?)`}}function v(){let{data:e}=a(()=>l.queues(),[],{intervalMs:3e4}),t=n().state?.clone,i=t?.options??{},[f,v]=(0,m.useState)(t?.queue??``),[b,x]=(0,m.useState)(t?.dataText??`{
|
|
2
|
+
"hello": "world"
|
|
3
|
+
}`),[S,ie]=(0,m.useState)(`1`),[C,ae]=(0,m.useState)(g(i.priority)),[w,T]=(0,m.useState)(``),[E,D]=(0,m.useState)(``),[O,oe]=(0,m.useState)(g(i.maxAttempts)),[k,se]=(0,m.useState)(g(typeof i.backoff==`number`?i.backoff:void 0)),[A,ce]=(0,m.useState)(g(i.timeout)),[j,M]=(0,m.useState)(``),[N,le]=(0,m.useState)(i.removeOnComplete??!1),[P,ue]=(0,m.useState)(i.removeOnFail??!1),[F,I]=(0,m.useState)(!1),[L,R]=(0,m.useState)(!1),[z,B]=(0,m.useState)(``),[V,H]=(0,m.useState)(``),[U,de]=(0,m.useState)(``),[W,fe]=(0,m.useState)(``),[G,pe]=(0,m.useState)(``),[K,q]=(0,m.useState)(!1),[J,Y]=(0,m.useState)(null),[X,Z]=(0,m.useState)(null),Q=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},$=(Q(S)??1)>1?_({data:null,tags:V.trim()?[V.trim()]:void 0,groupId:U.trim()||void 0,dependsOn:W.trim()?[W.trim()]:void 0,uniqueKey:G.trim()||void 0}):[],me=async()=>{Y(null),Z(null);let e=f.trim();if(!e){Y({ok:!1,msg:`Choose a queue`});return}let t;try{t=JSON.parse(b)}catch(e){Z(`Invalid JSON: ${e.message}`);return}let n=Q(w);if(E.trim()){let e=new Date(E).getTime();if(!Number.isFinite(e)){Y({ok:!1,msg:`Run at is not a valid date/time`});return}n=Math.max(0,e-Date.now())}let r=ne(Q(k),z);if(!r.ok){Y({ok:!1,msg:r.msg});return}let i=r.backoff,a=V.split(`,`).map(e=>e.trim()).filter(Boolean),o=W.split(`,`).map(e=>e.trim()).filter(Boolean),s={data:t,priority:Q(C),delay:n,maxAttempts:Q(O),backoff:i,timeout:Q(A),jobId:j.trim()||void 0,removeOnComplete:N||void 0,removeOnFail:P||void 0,durable:F||void 0,lifo:L||void 0,tags:a.length?a:void 0,groupId:U.trim()||void 0,dependsOn:o.length?o:void 0,uniqueKey:G.trim()||void 0},c=Q(S)??1;if(!Number.isInteger(c)||c<1){Y({ok:!1,msg:`Count must be an integer of at least 1`});return}if(c>1e4){Y({ok:!1,msg:`Count must be 10000 or fewer`});return}q(!0);try{if(c===1){let t=await l.addJob(e,s);Y({ok:!0,msg:`Created job ${t.id}`}),u.success(`Job created`,`${e} · ${t.id}`)}else{let t=await l.addJobsBulk(e,Array.from({length:c},()=>s)),n=re(new Set(t.ids).size,c);Y(n),n.ok?u.success(n.msg,`in ${e}`):u.error(n.msg,`in ${e}`)}}catch(e){Y({ok:!1,msg:e.message}),u.error(`Add job failed`,e.message)}finally{q(!1)}};return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(c,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,h.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,h.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,h.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),me()},children:[(0,h.jsxs)(s,{children:[(0,h.jsx)(o,{title:`Job`}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,h.jsxs)(p,{label:`Queue`,children:[(0,h.jsx)(d,{list:`queue-options`,value:f,onChange:e=>v(e.target.value),placeholder:`queue name (existing or new)`}),(0,h.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,h.jsx)(`option`,{value:e.name},e.name))})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(p,{label:`Data (JSON)`,children:(0,h.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,h.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:X})]})]})]}),(0,h.jsxs)(s,{children:[(0,h.jsx)(o,{title:`Options`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,h.jsx)(p,{label:`Priority`,children:(0,h.jsx)(d,{type:`number`,value:C,onChange:e=>ae(e.target.value),placeholder:`0`})}),(0,h.jsx)(p,{label:`Delay (ms)`,children:(0,h.jsx)(d,{type:`number`,min:0,value:w,onChange:e=>T(e.target.value),placeholder:`0`,disabled:E.trim()!==``})}),(0,h.jsx)(p,{label:`Run at`,hint:E.trim()?`Overrides Delay — derived from this time (local time).`:`(local time)`,children:(0,h.jsx)(d,{type:`datetime-local`,value:E,onChange:e=>D(e.target.value)})}),(0,h.jsx)(p,{label:`Max attempts`,hint:`blank = server default`,children:(0,h.jsx)(d,{type:`number`,min:1,value:O,onChange:e=>oe(e.target.value),placeholder:`3`})}),(0,h.jsx)(p,{label:`Backoff (ms)`,hint:`blank = server default`,children:(0,h.jsx)(d,{type:`number`,min:0,value:k,onChange:e=>se(e.target.value),placeholder:`1000`})}),(0,h.jsx)(p,{label:`Backoff strategy`,hint:`flat delay unless set`,children:(0,h.jsxs)(te,{value:z,onChange:e=>B(e.target.value),children:[(0,h.jsx)(`option`,{value:``,children:`flat`}),(0,h.jsx)(`option`,{value:`fixed`,children:`fixed`}),(0,h.jsx)(`option`,{value:`exponential`,children:`exponential`})]})}),(0,h.jsx)(p,{label:`Timeout (ms)`,children:(0,h.jsx)(d,{type:`number`,min:0,value:A,onChange:e=>ce(e.target.value),placeholder:`—`})}),(0,h.jsx)(p,{label:`Custom job ID`,children:(0,h.jsx)(d,{value:j,onChange:e=>M(e.target.value),placeholder:`idempotency key`})})]}),(0,h.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,h.jsx)(y,{label:`removeOnComplete`,checked:N,onChange:le}),(0,h.jsx)(y,{label:`removeOnFail`,checked:P,onChange:ue}),(0,h.jsx)(y,{label:`durable`,checked:F,onChange:I}),(0,h.jsx)(y,{label:`lifo`,checked:L,onChange:R})]}),(0,h.jsxs)(`div`,{className:`mt-4 border-t border-line pt-4`,children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] uppercase tracking-wider text-faint`,children:`Advanced`}),(0,h.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,h.jsx)(p,{label:`Tags`,hint:`comma-separated`,children:(0,h.jsx)(d,{value:V,onChange:e=>H(e.target.value),placeholder:`email, urgent`})}),(0,h.jsx)(p,{label:`Group ID`,children:(0,h.jsx)(d,{value:U,onChange:e=>de(e.target.value),placeholder:`—`})}),(0,h.jsx)(p,{label:`Unique key`,hint:`dedup key`,children:(0,h.jsx)(d,{value:G,onChange:e=>pe(e.target.value),placeholder:`—`})}),(0,h.jsx)(p,{label:`Depends on`,hint:`parent job ids, comma-separated`,children:(0,h.jsx)(d,{value:W,onChange:e=>fe(e.target.value),placeholder:`job-id-1, job-id-2`})})]})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,h.jsx)(`div`,{className:`w-28`,children:(0,h.jsx)(p,{label:`Count`,hint:`1–10000`,children:(0,h.jsx)(d,{type:`number`,min:1,value:S,onChange:e=>ie(e.target.value)})})}),(0,h.jsx)(ee,{type:`submit`,variant:`accent`,disabled:K,children:K?`Adding…`:`Add job`}),$.length>0&&(0,h.jsxs)(`span`,{className:`pb-2 text-xs text-warning`,children:[$.join(`, `),` `,$.length===1?`is`:`are`,` applied only when Count is 1 — the bulk route ignores `,$.length===1?`it`:`them`,`.`]}),J&&(0,h.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,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(f,{checked:t,onChange:n,label:e}),(0,h.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-BcouBxpZ.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-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{h as t,t as n}from"./react-vendor-BcouBxpZ.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-r1ZMLIZ9.js";import{a as h,n as g,o as _,t as v}from"./form-DGinTEEb.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-BcouBxpZ.js";import{r as i}from"./connectionStore-DO6xQY7h.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-r1ZMLIZ9.js";import{i as v,n as y,o as b,t as x}from"./form-DGinTEEb.js";import{t as S}from"./AreaChart-2gM0YoZT.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.max(0,Math.ceil(t/100*e.length)-1))]: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=[`waiting`,`completed`,`failed`,`delayed`],H=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],ee=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)(()=>ee(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]=H.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:te,error:ne}=a(()=>m.counts(R),[R],{intervalMs:1e3}),q=te?.counts??null,[J,Y]=(0,C.useState)(!1),[X,Z]=(0,C.useState)(null),re=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 V)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));if(n==null)Z({error:e??`server unreachable — could not verify`});else{let t=n.counts??{},r=V.reduce((e,n)=>e+(t[n]??0),0);Z(e||r>0?{error:e??`${d(r)} job(s) still present`}:{remaining:t.active??0})}}finally{Y(!1)}}},Q=r.runCfg??U(e),$=D(Q.total,1,w.total),ie=D(Q.workers,0,w.workers),ae=Q.mode===`count`&&(j||k)?Math.min(100,O.pushed/$*100):0,oe=Q.mode===`count`&&(j||k)?Math.min(100,O.completed/$*100):0,se=Q.mode===`duration`?Math.min(100,O.elapsedMs/(D(Q.durationS,1,w.durationS)*1e3)*100):0,ce=s===`running`?Q.mode===`duration`?`Running…`:`Producing…`:s===`draining`?`Draining…`:s===`stopping`?`Stopping…`:s===`error`?`Error`:k?`Result`:`Ready`,le=(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`,disabled:J,onClick:()=>{if(J)return;let t=U(e),n=t.queue.trim()||T.queue,a=q&&R===n?(q.waiting??0)+(q.delayed??0):0,o=t.workers>0&&a>0?` Warning: it already holds ${d(a)} job(s) — the simulated workers will pull and ack those too, and they will be counted as completed.`:``;window.confirm(`Enqueue real jobs into "${n}" on ${i()}?${o}`)&&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:re,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:ce}),(0,P.jsx)(`span`,{className:`text-xs text-faint`,children:le})]}),(0,P.jsx)(G,{label:Q.mode===`duration`?`Elapsed`:`Produced`,pct:Q.mode===`duration`?se:ae,tone:`accent`}),ie>0&&Q.mode===`count`&&(0,P.jsx)(G,{label:`Completed`,pct:oe,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}/${ie}`,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:ne?(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};
|