bunqueue-dashboard 0.0.15 → 0.0.16
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/dist/.vite/manifest.json +57 -57
- package/dist/assets/{AddJob-CgeLluaI.js → AddJob-CMIT6e17.js} +1 -1
- package/dist/assets/{Benchmark-DrUL2MGj.js → Benchmark-Dq1-vJ2k.js} +1 -1
- package/dist/assets/{CopilotPanel-fr19SCy4.js → CopilotPanel-BDZzDmVy.js} +1 -1
- package/dist/assets/{CopyButton-BRNz3U_X.js → CopyButton-XT7ykzf5.js} +1 -1
- package/dist/assets/{Cron-CGpba--B.js → Cron-9hndZ-Z5.js} +1 -1
- package/dist/assets/{CronManager-C8DgqC22.js → CronManager-BQupx6wZ.js} +1 -1
- package/dist/assets/{Database-3TVTb28B.js → Database-Difs7xYV.js} +1 -1
- package/dist/assets/{Diagnostics-Bx3SLh8R.js → Diagnostics-BzVDq9CH.js} +1 -1
- package/dist/assets/{Dlq-fvEtz0IH.js → Dlq-BCUVh_NO.js} +1 -1
- package/dist/assets/{DlqControl-BuoZGZiz.js → DlqControl-Cu2i1oq5.js} +1 -1
- package/dist/assets/{DlqPro-Dc4R2c0h.js → DlqPro-HBrCftLD.js} +1 -1
- package/dist/assets/{Flows-uJwr4Xtd.js → Flows-D3Bvkmd6.js} +1 -1
- package/dist/assets/{JobInspector-BHzMp9AE.js → JobInspector-B7zEuFhM.js} +1 -1
- package/dist/assets/{Jobs-B3ngaITT.js → Jobs-ovYRwmwi.js} +1 -1
- package/dist/assets/{JobsPro-B8ZXHQat.js → JobsPro-DNZivuzq.js} +1 -1
- package/dist/assets/{Logs-BFNzXnJu.js → Logs-CjM7MNYN.js} +1 -1
- package/dist/assets/{LogsPro-BsYmMhV3.js → LogsPro-P73LCkap.js} +1 -1
- package/dist/assets/{McpServer-Dp5CU2Ao.js → McpServer-CUK20-uN.js} +1 -1
- package/dist/assets/{Metrics-BIy2WsIk.js → Metrics-BodjiKpf.js} +1 -1
- package/dist/assets/{MetricsPro-59vtSH96.js → MetricsPro-CqcH6gJp.js} +1 -1
- package/dist/assets/{Overview-CKCv4aez.js → Overview-AwCA3XI2.js} +1 -1
- package/dist/assets/{Pagination-DdeRIp2i.js → Pagination-Cd6lHj2E.js} +1 -1
- package/dist/assets/{QueueControl-Bnk114Oa.js → QueueControl-D7J1JObu.js} +1 -1
- package/dist/assets/{QueueDetail-BjblUfMz.js → QueueDetail-BtiN0s3b.js} +1 -1
- package/dist/assets/{Queues-DLfqg-GX.js → Queues-LrodynCj.js} +1 -1
- package/dist/assets/{QueuesOverview-2q1ROf6f.js → QueuesOverview-DrYjyped.js} +1 -1
- package/dist/assets/{S3Backup-BnL4NviE.js → S3Backup-et1PcCC0.js} +1 -1
- package/dist/assets/{S3BackupPro-MKhVJfmN.js → S3BackupPro-BEo_EVAO.js} +1 -1
- package/dist/assets/{ServerControl-MwMUqZXA.js → ServerControl-BRLFRj7k.js} +1 -1
- package/dist/assets/{Settings-Bg4nYelW.js → Settings-CeRZgZU6.js} +1 -1
- package/dist/assets/{Usage-Cf-_mayK.js → Usage-CHCg6VNy.js} +1 -1
- package/dist/assets/{UsagePro-Dvnkxjtk.js → UsagePro-Cto9k5OI.js} +1 -1
- package/dist/assets/{Webhooks-DI-3YwZu.js → Webhooks-Cm3vZEp7.js} +1 -1
- package/dist/assets/{Workers-DzewyMtr.js → Workers-CVfx3TK-.js} +1 -1
- package/dist/assets/{WorkersPro-DXnomAJx.js → WorkersPro-BidtV_Bp.js} +1 -1
- package/dist/assets/{index-D6Nj5ksZ.js → index-C9fPU4bV.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/scripts/embedded.gen.ts +96 -96
- package/scripts/serve.ts +33 -6
package/dist/.vite/manifest.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"_react-vendor-CHIHtdAC.js"
|
|
8
8
|
]
|
|
9
9
|
},
|
|
10
|
-
"_CopyButton-
|
|
11
|
-
"file": "assets/CopyButton-
|
|
10
|
+
"_CopyButton-XT7ykzf5.js": {
|
|
11
|
+
"file": "assets/CopyButton-XT7ykzf5.js",
|
|
12
12
|
"name": "CopyButton",
|
|
13
13
|
"imports": [
|
|
14
14
|
"_cn-CMFYpumL.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"index.html"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"_Pagination-
|
|
20
|
-
"file": "assets/Pagination-
|
|
19
|
+
"_Pagination-Cd6lHj2E.js": {
|
|
20
|
+
"file": "assets/Pagination-Cd6lHj2E.js",
|
|
21
21
|
"name": "Pagination",
|
|
22
22
|
"imports": [
|
|
23
23
|
"_cn-CMFYpumL.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"index.html": {
|
|
60
|
-
"file": "assets/index-
|
|
60
|
+
"file": "assets/index-C9fPU4bV.js",
|
|
61
61
|
"name": "index",
|
|
62
62
|
"src": "index.html",
|
|
63
63
|
"isEntry": true,
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"src": "node_modules/@fontsource-variable/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2"
|
|
130
130
|
},
|
|
131
131
|
"src/components/copilot/CopilotPanel.tsx": {
|
|
132
|
-
"file": "assets/CopilotPanel-
|
|
132
|
+
"file": "assets/CopilotPanel-BDZzDmVy.js",
|
|
133
133
|
"name": "CopilotPanel",
|
|
134
134
|
"src": "src/components/copilot/CopilotPanel.tsx",
|
|
135
135
|
"isDynamicEntry": true,
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"isDynamicEntry": true
|
|
148
148
|
},
|
|
149
149
|
"src/pages/Cron.tsx": {
|
|
150
|
-
"file": "assets/Cron-
|
|
150
|
+
"file": "assets/Cron-9hndZ-Z5.js",
|
|
151
151
|
"name": "Cron",
|
|
152
152
|
"src": "src/pages/Cron.tsx",
|
|
153
153
|
"isDynamicEntry": true,
|
|
@@ -155,11 +155,11 @@
|
|
|
155
155
|
"_cn-CMFYpumL.js",
|
|
156
156
|
"_react-vendor-CHIHtdAC.js",
|
|
157
157
|
"index.html",
|
|
158
|
-
"_Pagination-
|
|
158
|
+
"_Pagination-Cd6lHj2E.js"
|
|
159
159
|
]
|
|
160
160
|
},
|
|
161
161
|
"src/pages/Dlq.tsx": {
|
|
162
|
-
"file": "assets/Dlq-
|
|
162
|
+
"file": "assets/Dlq-BCUVh_NO.js",
|
|
163
163
|
"name": "Dlq",
|
|
164
164
|
"src": "src/pages/Dlq.tsx",
|
|
165
165
|
"isDynamicEntry": true,
|
|
@@ -168,11 +168,11 @@
|
|
|
168
168
|
"_react-vendor-CHIHtdAC.js",
|
|
169
169
|
"index.html",
|
|
170
170
|
"_form-PtDLk33Z.js",
|
|
171
|
-
"_Pagination-
|
|
171
|
+
"_Pagination-Cd6lHj2E.js"
|
|
172
172
|
]
|
|
173
173
|
},
|
|
174
174
|
"src/pages/Jobs.tsx": {
|
|
175
|
-
"file": "assets/Jobs-
|
|
175
|
+
"file": "assets/Jobs-ovYRwmwi.js",
|
|
176
176
|
"name": "Jobs",
|
|
177
177
|
"src": "src/pages/Jobs.tsx",
|
|
178
178
|
"isDynamicEntry": true,
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
]
|
|
185
185
|
},
|
|
186
186
|
"src/pages/Logs.tsx": {
|
|
187
|
-
"file": "assets/Logs-
|
|
187
|
+
"file": "assets/Logs-CjM7MNYN.js",
|
|
188
188
|
"name": "Logs",
|
|
189
189
|
"src": "src/pages/Logs.tsx",
|
|
190
190
|
"isDynamicEntry": true,
|
|
@@ -193,11 +193,11 @@
|
|
|
193
193
|
"_react-vendor-CHIHtdAC.js",
|
|
194
194
|
"index.html",
|
|
195
195
|
"_form-PtDLk33Z.js",
|
|
196
|
-
"_Pagination-
|
|
196
|
+
"_Pagination-Cd6lHj2E.js"
|
|
197
197
|
]
|
|
198
198
|
},
|
|
199
199
|
"src/pages/Metrics.tsx": {
|
|
200
|
-
"file": "assets/Metrics-
|
|
200
|
+
"file": "assets/Metrics-BodjiKpf.js",
|
|
201
201
|
"name": "Metrics",
|
|
202
202
|
"src": "src/pages/Metrics.tsx",
|
|
203
203
|
"isDynamicEntry": true,
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
]
|
|
208
208
|
},
|
|
209
209
|
"src/pages/Overview.tsx": {
|
|
210
|
-
"file": "assets/Overview-
|
|
210
|
+
"file": "assets/Overview-AwCA3XI2.js",
|
|
211
211
|
"name": "Overview",
|
|
212
212
|
"src": "src/pages/Overview.tsx",
|
|
213
213
|
"isDynamicEntry": true,
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
]
|
|
218
218
|
},
|
|
219
219
|
"src/pages/QueueDetail.tsx": {
|
|
220
|
-
"file": "assets/QueueDetail-
|
|
220
|
+
"file": "assets/QueueDetail-BtiN0s3b.js",
|
|
221
221
|
"name": "QueueDetail",
|
|
222
222
|
"src": "src/pages/QueueDetail.tsx",
|
|
223
223
|
"isDynamicEntry": true,
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
]
|
|
230
230
|
},
|
|
231
231
|
"src/pages/Queues.tsx": {
|
|
232
|
-
"file": "assets/Queues-
|
|
232
|
+
"file": "assets/Queues-LrodynCj.js",
|
|
233
233
|
"name": "Queues",
|
|
234
234
|
"src": "src/pages/Queues.tsx",
|
|
235
235
|
"isDynamicEntry": true,
|
|
@@ -237,11 +237,11 @@
|
|
|
237
237
|
"_cn-CMFYpumL.js",
|
|
238
238
|
"_react-vendor-CHIHtdAC.js",
|
|
239
239
|
"index.html",
|
|
240
|
-
"_Pagination-
|
|
240
|
+
"_Pagination-Cd6lHj2E.js"
|
|
241
241
|
]
|
|
242
242
|
},
|
|
243
243
|
"src/pages/S3Backup.tsx": {
|
|
244
|
-
"file": "assets/S3Backup-
|
|
244
|
+
"file": "assets/S3Backup-et1PcCC0.js",
|
|
245
245
|
"name": "S3Backup",
|
|
246
246
|
"src": "src/pages/S3Backup.tsx",
|
|
247
247
|
"isDynamicEntry": true,
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
]
|
|
252
252
|
},
|
|
253
253
|
"src/pages/Settings.tsx": {
|
|
254
|
-
"file": "assets/Settings-
|
|
254
|
+
"file": "assets/Settings-CeRZgZU6.js",
|
|
255
255
|
"name": "Settings",
|
|
256
256
|
"src": "src/pages/Settings.tsx",
|
|
257
257
|
"isDynamicEntry": true,
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
]
|
|
265
265
|
},
|
|
266
266
|
"src/pages/Usage.tsx": {
|
|
267
|
-
"file": "assets/Usage-
|
|
267
|
+
"file": "assets/Usage-CHCg6VNy.js",
|
|
268
268
|
"name": "Usage",
|
|
269
269
|
"src": "src/pages/Usage.tsx",
|
|
270
270
|
"isDynamicEntry": true,
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
]
|
|
275
275
|
},
|
|
276
276
|
"src/pages/Workers.tsx": {
|
|
277
|
-
"file": "assets/Workers-
|
|
277
|
+
"file": "assets/Workers-CVfx3TK-.js",
|
|
278
278
|
"name": "Workers",
|
|
279
279
|
"src": "src/pages/Workers.tsx",
|
|
280
280
|
"isDynamicEntry": true,
|
|
@@ -282,11 +282,11 @@
|
|
|
282
282
|
"_cn-CMFYpumL.js",
|
|
283
283
|
"_react-vendor-CHIHtdAC.js",
|
|
284
284
|
"index.html",
|
|
285
|
-
"_Pagination-
|
|
285
|
+
"_Pagination-Cd6lHj2E.js"
|
|
286
286
|
]
|
|
287
287
|
},
|
|
288
288
|
"src/pages/control/AddJob.tsx": {
|
|
289
|
-
"file": "assets/AddJob-
|
|
289
|
+
"file": "assets/AddJob-CMIT6e17.js",
|
|
290
290
|
"name": "AddJob",
|
|
291
291
|
"src": "src/pages/control/AddJob.tsx",
|
|
292
292
|
"isDynamicEntry": true,
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
300
|
"src/pages/control/Benchmark.tsx": {
|
|
301
|
-
"file": "assets/Benchmark-
|
|
301
|
+
"file": "assets/Benchmark-Dq1-vJ2k.js",
|
|
302
302
|
"name": "Benchmark",
|
|
303
303
|
"src": "src/pages/control/Benchmark.tsx",
|
|
304
304
|
"isDynamicEntry": true,
|
|
@@ -308,11 +308,11 @@
|
|
|
308
308
|
"index.html",
|
|
309
309
|
"_form-PtDLk33Z.js",
|
|
310
310
|
"_AreaChart-DzUXW8u3.js",
|
|
311
|
-
"_CopyButton-
|
|
311
|
+
"_CopyButton-XT7ykzf5.js"
|
|
312
312
|
]
|
|
313
313
|
},
|
|
314
314
|
"src/pages/control/CronManager.tsx": {
|
|
315
|
-
"file": "assets/CronManager-
|
|
315
|
+
"file": "assets/CronManager-BQupx6wZ.js",
|
|
316
316
|
"name": "CronManager",
|
|
317
317
|
"src": "src/pages/control/CronManager.tsx",
|
|
318
318
|
"isDynamicEntry": true,
|
|
@@ -321,11 +321,11 @@
|
|
|
321
321
|
"_react-vendor-CHIHtdAC.js",
|
|
322
322
|
"index.html",
|
|
323
323
|
"_form-PtDLk33Z.js",
|
|
324
|
-
"_Pagination-
|
|
324
|
+
"_Pagination-Cd6lHj2E.js"
|
|
325
325
|
]
|
|
326
326
|
},
|
|
327
327
|
"src/pages/control/Database.tsx": {
|
|
328
|
-
"file": "assets/Database-
|
|
328
|
+
"file": "assets/Database-Difs7xYV.js",
|
|
329
329
|
"name": "Database",
|
|
330
330
|
"src": "src/pages/control/Database.tsx",
|
|
331
331
|
"isDynamicEntry": true,
|
|
@@ -334,12 +334,12 @@
|
|
|
334
334
|
"_react-vendor-CHIHtdAC.js",
|
|
335
335
|
"index.html",
|
|
336
336
|
"_form-PtDLk33Z.js",
|
|
337
|
-
"_Pagination-
|
|
338
|
-
"_CopyButton-
|
|
337
|
+
"_Pagination-Cd6lHj2E.js",
|
|
338
|
+
"_CopyButton-XT7ykzf5.js"
|
|
339
339
|
]
|
|
340
340
|
},
|
|
341
341
|
"src/pages/control/Diagnostics.tsx": {
|
|
342
|
-
"file": "assets/Diagnostics-
|
|
342
|
+
"file": "assets/Diagnostics-BzVDq9CH.js",
|
|
343
343
|
"name": "Diagnostics",
|
|
344
344
|
"src": "src/pages/control/Diagnostics.tsx",
|
|
345
345
|
"isDynamicEntry": true,
|
|
@@ -350,7 +350,7 @@
|
|
|
350
350
|
]
|
|
351
351
|
},
|
|
352
352
|
"src/pages/control/DlqControl.tsx": {
|
|
353
|
-
"file": "assets/DlqControl-
|
|
353
|
+
"file": "assets/DlqControl-Cu2i1oq5.js",
|
|
354
354
|
"name": "DlqControl",
|
|
355
355
|
"src": "src/pages/control/DlqControl.tsx",
|
|
356
356
|
"isDynamicEntry": true,
|
|
@@ -359,11 +359,11 @@
|
|
|
359
359
|
"_react-vendor-CHIHtdAC.js",
|
|
360
360
|
"index.html",
|
|
361
361
|
"_form-PtDLk33Z.js",
|
|
362
|
-
"_Pagination-
|
|
362
|
+
"_Pagination-Cd6lHj2E.js"
|
|
363
363
|
]
|
|
364
364
|
},
|
|
365
365
|
"src/pages/control/DlqPro.tsx": {
|
|
366
|
-
"file": "assets/DlqPro-
|
|
366
|
+
"file": "assets/DlqPro-HBrCftLD.js",
|
|
367
367
|
"name": "DlqPro",
|
|
368
368
|
"src": "src/pages/control/DlqPro.tsx",
|
|
369
369
|
"isDynamicEntry": true,
|
|
@@ -372,11 +372,11 @@
|
|
|
372
372
|
"_react-vendor-CHIHtdAC.js",
|
|
373
373
|
"index.html",
|
|
374
374
|
"_form-PtDLk33Z.js",
|
|
375
|
-
"_Pagination-
|
|
375
|
+
"_Pagination-Cd6lHj2E.js"
|
|
376
376
|
]
|
|
377
377
|
},
|
|
378
378
|
"src/pages/control/Flows.tsx": {
|
|
379
|
-
"file": "assets/Flows-
|
|
379
|
+
"file": "assets/Flows-D3Bvkmd6.js",
|
|
380
380
|
"name": "Flows",
|
|
381
381
|
"src": "src/pages/control/Flows.tsx",
|
|
382
382
|
"isDynamicEntry": true,
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
]
|
|
388
388
|
},
|
|
389
389
|
"src/pages/control/JobInspector.tsx": {
|
|
390
|
-
"file": "assets/JobInspector-
|
|
390
|
+
"file": "assets/JobInspector-B7zEuFhM.js",
|
|
391
391
|
"name": "JobInspector",
|
|
392
392
|
"src": "src/pages/control/JobInspector.tsx",
|
|
393
393
|
"isDynamicEntry": true,
|
|
@@ -396,12 +396,12 @@
|
|
|
396
396
|
"_react-vendor-CHIHtdAC.js",
|
|
397
397
|
"index.html",
|
|
398
398
|
"_form-PtDLk33Z.js",
|
|
399
|
-
"_CopyButton-
|
|
399
|
+
"_CopyButton-XT7ykzf5.js",
|
|
400
400
|
"_jobActions-CuOdMglt.js"
|
|
401
401
|
]
|
|
402
402
|
},
|
|
403
403
|
"src/pages/control/JobsPro.tsx": {
|
|
404
|
-
"file": "assets/JobsPro-
|
|
404
|
+
"file": "assets/JobsPro-DNZivuzq.js",
|
|
405
405
|
"name": "JobsPro",
|
|
406
406
|
"src": "src/pages/control/JobsPro.tsx",
|
|
407
407
|
"isDynamicEntry": true,
|
|
@@ -410,12 +410,12 @@
|
|
|
410
410
|
"_react-vendor-CHIHtdAC.js",
|
|
411
411
|
"index.html",
|
|
412
412
|
"_form-PtDLk33Z.js",
|
|
413
|
-
"_Pagination-
|
|
413
|
+
"_Pagination-Cd6lHj2E.js",
|
|
414
414
|
"_jobActions-CuOdMglt.js"
|
|
415
415
|
]
|
|
416
416
|
},
|
|
417
417
|
"src/pages/control/LogsPro.tsx": {
|
|
418
|
-
"file": "assets/LogsPro-
|
|
418
|
+
"file": "assets/LogsPro-P73LCkap.js",
|
|
419
419
|
"name": "LogsPro",
|
|
420
420
|
"src": "src/pages/control/LogsPro.tsx",
|
|
421
421
|
"isDynamicEntry": true,
|
|
@@ -424,22 +424,22 @@
|
|
|
424
424
|
"_react-vendor-CHIHtdAC.js",
|
|
425
425
|
"index.html",
|
|
426
426
|
"_form-PtDLk33Z.js",
|
|
427
|
-
"_Pagination-
|
|
427
|
+
"_Pagination-Cd6lHj2E.js"
|
|
428
428
|
]
|
|
429
429
|
},
|
|
430
430
|
"src/pages/control/McpServer.tsx": {
|
|
431
|
-
"file": "assets/McpServer-
|
|
431
|
+
"file": "assets/McpServer-CUK20-uN.js",
|
|
432
432
|
"name": "McpServer",
|
|
433
433
|
"src": "src/pages/control/McpServer.tsx",
|
|
434
434
|
"isDynamicEntry": true,
|
|
435
435
|
"imports": [
|
|
436
436
|
"_react-vendor-CHIHtdAC.js",
|
|
437
437
|
"index.html",
|
|
438
|
-
"_CopyButton-
|
|
438
|
+
"_CopyButton-XT7ykzf5.js"
|
|
439
439
|
]
|
|
440
440
|
},
|
|
441
441
|
"src/pages/control/MetricsPro.tsx": {
|
|
442
|
-
"file": "assets/MetricsPro-
|
|
442
|
+
"file": "assets/MetricsPro-CqcH6gJp.js",
|
|
443
443
|
"name": "MetricsPro",
|
|
444
444
|
"src": "src/pages/control/MetricsPro.tsx",
|
|
445
445
|
"isDynamicEntry": true,
|
|
@@ -447,12 +447,12 @@
|
|
|
447
447
|
"_cn-CMFYpumL.js",
|
|
448
448
|
"_react-vendor-CHIHtdAC.js",
|
|
449
449
|
"index.html",
|
|
450
|
-
"_Pagination-
|
|
450
|
+
"_Pagination-Cd6lHj2E.js",
|
|
451
451
|
"_AreaChart-DzUXW8u3.js"
|
|
452
452
|
]
|
|
453
453
|
},
|
|
454
454
|
"src/pages/control/QueueControl.tsx": {
|
|
455
|
-
"file": "assets/QueueControl-
|
|
455
|
+
"file": "assets/QueueControl-D7J1JObu.js",
|
|
456
456
|
"name": "QueueControl",
|
|
457
457
|
"src": "src/pages/control/QueueControl.tsx",
|
|
458
458
|
"isDynamicEntry": true,
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
]
|
|
465
465
|
},
|
|
466
466
|
"src/pages/control/QueuesOverview.tsx": {
|
|
467
|
-
"file": "assets/QueuesOverview-
|
|
467
|
+
"file": "assets/QueuesOverview-DrYjyped.js",
|
|
468
468
|
"name": "QueuesOverview",
|
|
469
469
|
"src": "src/pages/control/QueuesOverview.tsx",
|
|
470
470
|
"isDynamicEntry": true,
|
|
@@ -472,11 +472,11 @@
|
|
|
472
472
|
"_cn-CMFYpumL.js",
|
|
473
473
|
"_react-vendor-CHIHtdAC.js",
|
|
474
474
|
"index.html",
|
|
475
|
-
"_Pagination-
|
|
475
|
+
"_Pagination-Cd6lHj2E.js"
|
|
476
476
|
]
|
|
477
477
|
},
|
|
478
478
|
"src/pages/control/S3BackupPro.tsx": {
|
|
479
|
-
"file": "assets/S3BackupPro-
|
|
479
|
+
"file": "assets/S3BackupPro-BEo_EVAO.js",
|
|
480
480
|
"name": "S3BackupPro",
|
|
481
481
|
"src": "src/pages/control/S3BackupPro.tsx",
|
|
482
482
|
"isDynamicEntry": true,
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
]
|
|
490
490
|
},
|
|
491
491
|
"src/pages/control/ServerControl.tsx": {
|
|
492
|
-
"file": "assets/ServerControl-
|
|
492
|
+
"file": "assets/ServerControl-BRLFRj7k.js",
|
|
493
493
|
"name": "ServerControl",
|
|
494
494
|
"src": "src/pages/control/ServerControl.tsx",
|
|
495
495
|
"isDynamicEntry": true,
|
|
@@ -498,11 +498,11 @@
|
|
|
498
498
|
"_react-vendor-CHIHtdAC.js",
|
|
499
499
|
"index.html",
|
|
500
500
|
"_form-PtDLk33Z.js",
|
|
501
|
-
"_CopyButton-
|
|
501
|
+
"_CopyButton-XT7ykzf5.js"
|
|
502
502
|
]
|
|
503
503
|
},
|
|
504
504
|
"src/pages/control/UsagePro.tsx": {
|
|
505
|
-
"file": "assets/UsagePro-
|
|
505
|
+
"file": "assets/UsagePro-Cto9k5OI.js",
|
|
506
506
|
"name": "UsagePro",
|
|
507
507
|
"src": "src/pages/control/UsagePro.tsx",
|
|
508
508
|
"isDynamicEntry": true,
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
]
|
|
513
513
|
},
|
|
514
514
|
"src/pages/control/Webhooks.tsx": {
|
|
515
|
-
"file": "assets/Webhooks-
|
|
515
|
+
"file": "assets/Webhooks-Cm3vZEp7.js",
|
|
516
516
|
"name": "Webhooks",
|
|
517
517
|
"src": "src/pages/control/Webhooks.tsx",
|
|
518
518
|
"isDynamicEntry": true,
|
|
@@ -521,11 +521,11 @@
|
|
|
521
521
|
"_react-vendor-CHIHtdAC.js",
|
|
522
522
|
"index.html",
|
|
523
523
|
"_form-PtDLk33Z.js",
|
|
524
|
-
"_Pagination-
|
|
524
|
+
"_Pagination-Cd6lHj2E.js"
|
|
525
525
|
]
|
|
526
526
|
},
|
|
527
527
|
"src/pages/control/WorkersPro.tsx": {
|
|
528
|
-
"file": "assets/WorkersPro-
|
|
528
|
+
"file": "assets/WorkersPro-BidtV_Bp.js",
|
|
529
529
|
"name": "WorkersPro",
|
|
530
530
|
"src": "src/pages/control/WorkersPro.tsx",
|
|
531
531
|
"isDynamicEntry": true,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{m as t,t as n}from"./react-vendor-CHIHtdAC.js";import{D as r,E as i,T as a,g as o,j as s,v as c}from"./index-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{m as t,t as n}from"./react-vendor-CHIHtdAC.js";import{D as r,E as i,T as a,g as o,j as s,v as c}from"./index-C9fPU4bV.js";import{n as l,o as u,t as d}from"./form-PtDLk33Z.js";var f=e(t(),1),p=n();function m(){let{data:e}=s(()=>o.queues(),[],{intervalMs:3e4}),[t,n]=(0,f.useState)(``),[u,m]=(0,f.useState)(`{
|
|
2
2
|
"hello": "world"
|
|
3
3
|
}`),[g,_]=(0,f.useState)(`1`),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)(``),[E,D]=(0,f.useState)(``),[O,k]=(0,f.useState)(``),[A,j]=(0,f.useState)(!1),[M,N]=(0,f.useState)(!1),[P,F]=(0,f.useState)(!1),[I,L]=(0,f.useState)(!1),[R,z]=(0,f.useState)(!1),[B,V]=(0,f.useState)(null),[H,U]=(0,f.useState)(null),W=e=>{let t=Number(e);return e.trim()!==``&&Number.isFinite(t)?t:void 0},G=async()=>{if(V(null),U(null),!t.trim()){V({ok:!1,msg:`Choose a queue`});return}let e;try{e=JSON.parse(u)}catch(e){U(`Invalid JSON: ${e.message}`);return}let n={data:e,priority:W(v),delay:W(b),maxAttempts:W(S),backoff:W(w),timeout:W(E),jobId:O.trim()||void 0,removeOnComplete:A||void 0,removeOnFail:M||void 0,durable:P||void 0,lifo:I||void 0},r=W(g)??1;if(!Number.isInteger(r)||r<1){V({ok:!1,msg:`Count must be an integer of at least 1`});return}if(r>1e4){V({ok:!1,msg:`Count must be 10000 or fewer`});return}z(!0);try{if(r===1)V({ok:!0,msg:`Created job ${(await o.addJob(t,n)).id}`});else{let e=await o.addJobsBulk(t,Array.from({length:r},()=>n)),i=new Set(e.ids).size;V({ok:!0,msg:`Created ${i} job${i===1?``:`s`}`})}}catch(e){V({ok:!1,msg:e.message})}finally{z(!1)}};return(0,p.jsxs)(`div`,{children:[(0,p.jsx)(c,{title:`Add Job`,description:`Enqueue a job with full options.`}),(0,p.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),G()},children:[(0,p.jsxs)(a,{children:[(0,p.jsx)(i,{title:`Job`}),(0,p.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,p.jsxs)(d,{label:`Queue`,children:[(0,p.jsx)(l,{list:`queue-options`,value:t,onChange:e=>n(e.target.value),placeholder:`queue name (existing or new)`}),(0,p.jsx)(`datalist`,{id:`queue-options`,children:(e?.queues??[]).map(e=>(0,p.jsx)(`option`,{value:e.name},e.name))})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(d,{label:`Data (JSON)`,children:(0,p.jsx)(`textarea`,{value:u,onChange:e=>m(e.target.value),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`})}),H&&(0,p.jsx)(`p`,{className:`mt-2 text-xs text-danger`,children:H})]})]})]}),(0,p.jsxs)(a,{children:[(0,p.jsx)(i,{title:`Options`}),(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,p.jsx)(d,{label:`Priority`,children:(0,p.jsx)(l,{type:`number`,value:v,onChange:e=>y(e.target.value),placeholder:`0`})}),(0,p.jsx)(d,{label:`Delay (ms)`,children:(0,p.jsx)(l,{type:`number`,min:0,value:b,onChange:e=>x(e.target.value),placeholder:`0`})}),(0,p.jsx)(d,{label:`Max attempts`,children:(0,p.jsx)(l,{type:`number`,min:1,value:S,onChange:e=>C(e.target.value),placeholder:`3`})}),(0,p.jsx)(d,{label:`Backoff (ms)`,children:(0,p.jsx)(l,{type:`number`,min:0,value:w,onChange:e=>T(e.target.value),placeholder:`1000`})}),(0,p.jsx)(d,{label:`Timeout (ms)`,children:(0,p.jsx)(l,{type:`number`,min:0,value:E,onChange:e=>D(e.target.value),placeholder:`—`})}),(0,p.jsx)(d,{label:`Custom job ID`,children:(0,p.jsx)(l,{value:O,onChange:e=>k(e.target.value),placeholder:`idempotency key`})})]}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,p.jsx)(h,{label:`removeOnComplete`,checked:A,onChange:j}),(0,p.jsx)(h,{label:`removeOnFail`,checked:M,onChange:N}),(0,p.jsx)(h,{label:`durable`,checked:P,onChange:F}),(0,p.jsx)(h,{label:`lifo`,checked:I,onChange:L})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,p.jsx)(`div`,{className:`w-28`,children:(0,p.jsx)(d,{label:`Count`,children:(0,p.jsx)(l,{type:`number`,min:1,value:g,onChange:e=>_(e.target.value)})})}),(0,p.jsx)(r,{type:`submit`,variant:`accent`,disabled:R,children:R?`Adding…`:`Add job`}),B&&(0,p.jsx)(`span`,{className:B.ok?`text-sm text-success`:`text-sm text-danger`,children:B.msg})]})]})]})}function h({label:e,checked:t,onChange:n}){return(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(u,{checked:t,onChange:n,label:e}),(0,p.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}export{m as AddJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./cn-CMFYpumL.js";import{m as n,t as r}from"./react-vendor-CHIHtdAC.js";import{D as i,E as a,T as o,U as s,W as c,_ as l,c as u,g as d,j as f,r as p,s as m,v as h}from"./index-D6Nj5ksZ.js";import{i as g,n as _,o as v,t as y}from"./form-PtDLk33Z.js";import{t as b}from"./AreaChart-DzUXW8u3.js";import{t as x}from"./CopyButton-BRNz3U_X.js";var S=e(n(),1),C={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},w={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},T={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}},E=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,D=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,O=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),k=e=>new Promise(t=>setTimeout(t,e)),A=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await k(Math.min(100,Math.max(0,n-performance.now())))},j=e=>e instanceof Error?e.message:String(e),M=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,N=r();function P({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,N.jsxs)(o,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{value:n}),(0,N.jsx)(i,{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,N.jsx)(i,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,N.jsx)(`div`,{className:`overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,N.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,N.jsx)(`tbody`,{children:e.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,N.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:u(e.pushed)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:u(e.completed)}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[M(e.pushPerSec),`/s`]}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[M(e.donePerSec),`/s`]}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:m(e.p95)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:m(e.durationMs)})]},e.id))})]})})]})}var F={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},I=()=>({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:[]}),L=0;function R(){let[e,t]=(0,S.useState)(`idle`),[n,r]=(0,S.useState)(F),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),f=(0,S.useRef)(!1),p=(0,S.useRef)(!1),m=(0,S.useRef)(null),h=(0,S.useRef)(`idle`);h.current=e;let g=(0,S.useRef)(I());return(0,S.useEffect)(()=>()=>{u.current=!0},[]),(0,S.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=m.current;if(c&&c.mode===`count`){let t=E(c.total,1,C.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,E(c.durationS,1,C.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(!f.current){f.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...F,error:`Queue name is required.`}),t(`error`);return}try{await d.overview()}catch(e){r({...F,error:`Server unreachable — start it on the Server page first. (${j(e)})`}),t(`error`);return}let i=E(e.total,1,C.total),o=E(e.durationS,1,C.durationS)*1e3,c=E(e.batch,1,C.batch),f=E(e.producers,e.mode===`duration`?0:1,C.producers),_=E(e.payload,0,C.payload),v=E(e.workers,0,C.workers),y=E(e.workerBatch,1,C.workerBatch),b=E(e.processMs,0,C.processMs);u.current=!1,p.current=!1,m.current=e,l(e),g.current=I(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...F}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,w=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=O(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await d.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=j(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 d.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=j(e)}if(t.length>0){b>0&&await A(b,()=>!u.current);try{await d.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=j(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&p.current)break;await k(50)}}},M=Array.from({length:f},w),N=Array.from({length:v},T),P=Promise.all(M).then(()=>{p.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let R=g.current,z=performance.now()-R.startedAt,B=z/1e3||1,V=[...R.pushLat].sort((e,t)=>e-t),H={pushed:R.pushed,completed:R.completed,pushFailed:R.pushFailed,ackFailed:R.ackFailed,bytes:R.bytes,durationMs:z,pushPerSec:R.pushed/B,donePerSec:R.completed/B,mbPerSec:R.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:D(V,50),p95:D(V,95),p99:D(V,99),max:V.length?V[V.length-1]:0,error:R.error};a(H),r(e=>({...e,pushed:R.pushed,completed:R.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++L,at:Date.now(),mode:e.mode,producers:f,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{f.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(F),t(`idle`)},clearHistory:()=>s([])}}var z=[`count`,`duration`],B=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],V=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)}),H=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 U(){let[e,n]=(0,S.useState)(()=>V(w)),r=R(),{phase:x,live:D,summary:O,history:k}=r,A=x===`running`||x===`draining`||x===`stopping`,j=(e,t)=>n(n=>({...n,[e]:t})),F=e=>t=>j(e,t.target.value),I=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=B.includes(t)?String(r):r;return n}),[L,U]=(0,S.useState)(w.queue);(0,S.useEffect)(()=>{let t=setTimeout(()=>U(e.queue.trim()||w.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=f(()=>d.counts(L),[L],{intervalMs:1e3}),K=ee?.counts??null,[q,J]=(0,S.useState)(!1),[Y,X]=(0,S.useState)(null),ne=async()=>{let t=e.queue.trim();if(!(q||!t||!window.confirm(`Remove benchmark jobs from "${t}"?`))){J(!0),X(null);try{for(let e of[`waiting`,`completed`,`failed`,`delayed`])try{await d.clean(t,{state:e,limit:C.total})}catch{}X({remaining:(await d.counts(t).catch(()=>null))?.counts?.active??0})}finally{J(!1)}}},Z=r.runCfg??H(e),Q=E(Z.total,1,C.total),$=E(Z.workers,0,C.workers),re=Z.mode===`count`&&(A||O)?Math.min(100,D.pushed/Q*100):0,ie=Z.mode===`count`&&(A||O)?Math.min(100,D.completed/Q*100):0,ae=Z.mode===`duration`?Math.min(100,D.elapsedMs/(E(Z.durationS,1,C.durationS)*1e3)*100):0,oe=x===`running`?Z.mode===`duration`?`Running…`:`Producing…`:x===`draining`?`Draining…`:x===`stopping`?`Stopping…`:x===`error`?`Error`:O?`Result`:`Ready`,se=(x===`running`||x===`draining`)&&D.etaMs!=null?D.etaMs>0?`ETA ${m(D.etaMs)}`:`finishing…`:x===`stopped`?`stopped early`:x===`done`?`complete`:``;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(h,{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:x===`stopping`?(0,N.jsxs)(i,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,N.jsx)(s,{className:`size-3.5`}),` Stopping…`]}):A?(0,N.jsxs)(i,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,N.jsx)(s,{className:`size-3.5`}),` Stop`]}):(0,N.jsxs)(i,{variant:`success`,size:`sm`,onClick:()=>r.run(H(e)),children:[(0,N.jsx)(c,{className:`size-3.5`}),` Run benchmark`]})}),D.error&&(0,N.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:D.error}),(0,N.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(T).map(e=>(0,N.jsx)(`button`,{type:`button`,disabled:A,onClick:()=>I(T[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,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(o,{className:`lg:col-span-1`,children:[(0,N.jsx)(a,{title:`Configuration`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,N.jsx)(y,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,N.jsx)(_,{value:e.queue,disabled:A,onChange:e=>j(`queue`,e.target.value)})}),(0,N.jsx)(y,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,N.jsx)(g,{options:z,value:e.mode,onChange:e=>j(`mode`,e),disabled:A})}),e.mode===`count`?(0,N.jsx)(y,{label:`Total jobs`,hint:`max ${u(C.total)}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.total,value:e.total,disabled:A,onChange:F(`total`)})}):(0,N.jsx)(y,{label:`Duration (s)`,hint:`max ${C.durationS}s`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.durationS,value:e.durationS,disabled:A,onChange:F(`durationS`)})}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Producers`,hint:`parallel, max ${C.producers}`,children:(0,N.jsx)(_,{type:`number`,min:e.mode===`duration`?0:1,max:C.producers,value:e.producers,disabled:A,onChange:F(`producers`)})}),(0,N.jsx)(y,{label:`Push batch`,hint:`jobs/req, max ${C.batch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.batch,value:e.batch,disabled:A,onChange:F(`batch`)})}),(0,N.jsx)(y,{label:`Payload`,hint:`bytes/job, max ${u(C.payload)}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.payload,value:e.payload,disabled:A,onChange:F(`payload`)})})]}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Workers`,hint:`0 = produce only, max ${C.workers}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.workers,value:e.workers,disabled:A,onChange:F(`workers`)})}),(0,N.jsx)(y,{label:`Pull batch`,hint:`jobs/pull, max ${C.workerBatch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.workerBatch,value:e.workerBatch,disabled:A,onChange:F(`workerBatch`)})}),(0,N.jsx)(y,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.processMs,value:e.processMs,disabled:A,onChange:F(`processMs`)})})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.durable,onChange:e=>j(`durable`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.removeOnComplete,onChange:e=>j(`removeOnComplete`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,N.jsx)(i,{variant:`ghost`,size:`sm`,disabled:A||q,onClick:ne,children:q?`Cleaning…`:`Clean queue`}),Y&&(0,N.jsx)(`span`,{className:t(`text-xs`,Y.remaining>0?`text-warning`:`text-success`),children:Y.remaining>0?`Cleaned — ${u(Y.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`})]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,N.jsxs)(o,{children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:oe}),(0,N.jsx)(`span`,{className:`text-xs text-faint`,children:se})]}),(0,N.jsx)(W,{label:Z.mode===`duration`?`Elapsed`:`Produced`,pct:Z.mode===`duration`?ae:re,tone:`accent`}),$>0&&Z.mode===`count`&&(0,N.jsx)(W,{label:`Completed`,pct:ie,tone:`emerald`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,N.jsx)(l,{label:`Pushed`,value:u(D.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(D.completed),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Push/sec`,value:M(D.pushPerSec),compact:!0}),(0,N.jsx)(l,{label:`Done/sec`,value:M(D.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Elapsed`,value:m(D.elapsedMs),compact:!0}),(0,N.jsx)(l,{label:`Active workers`,value:`${D.activeWorkers}/${$}`,tone:`blue`,compact:!0}),(0,N.jsx)(l,{label:`Data`,value:p(O?.bytes??D.bytes),compact:!0}),(0,N.jsx)(l,{label:`Errors`,value:u((O?.pushFailed??D.pushFailed)+(O?.ackFailed??D.ackFailed)),tone:D.pushFailed+D.ackFailed?`red`:`default`,compact:!0})]})]}),(0,N.jsxs)(o,{children:[(0,N.jsx)(a,{title:`Throughput`}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,N.jsx)(b,{series:[{label:`Push/sec`,color:`#38bdf8`,points:D.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:D.doneSeries,area:!0}]}),(0,N.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,N.jsx)(G,{color:`#38bdf8`,label:`Push/sec`,value:D.pushPerSec}),(0,N.jsx)(G,{color:`#34d399`,label:`Done/sec`,value:D.donePerSec})]})]})]})]}),O&&(0,N.jsxs)(o,{className:`mt-6`,children:[(0,N.jsx)(a,{title:`Summary`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,N.jsx)(l,{label:`Pushed`,value:u(O.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(O.completed),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Duration`,value:m(O.durationMs),compact:!0}),(0,N.jsx)(l,{label:`Avg push/s`,value:M(O.pushPerSec),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Avg done/s`,value:M(O.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Data rate`,value:`${p(O.mbPerSec)}/s`,compact:!0}),(0,N.jsx)(l,{label:`Push p95`,value:m(O.p95),compact:!0}),(0,N.jsx)(l,{label:`Push p99`,value:m(O.p99),compact:!0})]}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,m(O.avg),` · p50 `,m(O.p50),` · p95`,` `,m(O.p95),` · p99 `,m(O.p99),` · max `,m(O.max),`.`,O.error?` First error: ${O.error}`:``]})]}),(0,N.jsxs)(o,{className:`mt-6`,children:[(0,N.jsx)(a,{title:`Server queue: ${L}`,action:te?(0,N.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),K?(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,N.jsx)(l,{label:`Waiting`,value:u(K.waiting??0),tone:`amber`,compact:!0}),(0,N.jsx)(l,{label:`Active`,value:u(K.active??0),tone:`blue`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(K.completed??0),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Failed`,value:u(K.failed??0),tone:K.failed?`red`:`default`,compact:!0}),(0,N.jsx)(l,{label:`Delayed`,value:u(K.delayed??0),compact:!0})]}):(0,N.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,N.jsx)(P,{history:k,onClear:r.clearHistory})]})}function W({label:e,pct:n,tone:r}){return(0,N.jsxs)(`div`,{className:`mb-2`,children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,N.jsx)(`span`,{children:e}),(0,N.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,N.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,N.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function G({color:e,label:t,value:n}){return(0,N.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,N.jsxs)(`span`,{className:`text-fg`,children:[M(n),`/s`]})]})}export{U as Benchmark};
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{m as n,t as r}from"./react-vendor-CHIHtdAC.js";import{D as i,E as a,T as o,U as s,W as c,_ as l,c as u,g as d,j as f,r as p,s as m,v as h}from"./index-C9fPU4bV.js";import{i as g,n as _,o as v,t as y}from"./form-PtDLk33Z.js";import{t as b}from"./AreaChart-DzUXW8u3.js";import{t as x}from"./CopyButton-XT7ykzf5.js";var S=e(n(),1),C={total:1e6,batch:5e3,producers:64,payload:65536,workers:64,workerBatch:1e3,processMs:6e4,durationS:600},w={queue:`benchmark`,mode:`count`,total:5e3,durationS:30,batch:100,producers:4,payload:128,workers:4,workerBatch:100,processMs:5,durable:!1,removeOnComplete:!0},T={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}},E=(e,t,n)=>Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t,D=(e,t)=>e.length?e[Math.min(e.length-1,Math.floor(t/100*e.length))]:0,O=(e,t,n,r,i)=>Array.from({length:t},(t,a)=>({data:{i:e+a,blob:n},durable:r,removeOnComplete:i})),k=e=>new Promise(t=>setTimeout(t,e)),A=async(e,t)=>{let n=performance.now()+e;for(;t()&&performance.now()<n;)await k(Math.min(100,Math.max(0,n-performance.now())))},j=e=>e instanceof Error?e.message:String(e),M=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:`${Math.round(e)}`,N=r();function P({history:e,onClear:t}){if(!e.length)return null;let n=JSON.stringify(e,null,2);return(0,N.jsxs)(o,{padded:!1,className:`mt-6 overflow-hidden`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:`Run history`}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(x,{value:n}),(0,N.jsx)(i,{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,N.jsx)(i,{size:`sm`,variant:`ghost`,onClick:t,children:`Clear`})]})]}),(0,N.jsx)(`div`,{className:`overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,N.jsx)(`th`,{className:`px-5 py-2 font-medium`,children:`Mode`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Prod`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Wkr`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Pushed`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Push/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Done/s`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`p95`}),(0,N.jsx)(`th`,{className:`px-5 py-2 text-right font-medium`,children:`Dur`})]})}),(0,N.jsx)(`tbody`,{children:e.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,N.jsx)(`td`,{className:`px-5 py-2 capitalize text-muted`,children:e.mode}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.producers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:e.workers}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-fg`,children:u(e.pushed)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:u(e.completed)}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-accent`,children:[M(e.pushPerSec),`/s`]}),(0,N.jsxs)(`td`,{className:`px-5 py-2 text-right tnum text-success`,children:[M(e.donePerSec),`/s`]}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:m(e.p95)}),(0,N.jsx)(`td`,{className:`px-5 py-2 text-right tnum text-muted`,children:m(e.durationMs)})]},e.id))})]})})]})}var F={pushed:0,completed:0,pushFailed:0,ackFailed:0,bytes:0,elapsedMs:0,pushPerSec:0,donePerSec:0,activeWorkers:0,pushSeries:[],doneSeries:[],etaMs:null,error:null},I=()=>({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:[]}),L=0;function R(){let[e,t]=(0,S.useState)(`idle`),[n,r]=(0,S.useState)(F),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(!1),f=(0,S.useRef)(!1),p=(0,S.useRef)(!1),m=(0,S.useRef)(null),h=(0,S.useRef)(`idle`);h.current=e;let g=(0,S.useRef)(I());return(0,S.useEffect)(()=>()=>{u.current=!0},[]),(0,S.useEffect)(()=>{if(e!==`running`&&e!==`draining`)return;let t=setInterval(()=>{let e=g.current,t=performance.now(),n=t-e.startedAt,i=(t-e.lastAt)/1e3,a=i>0?Math.max(0,(e.pushed-e.lastPushed)/i):0,o=i>0?Math.max(0,(e.completed-e.lastDone)/i):0;e.lastAt=t,e.lastPushed=e.pushed,e.lastDone=e.completed,e.pushSeries=[...e.pushSeries,a].slice(-60),e.doneSeries=[...e.doneSeries,o].slice(-60);let s=null,c=m.current;if(c&&c.mode===`count`){let t=E(c.total,1,C.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,E(c.durationS,1,C.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(!f.current){f.current=!0;try{a(null);let n=e.queue.trim();if(!n){r({...F,error:`Queue name is required.`}),t(`error`);return}try{await d.overview()}catch(e){r({...F,error:`Server unreachable — start it on the Server page first. (${j(e)})`}),t(`error`);return}let i=E(e.total,1,C.total),o=E(e.durationS,1,C.durationS)*1e3,c=E(e.batch,1,C.batch),f=E(e.producers,e.mode===`duration`?0:1,C.producers),_=E(e.payload,0,C.payload),v=E(e.workers,0,C.workers),y=E(e.workerBatch,1,C.workerBatch),b=E(e.processMs,0,C.processMs);u.current=!1,p.current=!1,m.current=e,l(e),g.current=I(),g.current.startedAt=performance.now(),g.current.lastAt=performance.now(),r({...F}),t(`running`);let x=`x`.repeat(_),S=performance.now()+o,w=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=O(r,t,x,e.durable,e.removeOnComplete),o=performance.now();try{await d.addJobsBulk(n,a),g.current.pushed+=t,g.current.bytes+=t*_}catch(e){g.current.pushFailed+=t,g.current.error??=j(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 d.pullBatch(n,y)).jobs??[]}catch(e){g.current.error??=j(e)}if(t.length>0){b>0&&await A(b,()=>!u.current);try{await d.ackBatch(t.map(e=>e.id)),g.current.completed+=t.length}catch(e){g.current.ackFailed+=t.length,g.current.error??=j(e)}}}finally{g.current.activeWorkers--}if(t.length===0){if(e.mode===`count`&&p.current)break;await k(50)}}},M=Array.from({length:f},w),N=Array.from({length:v},T),P=Promise.all(M).then(()=>{p.current=!0,!u.current&&e.mode===`count`&&v>0&&h.current===`running`&&t(`draining`)});await Promise.all([P,...N]);let R=g.current,z=performance.now()-R.startedAt,B=z/1e3||1,V=[...R.pushLat].sort((e,t)=>e-t),H={pushed:R.pushed,completed:R.completed,pushFailed:R.pushFailed,ackFailed:R.ackFailed,bytes:R.bytes,durationMs:z,pushPerSec:R.pushed/B,donePerSec:R.completed/B,mbPerSec:R.bytes/B,avg:V.length?V.reduce((e,t)=>e+t,0)/V.length:0,p50:D(V,50),p95:D(V,95),p99:D(V,99),max:V.length?V[V.length-1]:0,error:R.error};a(H),r(e=>({...e,pushed:R.pushed,completed:R.completed,elapsedMs:z,pushPerSec:0,donePerSec:0,activeWorkers:0,etaMs:0})),s(t=>[{...H,id:++L,at:Date.now(),mode:e.mode,producers:f,workers:v},...t].slice(0,12)),t(u.current?`stopped`:`done`)}finally{f.current=!1}}},stop:()=>{u.current=!0,(h.current===`running`||h.current===`draining`)&&t(`stopping`)},reset:()=>{u.current=!0,a(null),r(F),t(`idle`)},clearHistory:()=>s([])}}var z=[`count`,`duration`],B=[`total`,`durationS`,`batch`,`producers`,`payload`,`workers`,`workerBatch`,`processMs`],V=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)}),H=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 U(){let[e,n]=(0,S.useState)(()=>V(w)),r=R(),{phase:x,live:D,summary:O,history:k}=r,A=x===`running`||x===`draining`||x===`stopping`,j=(e,t)=>n(n=>({...n,[e]:t})),F=e=>t=>j(e,t.target.value),I=e=>n(t=>{let n={...t};for(let[t,r]of Object.entries(e))n[t]=B.includes(t)?String(r):r;return n}),[L,U]=(0,S.useState)(w.queue);(0,S.useEffect)(()=>{let t=setTimeout(()=>U(e.queue.trim()||w.queue),400);return()=>clearTimeout(t)},[e.queue]);let{data:ee,error:te}=f(()=>d.counts(L),[L],{intervalMs:1e3}),K=ee?.counts??null,[q,J]=(0,S.useState)(!1),[Y,X]=(0,S.useState)(null),ne=async()=>{let t=e.queue.trim();if(!(q||!t||!window.confirm(`Remove benchmark jobs from "${t}"?`))){J(!0),X(null);try{for(let e of[`waiting`,`completed`,`failed`,`delayed`])try{await d.clean(t,{state:e,limit:C.total})}catch{}X({remaining:(await d.counts(t).catch(()=>null))?.counts?.active??0})}finally{J(!1)}}},Z=r.runCfg??H(e),Q=E(Z.total,1,C.total),$=E(Z.workers,0,C.workers),re=Z.mode===`count`&&(A||O)?Math.min(100,D.pushed/Q*100):0,ie=Z.mode===`count`&&(A||O)?Math.min(100,D.completed/Q*100):0,ae=Z.mode===`duration`?Math.min(100,D.elapsedMs/(E(Z.durationS,1,C.durationS)*1e3)*100):0,oe=x===`running`?Z.mode===`duration`?`Running…`:`Producing…`:x===`draining`?`Draining…`:x===`stopping`?`Stopping…`:x===`error`?`Error`:O?`Result`:`Ready`,se=(x===`running`||x===`draining`)&&D.etaMs!=null?D.etaMs>0?`ETA ${m(D.etaMs)}`:`finishing…`:x===`stopped`?`stopped early`:x===`done`?`complete`:``;return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(h,{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:x===`stopping`?(0,N.jsxs)(i,{variant:`warning`,size:`sm`,disabled:!0,children:[(0,N.jsx)(s,{className:`size-3.5`}),` Stopping…`]}):A?(0,N.jsxs)(i,{variant:`warning`,size:`sm`,onClick:r.stop,children:[(0,N.jsx)(s,{className:`size-3.5`}),` Stop`]}):(0,N.jsxs)(i,{variant:`success`,size:`sm`,onClick:()=>r.run(H(e)),children:[(0,N.jsx)(c,{className:`size-3.5`}),` Run benchmark`]})}),D.error&&(0,N.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:D.error}),(0,N.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-faint`,children:`Presets`}),Object.keys(T).map(e=>(0,N.jsx)(`button`,{type:`button`,disabled:A,onClick:()=>I(T[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,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(o,{className:`lg:col-span-1`,children:[(0,N.jsx)(a,{title:`Configuration`}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,N.jsx)(y,{label:`Queue`,hint:`Jobs are enqueued here (created on first push).`,children:(0,N.jsx)(_,{value:e.queue,disabled:A,onChange:e=>j(`queue`,e.target.value)})}),(0,N.jsx)(y,{label:`Mode`,hint:e.mode===`count`?`Push a fixed number of jobs.`:`Run producers + workers for a fixed time.`,children:(0,N.jsx)(g,{options:z,value:e.mode,onChange:e=>j(`mode`,e),disabled:A})}),e.mode===`count`?(0,N.jsx)(y,{label:`Total jobs`,hint:`max ${u(C.total)}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.total,value:e.total,disabled:A,onChange:F(`total`)})}):(0,N.jsx)(y,{label:`Duration (s)`,hint:`max ${C.durationS}s`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.durationS,value:e.durationS,disabled:A,onChange:F(`durationS`)})}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Producers`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Producers`,hint:`parallel, max ${C.producers}`,children:(0,N.jsx)(_,{type:`number`,min:e.mode===`duration`?0:1,max:C.producers,value:e.producers,disabled:A,onChange:F(`producers`)})}),(0,N.jsx)(y,{label:`Push batch`,hint:`jobs/req, max ${C.batch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.batch,value:e.batch,disabled:A,onChange:F(`batch`)})}),(0,N.jsx)(y,{label:`Payload`,hint:`bytes/job, max ${u(C.payload)}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.payload,value:e.payload,disabled:A,onChange:F(`payload`)})})]}),(0,N.jsx)(`div`,{className:`mt-1 text-[11px] font-semibold uppercase tracking-wider text-faint`,children:`Workers (simulated)`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,N.jsx)(y,{label:`Workers`,hint:`0 = produce only, max ${C.workers}`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.workers,value:e.workers,disabled:A,onChange:F(`workers`)})}),(0,N.jsx)(y,{label:`Pull batch`,hint:`jobs/pull, max ${C.workerBatch}`,children:(0,N.jsx)(_,{type:`number`,min:1,max:C.workerBatch,value:e.workerBatch,disabled:A,onChange:F(`workerBatch`)})}),(0,N.jsx)(y,{label:`Process (ms)`,hint:`simulated work per pull`,children:(0,N.jsx)(_,{type:`number`,min:0,max:C.processMs,value:e.processMs,disabled:A,onChange:F(`processMs`)})})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.durable,onChange:e=>j(`durable`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Durable (fsync each job)`})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2`,children:[(0,N.jsx)(v,{checked:e.removeOnComplete,onChange:e=>j(`removeOnComplete`,e),disabled:A}),(0,N.jsx)(`span`,{className:`text-sm text-muted`,children:`Remove on complete`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[(0,N.jsx)(i,{variant:`ghost`,size:`sm`,disabled:A||q,onClick:ne,children:q?`Cleaning…`:`Clean queue`}),Y&&(0,N.jsx)(`span`,{className:t(`text-xs`,Y.remaining>0?`text-warning`:`text-success`),children:Y.remaining>0?`Cleaned — ${u(Y.remaining)} active job(s) remain (requeued after the stall timeout)`:`Cleaned — 0 jobs remain`})]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 lg:col-span-2`,children:[(0,N.jsxs)(o,{children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:oe}),(0,N.jsx)(`span`,{className:`text-xs text-faint`,children:se})]}),(0,N.jsx)(W,{label:Z.mode===`duration`?`Elapsed`:`Produced`,pct:Z.mode===`duration`?ae:re,tone:`accent`}),$>0&&Z.mode===`count`&&(0,N.jsx)(W,{label:`Completed`,pct:ie,tone:`emerald`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,N.jsx)(l,{label:`Pushed`,value:u(D.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(D.completed),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Push/sec`,value:M(D.pushPerSec),compact:!0}),(0,N.jsx)(l,{label:`Done/sec`,value:M(D.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Elapsed`,value:m(D.elapsedMs),compact:!0}),(0,N.jsx)(l,{label:`Active workers`,value:`${D.activeWorkers}/${$}`,tone:`blue`,compact:!0}),(0,N.jsx)(l,{label:`Data`,value:p(O?.bytes??D.bytes),compact:!0}),(0,N.jsx)(l,{label:`Errors`,value:u((O?.pushFailed??D.pushFailed)+(O?.ackFailed??D.ackFailed)),tone:D.pushFailed+D.ackFailed?`red`:`default`,compact:!0})]})]}),(0,N.jsxs)(o,{children:[(0,N.jsx)(a,{title:`Throughput`}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Enqueue (client → server) vs completion (workers) per second`}),(0,N.jsx)(b,{series:[{label:`Push/sec`,color:`#38bdf8`,points:D.pushSeries,area:!0},{label:`Done/sec`,color:`#34d399`,points:D.doneSeries,area:!0}]}),(0,N.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 font-mono text-[11px] text-faint`,children:[(0,N.jsx)(G,{color:`#38bdf8`,label:`Push/sec`,value:D.pushPerSec}),(0,N.jsx)(G,{color:`#34d399`,label:`Done/sec`,value:D.donePerSec})]})]})]})]}),O&&(0,N.jsxs)(o,{className:`mt-6`,children:[(0,N.jsx)(a,{title:`Summary`}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-4 xl:grid-cols-8`,children:[(0,N.jsx)(l,{label:`Pushed`,value:u(O.pushed),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(O.completed),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Duration`,value:m(O.durationMs),compact:!0}),(0,N.jsx)(l,{label:`Avg push/s`,value:M(O.pushPerSec),tone:`accent`,compact:!0}),(0,N.jsx)(l,{label:`Avg done/s`,value:M(O.donePerSec),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Data rate`,value:`${p(O.mbPerSec)}/s`,compact:!0}),(0,N.jsx)(l,{label:`Push p95`,value:m(O.p95),compact:!0}),(0,N.jsx)(l,{label:`Push p99`,value:m(O.p99),compact:!0})]}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-faint`,children:[`Push-batch latency avg `,m(O.avg),` · p50 `,m(O.p50),` · p95`,` `,m(O.p95),` · p99 `,m(O.p99),` · max `,m(O.max),`.`,O.error?` First error: ${O.error}`:``]})]}),(0,N.jsxs)(o,{className:`mt-6`,children:[(0,N.jsx)(a,{title:`Server queue: ${L}`,action:te?(0,N.jsx)(`span`,{className:`text-xs font-medium text-warning`,children:`stale — server unreachable`}):void 0}),(0,N.jsx)(`p`,{className:`-mt-3 mb-4 text-xs text-faint`,children:`Live counts from the server (poll 1s).`}),K?(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,N.jsx)(l,{label:`Waiting`,value:u(K.waiting??0),tone:`amber`,compact:!0}),(0,N.jsx)(l,{label:`Active`,value:u(K.active??0),tone:`blue`,compact:!0}),(0,N.jsx)(l,{label:`Completed`,value:u(K.completed??0),tone:`green`,compact:!0}),(0,N.jsx)(l,{label:`Failed`,value:u(K.failed??0),tone:K.failed?`red`:`default`,compact:!0}),(0,N.jsx)(l,{label:`Delayed`,value:u(K.delayed??0),compact:!0})]}):(0,N.jsx)(`p`,{className:`text-sm text-faint`,children:`No counts yet — waiting for the server to answer for this queue.`})]}),(0,N.jsx)(P,{history:k,onClear:r.clearHistory})]})}function W({label:e,pct:n,tone:r}){return(0,N.jsxs)(`div`,{className:`mb-2`,children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] text-faint`,children:[(0,N.jsx)(`span`,{children:e}),(0,N.jsxs)(`span`,{className:`tnum`,children:[n.toFixed(0),`%`]})]}),(0,N.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,N.jsx)(`div`,{className:t(`h-full rounded-full transition-all`,r===`accent`?`bg-accent`:`bg-emerald-500`),style:{width:`${n}%`}})})]})}function G({color:e,label:t,value:n}){return(0,N.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:e}}),t,` `,(0,N.jsxs)(`span`,{className:`text-fg`,children:[M(n),`/s`]})]})}export{U as Benchmark};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./cn-CMFYpumL.js";import{m as r,t as i}from"./react-vendor-CHIHtdAC.js";import{g as a,k as o}from"./index-
|
|
1
|
+
import{n as e,r as t,t as n}from"./cn-CMFYpumL.js";import{m as r,t as i}from"./react-vendor-CHIHtdAC.js";import{g as a,k as o}from"./index-C9fPU4bV.js";import{a as s,n as c,t as l}from"./form-PtDLk33Z.js";var u=t(r(),1),d=`vercel.ai.error`,f=Symbol.for(d),p,m,h=class e extends (m=Error,p=f,m){constructor({name:e,message:t,cause:n}){super(t),this[p]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,d)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},g=`AI_APICallError`,_=`vercel.ai.error.${g}`,v=Symbol.for(_),y,b,x=class extends (b=h,y=v,b){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:o,isRetryable:s=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:g,message:e,cause:o}),this[y]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return h.hasMarker(e,_)}},S=`AI_EmptyResponseBodyError`,ee=`vercel.ai.error.${S}`,te=Symbol.for(ee),ne,re,ie=class extends (re=h,ne=te,re){constructor({message:e=`Empty response body`}={}){super({name:S,message:e}),this[ne]=!0}static isInstance(e){return h.hasMarker(e,ee)}};function ae(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var oe=`AI_InvalidArgumentError`,se=`vercel.ai.error.${oe}`,C=Symbol.for(se),ce,le,ue=class extends (le=h,ce=C,le){constructor({message:e,cause:t,argument:n}){super({name:oe,message:e,cause:t}),this[ce]=!0,this.argument=n}static isInstance(e){return h.hasMarker(e,se)}},de=`AI_InvalidPromptError`,fe=`vercel.ai.error.${de}`,pe=Symbol.for(fe),me,he,ge=class extends (he=h,me=pe,he){constructor({prompt:e,message:t,cause:n}){super({name:de,message:`Invalid prompt: ${t}`,cause:n}),this[me]=!0,this.prompt=e}static isInstance(e){return h.hasMarker(e,fe)}},_e=`AI_InvalidResponseDataError`,ve=`vercel.ai.error.${_e}`,ye=Symbol.for(ve),be,xe,Se=class extends (xe=h,be=ye,xe){constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:_e,message:t}),this[be]=!0,this.data=e}static isInstance(e){return h.hasMarker(e,ve)}},Ce=`AI_JSONParseError`,we=`vercel.ai.error.${Ce}`,Te=Symbol.for(we),Ee,De,Oe=class extends (De=h,Ee=Te,De){constructor({text:e,cause:t}){super({name:Ce,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${ae(t)}`,cause:t}),this[Ee]=!0,this.text=e}static isInstance(e){return h.hasMarker(e,we)}},ke=`AI_LoadAPIKeyError`,Ae=`vercel.ai.error.${ke}`,je=Symbol.for(Ae),Me,Ne,Pe=class extends (Ne=h,Me=je,Ne){constructor({message:e}){super({name:ke,message:e}),this[Me]=!0}static isInstance(e){return h.hasMarker(e,Ae)}},Fe=`AI_NoSuchModelError`,Ie=`vercel.ai.error.${Fe}`,Le=Symbol.for(Ie),Re,ze,Be=class extends (ze=h,Re=Le,ze){constructor({errorName:e=Fe,modelId:t,modelType:n,message:r=`No such ${n}: ${t}`}){super({name:e,message:r}),this[Re]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return h.hasMarker(e,Ie)}},Ve=`AI_NoSuchProviderReferenceError`,He=`vercel.ai.error.${Ve}`,Ue=Symbol.for(He),We,Ge,Ke=class extends (Ge=h,We=Ue,Ge){constructor({provider:e,reference:t,message:n=`No provider reference found for provider '${e}'. Available providers: ${Object.keys(t).join(`, `)}`}){super({name:Ve,message:n}),this[We]=!0,this.provider=e,this.reference=t}static isInstance(e){return h.hasMarker(e,He)}},qe=`AI_TooManyEmbeddingValuesForCallError`,Je=`vercel.ai.error.${qe}`,Ye=Symbol.for(Je),Xe,Ze,Qe=class extends (Ze=h,Xe=Ye,Ze){constructor(e){super({name:qe,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Xe]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return h.hasMarker(e,Je)}},$e=`AI_TypeValidationError`,et=`vercel.ai.error.${$e}`,tt=Symbol.for(et),nt,rt,it=class e extends (rt=h,nt=tt,rt){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:$e,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${ae(t)}`,cause:t}),this[nt]=!0,this.value=e,this.context=n}static isInstance(e){return h.hasMarker(e,et)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},at=`AI_UnsupportedFunctionalityError`,ot=`vercel.ai.error.${at}`,st=Symbol.for(ot),ct,lt,w=class extends (lt=h,ct=st,lt){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:at,message:t}),this[ct]=!0,this.functionality=e}static isInstance(e){return h.hasMarker(e,ot)}},ut;function T(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var dt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ft=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ut=globalThis).__zod_globalConfig??(ut.__zod_globalConfig={});var pt=globalThis.__zod_globalConfig;function mt(e){return e&&Object.assign(pt,e),pt}function ht(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function gt(e,t){return typeof t==`bigint`?t.toString():t}function _t(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function vt(e){return e==null}function yt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function bt(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var xt=Symbol(`evaluating`);function St(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==xt)return r===void 0&&(r=xt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ct(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wt(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Tt(e){return JSON.stringify(e)}function Et(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Dt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ot(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var kt=_t(()=>{if(pt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function At(e){if(Ot(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Ot(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function jt(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Mt=new Set([`string`,`number`,`symbol`]);function Nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Pt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function E(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ft(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var It={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Lt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Pt(e,wt(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ct(this,`shape`,e),e},checks:[]}))}function Rt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Pt(e,wt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ct(this,`shape`,r),r},checks:[]}))}function zt(e,t){if(!At(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Pt(e,wt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ct(this,`shape`,n),n}}))}function Bt(e,t){if(!At(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Pt(e,wt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ct(this,`shape`,n),n}}))}function Vt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Pt(e,wt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ct(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ht(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Pt(t,wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ct(this,`shape`,i),i},checks:[]}))}function Ut(e,t,n){return Pt(t,wt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ct(this,`shape`,i),i}}))}function Wt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Gt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Kt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function qt(e){return typeof e==`string`?e:e?.message}function Jt(e,t,n){let r=e.message?e.message:qt(e.inst?._zod.def?.error?.(e))??qt(t?.error?.(e))??qt(n.customError?.(e))??qt(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Yt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Xt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Zt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Qt=T(`$ZodError`,Zt),$t=T(`$ZodError`,Zt,{Parent:Error});function en(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function tn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var nn=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new dt;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Jt(e,a,mt())));throw Dt(t,i?.callee),t}return o.value},rn=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Jt(e,a,mt())));throw Dt(t,i?.callee),t}return o.value},an=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new dt;return a.issues.length?{success:!1,error:new(e??Qt)(a.issues.map(e=>Jt(e,i,mt())))}:{success:!0,data:a.value}},on=an($t),sn=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Jt(e,i,mt())))}:{success:!0,data:a.value}},cn=sn($t),ln=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return nn(e)(t,n,i)},un=e=>(t,n,r)=>nn(e)(t,n,r),dn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rn(e)(t,n,i)},fn=e=>async(t,n,r)=>rn(e)(t,n,r),pn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return an(e)(t,n,i)},mn=e=>(t,n,r)=>an(e)(t,n,r),hn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return sn(e)(t,n,i)},gn=e=>async(t,n,r)=>sn(e)(t,n,r),_n=/^[cC][0-9a-z]{6,}$/,vn=/^[0-9a-z]+$/,yn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bn=/^[0-9a-vA-V]{20}$/,xn=/^[A-Za-z0-9]{27}$/,Sn=/^[a-zA-Z0-9_-]{21}$/,Cn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Tn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,En=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function On(){return new RegExp(Dn,`u`)}var kn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,An=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pn=/^[A-Za-z0-9_-]*$/,Fn=/^https?$/,In=/^\+[1-9]\d{6,14}$/,Ln=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Rn=RegExp(`^${Ln}$`);function zn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bn(e){return RegExp(`^${zn(e)}$`)}function Vn(e){let t=zn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Ln}T(?:${r})$`)}var Hn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Un=/^-?\d+$/,Wn=/^-?\d+(?:\.\d+)?$/,Gn=/^(?:true|false)$/i,Kn=/^null$/i,qn=/^[^A-Z]*$/,Jn=/^[^a-z]*$/,Yn=T(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Xn={number:`number`,bigint:`bigint`,object:`date`},Zn=T(`$ZodCheckLessThan`,(e,t)=>{Yn.init(e,t);let n=Xn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qn=T(`$ZodCheckGreaterThan`,(e,t)=>{Yn.init(e,t);let n=Xn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$n=T(`$ZodCheckMultipleOf`,(e,t)=>{Yn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):bt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),er=T(`$ZodCheckNumberFormat`,(e,t)=>{Yn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=It[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Un)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),tr=T(`$ZodCheckMaxLength`,(e,t)=>{var n;Yn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!vt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Yt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nr=T(`$ZodCheckMinLength`,(e,t)=>{var n;Yn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!vt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Yt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rr=T(`$ZodCheckLengthEquals`,(e,t)=>{var n;Yn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!vt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Yt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ir=T(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Yn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ar=T(`$ZodCheckRegex`,(e,t)=>{ir.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),or=T(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=qn,ir.init(e,t)}),sr=T(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Jn,ir.init(e,t)}),cr=T(`$ZodCheckIncludes`,(e,t)=>{Yn.init(e,t);let n=Nt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),lr=T(`$ZodCheckStartsWith`,(e,t)=>{Yn.init(e,t);let n=RegExp(`^${Nt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ur=T(`$ZodCheckEndsWith`,(e,t)=>{Yn.init(e,t);let n=RegExp(`.*${Nt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),dr=T(`$ZodCheckOverwrite`,(e,t)=>{Yn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),fr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
4
4
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./cn-CMFYpumL.js";import{m as n,t as r}from"./react-vendor-CHIHtdAC.js";import{I as i,L as a,P as o}from"./index-
|
|
1
|
+
import{r as e,t}from"./cn-CMFYpumL.js";import{m as n,t as r}from"./react-vendor-CHIHtdAC.js";import{I as i,L as a,P as o}from"./index-C9fPU4bV.js";var s=e(n(),1),c=r();function l(e){try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return t.remove(),n}catch{return!1}}function u({value:e,className:n}){let[r,u]=(0,s.useState)(`idle`),d=(0,s.useRef)(null);return(0,s.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),(0,c.jsx)(`button`,{type:`button`,onClick:async()=>{let t=!1;if(navigator.clipboard)try{await navigator.clipboard.writeText(e),t=!0}catch{}t||=l(e),u(t?`copied`:`failed`),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>u(`idle`),1500)},"aria-label":`Copy to clipboard`,title:r===`failed`?`Copy failed`:`Copy to clipboard`,className:t(`inline-flex size-6 shrink-0 items-center justify-center rounded-md text-faint transition-colors hover:bg-surface-2 hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,n),children:r===`copied`?(0,c.jsx)(o,{className:`size-3.5 text-success`}):r===`failed`?(0,c.jsx)(i,{className:`size-3.5 text-danger`}):(0,c.jsx)(a,{className:`size-3.5`})})}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./cn-CMFYpumL.js";import{m as t,t as n}from"./react-vendor-CHIHtdAC.js";import{C as r,M as i,O as a,R as o,S as s,Y as c,a as l,c as u,j as d,v as f,w as p}from"./index-
|
|
1
|
+
import{r as e}from"./cn-CMFYpumL.js";import{m as t,t as n}from"./react-vendor-CHIHtdAC.js";import{C as r,M as i,O as a,R as o,S as s,Y as c,a as l,c as u,j as d,v as f,w as p}from"./index-C9fPU4bV.js";import{t as m}from"./Pagination-Cd6lHj2E.js";var h=e(t(),1),g=n();function _(){let{data:e,error:t,loading:n,refetch:_}=d(()=>i.crons(),[]),v=(e?.crons??[]).slice(),[y,b]=(0,h.useState)(0),x=Math.max(1,Math.ceil(v.length/15)),S=Math.min(y,x-1),C=async e=>{if(window.confirm(`Delete cron "${e}"?`))try{await i.deleteCron(e),_()}catch{}};return(0,g.jsxs)(`div`,{children:[t&&(0,g.jsx)(p,{onRetry:_}),(0,g.jsx)(f,{title:`Cron Jobs`,description:`${v.length} scheduled`,live:!0}),n&&!e&&!t?(0,g.jsx)(r,{label:`Loading cron jobs…`}):v.length===0?(0,g.jsx)(s,{icon:(0,g.jsx)(o,{}),title:`No scheduled jobs`,hint:`Repeatable jobs created with upsertJobScheduler appear here.`}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,g.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,g.jsx)(`thead`,{children:(0,g.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,g.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Name`}),(0,g.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),(0,g.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Schedule`}),(0,g.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Next Run`}),(0,g.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Runs`}),(0,g.jsx)(`th`,{className:`w-12 px-5 py-3`})]})}),(0,g.jsx)(`tbody`,{children:v.slice(S*15,S*15+15).map(e=>(0,g.jsxs)(`tr`,{className:`border-b border-line last:border-0 hover:bg-surface-2/40`,children:[(0,g.jsx)(`td`,{className:`px-5 py-3 font-medium text-fg`,children:e.name}),(0,g.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.queue??`—`}),(0,g.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.schedule??(e.repeatEvery?`every ${e.repeatEvery}ms`:`—`)}),(0,g.jsx)(`td`,{className:`px-5 py-3 text-faint`,children:l(e.nextRun)}),(0,g.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:u(e.executions??0)}),(0,g.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,g.jsx)(a,{"aria-label":`Delete cron`,onClick:()=>C(e.name),children:(0,g.jsx)(c,{className:`size-3.5`})})})]},e.name))})]})}),(0,g.jsx)(m,{page:S,pageSize:15,total:v.length,onPageChange:b,label:`crons`})]})]})}export{_ as Cron};
|