@lunora/studio 0.0.0 → 1.0.0-alpha.1
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 +105 -0
- package/README.md +123 -9
- package/__assets__/package-og.svg +14 -0
- package/dist/index.d.ts +1402 -0
- package/dist/index.js +41 -0
- package/dist/mount.d.ts +21 -0
- package/dist/mount.js +26 -0
- package/dist/packem_shared/ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js +45 -0
- package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +842 -0
- package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +229 -0
- package/dist/packem_shared/ApiTab-DURGU15e.js +251 -0
- package/dist/packem_shared/AuditPanel-BC59Nhst.js +212 -0
- package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +373 -0
- package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +59 -0
- package/dist/packem_shared/ConnectionBadge-Bxagrip8.js +111 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +50 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +89 -0
- package/dist/packem_shared/DataBrowser-Coz6jJE6.js +4542 -0
- package/dist/packem_shared/DataFilters-FNquMaiu.js +249 -0
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +66 -0
- package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +193 -0
- package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +2932 -0
- package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +343 -0
- package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +432 -0
- package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +318 -0
- package/dist/packem_shared/HealthPanel-DOIgbUtx.js +640 -0
- package/dist/packem_shared/HomePanel-bdOCNA-p.js +1273 -0
- package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +423 -0
- package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +839 -0
- package/dist/packem_shared/MailPanel-D_EGtDnS.js +447 -0
- package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +1625 -0
- package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +246 -0
- package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +191 -0
- package/dist/packem_shared/PitrPanel-BbBkQR6t.js +252 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +3 -0
- package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +159 -0
- package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +2512 -0
- package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +79 -0
- package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +176 -0
- package/dist/packem_shared/ShardInput-DNCsT1KW.js +107 -0
- package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +13 -0
- package/dist/packem_shared/Studio-D36od9Oz.js +33 -0
- package/dist/packem_shared/StudioApp-dvywkJ8I.js +383 -0
- package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +48 -0
- package/dist/packem_shared/TableEditor-DIVDk3vT.js +371 -0
- package/dist/packem_shared/advisor-view-DBlzJi6C.js +159 -0
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +108 -0
- package/dist/packem_shared/app.d-CCmwDEVs.d.ts +300 -0
- package/dist/packem_shared/badge-B2PKA1-5.js +49 -0
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +3245 -0
- package/dist/packem_shared/button-BhsN2uZH.js +49 -0
- package/dist/packem_shared/card-DURq3ElK.js +175 -0
- package/dist/packem_shared/cf-links-BZfRdxSE.js +8 -0
- package/dist/packem_shared/checkbox-UNkzAxl-.js +63 -0
- package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +27 -0
- package/dist/packem_shared/data-grid-CCh2Couo.js +183 -0
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +280 -0
- package/dist/packem_shared/empty-state-DY_oe0k6.js +98 -0
- package/dist/packem_shared/grid-features-DTjG6Sex.js +840 -0
- package/dist/packem_shared/input-XH4r1Pt1.js +53 -0
- package/dist/packem_shared/internal-BBZYexre.js +68 -0
- package/dist/packem_shared/label-D8ykjn5J.js +46 -0
- package/dist/packem_shared/live-status-bPff1O7Y.js +44 -0
- package/dist/packem_shared/reference-view-BCKIoai7.js +2180 -0
- package/dist/packem_shared/shard-history-DyebH1R5.js +38 -0
- package/dist/packem_shared/sparkline-10dG-_f0.js +93 -0
- package/dist/packem_shared/sql-editor-panel-CW2y2x9h.js +2562 -0
- package/dist/packem_shared/storage-tier-CL98eOvn.js +85 -0
- package/dist/packem_shared/studio-BDVd7rIV.js +10303 -0
- package/dist/packem_shared/table-_RzNvy3R.js +246 -0
- package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +832 -0
- package/dist/packem_shared/textarea-D3gaCU_-.js +46 -0
- package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +73 -0
- package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +76 -0
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +32 -0
- package/dist/packem_shared/utils-B05Dmz_H.js +8 -0
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +10 -0
- package/dist/standalone/studio.js +356 -0
- package/dist/styles.css +2 -0
- package/package.json +77 -17
- package/src/theme.css +59 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useLunora } from '@lunora/react';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { L as LiveError } from './live-status-bPff1O7Y.js';
|
|
5
|
+
import { ShardInput } from './ShardInput-DNCsT1KW.js';
|
|
6
|
+
import { B as Badge } from './badge-B2PKA1-5.js';
|
|
7
|
+
import { B as Button } from './button-BhsN2uZH.js';
|
|
8
|
+
import { C as Card, a as CardContent } from './card-DURq3ElK.js';
|
|
9
|
+
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
10
|
+
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
|
|
11
|
+
import { u as useLiveAdmin } from './use-live-admin-D1h1Fzsd.js';
|
|
12
|
+
import { useT } from './createStudioI18n-CgvlmDkN.js';
|
|
13
|
+
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js';
|
|
14
|
+
import { d as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from './internal-BBZYexre.js';
|
|
15
|
+
import { c as cn } from './utils-B05Dmz_H.js';
|
|
16
|
+
import { u as useLiveShardSeed } from './use-live-shard-seed-B74RYcOy.js';
|
|
17
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
18
|
+
|
|
19
|
+
const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
|
|
20
|
+
const KIND_VARIANT = {
|
|
21
|
+
action: "outline",
|
|
22
|
+
mutation: "default",
|
|
23
|
+
query: "secondary"
|
|
24
|
+
};
|
|
25
|
+
const formatMs = (ms) => {
|
|
26
|
+
if (ms < 1e3) {
|
|
27
|
+
return `${ms < 10 ? ms.toFixed(1) : Math.round(ms).toString()}ms`;
|
|
28
|
+
}
|
|
29
|
+
return `${(ms / 1e3).toFixed(2)}s`;
|
|
30
|
+
};
|
|
31
|
+
const errorCell = (stat) => {
|
|
32
|
+
if (stat.calls === 0) {
|
|
33
|
+
return "—";
|
|
34
|
+
}
|
|
35
|
+
if (stat.errors === 0) {
|
|
36
|
+
return "0";
|
|
37
|
+
}
|
|
38
|
+
return `${stat.errors.toString()} (${(stat.errors / stat.calls * 100).toFixed(1)}%)`;
|
|
39
|
+
};
|
|
40
|
+
const conflictCell = (stat) => {
|
|
41
|
+
const conflicts = stat.conflicts ?? 0;
|
|
42
|
+
if (stat.calls === 0) {
|
|
43
|
+
return "—";
|
|
44
|
+
}
|
|
45
|
+
if (conflicts === 0) {
|
|
46
|
+
return "0";
|
|
47
|
+
}
|
|
48
|
+
return `${conflicts.toString()} (${(conflicts / stat.calls * 100).toFixed(1)}%)`;
|
|
49
|
+
};
|
|
50
|
+
const SORTERS = {
|
|
51
|
+
calls: (a, b) => b.calls - a.calls,
|
|
52
|
+
recent: (a, b) => b.lastCalledAt - a.lastCalledAt,
|
|
53
|
+
slowest: (a, b) => b.maxDurationMs - a.maxDurationMs
|
|
54
|
+
};
|
|
55
|
+
const FunctionStatsPanel = (t0) => {
|
|
56
|
+
const $ = c(48);
|
|
57
|
+
const {
|
|
58
|
+
functions,
|
|
59
|
+
initialShardKey
|
|
60
|
+
} = t0;
|
|
61
|
+
const client = useLunora();
|
|
62
|
+
const t = useT();
|
|
63
|
+
const [shardKey, setShardKey] = useState(initialShardKey ?? "");
|
|
64
|
+
const [stats, setStats] = useState(null);
|
|
65
|
+
const [error, setError] = useState(null);
|
|
66
|
+
const [sortKey, setSortKey] = useState("recent");
|
|
67
|
+
const [liveError, setLiveError] = useState(void 0);
|
|
68
|
+
const mountedRef = useRef(true);
|
|
69
|
+
let t1;
|
|
70
|
+
let t2;
|
|
71
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
72
|
+
t1 = () => {
|
|
73
|
+
mountedRef.current = true;
|
|
74
|
+
return () => {
|
|
75
|
+
mountedRef.current = false;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
t2 = [];
|
|
79
|
+
$[0] = t1;
|
|
80
|
+
$[1] = t2;
|
|
81
|
+
} else {
|
|
82
|
+
t1 = $[0];
|
|
83
|
+
t2 = $[1];
|
|
84
|
+
}
|
|
85
|
+
useEffect(t1, t2);
|
|
86
|
+
let t3;
|
|
87
|
+
if ($[2] !== functions) {
|
|
88
|
+
t3 = new Map((functions ?? []).map(_temp));
|
|
89
|
+
$[2] = functions;
|
|
90
|
+
$[3] = t3;
|
|
91
|
+
} else {
|
|
92
|
+
t3 = $[3];
|
|
93
|
+
}
|
|
94
|
+
const kindByPath = t3;
|
|
95
|
+
let t4;
|
|
96
|
+
if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
97
|
+
t4 = (result) => {
|
|
98
|
+
setError(null);
|
|
99
|
+
setLiveError(void 0);
|
|
100
|
+
setStats(result.functions);
|
|
101
|
+
};
|
|
102
|
+
$[4] = t4;
|
|
103
|
+
} else {
|
|
104
|
+
t4 = $[4];
|
|
105
|
+
}
|
|
106
|
+
const applyResult = t4;
|
|
107
|
+
let t5;
|
|
108
|
+
if ($[5] !== client) {
|
|
109
|
+
t5 = async (shard) => {
|
|
110
|
+
try {
|
|
111
|
+
const next = await client.query(GET_FUNCTION_STATS, {}, callOptions(shard));
|
|
112
|
+
if (mountedRef.current) {
|
|
113
|
+
applyResult(next);
|
|
114
|
+
}
|
|
115
|
+
} catch (t62) {
|
|
116
|
+
const error_ = t62;
|
|
117
|
+
if (mountedRef.current) {
|
|
118
|
+
setStats(null);
|
|
119
|
+
setError(errorMessage(error_));
|
|
120
|
+
}
|
|
121
|
+
throw error_;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
$[5] = client;
|
|
125
|
+
$[6] = t5;
|
|
126
|
+
} else {
|
|
127
|
+
t5 = $[6];
|
|
128
|
+
}
|
|
129
|
+
const refresh = t5;
|
|
130
|
+
const committedShard = useLiveShardSeed(shardKey, refresh);
|
|
131
|
+
let t6;
|
|
132
|
+
if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
133
|
+
t6 = {};
|
|
134
|
+
$[7] = t6;
|
|
135
|
+
} else {
|
|
136
|
+
t6 = $[7];
|
|
137
|
+
}
|
|
138
|
+
let t7;
|
|
139
|
+
if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
140
|
+
t7 = (next_0) => {
|
|
141
|
+
if (mountedRef.current) {
|
|
142
|
+
applyResult(next_0);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
$[8] = t7;
|
|
146
|
+
} else {
|
|
147
|
+
t7 = $[8];
|
|
148
|
+
}
|
|
149
|
+
let t8;
|
|
150
|
+
if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
151
|
+
t8 = (message) => {
|
|
152
|
+
if (mountedRef.current) {
|
|
153
|
+
setLiveError(message);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
$[9] = t8;
|
|
157
|
+
} else {
|
|
158
|
+
t8 = $[9];
|
|
159
|
+
}
|
|
160
|
+
useLiveAdmin(ADMIN_FUNCTIONS.getFunctionStats, t6, committedShard ?? "", t7, committedShard !== void 0, t8);
|
|
161
|
+
let t9;
|
|
162
|
+
if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
+
t9 = (event) => {
|
|
164
|
+
setSortKey(event.currentTarget.dataset.sort);
|
|
165
|
+
};
|
|
166
|
+
$[10] = t9;
|
|
167
|
+
} else {
|
|
168
|
+
t9 = $[10];
|
|
169
|
+
}
|
|
170
|
+
const selectSort = t9;
|
|
171
|
+
let t10;
|
|
172
|
+
if ($[11] !== error || $[12] !== kindByPath || $[13] !== liveError || $[14] !== shardKey || $[15] !== sortKey || $[16] !== stats || $[17] !== t) {
|
|
173
|
+
const sorted = stats === null ? [] : stats.toSorted(SORTERS[sortKey]);
|
|
174
|
+
let t11;
|
|
175
|
+
if ($[19] !== t) {
|
|
176
|
+
t11 = t("Recent");
|
|
177
|
+
$[19] = t;
|
|
178
|
+
$[20] = t11;
|
|
179
|
+
} else {
|
|
180
|
+
t11 = $[20];
|
|
181
|
+
}
|
|
182
|
+
let t12;
|
|
183
|
+
if ($[21] !== t11) {
|
|
184
|
+
t12 = {
|
|
185
|
+
key: "recent",
|
|
186
|
+
label: t11
|
|
187
|
+
};
|
|
188
|
+
$[21] = t11;
|
|
189
|
+
$[22] = t12;
|
|
190
|
+
} else {
|
|
191
|
+
t12 = $[22];
|
|
192
|
+
}
|
|
193
|
+
let t13;
|
|
194
|
+
if ($[23] !== t) {
|
|
195
|
+
t13 = t("Most called");
|
|
196
|
+
$[23] = t;
|
|
197
|
+
$[24] = t13;
|
|
198
|
+
} else {
|
|
199
|
+
t13 = $[24];
|
|
200
|
+
}
|
|
201
|
+
let t14;
|
|
202
|
+
if ($[25] !== t13) {
|
|
203
|
+
t14 = {
|
|
204
|
+
key: "calls",
|
|
205
|
+
label: t13
|
|
206
|
+
};
|
|
207
|
+
$[25] = t13;
|
|
208
|
+
$[26] = t14;
|
|
209
|
+
} else {
|
|
210
|
+
t14 = $[26];
|
|
211
|
+
}
|
|
212
|
+
let t15;
|
|
213
|
+
if ($[27] !== t) {
|
|
214
|
+
t15 = t("Slowest");
|
|
215
|
+
$[27] = t;
|
|
216
|
+
$[28] = t15;
|
|
217
|
+
} else {
|
|
218
|
+
t15 = $[28];
|
|
219
|
+
}
|
|
220
|
+
let t16;
|
|
221
|
+
if ($[29] !== t15) {
|
|
222
|
+
t16 = {
|
|
223
|
+
key: "slowest",
|
|
224
|
+
label: t15
|
|
225
|
+
};
|
|
226
|
+
$[29] = t15;
|
|
227
|
+
$[30] = t16;
|
|
228
|
+
} else {
|
|
229
|
+
t16 = $[30];
|
|
230
|
+
}
|
|
231
|
+
let t17;
|
|
232
|
+
if ($[31] !== t12 || $[32] !== t14 || $[33] !== t16) {
|
|
233
|
+
t17 = [t12, t14, t16];
|
|
234
|
+
$[31] = t12;
|
|
235
|
+
$[32] = t14;
|
|
236
|
+
$[33] = t16;
|
|
237
|
+
$[34] = t17;
|
|
238
|
+
} else {
|
|
239
|
+
t17 = $[34];
|
|
240
|
+
}
|
|
241
|
+
const sortButtons = t17;
|
|
242
|
+
let t18;
|
|
243
|
+
if ($[35] !== shardKey) {
|
|
244
|
+
t18 = /* @__PURE__ */ jsxDEV(ShardInput, {
|
|
245
|
+
onChange: setShardKey,
|
|
246
|
+
testId: "fs-shard-input",
|
|
247
|
+
value: shardKey
|
|
248
|
+
}, void 0, false);
|
|
249
|
+
$[35] = shardKey;
|
|
250
|
+
$[36] = t18;
|
|
251
|
+
} else {
|
|
252
|
+
t18 = $[36];
|
|
253
|
+
}
|
|
254
|
+
let t19;
|
|
255
|
+
if ($[37] !== liveError) {
|
|
256
|
+
t19 = /* @__PURE__ */ jsxDEV(LiveError, {
|
|
257
|
+
message: liveError,
|
|
258
|
+
prefix: "fs"
|
|
259
|
+
}, void 0, false);
|
|
260
|
+
$[37] = liveError;
|
|
261
|
+
$[38] = t19;
|
|
262
|
+
} else {
|
|
263
|
+
t19 = $[38];
|
|
264
|
+
}
|
|
265
|
+
let t20;
|
|
266
|
+
if ($[39] !== sortButtons || $[40] !== sortKey) {
|
|
267
|
+
t20 = /* @__PURE__ */ jsxDEV("div", {
|
|
268
|
+
className: "ml-auto flex items-center gap-1",
|
|
269
|
+
role: "group",
|
|
270
|
+
children: sortButtons.map((option) => /* @__PURE__ */ jsxDEV(Button, {
|
|
271
|
+
"data-sort": option.key,
|
|
272
|
+
"data-testid": `fs-sort-${option.key}`,
|
|
273
|
+
onClick: selectSort,
|
|
274
|
+
size: "sm",
|
|
275
|
+
type: "button",
|
|
276
|
+
variant: sortKey === option.key ? "secondary" : "ghost",
|
|
277
|
+
children: option.label
|
|
278
|
+
}, option.key, false))
|
|
279
|
+
}, void 0, false);
|
|
280
|
+
$[39] = sortButtons;
|
|
281
|
+
$[40] = sortKey;
|
|
282
|
+
$[41] = t20;
|
|
283
|
+
} else {
|
|
284
|
+
t20 = $[41];
|
|
285
|
+
}
|
|
286
|
+
let t21;
|
|
287
|
+
if ($[42] !== t18 || $[43] !== t19 || $[44] !== t20) {
|
|
288
|
+
t21 = /* @__PURE__ */ jsxDEV("div", {
|
|
289
|
+
className: "flex flex-wrap items-center gap-2",
|
|
290
|
+
children: [t18, t19, t20]
|
|
291
|
+
}, void 0, true);
|
|
292
|
+
$[42] = t18;
|
|
293
|
+
$[43] = t19;
|
|
294
|
+
$[44] = t20;
|
|
295
|
+
$[45] = t21;
|
|
296
|
+
} else {
|
|
297
|
+
t21 = $[45];
|
|
298
|
+
}
|
|
299
|
+
let t22;
|
|
300
|
+
if ($[46] !== error) {
|
|
301
|
+
t22 = error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
302
|
+
className: "text-sm text-destructive",
|
|
303
|
+
"data-testid": "fs-error",
|
|
304
|
+
role: "alert",
|
|
305
|
+
children: error
|
|
306
|
+
}, void 0, false);
|
|
307
|
+
$[46] = error;
|
|
308
|
+
$[47] = t22;
|
|
309
|
+
} else {
|
|
310
|
+
t22 = $[47];
|
|
311
|
+
}
|
|
312
|
+
t10 = /* @__PURE__ */ jsxDEV("div", {
|
|
313
|
+
className: "flex flex-col gap-4",
|
|
314
|
+
"data-testid": "lunora-function-stats",
|
|
315
|
+
children: [t21, t22, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
316
|
+
description: t("Per-function call counts, error rates, and latency land here after your first request."),
|
|
317
|
+
icon: /* @__PURE__ */ jsxDEV("svg", {
|
|
318
|
+
"aria-hidden": "true",
|
|
319
|
+
fill: "none",
|
|
320
|
+
stroke: "currentColor",
|
|
321
|
+
strokeLinecap: "round",
|
|
322
|
+
strokeLinejoin: "round",
|
|
323
|
+
strokeWidth: 1.6,
|
|
324
|
+
viewBox: "0 0 24 24",
|
|
325
|
+
children: [/* @__PURE__ */ jsxDEV("path", {
|
|
326
|
+
d: "M3 3v18h18"
|
|
327
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV("path", {
|
|
328
|
+
d: "M7 14l4-4 3 3 5-6"
|
|
329
|
+
}, void 0, false)]
|
|
330
|
+
}, void 0, true),
|
|
331
|
+
testId: "fs-empty",
|
|
332
|
+
title: t("No functions have run on this shard yet.")
|
|
333
|
+
}, void 0, false), sorted.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
334
|
+
className: "overflow-hidden py-0",
|
|
335
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
336
|
+
className: "px-0",
|
|
337
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
338
|
+
"data-testid": "fs-table",
|
|
339
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
340
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
341
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
342
|
+
children: t("function")
|
|
343
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
344
|
+
children: t("kind")
|
|
345
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
346
|
+
className: "text-right",
|
|
347
|
+
children: t("calls")
|
|
348
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
349
|
+
className: "text-right",
|
|
350
|
+
children: t("errors")
|
|
351
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
352
|
+
className: "text-right",
|
|
353
|
+
children: t("conflicts")
|
|
354
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
355
|
+
className: "text-right",
|
|
356
|
+
children: t("avg")
|
|
357
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
358
|
+
className: "text-right",
|
|
359
|
+
children: t("max")
|
|
360
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
361
|
+
children: t("last run")
|
|
362
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
363
|
+
children: t("last error")
|
|
364
|
+
}, void 0, false)]
|
|
365
|
+
}, void 0, true)
|
|
366
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
367
|
+
children: sorted.map((stat) => {
|
|
368
|
+
const kind = kindByPath.get(stat.path);
|
|
369
|
+
return /* @__PURE__ */ jsxDEV(TableRow, {
|
|
370
|
+
"data-testid": `fs-row-${stat.path}`,
|
|
371
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
372
|
+
className: "font-medium",
|
|
373
|
+
children: stat.path
|
|
374
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
375
|
+
children: kind === void 0 ? /* @__PURE__ */ jsxDEV("span", {
|
|
376
|
+
className: "text-muted-foreground",
|
|
377
|
+
children: "—"
|
|
378
|
+
}, void 0, false) : /* @__PURE__ */ jsxDEV(Badge, {
|
|
379
|
+
variant: KIND_VARIANT[kind],
|
|
380
|
+
children: kind
|
|
381
|
+
}, void 0, false)
|
|
382
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
383
|
+
className: "text-right tabular-nums",
|
|
384
|
+
children: stat.calls
|
|
385
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
386
|
+
className: cn("text-right tabular-nums", stat.errors > 0 && "text-destructive"),
|
|
387
|
+
children: errorCell(stat)
|
|
388
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
389
|
+
className: cn("text-right tabular-nums", (stat.conflicts ?? 0) > 0 && "text-warning"),
|
|
390
|
+
children: conflictCell(stat)
|
|
391
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
392
|
+
className: "text-right tabular-nums",
|
|
393
|
+
children: stat.calls === 0 ? "—" : formatMs(stat.totalDurationMs / stat.calls)
|
|
394
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
395
|
+
className: "text-right tabular-nums",
|
|
396
|
+
children: stat.calls === 0 ? "—" : formatMs(stat.maxDurationMs)
|
|
397
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
398
|
+
className: "text-muted-foreground",
|
|
399
|
+
children: formatTimestamp(stat.lastCalledAt, "—")
|
|
400
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
401
|
+
className: "max-w-[24ch] truncate text-destructive",
|
|
402
|
+
title: stat.lastErrorMessage ?? void 0,
|
|
403
|
+
children: stat.lastErrorMessage ?? /* @__PURE__ */ jsxDEV("span", {
|
|
404
|
+
className: "text-muted-foreground",
|
|
405
|
+
children: "—"
|
|
406
|
+
}, void 0, false)
|
|
407
|
+
}, void 0, false)]
|
|
408
|
+
}, stat.path, true);
|
|
409
|
+
})
|
|
410
|
+
}, void 0, false)]
|
|
411
|
+
}, void 0, true)
|
|
412
|
+
}, void 0, false)
|
|
413
|
+
}, void 0, false)]
|
|
414
|
+
}, void 0, true);
|
|
415
|
+
$[11] = error;
|
|
416
|
+
$[12] = kindByPath;
|
|
417
|
+
$[13] = liveError;
|
|
418
|
+
$[14] = shardKey;
|
|
419
|
+
$[15] = sortKey;
|
|
420
|
+
$[16] = stats;
|
|
421
|
+
$[17] = t;
|
|
422
|
+
$[18] = t10;
|
|
423
|
+
} else {
|
|
424
|
+
t10 = $[18];
|
|
425
|
+
}
|
|
426
|
+
return t10;
|
|
427
|
+
};
|
|
428
|
+
function _temp(descriptor) {
|
|
429
|
+
return [descriptor.path, descriptor.kind];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export { FunctionStatsPanel };
|