@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.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/LICENSE.md +6 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +33 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- 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} +29 -41
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
- 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} +153 -208
- 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} +108 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
- package/dist/packem_chunks/SettingsPanel.js +391 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
- 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 +365 -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 +780 -0
- package/dist/packem_chunks/fanout-panel.js +482 -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 +3178 -0
- package/dist/packem_chunks/payments-panel.js +186 -0
- package/dist/packem_chunks/permissions-panel.js +805 -0
- package/dist/packem_chunks/queues-panel.js +1075 -0
- package/dist/packem_chunks/rls-panel.js +315 -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 +140 -0
- package/dist/packem_chunks/subscriptions-panel.js +238 -0
- package/dist/packem_chunks/users-panel.js +1731 -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-BHHJi3Gb.js} +7 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
- package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
- package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- 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-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -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-CdXztApG.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
- package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- 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-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -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-UVIXQJdU.js} +1 -1
- package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
- package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
- package/dist/standalone/chunk-25AYY4H7.js +2 -0
- package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-3CJW6NWG.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-3OIHOXVV.js +1 -0
- package/dist/standalone/chunk-447TAUFD.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5C4TSNE6.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6HSHEMZV.js +76 -0
- package/dist/standalone/chunk-6JIZ34MB.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7MVSQS7B.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BX5MKYOC.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-EQZQOTJY.js +1 -0
- package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GUI5GFFI.js +1 -0
- package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HYDJNCGW.js +1 -0
- package/dist/standalone/chunk-HZK5RQHG.js +1 -0
- package/dist/standalone/chunk-IN2SYVJB.js +1 -0
- package/dist/standalone/chunk-IOANPSJN.js +1 -0
- package/dist/standalone/chunk-ISDZPW3V.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-J73VHFCL.js +1 -0
- package/dist/standalone/chunk-JHKMUTIF.js +13 -0
- package/dist/standalone/chunk-JPRH6DPK.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KA5YB3VP.js +1 -0
- package/dist/standalone/chunk-KBB75WNT.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KQV4NGH3.js +1 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KUH4P5F5.js +1 -0
- package/dist/standalone/chunk-KYJPPVGB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LBN7LPVK.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
- package/dist/standalone/chunk-N2X2OO4V.js +1 -0
- package/dist/standalone/chunk-NGKITPQP.js +13 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OZACQNKG.js +1 -0
- package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
- package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TDZ44E5I.js +4 -0
- package/dist/standalone/chunk-THNBTMUF.js +1 -0
- package/dist/standalone/chunk-TIQISBGK.js +1 -0
- package/dist/standalone/chunk-TMYVNQ66.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UJB2LEI4.js +4 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-W3JK4YWR.js +1 -0
- package/dist/standalone/chunk-W3SHEIAL.js +3 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WIHXMNUY.js +1 -0
- package/dist/standalone/chunk-WLDVXVI2.js +1 -0
- package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YJAPWSDC.js +4 -0
- package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
- package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +15 -13
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- 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, g as copyToClipboard } from '../packem_shared/internal-CYcbqMjX.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 };
|