bunqueue-dashboard 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/agent/manager/storageMode.ts +19 -0
- package/agent/manager.ts +5 -1
- package/agent/server/controlStatus.ts +5 -0
- package/dist/.vite/manifest.json +206 -189
- package/dist/assets/{AddJob-DkbI_J5p.js → AddJob-CFnESFEU.js} +1 -1
- package/dist/assets/{Alerts-CFj-u0iV.js → Alerts-CYwfGLSQ.js} +1 -1
- package/dist/assets/{Benchmark-Ey2sq57q.js → Benchmark-BINaJvak.js} +1 -1
- package/dist/assets/{BulkAddJobs-BwPoeSB6.js → BulkAddJobs-vyGFvlO3.js} +1 -1
- package/dist/assets/{CopilotPanel-CniuIIPn.js → CopilotPanel-DjHfX9ta.js} +1 -1
- package/dist/assets/{Cron-B5XFBvU-.js → Cron-CSoEPVeq.js} +1 -1
- package/dist/assets/{CronManager-Bdg2BECM.js → CronManager-s4xjNhGD.js} +1 -1
- package/dist/assets/Database-x6iWCu3-.js +3 -0
- package/dist/assets/{Diagnostics-BDRftXQy.js → Diagnostics-DFshXeHl.js} +1 -1
- package/dist/assets/{Dlq-CJO9itzJ.js → Dlq-Cayt1PEN.js} +1 -1
- package/dist/assets/{DlqControl-DZL2lHOU.js → DlqControl-BBQc6uu9.js} +1 -1
- package/dist/assets/DlqPro-BmrnGQ-3.js +1 -0
- package/dist/assets/Fleet-Bdrj9bLI.js +1 -0
- package/dist/assets/{Flows-BItJzbVQ.js → Flows-CcNdf_jS.js} +1 -1
- package/dist/assets/{JobInspector-CJHX63p_.js → JobInspector-BMjVR96H.js} +1 -1
- package/dist/assets/{Jobs-BwmTsjJx.js → Jobs-NN0fJ3BQ.js} +1 -1
- package/dist/assets/{JobsPro-eFVAZJ10.js → JobsPro-D_l1c80Q.js} +1 -1
- package/dist/assets/{Logs-CXIf58M4.js → Logs-BGeTppXO.js} +1 -1
- package/dist/assets/{LogsPro-Xm6rylAd.js → LogsPro-D7vvgZmb.js} +1 -1
- package/dist/assets/{McpServer-Rf3i6lRn.js → McpServer-AsaFGnYZ.js} +1 -1
- package/dist/assets/{Metrics-Cj3VYxzL.js → Metrics-CvoY4uhX.js} +1 -1
- package/dist/assets/{MetricsPro-C63eY00A.js → MetricsPro-C01FjqvR.js} +1 -1
- package/dist/assets/{Overview-CUM3XG7A.js → Overview-WStfS5ee.js} +1 -1
- package/dist/assets/{QueueActions-b19K0vCT.js → QueueActions-D51CYOjo.js} +1 -1
- package/dist/assets/{QueueControl-DusMoa05.js → QueueControl-Ce-O1L4p.js} +1 -1
- package/dist/assets/{QueueDetail-CpFIG1PU.js → QueueDetail-D5TKm4bv.js} +1 -1
- package/dist/assets/{QueueDetailPro-BNlBOj5s.js → QueueDetailPro-CFNQcKho.js} +1 -1
- package/dist/assets/{Queues-CZ2qc7FY.js → Queues-DlznHsfh.js} +1 -1
- package/dist/assets/QueuesOverview-DGtapyV0.js +1 -0
- package/dist/assets/{S3Backup-x4mOV-AO.js → S3Backup-CxwbLJGK.js} +1 -1
- package/dist/assets/{S3BackupPro-BtvbPVg-.js → S3BackupPro-8y0J0-3_.js} +2 -2
- package/dist/assets/{ServerControl-C5nQ7CCp.js → ServerControl-DpE7t-OF.js} +2 -2
- package/dist/assets/Settings-Bw5MtDTF.js +1 -0
- package/dist/assets/{Usage-UYovs3D-.js → Usage-DpShi3FE.js} +1 -1
- package/dist/assets/{UsagePro-bT82DS-d.js → UsagePro-D4cGbozz.js} +1 -1
- package/dist/assets/{Webhooks-BjsUMJAn.js → Webhooks-UYiTg6hn.js} +1 -1
- package/dist/assets/{Workers-CD4YZpca.js → Workers-D70B_uAI.js} +1 -1
- package/dist/assets/{WorkersPro-hCPhfb1Z.js → WorkersPro-YycNhm9w.js} +1 -1
- package/dist/assets/Workflows-BxlrgGEB.js +1 -0
- package/dist/assets/{api-BxYPEynh.js → api-BAGaBh6R.js} +1 -1
- package/dist/assets/bq-Qh0VFLKV.js +1 -0
- package/dist/assets/connectionStore-BJLihGaC.js +1 -0
- package/dist/assets/controlConnectionEpoch-CZsS0wAb.js +1 -0
- package/dist/assets/index-ByvrmBif.js +8 -0
- package/dist/assets/index-CxhXRVH_.css +1 -0
- package/dist/assets/{toastStore-B31o6Z5J.js → toastStore-IZn6OPLZ.js} +1 -1
- package/dist/assets/{useControlActionGuard-DT7uudrj.js → useControlActionGuard-B-bzKZKI.js} +1 -1
- package/dist/assets/usePolledData-0CVelkl2.js +1 -0
- package/dist/assets/{useServerActionGuard-Db7PPgaI.js → useServerActionGuard-uGePilQQ.js} +1 -1
- package/dist/assets/{useThroughputSeries-y7Yyi7Zh.js → useThroughputSeries-Cagm3qzB.js} +1 -1
- package/dist/index.html +7 -7
- package/package.json +4 -3
- package/scripts/embedded.gen.ts +152 -150
- package/dist/assets/Database-CB0oOEFB.js +0 -3
- package/dist/assets/DlqPro-OqBlzCnN.js +0 -1
- package/dist/assets/QueuesOverview-CBFqQ3N_.js +0 -1
- package/dist/assets/Settings-B5kCRSBH.js +0 -1
- package/dist/assets/Workflows-DOpeo-TP.js +0 -1
- package/dist/assets/bq-C7wdABtE.js +0 -1
- package/dist/assets/connectionStore-CFuNYZ_8.js +0 -1
- package/dist/assets/controlConnectionEpoch-DzbuWOhe.js +0 -1
- package/dist/assets/index-AUHH2nTG.js +0 -8
- package/dist/assets/index-BK7fjWKK.css +0 -1
- package/dist/assets/usePolledData-CNtNtd0a.js +0 -1
package/scripts/embedded.gen.ts
CHANGED
|
@@ -3,165 +3,167 @@
|
|
|
3
3
|
import f0 from "../dist/index.html" with { type: 'file' };
|
|
4
4
|
import f1 from "../dist/favicon.svg" with { type: 'file' };
|
|
5
5
|
import f2 from "../dist/og.png" with { type: 'file' };
|
|
6
|
-
import f3 from "../dist/assets/
|
|
7
|
-
import f4 from "../dist/assets/Workflows-
|
|
8
|
-
import f5 from "../dist/assets/
|
|
9
|
-
import f6 from "../dist/assets/
|
|
10
|
-
import f7 from "../dist/assets/
|
|
11
|
-
import f8 from "../dist/assets/
|
|
12
|
-
import f9 from "../dist/assets/
|
|
13
|
-
import f10 from "../dist/assets/
|
|
14
|
-
import f11 from "../dist/assets/
|
|
15
|
-
import f12 from "../dist/assets/
|
|
16
|
-
import f13 from "../dist/assets/
|
|
17
|
-
import f14 from "../dist/assets/
|
|
18
|
-
import f15 from "../dist/assets/
|
|
19
|
-
import f16 from "../dist/assets/
|
|
20
|
-
import f17 from "../dist/assets/
|
|
21
|
-
import f18 from "../dist/assets/
|
|
22
|
-
import f19 from "../dist/assets/
|
|
23
|
-
import f20 from "../dist/assets/
|
|
24
|
-
import f21 from "../dist/assets/
|
|
25
|
-
import f22 from "../dist/assets/
|
|
26
|
-
import f23 from "../dist/assets/
|
|
27
|
-
import f24 from "../dist/assets/
|
|
28
|
-
import f25 from "../dist/assets/
|
|
29
|
-
import f26 from "../dist/assets/
|
|
30
|
-
import f27 from "../dist/assets/
|
|
31
|
-
import f28 from "../dist/assets/
|
|
32
|
-
import f29 from "../dist/assets/
|
|
33
|
-
import f30 from "../dist/assets/
|
|
34
|
-
import f31 from "../dist/assets/
|
|
35
|
-
import f32 from "../dist/assets/
|
|
36
|
-
import f33 from "../dist/assets/
|
|
37
|
-
import f34 from "../dist/assets/
|
|
38
|
-
import f35 from "../dist/assets/
|
|
39
|
-
import f36 from "../dist/assets/
|
|
40
|
-
import f37 from "../dist/assets/
|
|
41
|
-
import f38 from "../dist/assets/
|
|
42
|
-
import f39 from "../dist/assets/
|
|
43
|
-
import f40 from "../dist/assets/
|
|
44
|
-
import f41 from "../dist/assets/
|
|
45
|
-
import f42 from "../dist/assets/
|
|
46
|
-
import f43 from "../dist/assets/
|
|
47
|
-
import f44 from "../dist/assets/
|
|
48
|
-
import f45 from "../dist/assets/
|
|
49
|
-
import f46 from "../dist/assets/
|
|
50
|
-
import f47 from "../dist/assets/
|
|
51
|
-
import f48 from "../dist/assets/
|
|
52
|
-
import f49 from "../dist/assets/
|
|
53
|
-
import f50 from "../dist/assets/
|
|
54
|
-
import f51 from "../dist/assets/
|
|
55
|
-
import f52 from "../dist/assets/
|
|
56
|
-
import f53 from "../dist/assets/
|
|
57
|
-
import f54 from "../dist/assets/
|
|
58
|
-
import f55 from "../dist/assets/
|
|
59
|
-
import f56 from "../dist/assets/
|
|
6
|
+
import f3 from "../dist/assets/usePolledData-0CVelkl2.js" with { type: 'file' };
|
|
7
|
+
import f4 from "../dist/assets/Workflows-BxlrgGEB.js" with { type: 'file' };
|
|
8
|
+
import f5 from "../dist/assets/QueueDetailPro-CFNQcKho.js" with { type: 'file' };
|
|
9
|
+
import f6 from "../dist/assets/Metrics-CvoY4uhX.js" with { type: 'file' };
|
|
10
|
+
import f7 from "../dist/assets/Diagnostics-DFshXeHl.js" with { type: 'file' };
|
|
11
|
+
import f8 from "../dist/assets/WorkersPro-YycNhm9w.js" with { type: 'file' };
|
|
12
|
+
import f9 from "../dist/assets/Logs-BGeTppXO.js" with { type: 'file' };
|
|
13
|
+
import f10 from "../dist/assets/Settings-Bw5MtDTF.js" with { type: 'file' };
|
|
14
|
+
import f11 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
|
|
15
|
+
import f12 from "../dist/assets/icons-BVzwsfbG.js" with { type: 'file' };
|
|
16
|
+
import f13 from "../dist/assets/feedback-QDN1AsYt.js" with { type: 'file' };
|
|
17
|
+
import f14 from "../dist/assets/Alerts-CYwfGLSQ.js" with { type: 'file' };
|
|
18
|
+
import f15 from "../dist/assets/connectionStore-BJLihGaC.js" with { type: 'file' };
|
|
19
|
+
import f16 from "../dist/assets/react-vendor-CvwrP0tU.js" with { type: 'file' };
|
|
20
|
+
import f17 from "../dist/assets/Flows-CcNdf_jS.js" with { type: 'file' };
|
|
21
|
+
import f18 from "../dist/assets/StatusBadge-BoOVTnKu.js" with { type: 'file' };
|
|
22
|
+
import f19 from "../dist/assets/Button-Ch1W94fJ.js" with { type: 'file' };
|
|
23
|
+
import f20 from "../dist/assets/exportFile-C7xhE8Yh.js" with { type: 'file' };
|
|
24
|
+
import f21 from "../dist/assets/Jobs-NN0fJ3BQ.js" with { type: 'file' };
|
|
25
|
+
import f22 from "../dist/assets/QueueControl-Ce-O1L4p.js" with { type: 'file' };
|
|
26
|
+
import f23 from "../dist/assets/index-ByvrmBif.js" with { type: 'file' };
|
|
27
|
+
import f24 from "../dist/assets/dist-DjvZiKhB.js" with { type: 'file' };
|
|
28
|
+
import f25 from "../dist/assets/McpServer-AsaFGnYZ.js" with { type: 'file' };
|
|
29
|
+
import f26 from "../dist/assets/Cron-CSoEPVeq.js" with { type: 'file' };
|
|
30
|
+
import f27 from "../dist/assets/Queues-DlznHsfh.js" with { type: 'file' };
|
|
31
|
+
import f28 from "../dist/assets/UsagePro-D4cGbozz.js" with { type: 'file' };
|
|
32
|
+
import f29 from "../dist/assets/upstreamPaths-B_cyinGI.js" with { type: 'file' };
|
|
33
|
+
import f30 from "../dist/assets/form-C4oby9pI.js" with { type: 'file' };
|
|
34
|
+
import f31 from "../dist/assets/BulkAddJobs-vyGFvlO3.js" with { type: 'file' };
|
|
35
|
+
import f32 from "../dist/assets/responses-DiIfPXXq.js" with { type: 'file' };
|
|
36
|
+
import f33 from "../dist/assets/api-BAGaBh6R.js" with { type: 'file' };
|
|
37
|
+
import f34 from "../dist/assets/Benchmark-BINaJvak.js" with { type: 'file' };
|
|
38
|
+
import f35 from "../dist/assets/controlConnectionEpoch-CZsS0wAb.js" with { type: 'file' };
|
|
39
|
+
import f36 from "../dist/assets/AreaChart-DEAalJ6P.js" with { type: 'file' };
|
|
40
|
+
import f37 from "../dist/assets/Pagination-x-Cwgrul.js" with { type: 'file' };
|
|
41
|
+
import f38 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
|
|
42
|
+
import f39 from "../dist/assets/useThroughputSeries-Cagm3qzB.js" with { type: 'file' };
|
|
43
|
+
import f40 from "../dist/assets/S3BackupPro-8y0J0-3_.js" with { type: 'file' };
|
|
44
|
+
import f41 from "../dist/assets/DlqPro-BmrnGQ-3.js" with { type: 'file' };
|
|
45
|
+
import f42 from "../dist/assets/dist-DpZcbP9W.js" with { type: 'file' };
|
|
46
|
+
import f43 from "../dist/assets/cn-zFEt5SO8.js" with { type: 'file' };
|
|
47
|
+
import f44 from "../dist/assets/useServerActionGuard-uGePilQQ.js" with { type: 'file' };
|
|
48
|
+
import f45 from "../dist/assets/PageHeader-CvIyaFOO.js" with { type: 'file' };
|
|
49
|
+
import f46 from "../dist/assets/Fleet-Bdrj9bLI.js" with { type: 'file' };
|
|
50
|
+
import f47 from "../dist/assets/MetricsPro-C01FjqvR.js" with { type: 'file' };
|
|
51
|
+
import f48 from "../dist/assets/bq-Qh0VFLKV.js" with { type: 'file' };
|
|
52
|
+
import f49 from "../dist/assets/Overview-WStfS5ee.js" with { type: 'file' };
|
|
53
|
+
import f50 from "../dist/assets/index-CxhXRVH_.css" with { type: 'file' };
|
|
54
|
+
import f51 from "../dist/assets/useControlActionGuard-B-bzKZKI.js" with { type: 'file' };
|
|
55
|
+
import f52 from "../dist/assets/JobsPro-D_l1c80Q.js" with { type: 'file' };
|
|
56
|
+
import f53 from "../dist/assets/Usage-DpShi3FE.js" with { type: 'file' };
|
|
57
|
+
import f54 from "../dist/assets/CronManager-s4xjNhGD.js" with { type: 'file' };
|
|
58
|
+
import f55 from "../dist/assets/install-C5y2ohOo.js" with { type: 'file' };
|
|
59
|
+
import f56 from "../dist/assets/toastStore-IZn6OPLZ.js" with { type: 'file' };
|
|
60
60
|
import f57 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
|
|
61
61
|
import f58 from "../dist/assets/format-Cg7VCIZW.js" with { type: 'file' };
|
|
62
|
-
import f59 from "../dist/assets/
|
|
62
|
+
import f59 from "../dist/assets/Database-x6iWCu3-.js" with { type: 'file' };
|
|
63
63
|
import f60 from "../dist/assets/dist-1f1fMHVO.js" with { type: 'file' };
|
|
64
|
-
import f61 from "../dist/assets/
|
|
65
|
-
import f62 from "../dist/assets/
|
|
66
|
-
import f63 from "../dist/assets/
|
|
67
|
-
import f64 from "../dist/assets/
|
|
68
|
-
import f65 from "../dist/assets/
|
|
69
|
-
import f66 from "../dist/assets/
|
|
70
|
-
import f67 from "../dist/assets/
|
|
71
|
-
import f68 from "../dist/assets/
|
|
72
|
-
import f69 from "../dist/assets/
|
|
73
|
-
import f70 from "../dist/assets/
|
|
74
|
-
import f71 from "../dist/assets/
|
|
75
|
-
import f72 from "../dist/assets/
|
|
76
|
-
import f73 from "../dist/assets/
|
|
77
|
-
import f74 from "../dist/assets/
|
|
78
|
-
import f75 from "../dist/assets/
|
|
79
|
-
import f76 from "../dist/assets/
|
|
80
|
-
import f77 from "../dist/assets/
|
|
81
|
-
import f78 from "../dist/assets/
|
|
82
|
-
import f79 from "../dist/assets/
|
|
83
|
-
import f80 from "../dist
|
|
64
|
+
import f61 from "../dist/assets/QueuesOverview-DGtapyV0.js" with { type: 'file' };
|
|
65
|
+
import f62 from "../dist/assets/promisePool-BVfQ9n9Q.js" with { type: 'file' };
|
|
66
|
+
import f63 from "../dist/assets/S3Backup-CxwbLJGK.js" with { type: 'file' };
|
|
67
|
+
import f64 from "../dist/assets/DlqControl-BBQc6uu9.js" with { type: 'file' };
|
|
68
|
+
import f65 from "../dist/assets/ServerControl-DpE7t-OF.js" with { type: 'file' };
|
|
69
|
+
import f66 from "../dist/assets/QueueDetail-D5TKm4bv.js" with { type: 'file' };
|
|
70
|
+
import f67 from "../dist/assets/Workers-D70B_uAI.js" with { type: 'file' };
|
|
71
|
+
import f68 from "../dist/assets/Card-CWxrC8OY.js" with { type: 'file' };
|
|
72
|
+
import f69 from "../dist/assets/LogsPro-D7vvgZmb.js" with { type: 'file' };
|
|
73
|
+
import f70 from "../dist/assets/dist-BlWBaCN6.js" with { type: 'file' };
|
|
74
|
+
import f71 from "../dist/assets/AddJob-CFnESFEU.js" with { type: 'file' };
|
|
75
|
+
import f72 from "../dist/assets/Dlq-Cayt1PEN.js" with { type: 'file' };
|
|
76
|
+
import f73 from "../dist/assets/JobInspector-BMjVR96H.js" with { type: 'file' };
|
|
77
|
+
import f74 from "../dist/assets/Webhooks-UYiTg6hn.js" with { type: 'file' };
|
|
78
|
+
import f75 from "../dist/assets/CopilotPanel-DjHfX9ta.js" with { type: 'file' };
|
|
79
|
+
import f76 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
|
|
80
|
+
import f77 from "../dist/assets/QueueActions-D51CYOjo.js" with { type: 'file' };
|
|
81
|
+
import f78 from "../dist/assets/jobActions-LQD4KfCc.js" with { type: 'file' };
|
|
82
|
+
import f79 from "../dist/assets/dist-DZL8soAh.js" with { type: 'file' };
|
|
83
|
+
import f80 from "../dist/assets/flowMutationSafety-DSd3JLAV.js" with { type: 'file' };
|
|
84
|
+
import f81 from "../dist/.vite/manifest.json" with { type: 'file' };
|
|
84
85
|
|
|
85
86
|
export const ASSETS: Record<string, string> = {
|
|
86
87
|
"/index.html": f0,
|
|
87
88
|
"/favicon.svg": f1,
|
|
88
89
|
"/og.png": f2,
|
|
89
|
-
"/assets/
|
|
90
|
-
"/assets/Workflows-
|
|
91
|
-
"/assets/
|
|
92
|
-
"/assets/
|
|
93
|
-
"/assets/
|
|
94
|
-
"/assets/
|
|
95
|
-
"/assets/
|
|
96
|
-
"/assets/
|
|
97
|
-
"/assets/
|
|
98
|
-
"/assets/
|
|
99
|
-
"/assets/
|
|
100
|
-
"/assets/
|
|
101
|
-
"/assets/
|
|
102
|
-
"/assets/
|
|
103
|
-
"/assets/
|
|
104
|
-
"/assets/
|
|
105
|
-
"/assets/
|
|
106
|
-
"/assets/
|
|
107
|
-
"/assets/
|
|
108
|
-
"/assets/
|
|
109
|
-
"/assets/
|
|
110
|
-
"/assets/
|
|
111
|
-
"/assets/
|
|
112
|
-
"/assets/
|
|
113
|
-
"/assets/
|
|
114
|
-
"/assets/
|
|
115
|
-
"/assets/
|
|
116
|
-
"/assets/
|
|
117
|
-
"/assets/
|
|
118
|
-
"/assets/
|
|
119
|
-
"/assets/
|
|
120
|
-
"/assets/
|
|
121
|
-
"/assets/
|
|
122
|
-
"/assets/
|
|
123
|
-
"/assets/
|
|
124
|
-
"/assets/
|
|
125
|
-
"/assets/
|
|
126
|
-
"/assets/
|
|
127
|
-
"/assets/
|
|
128
|
-
"/assets/
|
|
129
|
-
"/assets/
|
|
130
|
-
"/assets/
|
|
131
|
-
"/assets/
|
|
132
|
-
"/assets/
|
|
133
|
-
"/assets/
|
|
134
|
-
"/assets/
|
|
135
|
-
"/assets/
|
|
136
|
-
"/assets/
|
|
137
|
-
"/assets/
|
|
138
|
-
"/assets/
|
|
139
|
-
"/assets/
|
|
140
|
-
"/assets/
|
|
141
|
-
"/assets/
|
|
142
|
-
"/assets/
|
|
90
|
+
"/assets/usePolledData-0CVelkl2.js": f3,
|
|
91
|
+
"/assets/Workflows-BxlrgGEB.js": f4,
|
|
92
|
+
"/assets/QueueDetailPro-CFNQcKho.js": f5,
|
|
93
|
+
"/assets/Metrics-CvoY4uhX.js": f6,
|
|
94
|
+
"/assets/Diagnostics-DFshXeHl.js": f7,
|
|
95
|
+
"/assets/WorkersPro-YycNhm9w.js": f8,
|
|
96
|
+
"/assets/Logs-BGeTppXO.js": f9,
|
|
97
|
+
"/assets/Settings-Bw5MtDTF.js": f10,
|
|
98
|
+
"/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f11,
|
|
99
|
+
"/assets/icons-BVzwsfbG.js": f12,
|
|
100
|
+
"/assets/feedback-QDN1AsYt.js": f13,
|
|
101
|
+
"/assets/Alerts-CYwfGLSQ.js": f14,
|
|
102
|
+
"/assets/connectionStore-BJLihGaC.js": f15,
|
|
103
|
+
"/assets/react-vendor-CvwrP0tU.js": f16,
|
|
104
|
+
"/assets/Flows-CcNdf_jS.js": f17,
|
|
105
|
+
"/assets/StatusBadge-BoOVTnKu.js": f18,
|
|
106
|
+
"/assets/Button-Ch1W94fJ.js": f19,
|
|
107
|
+
"/assets/exportFile-C7xhE8Yh.js": f20,
|
|
108
|
+
"/assets/Jobs-NN0fJ3BQ.js": f21,
|
|
109
|
+
"/assets/QueueControl-Ce-O1L4p.js": f22,
|
|
110
|
+
"/assets/index-ByvrmBif.js": f23,
|
|
111
|
+
"/assets/dist-DjvZiKhB.js": f24,
|
|
112
|
+
"/assets/McpServer-AsaFGnYZ.js": f25,
|
|
113
|
+
"/assets/Cron-CSoEPVeq.js": f26,
|
|
114
|
+
"/assets/Queues-DlznHsfh.js": f27,
|
|
115
|
+
"/assets/UsagePro-D4cGbozz.js": f28,
|
|
116
|
+
"/assets/upstreamPaths-B_cyinGI.js": f29,
|
|
117
|
+
"/assets/form-C4oby9pI.js": f30,
|
|
118
|
+
"/assets/BulkAddJobs-vyGFvlO3.js": f31,
|
|
119
|
+
"/assets/responses-DiIfPXXq.js": f32,
|
|
120
|
+
"/assets/api-BAGaBh6R.js": f33,
|
|
121
|
+
"/assets/Benchmark-BINaJvak.js": f34,
|
|
122
|
+
"/assets/controlConnectionEpoch-CZsS0wAb.js": f35,
|
|
123
|
+
"/assets/AreaChart-DEAalJ6P.js": f36,
|
|
124
|
+
"/assets/Pagination-x-Cwgrul.js": f37,
|
|
125
|
+
"/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f38,
|
|
126
|
+
"/assets/useThroughputSeries-Cagm3qzB.js": f39,
|
|
127
|
+
"/assets/S3BackupPro-8y0J0-3_.js": f40,
|
|
128
|
+
"/assets/DlqPro-BmrnGQ-3.js": f41,
|
|
129
|
+
"/assets/dist-DpZcbP9W.js": f42,
|
|
130
|
+
"/assets/cn-zFEt5SO8.js": f43,
|
|
131
|
+
"/assets/useServerActionGuard-uGePilQQ.js": f44,
|
|
132
|
+
"/assets/PageHeader-CvIyaFOO.js": f45,
|
|
133
|
+
"/assets/Fleet-Bdrj9bLI.js": f46,
|
|
134
|
+
"/assets/MetricsPro-C01FjqvR.js": f47,
|
|
135
|
+
"/assets/bq-Qh0VFLKV.js": f48,
|
|
136
|
+
"/assets/Overview-WStfS5ee.js": f49,
|
|
137
|
+
"/assets/index-CxhXRVH_.css": f50,
|
|
138
|
+
"/assets/useControlActionGuard-B-bzKZKI.js": f51,
|
|
139
|
+
"/assets/JobsPro-D_l1c80Q.js": f52,
|
|
140
|
+
"/assets/Usage-DpShi3FE.js": f53,
|
|
141
|
+
"/assets/CronManager-s4xjNhGD.js": f54,
|
|
142
|
+
"/assets/install-C5y2ohOo.js": f55,
|
|
143
|
+
"/assets/toastStore-IZn6OPLZ.js": f56,
|
|
143
144
|
"/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f57,
|
|
144
145
|
"/assets/format-Cg7VCIZW.js": f58,
|
|
145
|
-
"/assets/
|
|
146
|
+
"/assets/Database-x6iWCu3-.js": f59,
|
|
146
147
|
"/assets/dist-1f1fMHVO.js": f60,
|
|
147
|
-
"/assets/
|
|
148
|
-
"/assets/
|
|
149
|
-
"/assets/
|
|
150
|
-
"/assets/
|
|
151
|
-
"/assets/
|
|
152
|
-
"/assets/
|
|
153
|
-
"/assets/
|
|
154
|
-
"/assets/
|
|
155
|
-
"/assets/
|
|
156
|
-
"/assets/
|
|
157
|
-
"/assets/
|
|
158
|
-
"/assets/
|
|
159
|
-
"/assets/
|
|
160
|
-
"/assets/
|
|
161
|
-
"/assets/
|
|
162
|
-
"/assets/
|
|
163
|
-
"/assets/
|
|
164
|
-
"/assets/
|
|
165
|
-
"/assets/
|
|
166
|
-
"
|
|
148
|
+
"/assets/QueuesOverview-DGtapyV0.js": f61,
|
|
149
|
+
"/assets/promisePool-BVfQ9n9Q.js": f62,
|
|
150
|
+
"/assets/S3Backup-CxwbLJGK.js": f63,
|
|
151
|
+
"/assets/DlqControl-BBQc6uu9.js": f64,
|
|
152
|
+
"/assets/ServerControl-DpE7t-OF.js": f65,
|
|
153
|
+
"/assets/QueueDetail-D5TKm4bv.js": f66,
|
|
154
|
+
"/assets/Workers-D70B_uAI.js": f67,
|
|
155
|
+
"/assets/Card-CWxrC8OY.js": f68,
|
|
156
|
+
"/assets/LogsPro-D7vvgZmb.js": f69,
|
|
157
|
+
"/assets/dist-BlWBaCN6.js": f70,
|
|
158
|
+
"/assets/AddJob-CFnESFEU.js": f71,
|
|
159
|
+
"/assets/Dlq-Cayt1PEN.js": f72,
|
|
160
|
+
"/assets/JobInspector-BMjVR96H.js": f73,
|
|
161
|
+
"/assets/Webhooks-UYiTg6hn.js": f74,
|
|
162
|
+
"/assets/CopilotPanel-DjHfX9ta.js": f75,
|
|
163
|
+
"/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f76,
|
|
164
|
+
"/assets/QueueActions-D51CYOjo.js": f77,
|
|
165
|
+
"/assets/jobActions-LQD4KfCc.js": f78,
|
|
166
|
+
"/assets/dist-DZL8soAh.js": f79,
|
|
167
|
+
"/assets/flowMutationSafety-DSd3JLAV.js": f80,
|
|
168
|
+
"/.vite/manifest.json": f81,
|
|
167
169
|
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./cn-zFEt5SO8.js";import{g as n,h as r,t as i}from"./react-vendor-CvwrP0tU.js";import{o as a}from"./connectionStore-CFuNYZ_8.js";import{a as o,i as s,t as c}from"./bq-C7wdABtE.js";import{t as l}from"./toastStore-B31o6Z5J.js";import{T as u,o as d}from"./icons-BVzwsfbG.js";import{n as f}from"./usePolledData-CNtNtd0a.js";import{t as p}from"./Button-Ch1W94fJ.js";import{n as m,t as h}from"./Card-CWxrC8OY.js";import{i as g,n as _,r as v,t as y}from"./feedback-QDN1AsYt.js";import{t as b}from"./PageHeader-CvIyaFOO.js";import{n as x,s as S}from"./format-Cg7VCIZW.js";import{a as C,c as w,n as T,s as E}from"./index-AUHH2nTG.js";import{a as D}from"./form-C4oby9pI.js";import{t as ee}from"./Pagination-x-Cwgrul.js";var O=e(r(),1),k=e(n(),1),A=i();function j({columns:e,filter:t,onChange:n}){let[r,i]=(0,k.useState)(t?.column??``),[a,o]=(0,k.useState)(t?.op??`contains`),[s,c]=(0,k.useState)(t?.value??``),l=r||e[0]||``,d=()=>n(s.trim()?{column:l,op:a,value:s.trim()}:null);return e.length===0?null:(0,A.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`w-40`,children:(0,A.jsx)(D,{value:l,"aria-label":`Filter column`,name:`database-filter-column`,autoComplete:`off`,onChange:e=>i(e.target.value),children:e.map(e=>(0,A.jsx)(`option`,{value:e,children:e},e))})}),(0,A.jsx)(`div`,{className:`w-32`,children:(0,A.jsxs)(D,{value:a,"aria-label":`Filter operator`,name:`database-filter-operator`,autoComplete:`off`,onChange:e=>o(e.target.value),children:[(0,A.jsx)(`option`,{value:`contains`,children:`contains`}),(0,A.jsx)(`option`,{value:`eq`,children:`=`}),(0,A.jsx)(`option`,{value:`ne`,children:`≠`})]})}),(0,A.jsxs)(`div`,{className:`relative min-w-40 flex-1`,children:[(0,A.jsx)(u,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint`}),(0,A.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),onKeyDown:e=>e.key===`Enter`&&d(),"aria-label":`Filter value`,name:`database-filter-value`,autoComplete:`off`,placeholder:`value — Enter to filter`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-8 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),(0,A.jsx)(p,{size:`sm`,onClick:d,disabled:!s.trim(),children:`Filter`}),t&&(0,A.jsx)(p,{size:`sm`,variant:`ghost`,onClick:()=>{c(``),n(null)},children:`Clear`}),(0,A.jsx)(`span`,{className:`text-[11px] text-faint`,children:`filters the whole table, server-side`})]})}var M=`bq-dash-db-history`,N=10,P=2e4,F=100;function I(e){let t=e==null?``:String(e),n=typeof e==`string`&&/^[=+\-@\t\r]/.test(e)?`'${e}`:t;return/[",\r\n]/.test(n)?`"${n.replaceAll(`"`,`""`)}"`:n}function L(e,t){return[e.map(I).join(`,`),...t.map(e=>e.map(I).join(`,`))].join(`
|
|
2
|
-
`)}function R(e,t,n){let r=URL.createObjectURL(new Blob([n],{type:t})),i=document.createElement(`a`);i.href=r,i.download=e,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}function z(e){if(!Array.isArray(e))return[];let t=[],n=new Set;for(let r of e.slice(0,F))if(!(typeof r!=`string`||r.length===0||r.length>P||n.has(r))&&(n.add(r),t.push(r),t.length===N))break;return t}function B(){try{return z(JSON.parse(localStorage.getItem(M)??`[]`))}catch{return[]}}function V(e){let t=z(e);try{localStorage.setItem(M,JSON.stringify(t))}catch{}return t}function H(e){return V([e,...B().filter(t=>t!==e)].slice(0,N))}function U(e){if(e==null)return`NULL`;let t=typeof e==`string`?e:String(e),n=t.trimStart();if(n.startsWith(`{`)||n.startsWith(`[`))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}return t}async function W(e,t=c.captureAgentRequestTarget(),n){let r=Object.freeze({table:e.table,orderBy:e.orderBy,dir:e.dir,filter:e.filter?Object.freeze({...e.filter}):void 0});return c.getDbExportAtTarget(t,r,n)}var G=e=>JSON.stringify([e.baseUrl,e.token,e.agentToken]);function te({value:e,align:n}){if(e==null)return(0,A.jsx)(`span`,{className:`italic text-faint`,children:`NULL`});let r=typeof e==`string`?e:String(e);return(0,A.jsx)(`span`,{className:t(`block max-w-[24rem] truncate`,n===`right`&&`text-right tabular-nums`),title:r,children:r})}function ne({columns:e,rows:n,truncatedCells:r,colMeta:i,sort:a,onSort:o,onRowClick:s,dimmed:c}){let l=(0,k.useMemo)(()=>e.map((e,t)=>{let r=i?.[e]?.type?.toUpperCase()??``;if(/INT|REAL|NUM|DEC|DOUB|FLOA/.test(r))return!0;let a=!1;for(let e of n){let n=e[t];if(n!=null&&(a=!0,typeof n!=`number`))return!1}return a}),[e,n,i]);return(0,A.jsx)(`div`,{className:t(`max-h-[70vh] overflow-auto rounded-xl border border-line bg-surface transition-opacity`,c&&`pointer-events-none opacity-50`),children:(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`text-left text-[11px] uppercase tracking-wider text-faint`,children:[s&&(0,A.jsx)(`th`,{className:`sticky top-0 z-10 whitespace-nowrap border-b border-line bg-surface px-4 py-3 font-medium`,children:(0,A.jsx)(`span`,{className:`sr-only`,children:`Row actions`})}),e.map((e,n)=>{let r=i?.[e];return(0,A.jsx)(`th`,{className:t(`sticky top-0 z-10 whitespace-nowrap border-b border-line bg-surface px-4 py-3 font-medium`,l[n]&&`text-right`),"aria-sort":a?.col===e?a.dir===`asc`?`ascending`:`descending`:o?`none`:void 0,children:o?(0,A.jsxs)(`button`,{type:`button`,onClick:()=>o(e),"aria-label":`Sort by ${e}`,className:`inline-flex items-center gap-1 uppercase tracking-wider hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[e,r?.primaryKey&&(0,A.jsx)(`span`,{className:`rounded bg-accent/15 px-1 py-0.5 text-[9px] font-semibold text-accent`,children:`PK`}),r?.type&&(0,A.jsx)(`span`,{className:`text-faint/70`,children:r.type.toLowerCase()}),(0,A.jsx)(`span`,{"aria-hidden":`true`,className:a?.col===e?`text-accent`:`text-faint/60`,children:a?.col===e?a.dir===`asc`?`▲`:`▼`:`↕`})]}):e},e)})]})}),(0,A.jsx)(`tbody`,{children:n.map((e,t)=>(0,A.jsxs)(`tr`,{className:`border-b border-line font-mono text-xs last:border-0 hover:bg-surface-2/40`,children:[s&&(0,A.jsx)(`td`,{className:`whitespace-nowrap px-4 py-2`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`View row ${t+1} details`,onClick:()=>s(t),className:`rounded-md border border-line px-2 py-1 font-sans text-[11px] font-medium text-muted transition-colors hover:border-line-strong hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent`,children:`View`})}),e.map((e,n)=>(0,A.jsx)(`td`,{className:`whitespace-nowrap px-4 py-2 text-muted`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(te,{value:e,align:l[n]?`right`:`left`}),r?.[t]?.[n]&&(0,A.jsx)(`span`,{title:`Value truncated — use the row's View action to read it in full`,className:`shrink-0 rounded bg-warning/15 px-1 text-[9px] font-semibold text-warning`,children:`…`})]})},n))]},t))})]})})}function K(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Malformed database query response.`);let t=e;if(t.ok!==!0||!Array.isArray(t.columns)||t.columns.some(e=>typeof e!=`string`)||!Array.isArray(t.rows)||t.rows.length>500||t.rows.some(e=>!Array.isArray(e)||e.length!==t.columns.length)||!Number.isSafeInteger(t.rowCount)||t.rowCount!==t.rows.length||typeof t.truncated!=`boolean`||typeof t.ms!=`number`||!Number.isFinite(t.ms)||t.ms<0)throw Error(`Malformed database query response.`);return{columns:[...t.columns],rows:t.rows.map(e=>[...e]),rowCount:t.rowCount,truncated:t.truncated,ms:t.ms}}function re({sql:e,setSql:t,editorRef:n}){let r=a(G),[i,o]=(0,k.useState)(null),[s,l]=(0,k.useState)(null),[u,d]=(0,k.useState)(B),[f,g]=(0,k.useState)(null),_=(0,k.useRef)(0),v=(0,k.useRef)(null),y=(0,k.useRef)(r);y.current!==r&&(y.current=r,_.current++,v.current=null),(0,k.useEffect)(()=>(_.current++,v.current=null,o(null),l(null),g(null),()=>{_.current++,v.current=null}),[r]);let b=i===r,x=s?.target===r?s.message:null,C=f?.target===r?f:null,w=async(t=e,n=!0)=>{let i=t.trim();if(!i||v.current?.target===r)return;let s=++_.current,u=r;v.current={generation:s,target:u},o(u),l(null);try{let e=K(await c.db.query(t));if(s!==_.current||G(a.getState())!==u)return;g({...e,target:u}),n&&d(H(i))}catch(e){if(s!==_.current||G(a.getState())!==u)return;g(null),l({target:u,message:e.message})}finally{v.current?.generation===s&&(v.current=null),s===_.current&&o(null)}};return(0,A.jsxs)(h,{className:`mt-6`,children:[(0,A.jsx)(m,{title:`Query`,action:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(p,{size:`sm`,disabled:b||!e.trim(),onClick:()=>{let t=e.trim();t&&w(`EXPLAIN QUERY PLAN ${t}`,!1)},children:`Explain`}),(0,A.jsx)(p,{size:`sm`,variant:`accent`,disabled:b||!e.trim(),onClick:()=>w(),children:b?`Running…`:`Run`})]})}),(0,A.jsx)(`textarea`,{name:`database-sql-query`,autoComplete:`off`,ref:n,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&w()},rows:3,spellCheck:!1,"aria-label":`SQL query`,placeholder:`SELECT … — read-only: writes are rejected by the engine`,className:`w-full resize-y rounded-lg border border-line bg-surface-2 p-3 font-mono text-xs text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`}),(0,A.jsx)(`p`,{className:`mt-1 text-[11px] text-faint`,children:`⌘/Ctrl+Enter runs. Connection is read-only.`}),u.length>0&&(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-faint`,children:`History`}),u.map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(e),title:e,className:`max-w-56 truncate rounded-md border border-line bg-surface-2 px-2 py-1 font-mono text-[11px] text-muted transition-colors hover:border-line-strong hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:e},e)),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{V([]),d([])},className:`rounded-md px-2 py-1 text-[11px] text-faint transition-colors hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:`Clear`})]}),(0,A.jsxs)(`div`,{"aria-live":`polite`,children:[x&&(0,A.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-danger`,children:x}),C&&!x&&(0,A.jsxs)(`div`,{className:`mt-4`,children:[(0,A.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-3`,children:[(0,A.jsxs)(`p`,{className:`text-xs text-faint`,children:[C.truncated?`≥ `:``,S(C.rowCount),` row`,C.rowCount===1?``:`s`,` · `,S(C.ms),` ms`,C.truncated&&(0,A.jsxs)(`span`,{className:`text-warning`,children:[` — showing first `,C.rows.length]})]}),C.rows.length>0&&(0,A.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,A.jsx)(p,{size:`sm`,onClick:()=>R(`query-results.csv`,`text/csv`,L(C.columns,C.rows)),children:`CSV`}),(0,A.jsx)(p,{size:`sm`,onClick:()=>R(`query-results.json`,`application/json`,JSON.stringify(C.rows.map(e=>Object.fromEntries(C.columns.map((t,n)=>[t,e[n]]))),null,2)),children:`JSON`})]})]}),C.rows.length>0?(0,A.jsx)(ne,{columns:C.columns,rows:C.rows}):(0,A.jsx)(`p`,{className:`text-xs text-faint`,children:`Query returned no rows.`})]})]})]})}var q=(e,t)=>t?e?.column===t.column&&e.op===t.op&&e.value===t.value:e===null;function J(e,t){return e.table===t.table&&e.limit===t.limit&&e.offset===t.offset&&e.orderBy===(t.orderBy??null)&&e.dir===t.dir&&q(e.filter,t.filter)}var Y=-(1n<<63n),X=(1n<<63n)-1n;function Z(e){if(e===null)return!0;if(typeof e==`number`)return Number.isSafeInteger(e);if(typeof e!=`string`||!/^-?(?:0|[1-9]\d*)$/.test(e)||e.length>20)return!1;try{let t=BigInt(e);return t>=Y&&t<=X}catch{return!1}}var ie=e=>e===null||typeof e==`string`||typeof e==`number`&&Number.isFinite(e);function ae(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Malformed database rows response.`);let n=e,r=n.columns,i=n.rows,a=n.rowids,o=n.truncatedCells,s=n.filter,c=s===null||typeof s==`object`&&!!s&&!Array.isArray(s)&&typeof s.column==`string`&&(s.op===`contains`||s.op===`eq`||s.op===`ne`)&&typeof s.value==`string`;if(n.ok!==!0||typeof n.table!=`string`||!Array.isArray(r)||r.length===0||r.length>2e3||r.some(e=>typeof e!=`string`||!e)||new Set(r).size!==r.length||!Array.isArray(i)||i.length>t.limit||i.some(e=>!Array.isArray(e)||e.length!==r.length||e.some(e=>!ie(e)))||!Array.isArray(a)||a.length!==i.length||a.some(e=>!Z(e))||!Array.isArray(o)||o.length!==i.length||o.some(e=>!Array.isArray(e)||e.length!==r.length||e.some(e=>typeof e!=`boolean`))||!Number.isSafeInteger(n.total)||n.total<0||!Number.isSafeInteger(n.limit)||!Number.isSafeInteger(n.offset)||n.offset<0||n.orderBy!==null&&typeof n.orderBy!=`string`||n.dir!==`asc`&&n.dir!==`desc`||!c)throw Error(`Malformed database rows response.`);let l={ok:!0,table:n.table,columns:[...r],rows:i.map(e=>[...e]),rowids:[...a],truncatedCells:o.map(e=>[...e]),total:n.total,limit:n.limit,offset:n.offset,orderBy:n.orderBy,dir:n.dir,filter:s===null?null:{...s}};if(!J(l,t))throw Error(`Database rows identity mismatch: requested table "${t.table}" at offset ${t.offset}.`);let u=Math.min(l.limit,Math.max(0,l.total-l.offset));if(l.rows.length!==u)throw Error(`Malformed database rows response: row count does not match pagination metadata.`);return l}function Q(e,t){let n=e.rows[t],r=e.truncatedCells[t],i=e.rowids[t];return!n||!r||i===void 0||t<0?null:{index:t,table:e.table,columns:[...e.columns],row:[...n],rowid:i,truncated:[...r]}}var oe=(e,t)=>e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]));function se(e,t){let n=Q(t,e.index);return n!==null&&n.table===e.table&&n.rowid===e.rowid&&oe(n.columns,e.columns)&&oe(n.row,e.row)&&oe(n.truncated,e.truncated)}function ce({schema:e}){return(0,A.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,A.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,A.jsx)(`th`,{className:`px-4 py-3 font-medium`,children:`Column`}),(0,A.jsx)(`th`,{className:`px-4 py-3 font-medium`,children:`Type`}),(0,A.jsx)(`th`,{className:`px-4 py-3 font-medium`,children:`Constraints`}),(0,A.jsx)(`th`,{className:`px-4 py-3 font-medium`,children:`Default`})]})}),(0,A.jsx)(`tbody`,{children:e.columns.map(e=>(0,A.jsxs)(`tr`,{className:`border-b border-line last:border-0`,children:[(0,A.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs text-fg`,children:e.name}),(0,A.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs text-muted`,children:e.type}),(0,A.jsxs)(`td`,{className:`px-4 py-2 text-xs`,children:[e.primaryKey&&(0,A.jsx)(`span`,{className:`mr-1 rounded-md bg-accent/15 px-1.5 py-0.5 text-[10px] font-semibold text-accent`,children:`PK`}),e.notNull&&(0,A.jsx)(`span`,{className:`rounded-md bg-surface-2 px-1.5 py-0.5 text-[10px] font-semibold text-muted`,children:`NOT NULL`})]}),(0,A.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs text-faint`,children:e.defaultValue??`—`})]},e.name))})]})}),(0,A.jsxs)(h,{children:[(0,A.jsx)(m,{title:`Indexes (${e.indexes.length})`}),e.indexes.length===0?(0,A.jsx)(`p`,{className:`text-xs text-faint`,children:`No indexes on this table.`}):(0,A.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.indexes.map(e=>(0,A.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 font-mono text-xs`,children:[(0,A.jsx)(`span`,{className:`text-fg`,children:e.name}),e.unique&&(0,A.jsx)(`span`,{className:`rounded-md bg-accent/15 px-1.5 py-0.5 text-[10px] font-semibold text-accent`,children:`UNIQUE`}),(0,A.jsxs)(`span`,{className:`text-faint`,children:[`(`,e.columns.join(`, `),`)`]})]},e.name))})]}),e.sql&&(0,A.jsxs)(h,{children:[(0,A.jsx)(m,{title:`DDL`,action:(0,A.jsx)(C,{value:e.sql})}),(0,A.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-surface-2 p-3 font-mono text-xs text-muted`,children:e.sql})]})]})}function le({db:e}){let{anyTruncated:n,colMeta:r,cycleSort:i,data:a,dbMissing:o,detail:s,editorRef:c,exportBusy:l,exportPage:u,exportTable:d,filter:f,info:m,infoError:C,msg:w,page:E,pageSize:D,queryThisTable:O,refetchInfo:k,refetchRows:M,refetchSchema:N,refetchTables:P,requestModal:F,rowsLoading:I,schema:L,schemaError:R,selectTable:z,selected:B,setDetailSelection:V,setFilter:H,setPage:U,setSql:W,setTab:G,sort:te,sql:K,tab:q,tables:J,tablesError:Y,tablesLoading:X,visibleRowsError:Z}=e;return(0,A.jsxs)(`div`,{"data-database-background":``,inert:s?!0:void 0,"aria-hidden":s?!0:void 0,children:[(0,A.jsx)(b,{title:`Database`,description:`SQLite inspector — schema, data and queries over a read-only connection.`,actions:(0,A.jsx)(`span`,{className:`rounded-full bg-emerald-500/10 px-2.5 py-1 text-[11px] font-medium text-success`,children:`read-only`})}),Y&&!o&&(0,A.jsx)(g,{message:`Could not read the database — ${Y.message}`,onRetry:P}),C&&!o&&(0,A.jsx)(g,{message:`Could not read database metadata — ${C.message}`,onRetry:k}),m&&(0,A.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-5`,children:[(0,A.jsx)(T,{label:`SQLite`,value:m.sqliteVersion,compact:!0}),(0,A.jsx)(T,{label:`On disk`,value:x(m.fileSize+m.walSize),compact:!0}),(0,A.jsx)(T,{label:`Journal`,value:m.journalMode.toUpperCase(),compact:!0}),(0,A.jsx)(T,{label:`Tables`,value:S(m.tables),compact:!0}),(0,A.jsx)(T,{label:`Indexes`,value:S(m.indexes),compact:!0})]}),o?(0,A.jsx)(y,{title:`No database yet`,hint:Y.message}):X&&J.length===0?(0,A.jsx)(v,{label:`Reading database…`}):(0,A.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-4`,children:[(0,A.jsxs)(h,{padded:!1,className:`self-start overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`border-b border-line px-4 py-3 text-[11px] font-medium uppercase tracking-wider text-faint`,children:[`Tables (`,J.length,`)`]}),(0,A.jsxs)(`ul`,{className:`max-h-[28rem] overflow-y-auto`,children:[J.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,onClick:()=>z(e.name),className:t(`flex w-full items-center justify-between gap-2 px-4 py-2 text-left text-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,B===e.name?`bg-surface-2 text-fg`:`text-muted hover:bg-surface-2/60 hover:text-fg`),children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.name}),(0,A.jsx)(`span`,{className:`shrink-0 text-[11px] text-faint tabular-nums`,children:S(e.rows)})]})},e.name)),J.length===0&&(0,A.jsx)(`li`,{className:`px-4 py-6 text-center text-xs text-faint`,children:`No tables.`})]})]}),(0,A.jsx)(`div`,{className:`min-w-0 lg:col-span-3`,children:J.length===0?(0,A.jsx)(y,{title:`No tables`,hint:`This database has no user tables yet.`}):(0,A.jsxs)(A.Fragment,{children:[B&&(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`mr-auto min-w-0 truncate font-mono text-sm text-fg`,title:B,children:B}),(0,A.jsx)(p,{size:`sm`,variant:`ghost`,onClick:O,children:`Query`}),(0,A.jsx)(`div`,{className:`inline-flex items-center gap-1 rounded-lg border border-line bg-surface p-1`,children:[`data`,`schema`].map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>G(e),"aria-pressed":q===e,className:t(`rounded-md px-3 py-1 text-xs font-medium capitalize transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,q===e?`bg-surface-2 text-fg`:`text-muted hover:text-fg`),children:e},e))}),q===`data`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(p,{size:`sm`,disabled:!a||a.rows.length===0,title:a?`Exports the ${a.rows.length} rows on this page only`:void 0,onClick:u,children:[`Export page`,a?` (${a.rows.length})`:``]}),(0,A.jsx)(p,{size:`sm`,variant:`accent`,disabled:l||!a||a.total===0,onClick:d,children:l?`Exporting…`:`Export table${a?` (${S(a.total)})`:``}`})]})]}),q===`data`&&B&&(0,A.jsx)(j,{columns:a?.columns??L?.columns.map(e=>e.name)??[],filter:f,onChange:e=>{H(e),U(0),V(null)}},B),w&&(0,A.jsx)(`p`,{className:`mb-3 text-xs text-muted`,children:w}),q===`schema`?R?(0,A.jsx)(y,{title:`Could not read schema`,hint:R.message,action:(0,A.jsx)(p,{size:`sm`,onClick:N,children:`Retry`})}):L?.table===B?(0,A.jsx)(ce,{schema:L}):(0,A.jsx)(v,{label:`Reading schema of ${B}…`}):Z?(0,A.jsx)(_,{error:Z,onRetry:M}):I&&!a?(0,A.jsx)(v,{label:`Reading ${B}…`}):a?a.total===0?(0,A.jsx)(y,{title:f?`No matching rows`:`Empty table`,hint:f?`No rows match the current filter.`:`"${a.table}" has no rows.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ne,{columns:a.columns,rows:a.rows,truncatedCells:a.truncatedCells,colMeta:r,sort:te,onSort:i,onRowClick:e=>{let t=Q(a,e);t&&F(`database-row`)&&V(t)},dimmed:I&&!a}),n&&(0,A.jsx)(`p`,{className:`mt-2 text-[11px] text-faint`,children:`Cells over 2000 chars and BLOBs are abbreviated in the grid and CSV — use the row's View action to read the full value.`}),(0,A.jsx)(ee,{page:E,pageSize:D,total:a.total,onPageChange:e=>{U(e),V(null)},label:`rows`})]}):(0,A.jsx)(y,{title:`Select a table`,hint:`Pick a table on the left to browse its rows.`}),(0,A.jsx)(re,{sql:K,setSql:W,editorRef:c})]})})]})]})}var ue=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function de({table:e,columns:t,row:n,rowid:r,truncated:i,onClose:a}){let[o,s]=(0,k.useState)({}),[l,u]=(0,k.useState)({}),f=(0,k.useRef)(null),p=(0,k.useRef)(null),m=(0,k.useRef)(a);m.current=a,(0,k.useEffect)(()=>{let e=document.activeElement,t=f.current,n=()=>t?Array.from(t.querySelectorAll(ue)).filter(e=>e.getAttribute(`aria-hidden`)!==`true`):[],r=(e=!1)=>{let r=n();(e?r.at(-1):r[0])?.focus(),r.length===0&&t?.focus()},i=e=>{if(e.key===`Escape`){e.preventDefault(),m.current();return}if(e.key!==`Tab`)return;let r=n();if(r.length===0){e.preventDefault(),t?.focus();return}let i=document.activeElement,a=r[0],o=r[r.length-1];e.shiftKey&&(i===a||!i||!t?.contains(i))?(e.preventDefault(),o.focus()):!e.shiftKey&&(i===o||!i||!t?.contains(i))&&(e.preventDefault(),a.focus())},a=e=>{t&&!t.contains(e.target)&&r()};return p.current?.focus(),document.activeElement!==p.current&&t?.focus(),document.addEventListener(`keydown`,i,!0),document.addEventListener(`focusin`,a),()=>{document.removeEventListener(`keydown`,i,!0),document.removeEventListener(`focusin`,a),E(`database-row`)&&e?.isConnected&&e.focus()}},[]);let h=JSON.stringify(t.filter((e,t)=>i[t]));return(0,k.useEffect)(()=>{s({}),u({});let t=JSON.parse(h);if(r==null||t.length===0)return;let n=!1;return Promise.all(t.map(async t=>{try{let i=await c.db.cell(e,r,t);if(!i||typeof i!=`object`||!Object.hasOwn(i,`value`))throw Error(`Malformed full-cell response.`);n||s(e=>({...e,[t]:i.value}))}catch(e){if(!n){let n=e instanceof Error?e.message:String(e);u(e=>({...e,[t]:n.slice(0,300)}))}}})),()=>{n=!0}},[e,r,h]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`Close row detail`,onClick:a,className:`fixed inset-0 z-40 bg-black/50`}),(0,A.jsxs)(`aside`,{ref:f,role:`dialog`,"aria-modal":`true`,"aria-label":`${e} row ${r??`detail`}`,tabIndex:-1,className:`fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l border-line bg-surface shadow-xl focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-5 py-4`,children:[(0,A.jsxs)(`h2`,{className:`font-mono text-sm text-fg`,children:[e,` · row detail`]}),(0,A.jsx)(`button`,{ref:p,type:`button`,"aria-label":`Close`,onClick:a,className:`flex size-8 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:(0,A.jsx)(d,{className:`size-4`})})]}),(0,A.jsx)(`div`,{className:`flex-1 overscroll-contain overflow-y-auto p-5`,children:(0,A.jsx)(`dl`,{className:`flex flex-col gap-4`,children:t.map((e,t)=>{let r=Object.hasOwn(o,e),a=r?o[e]:n[t],s=U(a),c=s.includes(`
|
|
3
|
-
`)||s.length>80;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`dt`,{className:`mb-1 flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-faint`,children:[e,a!=null&&(0,A.jsx)(C,{value:String(a)}),i[t]&&!r&&(Object.hasOwn(l,e)?(0,A.jsxs)(`span`,{role:`alert`,className:`normal-case text-danger`,children:[`(full value unavailable — `,l[e],`)`]}):(0,A.jsx)(`span`,{className:`text-warning`,children:`(loading full value…)`}))]}),(0,A.jsx)(`dd`,{children:a==null?(0,A.jsx)(`span`,{className:`italic text-faint`,children:`NULL`}):c?(0,A.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-2 p-3 font-mono text-xs text-muted`,children:s}):(0,A.jsx)(`span`,{className:`break-words font-mono text-sm text-fg`,children:s})})]},e)})})})]})]})}function fe({data:e,filter:t,page:n,selected:r,sort:i}){let o=a(G),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(null),m=(0,k.useRef)(!1),h=(0,k.useRef)(null);return(0,k.useEffect)(()=>(h.current?.abort(),h.current=null,m.current=!1,d(!1),p(null),()=>{h.current?.abort(),h.current=null,m.current=!1}),[o]),{exportBusy:u,exportPage:()=>{e&&R(`${e.table}-page${n+1}.csv`,`text/csv`,L(e.columns,e.rows))},exportTable:async()=>{if(!r||m.current)return;m.current=!0;let e=G(a.getState()),n={table:r,orderBy:i?.col,dir:i?.dir??`asc`,filter:t?{...t}:void 0},o=c.captureAgentRequestTarget(),u=new AbortController;h.current=u,d(!0),p(null);try{let t=await W(n,o,u.signal);if(u.signal.aborted||G(a.getState())!==e)return;R(`${n.table}.csv`,`text/csv;charset=utf-8`,t.content);let r=t.cap===`rows`?`Exported the first ${S(t.rowCount)} rows (row cap reached)`:t.cap===`bytes`?`Exported ${S(t.rowCount)} rows (${x(s)} byte cap reached)`:`Exported ${S(t.rowCount)} rows`;p(r),l.success(`Export of ${n.table} complete`,r)}catch(t){if(u.signal.aborted||G(a.getState())!==e)return;p(`Export failed: ${t.message}`),l.error(`Export of ${n.table} failed`,t.message)}finally{h.current===u&&(h.current=null,m.current=!1,u.signal.aborted||d(!1))}},msg:f}}var $=50;function pe(){let[e,t]=(0,k.useState)(``),[n,r]=(0,k.useState)(0),[i,a]=(0,k.useState)(null),[s,l]=(0,k.useState)(`data`),[u,d]=(0,k.useState)(null),[p,m]=(0,k.useState)(null),h=w(e=>e.active),g=w(e=>e.request),_=w(e=>e.release),[v,y]=(0,k.useState)(`SELECT name FROM sqlite_master WHERE type = 'table'`),b=(0,k.useRef)(null);(0,k.useEffect)(()=>{p===null?_(`database-row`):h!==`database-row`&&m(null)},[p,h,_]),(0,k.useEffect)(()=>()=>{w.getState().release(`database-row`)},[]);let{data:x,error:S,loading:C,refetch:T}=f(()=>c.db.tables(),[],{intervalMs:1e4}),E=(0,k.useMemo)(()=>x?.tables??[],[x]),D=S instanceof o&&S.status===404,{data:ee,error:O,refetch:A}=f(()=>D?Promise.resolve(null):c.db.info(),[D],{intervalMs:15e3}),j=e||E[0]?.name||``;(0,k.useEffect)(()=>{!e&&E[0]&&t(E[0].name)},[e,E]);let{data:M,error:N,refetch:P}=f(()=>j?c.db.schema(j):Promise.resolve(null),[j],{intervalMs:3e4}),F=(0,k.useMemo)(()=>{let e={};if(M?.table===j)for(let t of M.columns)e[t.name]={type:t.type,primaryKey:t.primaryKey};return e},[M,j]),I=u?JSON.stringify([u.column,u.op,u.value]):``,{data:L,error:R,loading:z,refetch:B}=f((0,k.useCallback)(async()=>{if(!j)return null;let e={table:j,limit:$,offset:n*$,orderBy:i?.col,dir:i?.dir??`asc`,filter:u??void 0};return ae(await c.db.rows(j,$,e.offset,i?.col,i?.dir,u??void 0),e)},[j,n,i,u]),[j,n,i,I],{intervalMs:6e3}),V={table:j,limit:$,offset:n*$,orderBy:i?.col,dir:i?.dir??`asc`,filter:u??void 0},H=!!L&&J(L,V),U=R??(L&&!H?Error(`Database rows identity no longer matches the selected table and page.`):null),W=!U&&H?L:null,G=p!==null&&W!==null&&se(p,W),te=G?p:null;(0,k.useEffect)(()=>{p&&!G&&m(null)},[p,G]),(0,k.useEffect)(()=>{W&&W.total>0&&W.rows.length===0&&n>0&&r(Math.max(0,Math.ceil(W.total/$)-1))},[W,n]);let ne=()=>{r(0),a(null),d(null),m(null)},K=e=>{t(e),l(`data`),ne()},re=e=>{r(0),m(null),a(t=>t?.col===e?t.dir===`asc`?{col:e,dir:`desc`}:null:{col:e,dir:`asc`})},q=()=>{let e=`SELECT * FROM "${j.replaceAll(`"`,`""`)}" LIMIT 100`;y(e),requestAnimationFrame(()=>{b.current?.focus(),b.current?.scrollIntoView({behavior:`smooth`,block:`center`})})},Y=!!W?.truncatedCells.some(e=>e.some(Boolean)),{exportBusy:X,exportPage:Z,exportTable:ie,msg:Q}=fe({data:W,filter:u,page:n,selected:j,sort:i});return{activeModal:h,anyTruncated:Y,colMeta:F,cycleSort:re,data:W,dbMissing:D,detail:te,editorRef:b,exportBusy:X,exportPage:Z,exportTable:ie,filter:u,info:ee,infoError:O,msg:Q,page:n,pageSize:$,queryThisTable:q,refetchInfo:A,refetchRows:B,refetchSchema:P,refetchTables:T,requestModal:g,rowsLoading:z,schema:M,schemaError:N,selectTable:K,selected:j,setDetailSelection:m,setFilter:d,setPage:r,setSql:y,setTab:l,sort:i,sql:v,tab:s,tables:E,tablesError:S,tablesLoading:C,visibleRowsError:U}}function me(){let e=pe(),{activeModal:t,detail:n,setDetailSelection:r}=e;return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(le,{db:e}),n&&t===`database-row`&&(0,O.createPortal)((0,A.jsx)(de,{table:n.table,columns:n.columns,row:n.row,rowid:n.rowid,truncated:n.truncated,onClose:()=>r(null)}),document.body)]})}export{me as Database};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./cn-zFEt5SO8.js";import{f as n,g as r,r as i,t as a}from"./react-vendor-CvwrP0tU.js";import{t as o}from"./bq-C7wdABtE.js";import{t as s}from"./toastStore-B31o6Z5J.js";import{C as c,d as l,u}from"./icons-BVzwsfbG.js";import{n as d}from"./usePolledData-CNtNtd0a.js";import{n as f,t as p}from"./Button-Ch1W94fJ.js";import{t as m}from"./Card-CWxrC8OY.js";import{i as h,n as g,r as _,t as v}from"./feedback-QDN1AsYt.js";import{t as y}from"./PageHeader-CvIyaFOO.js";import{l as b,s as x}from"./format-Cg7VCIZW.js";import{a as S}from"./form-C4oby9pI.js";import{t as C}from"./Pagination-x-Cwgrul.js";import{r as w,t as T}from"./flowMutationSafety-DSd3JLAV.js";import{t as E}from"./exportFile-C7xhE8Yh.js";import{t as D}from"./QueueControl-DusMoa05.js";var O=e(r(),1),k=a();function ee({total:e,discoveryError:n,healthy:r,statsError:i,queue:a,topReason:o,pendingRetry:s,reasonCount:c}){return(0,k.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-4`,children:[(0,k.jsxs)(m,{children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Total in DLQ`}),(0,k.jsx)(`span`,{className:t(`rounded-full px-2 py-0.5 text-[11px] font-medium`,n?`bg-amber-500/10 text-warning`:e==null?`bg-surface-2 text-muted`:r?`bg-emerald-500/10 text-success`:`bg-red-500/10 text-danger`),children:n?`Unavailable`:e==null?`Loading`:r?`Healthy`:`Attention`})]}),(0,k.jsx)(`div`,{className:t(`mt-2 text-3xl font-bold tnum`,e==null||n?`text-muted`:r?`text-success`:`text-danger`),children:e==null?`—`:x(e)})]}),(0,k.jsxs)(m,{children:[(0,k.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Top Reason`}),(0,k.jsx)(`div`,{className:`mt-2 text-lg font-semibold text-fg`,children:n||i?`Unavailable`:a?o??`No failures`:`Select a queue`})]}),(0,k.jsxs)(m,{children:[(0,k.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Pending Retry`}),(0,k.jsx)(`div`,{className:`mt-2 text-3xl font-bold tnum text-fg`,children:s==null?`—`:x(s)}),(0,k.jsx)(`div`,{className:`mt-1 text-xs text-faint`,children:a?`in this queue`:`awaiting retry`})]}),(0,k.jsxs)(m,{children:[(0,k.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Failure Types`}),(0,k.jsx)(`div`,{className:`mt-2 text-3xl font-bold tnum text-fg`,children:c==null?`—`:x(c)}),(0,k.jsx)(`div`,{className:`mt-1 text-xs text-faint`,children:`distinct reasons`})]})]})}function te({queues:e,queue:n,onSelect:r}){return e.length===0?null:(0,k.jsxs)(m,{className:`mb-6`,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-faint`,children:`DLQ by queue`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(p,{size:`sm`,disabled:!0,title:T,children:[(0,k.jsx)(c,{className:`size-3.5`}),` Retry all (`,e.length,` queues)`]}),(0,k.jsxs)(p,{variant:`danger`,size:`sm`,disabled:!0,title:w,children:[`Purge all (`,e.length,` queues)`]})]})]}),(0,k.jsx)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4 xl:grid-cols-5`,children:e.map(e=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>r(e.name),className:t(`rounded-lg border p-3 text-left transition-colors`,n===e.name?`border-accent/50 bg-surface-2`:`border-line hover:border-line-strong`),children:[(0,k.jsx)(`div`,{className:`truncate font-mono text-xs text-muted`,children:e.name}),(0,k.jsx)(`div`,{className:`mt-1 text-xl font-bold tnum text-danger`,children:e.dlq})]},e.name))})]})}function A({queue:e,queues:t,reason:n,reasons:r,sort:i,search:a,pageScoped:o,onQueue:s,onReason:u,onSort:d,onSearch:m,onExport:h}){return(0,k.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`div`,{className:`w-48`,children:(0,k.jsxs)(S,{value:e,"aria-label":`Queue`,name:`dlq-queue`,autoComplete:`off`,onChange:e=>s(e.target.value),children:[(0,k.jsx)(`option`,{value:``,children:`Select a queue…`}),t.map(e=>(0,k.jsxs)(`option`,{value:e.name,children:[e.name,e.dlq?` (${e.dlq})`:``]},e.name))]})}),(0,k.jsx)(`div`,{className:`w-40`,children:(0,k.jsxs)(S,{value:n,onChange:e=>u(e.target.value),"aria-label":`Filter by reason`,name:`dlq-reason-filter`,autoComplete:`off`,children:[(0,k.jsx)(`option`,{value:`all`,children:`All Reasons`}),r.map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))]})}),(0,k.jsx)(`div`,{className:`w-36`,children:(0,k.jsxs)(S,{value:i,onChange:e=>d(e.target.value),"aria-label":o?`Sort this page`:`Sort`,name:`dlq-sort`,autoComplete:`off`,children:[(0,k.jsxs)(`option`,{value:`newest`,children:[`Newest First`,o?` (this page)`:``]}),(0,k.jsxs)(`option`,{value:`oldest`,children:[`Oldest First`,o?` (this page)`:``]})]})}),(0,k.jsx)(`input`,{value:a,onChange:e=>m(e.target.value),placeholder:`Filter this page by job ID…`,"aria-label":`Filter this page by job ID`,name:`dlq-job-filter`,autoComplete:`off`,className:`h-9 min-w-40 flex-1 rounded-lg border border-line bg-surface px-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`}),(0,k.jsxs)(p,{size:`sm`,disabled:!0,title:T,children:[(0,k.jsx)(c,{className:`size-3.5`}),` Retry All`]}),(0,k.jsx)(p,{variant:`danger`,size:`sm`,disabled:!0,title:w,children:`Purge All`}),(0,k.jsx)(f,{"aria-label":`Export this page to CSV`,title:`Export this page to CSV`,disabled:!e,onClick:h,children:(0,k.jsx)(l,{className:`size-3.5`})})]})}function j({entries:e,expanded:n,onToggle:r}){return(0,k.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,k.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Job ID`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Name`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Reason`}),(0,k.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Error`}),(0,k.jsx)(`th`,{className:`px-5 py-3 text-right font-medium`,children:`Entered`}),(0,k.jsx)(`th`,{className:`w-16 px-5 py-3`})]})}),(0,k.jsx)(`tbody`,{children:e.map(e=>{let a=`${e.job.id}-${e.enteredAt}`;return(0,k.jsxs)(`tr`,{className:`border-b border-line last:border-0 align-top hover:bg-surface-2/40`,children:[(0,k.jsx)(`td`,{className:`px-5 py-3`,children:(0,k.jsx)(i,{to:`/job?id=${encodeURIComponent(e.job.id)}`,className:`font-mono text-xs text-accent hover:underline`,children:e.job.id})}),(0,k.jsx)(`td`,{className:`px-5 py-3 font-mono text-xs text-muted`,children:e.job.name??`default`}),(0,k.jsx)(`td`,{className:`px-5 py-3`,children:(0,k.jsx)(`span`,{className:`rounded-md bg-red-500/10 px-2 py-0.5 text-xs text-danger`,children:e.reason})}),(0,k.jsx)(`td`,{className:`max-w-md px-5 py-3 text-xs text-danger/80`,children:e.error?(0,k.jsx)(`button`,{type:`button`,title:e.error,"aria-expanded":n.has(a),onClick:()=>r(a),className:t(`block w-full break-words text-left`,!n.has(a)&&`line-clamp-2`),children:e.error}):`—`}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right text-faint`,children:b(e.enteredAt)}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right`,children:(0,k.jsx)(f,{"aria-label":`Retry unavailable`,disabled:!0,title:T,children:(0,k.jsx)(c,{className:`size-3.5`})})})]},a)})})]})})}var M=25;function N(){let[e,t]=n(),[r,i]=(0,O.useState)(``),[a,c]=(0,O.useState)(`all`),[l,f]=(0,O.useState)(`newest`),[p,m]=(0,O.useState)(``),[b,x]=(0,O.useState)(0),[S,w]=(0,O.useState)(new Set),{data:N,error:P,loading:F,refetch:I}=d(D,[],{intervalMs:1e4}),L=N?.queues??[],R=N?L.reduce((e,t)=>e+t.dlq,0):null,{data:z,error:B,loading:V,refetch:H}=d((0,O.useCallback)(async()=>{if(!r)return{queue:r,page:b,entries:[],entriesTotal:0,stats:null,statsError:null};let[e,t]=await Promise.all([o.dlq(r,M,b*M),o.dlqStats(r).then(e=>({stats:e.stats,error:null})).catch(e=>({stats:null,error:e.message||`Unknown error`}))]);return{queue:r,page:b,entries:e.entries??[],entriesTotal:e.total??0,stats:t.stats,statsError:t.error}},[r,b]),[r,b]),U=z?.queue===r&&z.page===b?z:null;(0,O.useEffect)(()=>{if(!U)return;let e=U.entriesTotal??0;b>0&&b*M>=e&&x(Math.max(0,Math.ceil(e/M)-1))},[U,b]);let W=()=>{let e=(U?.entries??[]).map(e=>({jobId:e.job.id,reason:e.reason,error:e.error??``,enteredAt:new Date(e.enteredAt).toISOString(),attempts:e.attempts?.length??0}));if(e.length===0){s.info(`Nothing to export on this page`);return}E(`dlq-${r}`,e,[`jobId`,`reason`,`error`,`enteredAt`,`attempts`])},G=e=>{X.current=!0,i(e),x(0),c(`all`),t(e?{queue:e}:{},{replace:!0})},K=U?.stats?.byReason??{},q=Object.keys(K).filter(e=>K[e]>0),J=[...q].sort((e,t)=>(K[t]??0)-(K[e]??0))[0],Y=(0,O.useMemo)(()=>L.filter(e=>e.dlq>0).sort((e,t)=>t.dlq-e.dlq),[L]),X=(0,O.useRef)(!1),Z=e.get(`queue`);(0,O.useEffect)(()=>{if(!(X.current||r)){if(Z){if(L.some(e=>e.name===Z)){X.current=!0,i(Z),x(0),c(`all`);return}if(L.length===0)return}Y.length!==0&&(X.current=!0,i(Y[0].name),x(0),c(`all`))}},[r,L,Y,Z]);let Q=(0,O.useMemo)(()=>{let e=U?.entries??[];a!==`all`&&(e=e.filter(e=>e.reason===a));let t=p.trim().toLowerCase();return t&&(e=e.filter(e=>e.job.id.toLowerCase().includes(t))),[...e].sort((e,t)=>l===`newest`?t.enteredAt-e.enteredAt:e.enteredAt-t.enteredAt)},[U,a,p,l]),ne=R===0&&!P,$=a!==`all`||p.trim()!==``,re=(U?.entriesTotal??0)>M;return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(y,{title:`Dead Letter Queue`,description:`Jobs that failed after exhausting all retries. Inspect and export entries without mutating flow topology.`,live:!!r&&!!U&&!U.statsError&&!B&&!P}),B&&U&&(0,k.jsx)(h,{message:`DLQ refresh failed — showing the last successful page.`,onRetry:H}),P&&(0,k.jsx)(h,{onRetry:I,message:`Could not discover queue DLQ totals — ${P.message}. Health status is unavailable.`}),U?.statsError&&(0,k.jsx)(h,{message:`DLQ statistics are unavailable — ${U.statsError}. The entry list may still be current.`,onRetry:H}),(0,k.jsx)(ee,{total:R,discoveryError:!!P,healthy:ne,statsError:!!U?.statsError,queue:r,topReason:J,pendingRetry:U?.stats?.pendingRetry,reasonCount:U?.stats?q.length:void 0}),(0,k.jsx)(te,{queues:Y,queue:r,onSelect:G}),(0,k.jsx)(A,{queue:r,queues:L,reason:a,reasons:q,sort:l,search:p,pageScoped:re,onQueue:G,onReason:c,onSort:f,onSearch:m,onExport:W}),(0,k.jsx)(`p`,{className:`mb-4 text-xs text-warning`,children:T}),B&&!U?(0,k.jsx)(g,{error:B,onRetry:H}):F&&!N&&!r&&!P?(0,k.jsx)(_,{label:`Discovering queues…`}):V&&!U&&!B?(0,k.jsx)(_,{label:`Loading DLQ…`}):P&&!r?(0,k.jsx)(v,{icon:(0,k.jsx)(u,{}),title:`Could not discover queues`,hint:`${P.message}. Retry the queue discovery request above.`}):r?Q.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(u,{}),title:$?`No matches on this page`:`No dead letter entries`,hint:$?`No entries on this page match your filter — the filter is page-scoped. Use the pager below to check other pages.`:`This queue has no dead letter entries.`}):(0,k.jsx)(j,{entries:Q,expanded:S,onToggle:e=>w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}):(0,k.jsx)(v,{icon:(0,k.jsx)(u,{}),title:`Select a queue`,hint:`Choose a queue from the dropdown to view its dead letter queue entries.`}),r&&U&&(0,k.jsx)(C,{page:b,pageSize:M,total:U.entriesTotal,onPageChange:x,label:`entries`})]})}export{N as DlqPro};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./cn-zFEt5SO8.js";import{g as n,r,t as i}from"./react-vendor-CvwrP0tU.js";import{t as a}from"./bq-C7wdABtE.js";import{t as o}from"./toastStore-B31o6Z5J.js";import{S as s,T as c,b as l,n as u,x as d}from"./icons-BVzwsfbG.js";import{n as f}from"./usePolledData-CNtNtd0a.js";import{n as p,t as m}from"./Button-Ch1W94fJ.js";import{i as h,n as g,r as _}from"./feedback-QDN1AsYt.js";import{t as v}from"./PageHeader-CvIyaFOO.js";import{s as y}from"./format-Cg7VCIZW.js";import{n as b}from"./index-AUHH2nTG.js";import{t as x}from"./Pagination-x-Cwgrul.js";import{r as S,t as C}from"./useServerActionGuard-Db7PPgaI.js";import{t as w}from"./promisePool-BVfQ9n9Q.js";var T=e(n(),1),E=i(),D=[[`waiting`,`Waiting`],[`prioritized`,`Prioritized`],[`active`,`Active`],[`completed`,`Completed`],[`failed`,`Failed`],[`delayed`,`Delayed`]];function O({rows:e,hasData:n,error:i,search:a,sortCol:o,sortDir:c,bulkBusy:f,busy:m,onSort:h,onToggle:g}){return(0,E.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{className:`border-b border-line text-left text-[11px] uppercase tracking-wider text-faint`,children:[(0,E.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Queue`}),D.map(([e,t])=>(0,E.jsx)(`th`,{"aria-sort":o===e?c===`desc`?`descending`:`ascending`:void 0,className:`px-5 py-3 text-right font-medium`,children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>h(e),className:`inline-flex items-center gap-1 rounded uppercase tracking-wider hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[t,o===e&&(0,E.jsx)(`span`,{"aria-hidden":`true`,children:c===`desc`?`↓`:`↑`})]})},e)),(0,E.jsx)(`th`,{className:`px-5 py-3 font-medium`,children:`Status`}),(0,E.jsx)(`th`,{className:`w-24 px-5 py-3 text-right font-medium`,children:`Actions`})]})}),(0,E.jsx)(`tbody`,{children:!n&&i?(0,E.jsx)(`tr`,{children:(0,E.jsxs)(`td`,{colSpan:9,className:`px-5 py-12 text-center text-sm text-warning`,children:[`Could not load queues — `,i.message,`. Retry above.`]})}):e.length===0?(0,E.jsx)(`tr`,{children:(0,E.jsx)(`td`,{colSpan:9,className:`px-5 py-12 text-center text-sm text-faint`,children:a?`No queues match your search.`:`No queues yet.`})}):e.map(e=>{let n=f||m.has(e.name);return(0,E.jsxs)(`tr`,{className:`group border-b border-line last:border-0 transition-colors hover:bg-surface-2/50`,children:[(0,E.jsx)(`td`,{className:`px-5 py-3`,children:(0,E.jsxs)(r,{to:`/queues/${encodeURIComponent(e.name)}`,className:`flex items-center gap-2 rounded font-medium text-fg hover:text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,children:[(0,E.jsx)(s,{className:`size-4 text-faint`}),e.name]})}),(0,E.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-warning`,children:y(e.counts.waiting)}),(0,E.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-orange-400`,children:y(e.counts.prioritized)}),(0,E.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-blue-400`,children:y(e.counts.active)}),(0,E.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-success`,children:y(e.counts.completed)}),(0,E.jsx)(`td`,{className:t(`px-5 py-3 text-right tnum`,e.counts.failed?`text-danger`:`text-muted`),children:y(e.counts.failed)}),(0,E.jsx)(`td`,{className:`px-5 py-3 text-right tnum text-muted`,children:y(e.counts.delayed)}),(0,E.jsx)(`td`,{className:`px-5 py-3`,children:(0,E.jsxs)(`span`,{className:t(`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,e.paused?`bg-orange-500/10 text-orange-400`:`bg-emerald-500/10 text-success`),children:[(0,E.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`}),e.paused?`Paused`:`Active`]})}),(0,E.jsx)(`td`,{className:`px-5 py-3`,children:(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,E.jsx)(p,{"aria-label":e.paused?`Resume queue`:`Pause queue`,disabled:n,onClick:t=>{t.stopPropagation(),g(e)},children:e.paused?(0,E.jsx)(d,{className:`size-3.5 text-success`}):(0,E.jsx)(l,{className:`size-3.5 text-warning`})}),(0,E.jsx)(u,{className:`size-4 text-faint opacity-0 transition-opacity group-hover:opacity-100`})]})})]},e.name)})})]})})}var k=6,A=15;function j(){let[e,n]=(0,T.useState)(``),[r,i]=(0,T.useState)(0),[s,u]=(0,T.useState)(new Set),[p,D]=(0,T.useState)(!1),[j,M]=(0,T.useState)(null),[N,P]=(0,T.useState)(null),[F,I]=(0,T.useState)(`desc`),L=S(`queues-overview`);(0,T.useEffect)(()=>{u(new Set),D(!1),M(null)},[L.scopeKey]);let{data:R,error:z,loading:B,refetch:V}=f(()=>a.queuesSummary(),[]),H=R??[],U=e=>{N===e?F===`desc`?I(`asc`):P(null):(P(e),I(`desc`)),i(0)},W=(0,T.useMemo)(()=>{let t=e.trim().toLowerCase(),n=[...t?H.filter(e=>e.name.toLowerCase().includes(t)):H].sort((e,t)=>e.name.localeCompare(t.name));if(N){let e=F===`desc`?-1:1;n.sort((t,n)=>e*(t.counts[N]-n.counts[N]))}return n},[H,e,N,F]),G=(0,T.useMemo)(()=>H.reduce((e,t)=>(e.waiting+=t.counts.waiting,e.prioritized+=t.counts.prioritized,e.active+=t.counts.active,e.failed+=t.counts.failed,e.paused+=+!!t.paused,e),{waiting:0,prioritized:0,active:0,failed:0,paused:0}),[H]),K=Math.max(1,Math.ceil(W.length/A)),q=Math.min(r,K-1),J=W.slice(q*A,q*A+A),Y=async e=>{let t=L.begin(`queue:${e.name}`);if(t){u(t=>new Set(t).add(e.name)),M(null);try{if(C(await(e.paused?a.resume(e.name):a.pause(e.name)),e.paused?`Resume queue`:`Pause queue`),!t.isCurrent())return;M({ok:!0,text:`${e.name} ${e.paused?`resumed`:`paused`} ✓`}),V()}catch(n){if(!t.isCurrent())return;M({ok:!1,text:n.message}),o.error(`Failed to ${e.paused?`resume`:`pause`} ${e.name}`,n.message)}finally{t.finish()&&u(t=>{let n=new Set(t);return n.delete(e.name),n})}}},X=async e=>{let t=H.filter(t=>e===`pause`?!t.paused:t.paused);if(t.length===0){o.info(`No queues to ${e}`);return}if(!window.confirm(`${e===`pause`?`Pause`:`Resume`} ${t.length} queue(s)?`))return;let n=L.begin([`bulk`,...H.map(e=>`queue:${e.name}`)]);if(n){D(!0),M(null);try{let r=await w(t,k,async t=>{if(!n.isCurrent())throw Error(`Queue action target changed`);C(e===`pause`?await a.pause(t.name):await a.resume(t.name),`${e===`pause`?`Pause`:`Resume`} ${t.name}`)});if(!n.isCurrent())return;let i=r.filter(e=>e.status===`rejected`).length,s=`${e===`pause`?`Paused`:`Resumed`} ${t.length-i}/${t.length} queues${i?`, ${i} failed`:``}`;M({ok:i===0,text:s}),i===0?o.success(s):o.error(s),V()}finally{n.finish()&&D(!1)}}};return B&&!R&&!z?(0,E.jsx)(_,{label:`Loading queues…`}):z&&!R?(0,E.jsxs)(`div`,{children:[(0,E.jsx)(v,{title:`Queues`,description:`Queue inventory unavailable`}),(0,E.jsx)(g,{error:z,onRetry:V})]}):(0,E.jsxs)(`div`,{children:[(0,E.jsx)(v,{title:`Queues`,description:R?`${H.length} queues`:`Queue inventory unavailable`,live:!!R&&!z,actions:H.length>0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(m,{variant:`warning`,size:`sm`,disabled:p||s.size>0||G.paused>=H.length,onClick:()=>X(`pause`),children:[(0,E.jsx)(l,{className:`size-3.5`}),` Pause all`]}),(0,E.jsxs)(m,{variant:`success`,size:`sm`,disabled:p||s.size>0||G.paused===0,onClick:()=>X(`resume`),children:[(0,E.jsx)(d,{className:`size-3.5`}),` Resume all`]})]}):void 0}),z&&(0,E.jsx)(h,{message:`Queue refresh failed — showing the last successful inventory.`,onRetry:V}),(0,E.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-4 md:grid-cols-5`,children:[(0,E.jsx)(b,{label:`Waiting`,value:y(G.waiting),tone:`amber`,compact:!0}),(0,E.jsx)(b,{label:`Prioritized`,value:y(G.prioritized),tone:`amber`,compact:!0}),(0,E.jsx)(b,{label:`Active`,value:y(G.active),tone:`blue`,compact:!0}),(0,E.jsx)(b,{label:`Failed`,value:y(G.failed),tone:G.failed?`red`:`default`,compact:!0}),(0,E.jsx)(b,{label:`Paused`,value:y(G.paused),tone:G.paused?`amber`:`default`,compact:!0})]}),(0,E.jsxs)(`div`,{className:`relative mb-4 max-w-sm`,children:[(0,E.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-faint`}),(0,E.jsx)(`input`,{value:e,onChange:e=>{n(e.target.value),i(0)},placeholder:`Search queues…`,"aria-label":`Filter queues`,name:`queue-filter`,autoComplete:`off`,className:`h-9 w-full rounded-lg border border-line bg-surface pl-9 pr-3 text-sm text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})]}),j&&(0,E.jsx)(`div`,{role:`status`,className:t(`mb-3 text-sm`,j.ok?`text-success`:`text-danger`),children:j.text}),(0,E.jsx)(O,{rows:J,hasData:!!R,error:z,search:e,sortCol:N,sortDir:F,bulkBusy:p,busy:s,onSort:U,onToggle:e=>void Y(e)}),(0,E.jsx)(x,{page:q,pageSize:A,total:W.length,onPageChange:i,label:`queues`})]})}export{j as QueuesOverview};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./cn-zFEt5SO8.js";import{g as t,t as n}from"./react-vendor-CvwrP0tU.js";import{a as r,o as i,t as a}from"./connectionStore-CFuNYZ_8.js";import{f as o}from"./icons-BVzwsfbG.js";import{n as s,t as c}from"./Button-Ch1W94fJ.js";import{n as l,t as u}from"./Card-CWxrC8OY.js";import{t as d}from"./PageHeader-CvIyaFOO.js";import{o as f}from"./index-AUHH2nTG.js";import{a as p,n as m,t as h}from"./form-C4oby9pI.js";var g=e(t(),1),_=n(),v=[[`1000`,`1 second`],[`2000`,`2 seconds`],[`3000`,`3 seconds`],[`5000`,`5 seconds`],[`10000`,`10 seconds`]];function y(){let{refreshMs:e,setRefreshMs:t}=i(),{theme:n,setTheme:r}=f();return(0,_.jsxs)(u,{children:[(0,_.jsx)(l,{title:`Appearance & refresh`}),(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,_.jsx)(h,{label:`Theme`,children:(0,_.jsxs)(p,{name:`theme`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),children:[(0,_.jsx)(`option`,{value:`dark`,children:`Dark`}),(0,_.jsx)(`option`,{value:`light`,children:`Light`})]})}),(0,_.jsx)(h,{label:`Refresh interval`,children:(0,_.jsx)(p,{name:`refresh-interval`,autoComplete:`off`,value:String(e),onChange:e=>t(Number(e.target.value)),children:v.map(([e,t])=>(0,_.jsx)(`option`,{value:e,children:t},e))})})]})]})}var b=1e4,x=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u;async function S(e,t={},n=b){let r=new AbortController,i=t.signal,a=i?AbortSignal.any([i,r.signal]):r.signal,o=Error(`Connection test timed out after ${Math.ceil(n/1e3)} seconds.`),s,c,l=new Promise((e,t)=>{s=setTimeout(()=>{r.abort(o),t(o)},n)}),u=i?new Promise((e,t)=>{let n=()=>{t(i.reason??new DOMException(`Connection test aborted`,`AbortError`))};i.aborted?n():(i.addEventListener(`abort`,n,{once:!0}),c=()=>i.removeEventListener(`abort`,n))}):null;try{let n=(async()=>{let n=await fetch(e,{...t,signal:a});if(!n.ok&&n.status!==503)throw Error(`HTTP ${n.status}`);let r=await n.json();if(typeof r!=`object`||!r||Array.isArray(r))throw Error(`Malformed health response`);let i=r;if(typeof i.ok!=`boolean`||i.status!==`healthy`&&i.status!==`degraded`||!Number.isSafeInteger(i.uptime)||i.uptime<0||typeof i.version!=`string`||!x.test(i.version)||i.ok!==(i.status===`healthy`))throw Error(`Malformed health response`);return{response:n,health:i}})();return await Promise.race(u?[n,l,u]:[n,l])}catch(e){throw r.signal.aborted&&r.signal.reason===o?o:e}finally{s!==void 0&&clearTimeout(s),c?.()}}function C(){let{baseUrl:e,token:t,agentToken:n,saveConnection:f}=i(),[p,v]=(0,g.useState)(!1),[b,x]=(0,g.useState)(null),[C,w]=(0,g.useState)(e),[T,E]=(0,g.useState)(t),[D,O]=(0,g.useState)(n),[k,A]=(0,g.useState)(!1),[j,M]=(0,g.useState)(!1),[N,P]=(0,g.useState)(null),[F,I]=(0,g.useState)(null),L=(0,g.useRef)(!0),R=(0,g.useRef)(0),z=(0,g.useRef)(null),B=(0,g.useRef)(null),V=(0,g.useCallback)(()=>{B.current!==null&&(clearTimeout(B.current),B.current=null),L.current&&I(null)},[]),H=(0,g.useCallback)(()=>{R.current+=1,z.current?.abort(new DOMException(`Connection test superseded`,`AbortError`)),z.current=null,L.current&&(v(!1),x(null))},[]);return(0,g.useEffect)(()=>(L.current=!0,()=>{L.current=!1,R.current+=1,z.current?.abort(new DOMException(`Settings unmounted`,`AbortError`)),z.current=null,B.current!==null&&(clearTimeout(B.current),B.current=null)}),[]),(0,g.useEffect)(()=>{w(e),E(t),O(n),H()},[n,e,H,t]),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(d,{title:`Settings`,description:`Connection and appearance.`}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,_.jsxs)(u,{children:[(0,_.jsx)(l,{title:`Connection`}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,_.jsx)(h,{label:`Server URL`,children:(0,_.jsx)(m,{name:`server-url`,value:C,onChange:e=>{H(),V(),w(e.target.value),P(null)},placeholder:`/api or https://queue.example.com`,autoComplete:`off`,inputMode:`url`,"aria-invalid":N?!0:void 0,"aria-describedby":N?`server-url-error`:`server-url-help`})}),N&&(0,_.jsx)(`p`,{id:`server-url-error`,className:`-mt-2 text-xs text-danger`,children:N}),(0,_.jsxs)(`p`,{id:`server-url-help`,className:`-mt-2 text-xs text-faint`,children:[`Use `,(0,_.jsx)(`code`,{className:`font-mono`,children:`/api`}),` in dev (proxied to localhost:6790), or the server origin in production.`]}),(0,_.jsx)(h,{label:`Bearer token (optional)`,hint:`Kept in memory only — re-enter after reload. Never bake secrets into VITE_* variables.`,htmlFor:`bearer-token`,children:(0,_.jsxs)(`div`,{className:`relative`,children:[(0,_.jsx)(m,{id:`bearer-token`,name:`bearer-token`,type:k?`text`:`password`,value:T,onChange:e=>{H(),V(),E(e.target.value)},placeholder:`only if AUTH_TOKENS is set`,className:`pr-10`,autoComplete:`off`,spellCheck:!1}),(0,_.jsx)(s,{"aria-label":k?`Hide token`:`Show token`,className:`absolute right-0.5 top-1/2 -translate-y-1/2`,onClick:()=>A(e=>!e),children:(0,_.jsx)(o,{className:`size-4`})})]})}),(0,_.jsx)(h,{label:`Agent token (optional)`,hint:`Only if the control agent runs with AGENT_TOKEN. Kept in memory; re-enter after reload.`,htmlFor:`agent-token`,children:(0,_.jsxs)(`div`,{className:`relative`,children:[(0,_.jsx)(m,{id:`agent-token`,name:`agent-token`,type:j?`text`:`password`,value:D,onChange:e=>{H(),V(),O(e.target.value)},placeholder:`only if AGENT_TOKEN is set`,className:`pr-10`,autoComplete:`off`,spellCheck:!1}),(0,_.jsx)(s,{"aria-label":j?`Hide agent token`:`Show agent token`,className:`absolute right-0.5 top-1/2 -translate-y-1/2`,onClick:()=>M(e=>!e),children:(0,_.jsx)(o,{className:`size-4`})})]})}),(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,_.jsx)(c,{variant:`accent`,onClick:()=>{H();let e=r(C);if(!e){P(a);return}P(null),w(e);let t=f({baseUrl:e,token:T,agentToken:D});V(),I({persisted:t.persisted,message:t.persisted?`Saved ✓`:`Saved for this session only — browser storage unavailable${t.error?`: ${t.error}`:`.`}`}),B.current=setTimeout(()=>{B.current=null,L.current&&I(null)},4e3)},children:`Save`}),(0,_.jsx)(c,{onClick:async()=>{H();let e=r(C);if(!e){P(a),x({ok:!1,msg:a});return}P(null);let t=R.current,n=new AbortController,o=i.getState(),s=()=>{let e=i.getState();return L.current&&t===R.current&&!n.signal.aborted&&e.baseUrl===o.baseUrl&&e.token===o.token&&e.agentToken===o.agentToken};z.current=n,v(!0),x(null);let c=performance.now();try{let{response:t,health:r}=await S(`${e}/health`,{headers:T.trim()?{Authorization:`Bearer ${T.trim()}`}:void 0,signal:n.signal});if(!s())return;let i=Math.round(performance.now()-c),a=t.status===503||r.status===`degraded`;x({ok:!a,msg:`${a?`Server reachable`:`Connected`} in ${i}ms · bunqueue v${r.version}${a?` · degraded`:``}`})}catch(e){if(!s())return;x({ok:!1,msg:e.message})}finally{L.current&&t===R.current&&(z.current=null,v(!1))}},children:p?`Restart test`:`Test connection`}),F&&(0,_.jsx)(`span`,{role:`status`,className:F.persisted?`text-sm text-success`:`text-sm text-warning`,children:F.message}),b&&(0,_.jsx)(`span`,{role:`status`,className:b.ok?`text-sm text-success`:`text-sm text-danger`,children:b.msg})]}),(0,_.jsx)(`p`,{className:`-mt-1 text-xs text-faint`,children:`Test checks the values above as typed. Saving repoints every page at the new server immediately.`})]})]}),(0,_.jsx)(y,{})]})]})}export{C as Settings};
|