@lunora/studio 1.0.0-alpha.1 → 1.0.0-alpha.10
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 +15 -14
- package/dist/index.js +34 -34
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_shared/{ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js → ADMIN_FUNCTIONS-DjXgvJb6.js} +1 -0
- package/dist/packem_shared/{ApiDocsPanel-DpRjJhG5.js → ApiDocsPanel-yVSGHK3H.js} +3 -3
- package/dist/packem_shared/{ApiReferencePanel-DMIUp-kK.js → ApiReferencePanel-1vubqG5s.js} +2 -2
- package/dist/packem_shared/{ApiTab-DURGU15e.js → ApiTab-rwttyQ1-.js} +4 -4
- package/dist/packem_shared/{AuditPanel-BC59Nhst.js → AuditPanel-D9Eh7j7E.js} +19 -31
- package/dist/packem_shared/{CommandPalette-Dx_CoB9i.js → CommandPalette-BtgkBzZI.js} +2 -2
- package/dist/packem_shared/{ConfirmButton-WQVUoGFb.js → ConfirmButton-C2eVi2Qv.js} +1 -1
- package/dist/packem_shared/{ConnectionBadge-Bxagrip8.js → ConnectionBadge-B2DDM2Tn.js} +1 -1
- package/dist/packem_shared/{createStudioI18n-CgvlmDkN.js → DEFAULT_LOCALE-CiX4W7Kr.js} +1 -1
- package/dist/packem_shared/{DataBrowser-Coz6jJE6.js → DataBrowser-CyckZRwj.js} +115 -177
- package/dist/packem_shared/{ExportImportPanel-WO34fJxy.js → ExportImportPanel-BGJqFK9X.js} +9 -5
- package/dist/packem_shared/{FileBrowser-Zcr-Qgxo.js → FileBrowser-0pCpdKPE.js} +7 -7
- package/dist/packem_shared/{FunctionRunner-j0Rd5m9t.js → FunctionRunner-7NH3KcTg.js} +4 -4
- package/dist/packem_shared/{FunctionStatsPanel-DboBl-XL.js → FunctionStatsPanel-CXynSuqT.js} +141 -198
- package/dist/packem_shared/{GlobalDataBrowser-9MhPEfgN.js → GlobalDataBrowser-DAxzB-Br.js} +37 -66
- package/dist/packem_shared/{HealthPanel-DOIgbUtx.js → HealthPanel-CyLs7qZm.js} +31 -23
- package/dist/packem_shared/{HomePanel-bdOCNA-p.js → HomePanel-BOkFRbuj.js} +450 -389
- package/dist/packem_shared/{InsightsPanel-DaZPnSgt.js → InsightsPanel-CvXMoZuv.js} +104 -66
- package/dist/packem_shared/{LogsPanel-CWdqAGpQ.js → LogsPanel-BrUstOk6.js} +35 -47
- package/dist/packem_shared/{MailPanel-D_EGtDnS.js → MailPanel-GnnrNqL6.js} +31 -38
- package/dist/packem_shared/{MetricsPanel-E4Gv6wTO.js → MetricsPanel-BN_uUU-_.js} +34 -48
- package/dist/packem_shared/{MigrationsPanel-DQdPY9io.js → MigrationsPanel-DaZuUHje.js} +31 -38
- package/dist/packem_shared/{OpenRpcReferencePanel-j2p3HB0s.js → OpenRpcReferencePanel-vbcYbv3V.js} +2 -2
- package/dist/packem_shared/{PitrPanel-BbBkQR6t.js → PitrPanel-LJGNP_IX.js} +4 -4
- package/dist/packem_shared/{ScheduledJobs-Ok1CYYwI.js → ScheduledJobs-UmVaMbJy.js} +164 -61
- package/dist/packem_shared/{SchemaViewer-D8XGnp-X.js → SchemaViewer-Bam6ylvw.js} +4 -4
- package/dist/packem_shared/{SecurityAdvisorPanel-Cdm2IxLW.js → SecurityAdvisorPanel-DTmjUNqt.js} +44 -31
- package/dist/packem_shared/SettingsPanel-C2wDK-8F.js +390 -0
- package/dist/packem_shared/{ShardInput-DNCsT1KW.js → ShardInput-gx_DZXXn.js} +1 -1
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +13 -0
- package/dist/packem_shared/Studio-DpgYe4qt.js +33 -0
- package/dist/packem_shared/{StudioApp-dvywkJ8I.js → StudioApp-C7aaizqc.js} +278 -4
- package/dist/packem_shared/{StudioI18nProvider-Dcajsznk.js → StudioI18nProvider-B-tDCZIi.js} +1 -1
- package/dist/packem_shared/{TableEditor-DIVDk3vT.js → TableEditor-DzK3Z6rL.js} +4 -4
- package/dist/packem_shared/{advisor-view-DBlzJi6C.js → advisor-view-CGcfMiPq.js} +1 -1
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-Nbhpihxv.d.ts} +1 -1
- package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-2cktDedA.js} +1 -1
- package/dist/packem_shared/{data-grid-CCh2Couo.js → data-grid-B5CaV3wS.js} +2 -2
- package/dist/packem_shared/{grid-features-DTjG6Sex.js → grid-features-CzUfqgsM.js} +3 -3
- package/dist/packem_shared/{internal-BBZYexre.js → internal-rXJEAhXS.js} +1 -1
- package/dist/packem_shared/{live-status-bPff1O7Y.js → live-status-FZ0psC1z.js} +1 -1
- package/dist/packem_shared/{reference-view-BCKIoai7.js → reference-view-B4E49Lip.js} +3 -3
- package/dist/packem_shared/{sql-editor-panel-CW2y2x9h.js → sql-editor-panel-Smfl_FDF.js} +6 -6
- package/dist/packem_shared/{studio-BDVd7rIV.js → studio-9Mq0PdMi.js} +2120 -1592
- package/dist/packem_shared/{table-list-sidebar-aZHLq70w.js → table-list-sidebar-Bg7uzbvC.js} +2 -2
- package/dist/packem_shared/use-admin-query-4JQW2rr1.js +88 -0
- package/dist/standalone/studio.js +176 -154
- package/dist/styles.css +1 -1
- package/package.json +13 -12
- package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
- package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
- package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
package/dist/packem_shared/{FunctionStatsPanel-DboBl-XL.js → FunctionStatsPanel-CXynSuqT.js}
RENAMED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ShardInput } from './ShardInput-DNCsT1KW.js';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { L as LiveError } from './live-status-FZ0psC1z.js';
|
|
4
|
+
import { ShardInput } from './ShardInput-gx_DZXXn.js';
|
|
6
5
|
import { B as Badge } from './badge-B2PKA1-5.js';
|
|
7
6
|
import { B as Button } from './button-BhsN2uZH.js';
|
|
8
7
|
import { C as Card, a as CardContent } from './card-DURq3ElK.js';
|
|
9
8
|
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
10
9
|
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
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
|
|
11
|
+
import useDebounced from './useDebounced-Dxncpg6z.js';
|
|
12
|
+
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
13
|
+
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
|
|
14
|
+
import { b as formatTimestamp } from './internal-rXJEAhXS.js';
|
|
15
15
|
import { c as cn } from './utils-B05Dmz_H.js';
|
|
16
|
-
import { u as useLiveShardSeed } from './use-live-shard-seed-B74RYcOy.js';
|
|
17
16
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
18
17
|
|
|
19
|
-
const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
|
|
20
18
|
const KIND_VARIANT = {
|
|
21
19
|
action: "outline",
|
|
22
20
|
mutation: "default",
|
|
@@ -53,218 +51,163 @@ const SORTERS = {
|
|
|
53
51
|
slowest: (a, b) => b.maxDurationMs - a.maxDurationMs
|
|
54
52
|
};
|
|
55
53
|
const FunctionStatsPanel = (t0) => {
|
|
56
|
-
const $ = c(
|
|
54
|
+
const $ = c(45);
|
|
57
55
|
const {
|
|
58
56
|
functions,
|
|
59
57
|
initialShardKey
|
|
60
58
|
} = t0;
|
|
61
|
-
const client = useLunora();
|
|
62
59
|
const t = useT();
|
|
63
60
|
const [shardKey, setShardKey] = useState(initialShardKey ?? "");
|
|
64
|
-
const [stats, setStats] = useState(null);
|
|
65
|
-
const [error, setError] = useState(null);
|
|
66
61
|
const [sortKey, setSortKey] = useState("recent");
|
|
67
|
-
const [liveError, setLiveError] = useState(void 0);
|
|
68
|
-
const mountedRef = useRef(true);
|
|
69
62
|
let t1;
|
|
63
|
+
if ($[0] !== shardKey) {
|
|
64
|
+
t1 = shardKey.trim();
|
|
65
|
+
$[0] = shardKey;
|
|
66
|
+
$[1] = t1;
|
|
67
|
+
} else {
|
|
68
|
+
t1 = $[1];
|
|
69
|
+
}
|
|
70
|
+
const debouncedShard = useDebounced(t1, 400);
|
|
70
71
|
let t2;
|
|
71
|
-
if ($[
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return () => {
|
|
75
|
-
mountedRef.current = false;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
t2 = [];
|
|
79
|
-
$[0] = t1;
|
|
80
|
-
$[1] = t2;
|
|
72
|
+
if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
73
|
+
t2 = {};
|
|
74
|
+
$[2] = t2;
|
|
81
75
|
} else {
|
|
82
|
-
|
|
83
|
-
t2 = $[1];
|
|
76
|
+
t2 = $[2];
|
|
84
77
|
}
|
|
85
|
-
useEffect(t1, t2);
|
|
86
78
|
let t3;
|
|
87
|
-
if ($[
|
|
88
|
-
t3 =
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
if ($[3] !== debouncedShard) {
|
|
80
|
+
t3 = {
|
|
81
|
+
live: true,
|
|
82
|
+
shardKey: debouncedShard
|
|
83
|
+
};
|
|
84
|
+
$[3] = debouncedShard;
|
|
85
|
+
$[4] = t3;
|
|
91
86
|
} else {
|
|
92
|
-
t3 = $[
|
|
87
|
+
t3 = $[4];
|
|
93
88
|
}
|
|
94
|
-
const
|
|
89
|
+
const {
|
|
90
|
+
data,
|
|
91
|
+
error,
|
|
92
|
+
liveError
|
|
93
|
+
} = useAdminQuery(ADMIN_FUNCTIONS.getFunctionStats, t2, t3);
|
|
94
|
+
const stats = data?.functions ?? null;
|
|
95
95
|
let t4;
|
|
96
|
-
if ($[
|
|
97
|
-
t4 = (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
setStats(result.functions);
|
|
101
|
-
};
|
|
102
|
-
$[4] = t4;
|
|
96
|
+
if ($[5] !== functions) {
|
|
97
|
+
t4 = new Map((functions ?? []).map(_temp));
|
|
98
|
+
$[5] = functions;
|
|
99
|
+
$[6] = t4;
|
|
103
100
|
} else {
|
|
104
|
-
t4 = $[
|
|
101
|
+
t4 = $[6];
|
|
105
102
|
}
|
|
106
|
-
const
|
|
103
|
+
const kindByPath = t4;
|
|
107
104
|
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
105
|
if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
133
|
-
|
|
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) => {
|
|
106
|
+
t5 = (event) => {
|
|
164
107
|
setSortKey(event.currentTarget.dataset.sort);
|
|
165
108
|
};
|
|
166
|
-
$[
|
|
109
|
+
$[7] = t5;
|
|
167
110
|
} else {
|
|
168
|
-
|
|
111
|
+
t5 = $[7];
|
|
169
112
|
}
|
|
170
|
-
const selectSort =
|
|
171
|
-
let
|
|
172
|
-
if ($[
|
|
113
|
+
const selectSort = t5;
|
|
114
|
+
let t6;
|
|
115
|
+
if ($[8] !== error || $[9] !== kindByPath || $[10] !== liveError || $[11] !== shardKey || $[12] !== sortKey || $[13] !== stats || $[14] !== t) {
|
|
173
116
|
const sorted = stats === null ? [] : stats.toSorted(SORTERS[sortKey]);
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
117
|
+
let t7;
|
|
118
|
+
if ($[16] !== t) {
|
|
119
|
+
t7 = t("Recent");
|
|
120
|
+
$[16] = t;
|
|
121
|
+
$[17] = t7;
|
|
179
122
|
} else {
|
|
180
|
-
|
|
123
|
+
t7 = $[17];
|
|
181
124
|
}
|
|
182
|
-
let
|
|
183
|
-
if ($[
|
|
184
|
-
|
|
125
|
+
let t8;
|
|
126
|
+
if ($[18] !== t7) {
|
|
127
|
+
t8 = {
|
|
185
128
|
key: "recent",
|
|
186
|
-
label:
|
|
129
|
+
label: t7
|
|
187
130
|
};
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
131
|
+
$[18] = t7;
|
|
132
|
+
$[19] = t8;
|
|
190
133
|
} else {
|
|
191
|
-
|
|
134
|
+
t8 = $[19];
|
|
192
135
|
}
|
|
193
|
-
let
|
|
194
|
-
if ($[
|
|
195
|
-
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
136
|
+
let t9;
|
|
137
|
+
if ($[20] !== t) {
|
|
138
|
+
t9 = t("Most called");
|
|
139
|
+
$[20] = t;
|
|
140
|
+
$[21] = t9;
|
|
198
141
|
} else {
|
|
199
|
-
|
|
142
|
+
t9 = $[21];
|
|
200
143
|
}
|
|
201
|
-
let
|
|
202
|
-
if ($[
|
|
203
|
-
|
|
144
|
+
let t10;
|
|
145
|
+
if ($[22] !== t9) {
|
|
146
|
+
t10 = {
|
|
204
147
|
key: "calls",
|
|
205
|
-
label:
|
|
148
|
+
label: t9
|
|
206
149
|
};
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
150
|
+
$[22] = t9;
|
|
151
|
+
$[23] = t10;
|
|
209
152
|
} else {
|
|
210
|
-
|
|
153
|
+
t10 = $[23];
|
|
211
154
|
}
|
|
212
|
-
let
|
|
213
|
-
if ($[
|
|
214
|
-
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
155
|
+
let t11;
|
|
156
|
+
if ($[24] !== t) {
|
|
157
|
+
t11 = t("Slowest");
|
|
158
|
+
$[24] = t;
|
|
159
|
+
$[25] = t11;
|
|
217
160
|
} else {
|
|
218
|
-
|
|
161
|
+
t11 = $[25];
|
|
219
162
|
}
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
163
|
+
let t12;
|
|
164
|
+
if ($[26] !== t11) {
|
|
165
|
+
t12 = {
|
|
223
166
|
key: "slowest",
|
|
224
|
-
label:
|
|
167
|
+
label: t11
|
|
225
168
|
};
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
169
|
+
$[26] = t11;
|
|
170
|
+
$[27] = t12;
|
|
228
171
|
} else {
|
|
229
|
-
|
|
172
|
+
t12 = $[27];
|
|
230
173
|
}
|
|
231
|
-
let
|
|
232
|
-
if ($[
|
|
233
|
-
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
174
|
+
let t13;
|
|
175
|
+
if ($[28] !== t10 || $[29] !== t12 || $[30] !== t8) {
|
|
176
|
+
t13 = [t8, t10, t12];
|
|
177
|
+
$[28] = t10;
|
|
178
|
+
$[29] = t12;
|
|
179
|
+
$[30] = t8;
|
|
180
|
+
$[31] = t13;
|
|
238
181
|
} else {
|
|
239
|
-
|
|
182
|
+
t13 = $[31];
|
|
240
183
|
}
|
|
241
|
-
const sortButtons =
|
|
242
|
-
let
|
|
243
|
-
if ($[
|
|
244
|
-
|
|
184
|
+
const sortButtons = t13;
|
|
185
|
+
let t14;
|
|
186
|
+
if ($[32] !== shardKey) {
|
|
187
|
+
t14 = /* @__PURE__ */ jsxDEV(ShardInput, {
|
|
245
188
|
onChange: setShardKey,
|
|
246
189
|
testId: "fs-shard-input",
|
|
247
190
|
value: shardKey
|
|
248
191
|
}, void 0, false);
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
192
|
+
$[32] = shardKey;
|
|
193
|
+
$[33] = t14;
|
|
251
194
|
} else {
|
|
252
|
-
|
|
195
|
+
t14 = $[33];
|
|
253
196
|
}
|
|
254
|
-
let
|
|
255
|
-
if ($[
|
|
256
|
-
|
|
197
|
+
let t15;
|
|
198
|
+
if ($[34] !== liveError) {
|
|
199
|
+
t15 = /* @__PURE__ */ jsxDEV(LiveError, {
|
|
257
200
|
message: liveError,
|
|
258
201
|
prefix: "fs"
|
|
259
202
|
}, void 0, false);
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
203
|
+
$[34] = liveError;
|
|
204
|
+
$[35] = t15;
|
|
262
205
|
} else {
|
|
263
|
-
|
|
206
|
+
t15 = $[35];
|
|
264
207
|
}
|
|
265
|
-
let
|
|
266
|
-
if ($[
|
|
267
|
-
|
|
208
|
+
let t16;
|
|
209
|
+
if ($[36] !== sortButtons || $[37] !== sortKey) {
|
|
210
|
+
t16 = /* @__PURE__ */ jsxDEV("div", {
|
|
268
211
|
className: "ml-auto flex items-center gap-1",
|
|
269
212
|
role: "group",
|
|
270
213
|
children: sortButtons.map((option) => /* @__PURE__ */ jsxDEV(Button, {
|
|
@@ -277,42 +220,42 @@ const FunctionStatsPanel = (t0) => {
|
|
|
277
220
|
children: option.label
|
|
278
221
|
}, option.key, false))
|
|
279
222
|
}, void 0, false);
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
223
|
+
$[36] = sortButtons;
|
|
224
|
+
$[37] = sortKey;
|
|
225
|
+
$[38] = t16;
|
|
283
226
|
} else {
|
|
284
|
-
|
|
227
|
+
t16 = $[38];
|
|
285
228
|
}
|
|
286
|
-
let
|
|
287
|
-
if ($[
|
|
288
|
-
|
|
229
|
+
let t17;
|
|
230
|
+
if ($[39] !== t14 || $[40] !== t15 || $[41] !== t16) {
|
|
231
|
+
t17 = /* @__PURE__ */ jsxDEV("div", {
|
|
289
232
|
className: "flex flex-wrap items-center gap-2",
|
|
290
|
-
children: [
|
|
233
|
+
children: [t14, t15, t16]
|
|
291
234
|
}, void 0, true);
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
235
|
+
$[39] = t14;
|
|
236
|
+
$[40] = t15;
|
|
237
|
+
$[41] = t16;
|
|
238
|
+
$[42] = t17;
|
|
296
239
|
} else {
|
|
297
|
-
|
|
240
|
+
t17 = $[42];
|
|
298
241
|
}
|
|
299
|
-
let
|
|
300
|
-
if ($[
|
|
301
|
-
|
|
242
|
+
let t18;
|
|
243
|
+
if ($[43] !== error) {
|
|
244
|
+
t18 = error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
302
245
|
className: "text-sm text-destructive",
|
|
303
246
|
"data-testid": "fs-error",
|
|
304
247
|
role: "alert",
|
|
305
248
|
children: error
|
|
306
249
|
}, void 0, false);
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
250
|
+
$[43] = error;
|
|
251
|
+
$[44] = t18;
|
|
309
252
|
} else {
|
|
310
|
-
|
|
253
|
+
t18 = $[44];
|
|
311
254
|
}
|
|
312
|
-
|
|
255
|
+
t6 = /* @__PURE__ */ jsxDEV("div", {
|
|
313
256
|
className: "flex flex-col gap-4",
|
|
314
257
|
"data-testid": "lunora-function-stats",
|
|
315
|
-
children: [
|
|
258
|
+
children: [t17, t18, stats !== null && sorted.length === 0 && error === null && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
316
259
|
description: t("Per-function call counts, error rates, and latency land here after your first request."),
|
|
317
260
|
icon: /* @__PURE__ */ jsxDEV("svg", {
|
|
318
261
|
"aria-hidden": "true",
|
|
@@ -412,18 +355,18 @@ const FunctionStatsPanel = (t0) => {
|
|
|
412
355
|
}, void 0, false)
|
|
413
356
|
}, void 0, false)]
|
|
414
357
|
}, void 0, true);
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
358
|
+
$[8] = error;
|
|
359
|
+
$[9] = kindByPath;
|
|
360
|
+
$[10] = liveError;
|
|
361
|
+
$[11] = shardKey;
|
|
362
|
+
$[12] = sortKey;
|
|
363
|
+
$[13] = stats;
|
|
364
|
+
$[14] = t;
|
|
365
|
+
$[15] = t6;
|
|
423
366
|
} else {
|
|
424
|
-
|
|
367
|
+
t6 = $[15];
|
|
425
368
|
}
|
|
426
|
-
return
|
|
369
|
+
return t6;
|
|
427
370
|
};
|
|
428
371
|
function _temp(descriptor) {
|
|
429
372
|
return [descriptor.path, descriptor.kind];
|
|
@@ -2,12 +2,12 @@ import { useLunora } from '@lunora/react';
|
|
|
2
2
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
4
4
|
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
|
|
5
|
+
import { b as useClientQuery } from './use-admin-query-4JQW2rr1.js';
|
|
5
6
|
import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
|
|
6
|
-
import { useT } from './
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { G as GridContainer, C as CellValue } from './data-grid-CCh2Couo.js';
|
|
7
|
+
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
8
|
+
import { b as CLOUDFLARE_D1_URL } from './cf-links-2cktDedA.js';
|
|
9
|
+
import { u as useFacets, T as TableListSidebar, G as GridPagination, D as DataFacets } from './table-list-sidebar-Bg7uzbvC.js';
|
|
10
|
+
import { G as GridContainer, C as CellValue } from './data-grid-B5CaV3wS.js';
|
|
11
11
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
12
12
|
|
|
13
13
|
const DEFAULT_PAGE_SIZE = 50;
|
|
@@ -37,13 +37,9 @@ const GlobalDataBrowser = ({
|
|
|
37
37
|
} = {}) => {
|
|
38
38
|
const client = useLunora();
|
|
39
39
|
const t = useT();
|
|
40
|
-
const [tables, setTables] = useState(null);
|
|
41
|
-
const [tablesError, setTablesError] = useState(null);
|
|
42
40
|
const [selectedTable, setSelectedTable] = useState(initialTable ?? null);
|
|
43
41
|
const [offset, setOffset] = useState(0);
|
|
44
42
|
const [pageSize, setPageSize] = useState(initialPageSize);
|
|
45
|
-
const [page, setPage] = useState(null);
|
|
46
|
-
const [pageError, setPageError] = useState(null);
|
|
47
43
|
const [filters, setFilters] = useState([]);
|
|
48
44
|
const filtersRef = useRef(filters);
|
|
49
45
|
filtersRef.current = filters;
|
|
@@ -53,76 +49,53 @@ const GlobalDataBrowser = ({
|
|
|
53
49
|
refetchFacets: refetchFacetsViaHook,
|
|
54
50
|
toggleFacet
|
|
55
51
|
} = useFacets();
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const result = await client.readGlobalTablePage({
|
|
72
|
-
filters: activeFilters,
|
|
73
|
-
limit,
|
|
74
|
-
offset: nextOffset,
|
|
75
|
-
table
|
|
76
|
-
});
|
|
77
|
-
if (fetchSeqRef.current !== seq) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
setPage(result);
|
|
81
|
-
setOffset(nextOffset);
|
|
82
|
-
} catch (error_0) {
|
|
83
|
-
if (fetchSeqRef.current !== seq) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
setPage(null);
|
|
87
|
-
setPageError(errorMessage(error_0));
|
|
88
|
-
}
|
|
89
|
-
}, [client, pageSize]);
|
|
90
|
-
const facetFetcher = (table_0, activeFilters_0) => (column) => client.facetGlobalColumn({
|
|
52
|
+
const tablesQuery = useClientQuery(["lunora-global-tables"], () => client.listGlobalTables());
|
|
53
|
+
const tables = tablesQuery.data ?? null;
|
|
54
|
+
const tablesError = tablesQuery.error;
|
|
55
|
+
const pageQuery = useClientQuery(["lunora-global-page", selectedTable ?? "", offset, pageSize, JSON.stringify(filters)], () => client.readGlobalTablePage({
|
|
56
|
+
filters,
|
|
57
|
+
limit: pageSize,
|
|
58
|
+
offset,
|
|
59
|
+
table: selectedTable ?? ""
|
|
60
|
+
}), {
|
|
61
|
+
enabled: selectedTable !== null,
|
|
62
|
+
keepPreviousData: false
|
|
63
|
+
});
|
|
64
|
+
const page = pageQuery.data ?? null;
|
|
65
|
+
const pageError = pageQuery.error;
|
|
66
|
+
const facetFetcher = (table, activeFilters) => (column) => client.facetGlobalColumn({
|
|
91
67
|
column,
|
|
92
|
-
filters:
|
|
93
|
-
table
|
|
68
|
+
filters: activeFilters,
|
|
69
|
+
table
|
|
94
70
|
});
|
|
95
|
-
const refetchFacets = (
|
|
96
|
-
refetchFacetsViaHook(facetFetcher(
|
|
71
|
+
const refetchFacets = (table_0, activeFilters_0) => {
|
|
72
|
+
refetchFacetsViaHook(facetFetcher(table_0, activeFilters_0));
|
|
97
73
|
};
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
fireAndForget(fetchTables());
|
|
100
|
-
}, [fetchTables]);
|
|
101
74
|
useAutoRefresh(() => {
|
|
102
|
-
|
|
75
|
+
tablesQuery.refetch();
|
|
103
76
|
if (selectedTable !== null) {
|
|
104
|
-
|
|
77
|
+
pageQuery.refetch();
|
|
105
78
|
refetchFacets(selectedTable, filtersRef.current);
|
|
106
79
|
}
|
|
107
80
|
}, true);
|
|
108
81
|
const appliedInitialTable = useRef(void 0);
|
|
109
|
-
const selectTable = useCallback((
|
|
110
|
-
setSelectedTable(
|
|
111
|
-
appliedInitialTable.current =
|
|
82
|
+
const selectTable = useCallback((table_1) => {
|
|
83
|
+
setSelectedTable(table_1);
|
|
84
|
+
appliedInitialTable.current = table_1;
|
|
112
85
|
setFilters([]);
|
|
113
86
|
filtersRef.current = [];
|
|
114
87
|
clearFacets();
|
|
115
|
-
|
|
116
|
-
onSelectTable?.(
|
|
117
|
-
}, [clearFacets,
|
|
88
|
+
setOffset(0);
|
|
89
|
+
onSelectTable?.(table_1);
|
|
90
|
+
}, [clearFacets, onSelectTable]);
|
|
118
91
|
const onToggleFacet = (column_0) => {
|
|
119
92
|
toggleFacet(column_0, selectedTable === null ? null : facetFetcher(selectedTable, filtersRef.current));
|
|
120
93
|
};
|
|
121
94
|
const applyFilters = (next) => {
|
|
122
95
|
setFilters(next);
|
|
123
96
|
filtersRef.current = next;
|
|
97
|
+
setOffset(0);
|
|
124
98
|
if (selectedTable !== null) {
|
|
125
|
-
fireAndForget(fetchPage(selectedTable, 0, pageSize, next));
|
|
126
99
|
refetchFacets(selectedTable, next);
|
|
127
100
|
}
|
|
128
101
|
};
|
|
@@ -146,11 +119,11 @@ const GlobalDataBrowser = ({
|
|
|
146
119
|
selectTable(target);
|
|
147
120
|
});
|
|
148
121
|
}, [initialTable, selectTable]);
|
|
149
|
-
const goToPage = (
|
|
122
|
+
const goToPage = (nextOffset) => {
|
|
150
123
|
if (selectedTable === null) {
|
|
151
124
|
return;
|
|
152
125
|
}
|
|
153
|
-
|
|
126
|
+
setOffset(Math.max(0, nextOffset));
|
|
154
127
|
};
|
|
155
128
|
const total = page?.total ?? 0;
|
|
156
129
|
const hasPrevious = offset > 0;
|
|
@@ -158,7 +131,7 @@ const GlobalDataBrowser = ({
|
|
|
158
131
|
const rangeStart = page === null || page.rows.length === 0 ? 0 : offset + 1;
|
|
159
132
|
const rangeEnd = page === null ? 0 : offset + page.rows.length;
|
|
160
133
|
const reloadTables = () => {
|
|
161
|
-
|
|
134
|
+
tablesQuery.refetch();
|
|
162
135
|
};
|
|
163
136
|
const goPrevious = () => {
|
|
164
137
|
goToPage(offset - pageSize);
|
|
@@ -171,9 +144,7 @@ const GlobalDataBrowser = ({
|
|
|
171
144
|
};
|
|
172
145
|
const changePageSize = (size) => {
|
|
173
146
|
setPageSize(size);
|
|
174
|
-
|
|
175
|
-
fireAndForget(fetchPage(selectedTable, 0, size));
|
|
176
|
-
}
|
|
147
|
+
setOffset(0);
|
|
177
148
|
};
|
|
178
149
|
return /* @__PURE__ */ jsxDEV("div", {
|
|
179
150
|
className: "flex h-full min-w-0",
|