@lunora/studio 1.0.0-alpha.3 → 1.0.0-alpha.31
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/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +29 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
- package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +24 -36
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +13 -9
- package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
- package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +147 -204
- package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
- package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +107 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +41 -53
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +37 -44
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +39 -46
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +15 -15
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +44 -31
- package/dist/packem_chunks/SettingsPanel.js +390 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +12 -252
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
- package/dist/packem_chunks/analytics-panel.js +261 -0
- package/dist/packem_chunks/auth-config-panel.js +179 -0
- package/dist/packem_chunks/auth-sessions-panel.js +175 -0
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +779 -0
- package/dist/packem_chunks/fanout-panel.js +481 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/kv-browser.js +1896 -0
- package/dist/packem_chunks/log-drains-panel.js +273 -0
- package/dist/packem_chunks/organizations-panel.js +670 -0
- package/dist/packem_chunks/payments-panel.js +185 -0
- package/dist/packem_chunks/permissions-panel.js +804 -0
- package/dist/packem_chunks/queues-panel.js +147 -0
- package/dist/packem_chunks/rls-panel.js +313 -0
- package/dist/packem_chunks/schedule-panel.js +831 -0
- package/dist/packem_chunks/sparkline.js +79 -0
- package/dist/packem_chunks/storage-rules-panel.js +138 -0
- package/dist/packem_chunks/subscriptions-panel.js +236 -0
- package/dist/packem_chunks/users-panel.js +1265 -0
- package/dist/packem_chunks/vector-browser.js +281 -0
- package/dist/packem_chunks/workflows-panel.js +562 -0
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-B6u_wnz-.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Drz4UO0a.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-B5BertvU.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-ANTHLWWh.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CjgTG_wa.js} +37 -66
- package/dist/packem_shared/HomePanel-BRcQVDby.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CspFdbUT.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-BEJXtsBn.js} +163 -60
- package/dist/packem_shared/Studio-B1V0GxTz.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-CR0Tvy81.js} +277 -3
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-DzqyvUU3.js} +1 -1
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-Bb__F5-u.js} +1 -1
- package/dist/packem_shared/browser-storage-d03UsV7v.js +249 -0
- package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
- package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-Dsg6nRjo.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-D7nNzBYm.js} +4 -99
- package/dist/packem_shared/{HomePanel-Cw16stjq.js → home-panel-CRIs6x2j.js} +835 -469
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-FcNZ3beb.js} +1 -1
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-Doy1XlQq.js} +4 -44
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
- package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-KgMPHS4u.js} +1 -1
- package/dist/packem_shared/studio-CQ-rtNhn.js +4013 -0
- package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-VMo0ftxD.js} +1 -1
- package/dist/packem_shared/use-admin-query-BViPA3US.js +105 -0
- package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +32 -0
- package/dist/standalone/chunk-2DS7JLWL.js +13 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-2PDQ4KZ6.js +1 -0
- package/dist/standalone/chunk-3BP4BTLR.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-45QK5ZPN.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-57LYXHXH.js +1 -0
- package/dist/standalone/chunk-5NSZVXCS.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-63XKJQTQ.js +1 -0
- package/dist/standalone/chunk-6RC6L33K.js +4 -0
- package/dist/standalone/chunk-6VTGE3WJ.js +1 -0
- package/dist/standalone/chunk-7PBZKXYA.js +1 -0
- package/dist/standalone/chunk-7POIIWC5.js +3 -0
- package/dist/standalone/chunk-7RYIQKZA.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-AB6QGMBF.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-AQGOX5DK.js +1 -0
- package/dist/standalone/chunk-ASLGNHAX.js +1 -0
- package/dist/standalone/chunk-BHTPZS7L.js +4 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-D6ORSB24.js +1 -0
- package/dist/standalone/chunk-DGWTR4G7.js +1 -0
- package/dist/standalone/chunk-DSX53PBM.js +1 -0
- package/dist/standalone/chunk-DV2MNASX.js +1 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-EGJX34WM.js +1 -0
- package/dist/standalone/chunk-FCR3HKFV.js +1 -0
- package/dist/standalone/chunk-FKO3HO6I.js +4 -0
- package/dist/standalone/chunk-FQKNJSRA.js +76 -0
- package/dist/standalone/chunk-G2TFEWEQ.js +4 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GZXPPJVK.js +1 -0
- package/dist/standalone/chunk-HFBRE65A.js +1 -0
- package/dist/standalone/chunk-HG7Q5B3H.js +1 -0
- package/dist/standalone/chunk-HTQL7AXU.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-ITLLHEVG.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KG3QTFWE.js +1 -0
- package/dist/standalone/chunk-KGS7KM4A.js +2 -0
- package/dist/standalone/chunk-KNRVPCFX.js +1 -0
- package/dist/standalone/chunk-KODWGUAB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-LZWPCZLE.js +1 -0
- package/dist/standalone/chunk-N2QDG3MW.js +1 -0
- package/dist/standalone/chunk-N4JI6VQD.js +1 -0
- package/dist/standalone/chunk-NNISYDNI.js +1 -0
- package/dist/standalone/chunk-O4PXDNR3.js +1 -0
- package/dist/standalone/chunk-O77VNUFD.js +1 -0
- package/dist/standalone/chunk-OD2POGPJ.js +1 -0
- package/dist/standalone/chunk-OXCK3ZUG.js +1 -0
- package/dist/standalone/chunk-P7DSVO4U.js +1 -0
- package/dist/standalone/chunk-PKAM3N5C.js +1 -0
- package/dist/standalone/chunk-QGXGBHQO.js +1 -0
- package/dist/standalone/chunk-QHA3TAEJ.js +1 -0
- package/dist/standalone/chunk-QQWC62X7.js +1 -0
- package/dist/standalone/chunk-RMYA7NAH.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-S53RUBW5.js +1 -0
- package/dist/standalone/chunk-SB4GT6PK.js +1 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-SHIOUDOT.js +1 -0
- package/dist/standalone/chunk-SIDRSX7Y.js +1 -0
- package/dist/standalone/chunk-SVR644RF.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TICVNLPM.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGMRUEBU.js +1 -0
- package/dist/standalone/chunk-UII66UVF.js +1 -0
- package/dist/standalone/chunk-VJPQUBN6.js +8 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VMJKJWG6.js +1 -0
- package/dist/standalone/chunk-VPDPN5RR.js +2 -0
- package/dist/standalone/chunk-VSEGZA3J.js +1 -0
- package/dist/standalone/chunk-VXBZQIGY.js +4 -0
- package/dist/standalone/chunk-W5LWN6IP.js +1 -0
- package/dist/standalone/chunk-W7PCVQTE.js +1 -0
- package/dist/standalone/chunk-W7SQVLBH.js +1 -0
- package/dist/standalone/chunk-XLILSHPE.js +1 -0
- package/dist/standalone/chunk-XURNGQSS.js +1 -0
- package/dist/standalone/chunk-YJGANMU7.js +18 -0
- package/dist/standalone/chunk-YQQJ4N6U.js +1 -0
- package/dist/standalone/chunk-ZH7UES4T.js +2 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/chunk-ZQCVDXDL.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +1 -1
- package/package.json +13 -12
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
- package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
4
|
+
import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
|
|
5
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
6
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
7
|
+
import { a as CLOUDFLARE_OBSERVABILITY_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
|
|
8
|
+
import { f as fireAndForget, e as errorMessage, b as copyToClipboard } from '../packem_shared/internal-FcNZ3beb.js';
|
|
9
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
10
|
+
|
|
11
|
+
const DestinationRow = (t0) => {
|
|
12
|
+
const $ = c(23);
|
|
13
|
+
const {
|
|
14
|
+
destination
|
|
15
|
+
} = t0;
|
|
16
|
+
const t = useT();
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== destination.snippet) {
|
|
19
|
+
t1 = () => {
|
|
20
|
+
copyToClipboard(destination.snippet);
|
|
21
|
+
};
|
|
22
|
+
$[0] = destination.snippet;
|
|
23
|
+
$[1] = t1;
|
|
24
|
+
} else {
|
|
25
|
+
t1 = $[1];
|
|
26
|
+
}
|
|
27
|
+
const onCopy = t1;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[2] !== destination.title) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsxDEV("h4", {
|
|
31
|
+
className: "text-sm font-semibold",
|
|
32
|
+
children: destination.title
|
|
33
|
+
}, void 0, false);
|
|
34
|
+
$[2] = destination.title;
|
|
35
|
+
$[3] = t2;
|
|
36
|
+
} else {
|
|
37
|
+
t2 = $[3];
|
|
38
|
+
}
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[4] !== destination.description) {
|
|
41
|
+
t3 = /* @__PURE__ */ jsxDEV("p", {
|
|
42
|
+
className: "text-sm text-muted-foreground",
|
|
43
|
+
children: destination.description
|
|
44
|
+
}, void 0, false);
|
|
45
|
+
$[4] = destination.description;
|
|
46
|
+
$[5] = t3;
|
|
47
|
+
} else {
|
|
48
|
+
t3 = $[5];
|
|
49
|
+
}
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[6] !== t2 || $[7] !== t3) {
|
|
52
|
+
t4 = /* @__PURE__ */ jsxDEV("div", {
|
|
53
|
+
children: [t2, t3]
|
|
54
|
+
}, void 0, true);
|
|
55
|
+
$[6] = t2;
|
|
56
|
+
$[7] = t3;
|
|
57
|
+
$[8] = t4;
|
|
58
|
+
} else {
|
|
59
|
+
t4 = $[8];
|
|
60
|
+
}
|
|
61
|
+
const t5 = `drain-copy-${destination.id}`;
|
|
62
|
+
let t6;
|
|
63
|
+
if ($[9] !== t) {
|
|
64
|
+
t6 = t("Copy");
|
|
65
|
+
$[9] = t;
|
|
66
|
+
$[10] = t6;
|
|
67
|
+
} else {
|
|
68
|
+
t6 = $[10];
|
|
69
|
+
}
|
|
70
|
+
let t7;
|
|
71
|
+
if ($[11] !== onCopy || $[12] !== t5 || $[13] !== t6) {
|
|
72
|
+
t7 = /* @__PURE__ */ jsxDEV(Button, {
|
|
73
|
+
"data-testid": t5,
|
|
74
|
+
onClick: onCopy,
|
|
75
|
+
size: "sm",
|
|
76
|
+
variant: "outline",
|
|
77
|
+
children: t6
|
|
78
|
+
}, void 0, false);
|
|
79
|
+
$[11] = onCopy;
|
|
80
|
+
$[12] = t5;
|
|
81
|
+
$[13] = t6;
|
|
82
|
+
$[14] = t7;
|
|
83
|
+
} else {
|
|
84
|
+
t7 = $[14];
|
|
85
|
+
}
|
|
86
|
+
let t8;
|
|
87
|
+
if ($[15] !== t4 || $[16] !== t7) {
|
|
88
|
+
t8 = /* @__PURE__ */ jsxDEV("div", {
|
|
89
|
+
className: "flex items-start justify-between gap-3",
|
|
90
|
+
children: [t4, t7]
|
|
91
|
+
}, void 0, true);
|
|
92
|
+
$[15] = t4;
|
|
93
|
+
$[16] = t7;
|
|
94
|
+
$[17] = t8;
|
|
95
|
+
} else {
|
|
96
|
+
t8 = $[17];
|
|
97
|
+
}
|
|
98
|
+
let t9;
|
|
99
|
+
if ($[18] !== destination.snippet) {
|
|
100
|
+
t9 = /* @__PURE__ */ jsxDEV("pre", {
|
|
101
|
+
className: "mt-2 overflow-x-auto rounded bg-muted p-2 font-mono text-xs",
|
|
102
|
+
children: destination.snippet
|
|
103
|
+
}, void 0, false);
|
|
104
|
+
$[18] = destination.snippet;
|
|
105
|
+
$[19] = t9;
|
|
106
|
+
} else {
|
|
107
|
+
t9 = $[19];
|
|
108
|
+
}
|
|
109
|
+
let t10;
|
|
110
|
+
if ($[20] !== t8 || $[21] !== t9) {
|
|
111
|
+
t10 = /* @__PURE__ */ jsxDEV(Card, {
|
|
112
|
+
className: "py-0",
|
|
113
|
+
"data-testid": "drain-card",
|
|
114
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
115
|
+
className: "p-3",
|
|
116
|
+
children: [t8, t9]
|
|
117
|
+
}, void 0, true)
|
|
118
|
+
}, void 0, false);
|
|
119
|
+
$[20] = t8;
|
|
120
|
+
$[21] = t9;
|
|
121
|
+
$[22] = t10;
|
|
122
|
+
} else {
|
|
123
|
+
t10 = $[22];
|
|
124
|
+
}
|
|
125
|
+
return t10;
|
|
126
|
+
};
|
|
127
|
+
const LogDrainsPanel = () => {
|
|
128
|
+
const t = useT();
|
|
129
|
+
const destinations = [{
|
|
130
|
+
description: t("Stream every request log to R2, a SIEM, or a third-party log service."),
|
|
131
|
+
id: "logpush",
|
|
132
|
+
snippet: ["{", ' "logpush": true', "}"].join("\n"),
|
|
133
|
+
title: t("Logpush")
|
|
134
|
+
}, {
|
|
135
|
+
description: t("Send logs programmatically to a Worker for custom capture and forwarding."),
|
|
136
|
+
id: "tail-worker",
|
|
137
|
+
snippet: ["{", ' "tail_consumers": [{ "service": "my-log-forwarder" }]', "}"].join("\n"),
|
|
138
|
+
title: t("Tail Workers")
|
|
139
|
+
}, {
|
|
140
|
+
description: t("Retain and query recent request logs directly in Cloudflare's dashboard."),
|
|
141
|
+
id: "workers-logs",
|
|
142
|
+
snippet: ["{", ' "observability": { "enabled": true }', "}"].join("\n"),
|
|
143
|
+
title: t("Workers Logs")
|
|
144
|
+
}];
|
|
145
|
+
const [webhookUrl, setWebhookUrl] = useState("");
|
|
146
|
+
const [sending, setSending] = useState(false);
|
|
147
|
+
const [result, setResult] = useState(null);
|
|
148
|
+
const sendTest = async () => {
|
|
149
|
+
const url = webhookUrl.trim();
|
|
150
|
+
if (url === "") {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const fetchFunction = "fetch" in globalThis ? globalThis.fetch : void 0;
|
|
154
|
+
if (fetchFunction === void 0) {
|
|
155
|
+
setResult({
|
|
156
|
+
kind: "error",
|
|
157
|
+
message: t("fetch is unavailable in this environment.")
|
|
158
|
+
});
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const sampleEvent = {
|
|
162
|
+
durationMs: 12,
|
|
163
|
+
function: "messages:list",
|
|
164
|
+
outcome: "ok",
|
|
165
|
+
shard: "root",
|
|
166
|
+
source: "lunora",
|
|
167
|
+
tablesRead: ["messages"],
|
|
168
|
+
tablesWritten: [],
|
|
169
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
170
|
+
type: "request"
|
|
171
|
+
};
|
|
172
|
+
setSending(true);
|
|
173
|
+
setResult(null);
|
|
174
|
+
const startedAt = performance.now();
|
|
175
|
+
try {
|
|
176
|
+
const response = await fetchFunction(url, {
|
|
177
|
+
body: JSON.stringify(sampleEvent),
|
|
178
|
+
headers: {
|
|
179
|
+
"Content-Type": "application/json"
|
|
180
|
+
},
|
|
181
|
+
method: "POST"
|
|
182
|
+
});
|
|
183
|
+
setResult({
|
|
184
|
+
kind: "success",
|
|
185
|
+
latencyMs: Math.round(performance.now() - startedAt),
|
|
186
|
+
status: response.status
|
|
187
|
+
});
|
|
188
|
+
} catch (error) {
|
|
189
|
+
setResult({
|
|
190
|
+
kind: "error",
|
|
191
|
+
message: errorMessage(error)
|
|
192
|
+
});
|
|
193
|
+
} finally {
|
|
194
|
+
setSending(false);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
const onSendTest = () => {
|
|
198
|
+
fireAndForget(sendTest());
|
|
199
|
+
};
|
|
200
|
+
const onWebhookUrlChange = (event) => {
|
|
201
|
+
setWebhookUrl(event.target.value);
|
|
202
|
+
};
|
|
203
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
204
|
+
className: "flex flex-col gap-4",
|
|
205
|
+
"data-testid": "log-drains",
|
|
206
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
207
|
+
className: "flex flex-wrap items-center gap-3",
|
|
208
|
+
children: /* @__PURE__ */ jsxDEV("a", {
|
|
209
|
+
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
210
|
+
"data-testid": "drain-cf-link",
|
|
211
|
+
href: CLOUDFLARE_OBSERVABILITY_URL,
|
|
212
|
+
rel: "noreferrer",
|
|
213
|
+
target: "_blank",
|
|
214
|
+
children: t("Open in Cloudflare")
|
|
215
|
+
}, void 0, false)
|
|
216
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("p", {
|
|
217
|
+
className: "text-sm text-muted-foreground",
|
|
218
|
+
"data-testid": "drain-readonly-note",
|
|
219
|
+
children: t("Lunora does not ship logs itself — forwarding is handled by Cloudflare. Configure a destination below, then test your collector.")
|
|
220
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("section", {
|
|
221
|
+
className: "flex flex-col gap-3",
|
|
222
|
+
"data-testid": "drain-destinations",
|
|
223
|
+
children: [/* @__PURE__ */ jsxDEV("h3", {
|
|
224
|
+
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
225
|
+
children: t("Cloudflare destinations")
|
|
226
|
+
}, void 0, false), destinations.map((destination) => /* @__PURE__ */ jsxDEV(DestinationRow, {
|
|
227
|
+
destination
|
|
228
|
+
}, destination.id, false))]
|
|
229
|
+
}, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
|
|
230
|
+
className: "py-0",
|
|
231
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
232
|
+
className: "p-3",
|
|
233
|
+
children: /* @__PURE__ */ jsxDEV("section", {
|
|
234
|
+
"data-testid": "drain-webhook",
|
|
235
|
+
children: [/* @__PURE__ */ jsxDEV("h3", {
|
|
236
|
+
className: "mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
237
|
+
children: t("Webhook test")
|
|
238
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("p", {
|
|
239
|
+
className: "mb-2 text-sm text-muted-foreground",
|
|
240
|
+
children: t("POST a sample Lunora request-log envelope to your collector to confirm it is reachable.")
|
|
241
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
242
|
+
className: "flex flex-wrap items-center gap-2",
|
|
243
|
+
children: [/* @__PURE__ */ jsxDEV(Input, {
|
|
244
|
+
className: "min-w-[20rem] flex-1",
|
|
245
|
+
"data-testid": "drain-webhook-url",
|
|
246
|
+
onChange: onWebhookUrlChange,
|
|
247
|
+
placeholder: t("https://example.com/logs"),
|
|
248
|
+
type: "url",
|
|
249
|
+
value: webhookUrl
|
|
250
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
|
|
251
|
+
"data-testid": "drain-webhook-test",
|
|
252
|
+
disabled: sending || webhookUrl.trim() === "",
|
|
253
|
+
onClick: onSendTest,
|
|
254
|
+
children: sending ? t("Sending…") : t("Send test event")
|
|
255
|
+
}, void 0, false)]
|
|
256
|
+
}, void 0, true), result !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
257
|
+
className: result.kind === "success" ? "mt-2 text-sm text-muted-foreground" : "mt-2 text-sm text-destructive",
|
|
258
|
+
"data-testid": "drain-webhook-result",
|
|
259
|
+
role: result.kind === "error" ? "alert" : void 0,
|
|
260
|
+
children: result.kind === "success" ? t("Delivered — status {status} in {latency}ms", {
|
|
261
|
+
latency: result.latencyMs,
|
|
262
|
+
status: result.status
|
|
263
|
+
}) : t("Failed: {message}", {
|
|
264
|
+
message: result.message
|
|
265
|
+
})
|
|
266
|
+
}, void 0, false)]
|
|
267
|
+
}, void 0, true)
|
|
268
|
+
}, void 0, false)
|
|
269
|
+
}, void 0, false)]
|
|
270
|
+
}, void 0, true);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export { LogDrainsPanel };
|