@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,562 @@
|
|
|
1
|
+
import { useLunora } from '@lunora/react';
|
|
2
|
+
import { useState, useEffect, useMemo } 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 { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
6
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
7
|
+
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
|
|
8
|
+
import { T as Textarea } from '../packem_shared/textarea-D3gaCU_-.js';
|
|
9
|
+
import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
|
|
10
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
11
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
12
|
+
import { f as fireAndForget, e as errorMessage, c as callOptions, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
|
|
13
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
14
|
+
|
|
15
|
+
const STATUS_FILTERS = ["queued", "running", "paused", "waiting", "complete", "errored", "terminated"];
|
|
16
|
+
const ACTIONS = ["pause", "resume", "terminate"];
|
|
17
|
+
const NOT_CONFIGURED_CODE = "WORKFLOWS_NOT_CONFIGURED";
|
|
18
|
+
const isNotConfigured = (error) => typeof error === "object" && error !== null && error.code === NOT_CONFIGURED_CODE;
|
|
19
|
+
const formatStepPayload = (step) => {
|
|
20
|
+
const value = step.error ?? step.output;
|
|
21
|
+
if (value === void 0) {
|
|
22
|
+
return "—";
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return JSON.stringify(value);
|
|
26
|
+
} catch {
|
|
27
|
+
return "(unserializable)";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const WorkflowInstanceHistory = ({
|
|
31
|
+
loadDetail,
|
|
32
|
+
loadInstances,
|
|
33
|
+
readOnly,
|
|
34
|
+
runAction,
|
|
35
|
+
workflowName
|
|
36
|
+
}) => {
|
|
37
|
+
const client = useLunora();
|
|
38
|
+
const t = useT();
|
|
39
|
+
const [instances, setInstances] = useState(null);
|
|
40
|
+
const [detail, setDetail] = useState(null);
|
|
41
|
+
const [statusFilter, setStatusFilter] = useState("");
|
|
42
|
+
const [error, setError] = useState(null);
|
|
43
|
+
const [notConfigured, setNotConfigured] = useState(false);
|
|
44
|
+
const [busyId, setBusyId] = useState(null);
|
|
45
|
+
const detailImpl = loadDetail ?? ((arguments_) => client.getWorkflowInstance(arguments_));
|
|
46
|
+
const clientOwned = loadInstances === void 0;
|
|
47
|
+
const clientAction = clientOwned ? (arguments_) => client.setWorkflowInstanceStatus(arguments_) : void 0;
|
|
48
|
+
const actionImpl = readOnly ? void 0 : runAction ?? clientAction;
|
|
49
|
+
const load = async () => {
|
|
50
|
+
setError(null);
|
|
51
|
+
setNotConfigured(false);
|
|
52
|
+
const status = statusFilter === "" ? void 0 : statusFilter;
|
|
53
|
+
try {
|
|
54
|
+
if (loadInstances === void 0) {
|
|
55
|
+
const page = await client.listWorkflowInstances({
|
|
56
|
+
name: workflowName,
|
|
57
|
+
status
|
|
58
|
+
});
|
|
59
|
+
if (page.configured === false) {
|
|
60
|
+
setInstances(null);
|
|
61
|
+
setNotConfigured(true);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setInstances(page.instances);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setInstances(await loadInstances({
|
|
68
|
+
name: workflowName,
|
|
69
|
+
status
|
|
70
|
+
}));
|
|
71
|
+
} catch (error_) {
|
|
72
|
+
setInstances(null);
|
|
73
|
+
if (isNotConfigured(error_)) {
|
|
74
|
+
setNotConfigured(true);
|
|
75
|
+
} else {
|
|
76
|
+
setError(errorMessage(error_));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
setDetail(null);
|
|
82
|
+
fireAndForget(load());
|
|
83
|
+
}, [workflowName, statusFilter]);
|
|
84
|
+
const openDetail = async (id) => {
|
|
85
|
+
setError(null);
|
|
86
|
+
try {
|
|
87
|
+
setDetail(await detailImpl({
|
|
88
|
+
id,
|
|
89
|
+
name: workflowName
|
|
90
|
+
}));
|
|
91
|
+
} catch (error_) {
|
|
92
|
+
setError(errorMessage(error_));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const act = async (id, action) => {
|
|
96
|
+
if (actionImpl === void 0) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setBusyId(id);
|
|
100
|
+
setError(null);
|
|
101
|
+
try {
|
|
102
|
+
await actionImpl({
|
|
103
|
+
action,
|
|
104
|
+
id,
|
|
105
|
+
name: workflowName
|
|
106
|
+
});
|
|
107
|
+
await load();
|
|
108
|
+
} catch (error_) {
|
|
109
|
+
setError(errorMessage(error_));
|
|
110
|
+
} finally {
|
|
111
|
+
setBusyId(null);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
115
|
+
className: "flex flex-col gap-3",
|
|
116
|
+
"data-testid": "lunora-workflow-instances",
|
|
117
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
118
|
+
className: "flex items-center justify-between gap-2",
|
|
119
|
+
children: [/* @__PURE__ */ jsxDEV("h3", {
|
|
120
|
+
className: "text-sm font-medium",
|
|
121
|
+
children: t("Instance history")
|
|
122
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("select", {
|
|
123
|
+
"aria-label": t("Filter by status"),
|
|
124
|
+
className: "h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50",
|
|
125
|
+
"data-testid": "workflow-instances-filter",
|
|
126
|
+
onChange: (event) => {
|
|
127
|
+
setStatusFilter(event.target.value);
|
|
128
|
+
},
|
|
129
|
+
value: statusFilter,
|
|
130
|
+
children: [/* @__PURE__ */ jsxDEV("option", {
|
|
131
|
+
value: "",
|
|
132
|
+
children: t("All statuses")
|
|
133
|
+
}, void 0, false), STATUS_FILTERS.map((status) => /* @__PURE__ */ jsxDEV("option", {
|
|
134
|
+
value: status,
|
|
135
|
+
children: status
|
|
136
|
+
}, status, false))]
|
|
137
|
+
}, void 0, true)]
|
|
138
|
+
}, void 0, true), error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
139
|
+
className: "text-sm text-destructive",
|
|
140
|
+
"data-testid": "workflow-instances-error",
|
|
141
|
+
role: "alert",
|
|
142
|
+
children: error
|
|
143
|
+
}, void 0, false), notConfigured && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
144
|
+
description: t("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),
|
|
145
|
+
testId: "workflow-instances-unconfigured",
|
|
146
|
+
title: t("Workflow inspection not configured")
|
|
147
|
+
}, void 0, false), !notConfigured && instances !== null && instances.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
148
|
+
description: t("No instances match this filter for the selected workflow."),
|
|
149
|
+
testId: "workflow-instances-empty",
|
|
150
|
+
title: t("No instances")
|
|
151
|
+
}, void 0, false), instances !== null && instances.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
152
|
+
className: "overflow-hidden py-0",
|
|
153
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
154
|
+
className: "px-0",
|
|
155
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
156
|
+
"data-testid": "workflow-instances-table",
|
|
157
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
158
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
159
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
160
|
+
children: t("Instance id")
|
|
161
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
162
|
+
children: t("Status")
|
|
163
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
164
|
+
children: t("Created")
|
|
165
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
166
|
+
children: t("Ended")
|
|
167
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
168
|
+
"aria-label": t("Actions")
|
|
169
|
+
}, void 0, false)]
|
|
170
|
+
}, void 0, true)
|
|
171
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
172
|
+
children: instances.map((instance) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
173
|
+
"data-testid": `workflow-instance-${instance.id}`,
|
|
174
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
175
|
+
className: "font-mono text-xs",
|
|
176
|
+
children: instance.id
|
|
177
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
178
|
+
className: "font-mono text-xs",
|
|
179
|
+
children: instance.status
|
|
180
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
181
|
+
className: "text-muted-foreground tabular-nums",
|
|
182
|
+
children: instance.createdOn ?? "—"
|
|
183
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
184
|
+
className: "text-muted-foreground tabular-nums",
|
|
185
|
+
children: instance.endedOn ?? "—"
|
|
186
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
187
|
+
className: "text-right",
|
|
188
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
189
|
+
className: "flex justify-end gap-1.5",
|
|
190
|
+
children: [/* @__PURE__ */ jsxDEV(Button, {
|
|
191
|
+
"data-testid": `workflow-instance-steps-${instance.id}`,
|
|
192
|
+
onClick: () => {
|
|
193
|
+
fireAndForget(openDetail(instance.id));
|
|
194
|
+
},
|
|
195
|
+
size: "sm",
|
|
196
|
+
type: "button",
|
|
197
|
+
variant: "outline",
|
|
198
|
+
children: t("Steps")
|
|
199
|
+
}, void 0, false), actionImpl !== void 0 && ACTIONS.map((action) => /* @__PURE__ */ jsxDEV(Button, {
|
|
200
|
+
"data-testid": `workflow-instance-${action}-${instance.id}`,
|
|
201
|
+
disabled: busyId === instance.id,
|
|
202
|
+
onClick: () => {
|
|
203
|
+
fireAndForget(act(instance.id, action));
|
|
204
|
+
},
|
|
205
|
+
size: "sm",
|
|
206
|
+
type: "button",
|
|
207
|
+
variant: "ghost",
|
|
208
|
+
children: t(action)
|
|
209
|
+
}, action, false))]
|
|
210
|
+
}, void 0, true)
|
|
211
|
+
}, void 0, false)]
|
|
212
|
+
}, instance.id, true))
|
|
213
|
+
}, void 0, false)]
|
|
214
|
+
}, void 0, true)
|
|
215
|
+
}, void 0, false)
|
|
216
|
+
}, void 0, false), detail !== null && /* @__PURE__ */ jsxDEV(Card, {
|
|
217
|
+
className: "overflow-hidden py-0",
|
|
218
|
+
"data-testid": "workflow-instance-detail",
|
|
219
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
220
|
+
className: "flex flex-col gap-2 px-4 py-3",
|
|
221
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
222
|
+
className: "flex items-center justify-between",
|
|
223
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
224
|
+
className: "font-mono text-xs",
|
|
225
|
+
children: [t("Steps"), " · ", detail.id]
|
|
226
|
+
}, void 0, true), /* @__PURE__ */ jsxDEV(Button, {
|
|
227
|
+
"data-testid": "workflow-instance-detail-close",
|
|
228
|
+
onClick: () => {
|
|
229
|
+
setDetail(null);
|
|
230
|
+
},
|
|
231
|
+
size: "xs",
|
|
232
|
+
type: "button",
|
|
233
|
+
variant: "ghost",
|
|
234
|
+
children: t("Close")
|
|
235
|
+
}, void 0, false)]
|
|
236
|
+
}, void 0, true), detail.steps.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
237
|
+
className: "text-xs text-muted-foreground",
|
|
238
|
+
children: t("This instance has no recorded steps yet.")
|
|
239
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV(Table, {
|
|
240
|
+
"data-testid": "workflow-instance-steps",
|
|
241
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
242
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
243
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
244
|
+
children: t("Step")
|
|
245
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
246
|
+
children: t("Type")
|
|
247
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
248
|
+
children: t("Attempts")
|
|
249
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
250
|
+
children: t("Started")
|
|
251
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
252
|
+
children: t("Output")
|
|
253
|
+
}, void 0, false)]
|
|
254
|
+
}, void 0, true)
|
|
255
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
256
|
+
children: detail.steps.map((step, index) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
257
|
+
"data-testid": `workflow-step-${String(index)}`,
|
|
258
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
259
|
+
className: "font-mono text-xs",
|
|
260
|
+
children: step.name
|
|
261
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
262
|
+
className: "text-xs text-muted-foreground",
|
|
263
|
+
children: step.type ?? "—"
|
|
264
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
265
|
+
className: "tabular-nums",
|
|
266
|
+
children: step.attempts ?? "—"
|
|
267
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
268
|
+
className: "text-muted-foreground tabular-nums",
|
|
269
|
+
children: step.start ?? "—"
|
|
270
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
271
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
272
|
+
children: formatStepPayload(step)
|
|
273
|
+
}, void 0, false)]
|
|
274
|
+
}, `${step.name}:${String(index)}`, true))
|
|
275
|
+
}, void 0, false)]
|
|
276
|
+
}, void 0, true)]
|
|
277
|
+
}, void 0, true)
|
|
278
|
+
}, void 0, false)]
|
|
279
|
+
}, void 0, true);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const CREATE_WORKFLOW_INSTANCE = adminRef(ADMIN_FUNCTIONS.createWorkflowInstance);
|
|
283
|
+
const GET_WORKFLOW_INSTANCE_STATUS = adminRef(ADMIN_FUNCTIONS.getWorkflowInstanceStatus);
|
|
284
|
+
const formatPayload = (instance) => {
|
|
285
|
+
if (instance.error) {
|
|
286
|
+
return `${instance.error.name}: ${instance.error.message}`;
|
|
287
|
+
}
|
|
288
|
+
if (instance.output === void 0) {
|
|
289
|
+
return "—";
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
return JSON.stringify(instance.output);
|
|
293
|
+
} catch {
|
|
294
|
+
return "(unserializable)";
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
const WorkflowsPanel = () => {
|
|
298
|
+
const client = useLunora();
|
|
299
|
+
const t = useT();
|
|
300
|
+
const {
|
|
301
|
+
data,
|
|
302
|
+
error
|
|
303
|
+
} = useAdminQuery(ADMIN_FUNCTIONS.listWorkflows, {});
|
|
304
|
+
const [selectedExport, setSelectedExport] = useState("");
|
|
305
|
+
const [instanceIdInput, setInstanceIdInput] = useState("");
|
|
306
|
+
const [paramsText, setParamsText] = useState("");
|
|
307
|
+
const [starting, setStarting] = useState(false);
|
|
308
|
+
const [startError, setStartError] = useState(null);
|
|
309
|
+
const [instances, setInstances] = useState([]);
|
|
310
|
+
const [refreshingId, setRefreshingId] = useState(null);
|
|
311
|
+
const loaded = data !== void 0;
|
|
312
|
+
const workflows = useMemo(() => Array.isArray(data?.workflows) ? [...data.workflows].toSorted((a, b) => a.exportName.localeCompare(b.exportName)) : [], [data]);
|
|
313
|
+
const selectedExportName = useMemo(() => {
|
|
314
|
+
if (workflows.some((workflow) => workflow.exportName === selectedExport)) {
|
|
315
|
+
return selectedExport;
|
|
316
|
+
}
|
|
317
|
+
return workflows[0]?.exportName ?? "";
|
|
318
|
+
}, [workflows, selectedExport]);
|
|
319
|
+
const selectedWorkflow = useMemo(() => workflows.find((workflow_0) => workflow_0.exportName === selectedExportName), [workflows, selectedExportName]);
|
|
320
|
+
const upsertInstance = (next) => {
|
|
321
|
+
setInstances((previous) => {
|
|
322
|
+
const rest = previous.filter((entry) => !(entry.exportName === next.exportName && entry.id === next.id));
|
|
323
|
+
return [next, ...rest];
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
const start = async () => {
|
|
327
|
+
const exportName = selectedExportName;
|
|
328
|
+
if (exportName === "") {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
let parameters;
|
|
332
|
+
const trimmed = paramsText.trim();
|
|
333
|
+
if (trimmed !== "") {
|
|
334
|
+
try {
|
|
335
|
+
parameters = JSON.parse(trimmed);
|
|
336
|
+
} catch {
|
|
337
|
+
setStartError(t("Params must be valid JSON"));
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
setStarting(true);
|
|
342
|
+
setStartError(null);
|
|
343
|
+
try {
|
|
344
|
+
const id = instanceIdInput.trim();
|
|
345
|
+
const result = await client.query(CREATE_WORKFLOW_INSTANCE, {
|
|
346
|
+
exportName,
|
|
347
|
+
id: id === "" ? void 0 : id,
|
|
348
|
+
params: parameters
|
|
349
|
+
}, callOptions(""));
|
|
350
|
+
upsertInstance({
|
|
351
|
+
exportName,
|
|
352
|
+
id: result.id,
|
|
353
|
+
status: result.status
|
|
354
|
+
});
|
|
355
|
+
setInstanceIdInput("");
|
|
356
|
+
} catch (error_) {
|
|
357
|
+
setStartError(errorMessage(error_));
|
|
358
|
+
} finally {
|
|
359
|
+
setStarting(false);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
const startInstance = () => {
|
|
363
|
+
fireAndForget(start());
|
|
364
|
+
};
|
|
365
|
+
const refreshInstance = async (exportName_0, id_0) => {
|
|
366
|
+
setRefreshingId(id_0);
|
|
367
|
+
try {
|
|
368
|
+
const result_0 = await client.query(GET_WORKFLOW_INSTANCE_STATUS, {
|
|
369
|
+
exportName: exportName_0,
|
|
370
|
+
id: id_0
|
|
371
|
+
}, callOptions(""));
|
|
372
|
+
upsertInstance({
|
|
373
|
+
error: result_0.error,
|
|
374
|
+
exportName: exportName_0,
|
|
375
|
+
id: result_0.id,
|
|
376
|
+
output: result_0.output,
|
|
377
|
+
status: result_0.status
|
|
378
|
+
});
|
|
379
|
+
} catch (error__0) {
|
|
380
|
+
setStartError(errorMessage(error__0));
|
|
381
|
+
} finally {
|
|
382
|
+
setRefreshingId(null);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const onSelectedExportChange = (event) => {
|
|
386
|
+
setSelectedExport(event.target.value);
|
|
387
|
+
};
|
|
388
|
+
const onInstanceIdChange = (event_0) => {
|
|
389
|
+
setInstanceIdInput(event_0.target.value);
|
|
390
|
+
};
|
|
391
|
+
const onParamsChange = (event_1) => {
|
|
392
|
+
setParamsText(event_1.target.value);
|
|
393
|
+
};
|
|
394
|
+
const onRefreshClick = (event_2) => {
|
|
395
|
+
const {
|
|
396
|
+
export: exportName_1,
|
|
397
|
+
id: id_1
|
|
398
|
+
} = event_2.currentTarget.dataset;
|
|
399
|
+
if (exportName_1 !== void 0 && id_1 !== void 0) {
|
|
400
|
+
fireAndForget(refreshInstance(exportName_1, id_1));
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
404
|
+
className: "flex flex-col gap-6",
|
|
405
|
+
"data-testid": "lunora-workflows-panel",
|
|
406
|
+
children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
407
|
+
className: "text-sm text-destructive",
|
|
408
|
+
"data-testid": "workflows-error",
|
|
409
|
+
role: "alert",
|
|
410
|
+
children: error
|
|
411
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("p", {
|
|
412
|
+
className: "text-sm text-muted-foreground",
|
|
413
|
+
children: t("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")
|
|
414
|
+
}, void 0, false), loaded && workflows.length === 0 ? /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
415
|
+
description: t("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),
|
|
416
|
+
testId: "workflows-empty",
|
|
417
|
+
title: t("No workflows defined")
|
|
418
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV(Card, {
|
|
419
|
+
className: "overflow-hidden py-0",
|
|
420
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
421
|
+
className: "px-0",
|
|
422
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
423
|
+
"data-testid": "workflows-table",
|
|
424
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
425
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
426
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
427
|
+
children: t("Export")
|
|
428
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
429
|
+
children: t("Name")
|
|
430
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
431
|
+
children: t("Class")
|
|
432
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
433
|
+
children: t("Binding")
|
|
434
|
+
}, void 0, false)]
|
|
435
|
+
}, void 0, true)
|
|
436
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
437
|
+
children: workflows.map((workflow_1) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
438
|
+
"data-testid": `workflows-row-${workflow_1.exportName}`,
|
|
439
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
440
|
+
className: "font-mono text-xs",
|
|
441
|
+
children: workflow_1.exportName
|
|
442
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
443
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
444
|
+
children: workflow_1.name
|
|
445
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
446
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
447
|
+
children: workflow_1.className
|
|
448
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
449
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
450
|
+
children: workflow_1.binding
|
|
451
|
+
}, void 0, false)]
|
|
452
|
+
}, workflow_1.exportName, true))
|
|
453
|
+
}, void 0, false)]
|
|
454
|
+
}, void 0, true)
|
|
455
|
+
}, void 0, false)
|
|
456
|
+
}, void 0, false), workflows.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
457
|
+
className: "flex flex-col gap-3",
|
|
458
|
+
"data-testid": "workflows-start",
|
|
459
|
+
children: [/* @__PURE__ */ jsxDEV("h3", {
|
|
460
|
+
className: "text-sm font-medium",
|
|
461
|
+
children: t("Start instance")
|
|
462
|
+
}, void 0, false), startError !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
463
|
+
className: "text-sm text-destructive",
|
|
464
|
+
"data-testid": "workflows-start-error",
|
|
465
|
+
role: "alert",
|
|
466
|
+
children: startError
|
|
467
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
468
|
+
className: "flex flex-wrap items-center gap-2",
|
|
469
|
+
children: [/* @__PURE__ */ jsxDEV("select", {
|
|
470
|
+
"aria-label": t("Workflow"),
|
|
471
|
+
className: "h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50",
|
|
472
|
+
"data-testid": "workflows-start-select",
|
|
473
|
+
onChange: onSelectedExportChange,
|
|
474
|
+
value: selectedExportName,
|
|
475
|
+
children: workflows.map((workflow_2) => /* @__PURE__ */ jsxDEV("option", {
|
|
476
|
+
value: workflow_2.exportName,
|
|
477
|
+
children: workflow_2.exportName
|
|
478
|
+
}, workflow_2.exportName, false))
|
|
479
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
|
|
480
|
+
"aria-label": t("Instance id (optional)"),
|
|
481
|
+
className: "max-w-48",
|
|
482
|
+
"data-testid": "workflows-start-id",
|
|
483
|
+
onChange: onInstanceIdChange,
|
|
484
|
+
placeholder: t("Instance id (optional)"),
|
|
485
|
+
value: instanceIdInput
|
|
486
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
|
|
487
|
+
"data-testid": "workflows-start-button",
|
|
488
|
+
disabled: starting || selectedExportName === "",
|
|
489
|
+
onClick: startInstance,
|
|
490
|
+
children: starting ? t("Starting…") : t("Start instance")
|
|
491
|
+
}, void 0, false)]
|
|
492
|
+
}, void 0, true), /* @__PURE__ */ jsxDEV(Textarea, {
|
|
493
|
+
"aria-label": t("Params (JSON)"),
|
|
494
|
+
className: "font-mono",
|
|
495
|
+
"data-testid": "workflows-start-params",
|
|
496
|
+
onChange: onParamsChange,
|
|
497
|
+
placeholder: t("Params (JSON, optional)"),
|
|
498
|
+
value: paramsText
|
|
499
|
+
}, void 0, false)]
|
|
500
|
+
}, void 0, true), instances.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
501
|
+
className: "flex flex-col gap-3",
|
|
502
|
+
"data-testid": "workflows-instances",
|
|
503
|
+
children: [/* @__PURE__ */ jsxDEV("h3", {
|
|
504
|
+
className: "text-sm font-medium",
|
|
505
|
+
children: t("Instances")
|
|
506
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Card, {
|
|
507
|
+
className: "overflow-hidden py-0",
|
|
508
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
509
|
+
className: "px-0",
|
|
510
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
511
|
+
"data-testid": "workflows-instances-table",
|
|
512
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
513
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
514
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
515
|
+
children: t("Workflow")
|
|
516
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
517
|
+
children: t("Instance id")
|
|
518
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
519
|
+
children: t("Status")
|
|
520
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
521
|
+
children: t("Output")
|
|
522
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {}, void 0, false)]
|
|
523
|
+
}, void 0, true)
|
|
524
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
525
|
+
children: instances.map((instance) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
526
|
+
"data-testid": `workflows-instance-${instance.id}`,
|
|
527
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
528
|
+
className: "font-mono text-xs",
|
|
529
|
+
children: instance.exportName
|
|
530
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
531
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
532
|
+
children: instance.id
|
|
533
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
534
|
+
className: "font-mono text-xs",
|
|
535
|
+
children: instance.status
|
|
536
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
537
|
+
className: "font-mono text-xs text-muted-foreground",
|
|
538
|
+
children: formatPayload(instance)
|
|
539
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
540
|
+
children: /* @__PURE__ */ jsxDEV(Button, {
|
|
541
|
+
"data-export": instance.exportName,
|
|
542
|
+
"data-id": instance.id,
|
|
543
|
+
"data-testid": `workflows-instance-refresh-${instance.id}`,
|
|
544
|
+
disabled: refreshingId === instance.id,
|
|
545
|
+
onClick: onRefreshClick,
|
|
546
|
+
size: "xs",
|
|
547
|
+
variant: "outline",
|
|
548
|
+
children: refreshingId === instance.id ? t("Refreshing…") : t("Refresh")
|
|
549
|
+
}, void 0, false)
|
|
550
|
+
}, void 0, false)]
|
|
551
|
+
}, `${instance.exportName}:${instance.id}`, true))
|
|
552
|
+
}, void 0, false)]
|
|
553
|
+
}, void 0, true)
|
|
554
|
+
}, void 0, false)
|
|
555
|
+
}, void 0, false)]
|
|
556
|
+
}, void 0, true), selectedWorkflow !== void 0 && /* @__PURE__ */ jsxDEV(WorkflowInstanceHistory, {
|
|
557
|
+
workflowName: selectedWorkflow.name
|
|
558
|
+
}, void 0, false)]
|
|
559
|
+
}, void 0, true);
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
export { WorkflowsPanel as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const ADMIN_FUNCTION_PREFIX = "__lunora_admin__:";
|
|
2
2
|
const ADMIN_FUNCTIONS = {
|
|
3
3
|
clearCapturedMail: "__lunora_admin__:clearCapturedMail",
|
|
4
|
+
clearQueueMessages: "__lunora_admin__:clearQueueMessages",
|
|
4
5
|
clearTable: "__lunora_admin__:clearTable",
|
|
5
6
|
createWorkflowInstance: "__lunora_admin__:createWorkflowInstance",
|
|
6
7
|
deleteRows: "__lunora_admin__:deleteRows",
|
|
@@ -12,13 +13,17 @@ const ADMIN_FUNCTIONS = {
|
|
|
12
13
|
getAuditLog: "__lunora_admin__:getAuditLog",
|
|
13
14
|
getAuthMetrics: "__lunora_admin__:getAuthMetrics",
|
|
14
15
|
getCapturedMail: "__lunora_admin__:getCapturedMail",
|
|
16
|
+
getFanoutMetrics: "__lunora_admin__:getFanoutMetrics",
|
|
15
17
|
getFunctionStats: "__lunora_admin__:getFunctionStats",
|
|
18
|
+
listFlags: "__lunora_admin__:listFlags",
|
|
19
|
+
listQueues: "__lunora_admin__:listQueues",
|
|
16
20
|
listSubscriptions: "__lunora_admin__:listSubscriptions",
|
|
17
21
|
listTableIndexes: "__lunora_admin__:listTableIndexes",
|
|
18
22
|
listWorkflows: "__lunora_admin__:listWorkflows",
|
|
19
23
|
getLogs: "__lunora_admin__:getLogs",
|
|
20
24
|
getMetrics: "__lunora_admin__:getMetrics",
|
|
21
25
|
getPitrBookmark: "__lunora_admin__:getPitrBookmark",
|
|
26
|
+
getQueueMessages: "__lunora_admin__:getQueueMessages",
|
|
22
27
|
getRequestLog: "__lunora_admin__:getRequestLog",
|
|
23
28
|
getSecurityAudit: "__lunora_admin__:getSecurityAudit",
|
|
24
29
|
getSettings: "__lunora_admin__:getSettings",
|
|
@@ -30,10 +35,12 @@ const ADMIN_FUNCTIONS = {
|
|
|
30
35
|
migrationStatus: "__lunora_admin__:migrationStatus",
|
|
31
36
|
pitrRestore: "__lunora_admin__:pitrRestore",
|
|
32
37
|
readTablePage: "__lunora_admin__:readTablePage",
|
|
38
|
+
replayQueueMessage: "__lunora_admin__:replayQueueMessage",
|
|
33
39
|
rlsPolicies: "__lunora_admin__:rlsPolicies",
|
|
34
40
|
runAs: "__lunora_admin__:runAs",
|
|
35
41
|
runMigration: "__lunora_admin__:runMigration",
|
|
36
42
|
runSql: "__lunora_admin__:runSql",
|
|
43
|
+
sendQueueMessage: "__lunora_admin__:sendQueueMessage",
|
|
37
44
|
sendTestMail: "__lunora_admin__:sendTestMail",
|
|
38
45
|
storageOrphans: "__lunora_admin__:storageOrphans",
|
|
39
46
|
storageReferences: "__lunora_admin__:storageReferences",
|
|
@@ -4,8 +4,8 @@ import { useState, useEffect } from 'react';
|
|
|
4
4
|
import { B as Button } from './button-BhsN2uZH.js';
|
|
5
5
|
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
6
6
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
7
|
-
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-
|
|
8
|
-
import { c as callOptions, a as adminRef, g as copyToClipboard } from './internal-
|
|
7
|
+
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
8
|
+
import { c as callOptions, a as adminRef, g as copyToClipboard } from './internal-CYcbqMjX.js';
|
|
9
9
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
10
10
|
|
|
11
11
|
const LIST_TABLES = adminRef(ADMIN_FUNCTIONS.listTables);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { useLunora } from '@lunora/react';
|
|
3
3
|
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
4
|
-
import {
|
|
4
|
+
import { S as Skeleton } from './skeleton-CGhL0p20.js';
|
|
5
|
+
import { u as useAdminSpec, R as ReferenceView } from './reference-view-DUiJcILV.js';
|
|
5
6
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
6
7
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
7
8
|
|
|
@@ -3,7 +3,7 @@ import { Dialog } from '@base-ui/react/dialog';
|
|
|
3
3
|
import { useNavigate } from '@tanstack/react-router';
|
|
4
4
|
import { useState, useRef, useEffect } from 'react';
|
|
5
5
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
6
|
-
import { f as fireAndForget } from './internal-
|
|
6
|
+
import { f as fireAndForget } from './internal-CYcbqMjX.js';
|
|
7
7
|
import { c as cn } from './utils-B05Dmz_H.js';
|
|
8
8
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
9
9
|
|