@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.40
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-23C4TCRO.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-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-5ZAA2PVR.js +1 -0
- package/dist/standalone/chunk-676HEBIR.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7RE5UW27.js +8 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AAVIFQ4Y.js +2 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-AJFQ3LNM.js +1 -0
- package/dist/standalone/chunk-AJULNB46.js +4 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BKW7FFEO.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BXOYVWJR.js +13 -0
- package/dist/standalone/chunk-C7WTJLC3.js +1 -0
- package/dist/standalone/chunk-CACB34RQ.js +1 -0
- package/dist/standalone/chunk-CICVBMEN.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-CWEAJUHW.js +1 -0
- package/dist/standalone/chunk-DC72CQY4.js +76 -0
- package/dist/standalone/chunk-DECHEGIC.js +1 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-ERJNDIXC.js +1 -0
- package/dist/standalone/chunk-FKACHRWO.js +1 -0
- package/dist/standalone/chunk-FSGCANAU.js +1 -0
- package/dist/standalone/chunk-GLUNBZRI.js +1 -0
- package/dist/standalone/chunk-GMSGZDDH.js +13 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-H6RKXQZU.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HZTGDL4L.js +1 -0
- package/dist/standalone/chunk-I7ZZRM7I.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J46WXQYL.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-JVODY4EP.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-LYB5L53X.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MT2J3H7O.js +3 -0
- package/dist/standalone/chunk-N746FOQP.js +1 -0
- package/dist/standalone/chunk-NC6MBMSI.js +1 -0
- package/dist/standalone/chunk-NN27EDQB.js +1 -0
- package/dist/standalone/chunk-NY6GDADQ.js +1 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OY3HD7BJ.js +4 -0
- package/dist/standalone/chunk-P5HJXCZS.js +1 -0
- package/dist/standalone/chunk-PTS5TW3J.js +1 -0
- package/dist/standalone/chunk-Q52CHOSY.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-QDBOPDJ7.js +1 -0
- package/dist/standalone/chunk-QHFTGJPS.js +4 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-SG3ALJJU.js +1 -0
- package/dist/standalone/chunk-SSI4G2MY.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TH45YG6Q.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-V6IWFYAQ.js +1 -0
- package/dist/standalone/chunk-V7SRH36W.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WPNXY7IS.js +1 -0
- package/dist/standalone/chunk-X33MSJPP.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-XRNXOIVZ.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YNZ7ARWW.js +1 -0
- package/dist/standalone/chunk-YTO65GHS.js +1 -0
- package/dist/standalone/chunk-ZE6FT5Z3.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
|
@@ -1,290 +1,23 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { c } from 'react/compiler-runtime';
|
|
3
2
|
import { useLunora } from '@lunora/react';
|
|
4
3
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
5
|
-
import { L as LiveError } from '
|
|
6
|
-
import { ShardInput } from '
|
|
7
|
-
import { B as Button } from '
|
|
8
|
-
import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from '
|
|
9
|
-
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from '
|
|
18
|
-
import { B as Badge } from '
|
|
19
|
-
import {
|
|
20
|
-
import { c as cn } from './utils-B05Dmz_H.js';
|
|
21
|
-
import { HugeiconsIcon } from '@hugeicons/react';
|
|
22
|
-
import { UnfoldMoreIcon, Tick02Icon, ArrowUp01Icon, ArrowDown01Icon } from '@hugeicons/core-free-icons';
|
|
4
|
+
import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
|
|
5
|
+
import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
|
|
6
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
7
|
+
import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from '../packem_shared/card-DURq3ElK.js';
|
|
8
|
+
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';
|
|
9
|
+
import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
|
|
10
|
+
import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
|
|
11
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
12
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
13
|
+
import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
|
|
14
|
+
import { j as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
|
|
15
|
+
import { r as recordShard, l as loadRecentShards } from '../packem_shared/shard-history-DyebH1R5.js';
|
|
16
|
+
import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from '../packem_shared/aggregateMetrics-D4nUHEKU.js';
|
|
17
|
+
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
18
|
+
import { S as SelectValue, a as SelectTrigger, b as SelectItem, c as SelectContent, d as Select } from '../packem_shared/select-UkNYCT3s.js';
|
|
23
19
|
import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
|
|
24
|
-
import { S as Sparkline } from '
|
|
25
|
-
|
|
26
|
-
const Select = Select$1.Root;
|
|
27
|
-
function SelectValue(t0) {
|
|
28
|
-
const $ = c(8);
|
|
29
|
-
let className;
|
|
30
|
-
let props;
|
|
31
|
-
if ($[0] !== t0) {
|
|
32
|
-
({
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
} = t0);
|
|
36
|
-
$[0] = t0;
|
|
37
|
-
$[1] = className;
|
|
38
|
-
$[2] = props;
|
|
39
|
-
} else {
|
|
40
|
-
className = $[1];
|
|
41
|
-
props = $[2];
|
|
42
|
-
}
|
|
43
|
-
let t1;
|
|
44
|
-
if ($[3] !== className) {
|
|
45
|
-
t1 = cn("flex flex-1 text-start", className);
|
|
46
|
-
$[3] = className;
|
|
47
|
-
$[4] = t1;
|
|
48
|
-
} else {
|
|
49
|
-
t1 = $[4];
|
|
50
|
-
}
|
|
51
|
-
let t2;
|
|
52
|
-
if ($[5] !== props || $[6] !== t1) {
|
|
53
|
-
t2 = /* @__PURE__ */ jsxDEV(Select$1.Value, {
|
|
54
|
-
"data-slot": "select-value",
|
|
55
|
-
className: t1,
|
|
56
|
-
...props
|
|
57
|
-
}, void 0, false);
|
|
58
|
-
$[5] = props;
|
|
59
|
-
$[6] = t1;
|
|
60
|
-
$[7] = t2;
|
|
61
|
-
} else {
|
|
62
|
-
t2 = $[7];
|
|
63
|
-
}
|
|
64
|
-
return t2;
|
|
65
|
-
}
|
|
66
|
-
function SelectTrigger({
|
|
67
|
-
className,
|
|
68
|
-
size = "default",
|
|
69
|
-
children,
|
|
70
|
-
...props
|
|
71
|
-
}) {
|
|
72
|
-
return /* @__PURE__ */ jsxDEV(Select$1.Trigger, {
|
|
73
|
-
"data-slot": "select-trigger",
|
|
74
|
-
"data-size": size,
|
|
75
|
-
className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
76
|
-
...props,
|
|
77
|
-
children: [children, /* @__PURE__ */ jsxDEV(Select$1.Icon, {
|
|
78
|
-
render: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
|
|
79
|
-
icon: UnfoldMoreIcon,
|
|
80
|
-
strokeWidth: 2,
|
|
81
|
-
className: "pointer-events-none size-4 text-muted-foreground"
|
|
82
|
-
}, void 0, false)
|
|
83
|
-
}, void 0, false)]
|
|
84
|
-
}, void 0, true);
|
|
85
|
-
}
|
|
86
|
-
function SelectContent({
|
|
87
|
-
className,
|
|
88
|
-
children,
|
|
89
|
-
side = "bottom",
|
|
90
|
-
sideOffset = 4,
|
|
91
|
-
align = "center",
|
|
92
|
-
alignOffset = 0,
|
|
93
|
-
alignItemWithTrigger = true,
|
|
94
|
-
...props
|
|
95
|
-
}) {
|
|
96
|
-
return /* @__PURE__ */ jsxDEV(Select$1.Portal, {
|
|
97
|
-
children: /* @__PURE__ */ jsxDEV(Select$1.Positioner, {
|
|
98
|
-
side,
|
|
99
|
-
sideOffset,
|
|
100
|
-
align,
|
|
101
|
-
alignOffset,
|
|
102
|
-
alignItemWithTrigger,
|
|
103
|
-
className: "isolate z-50",
|
|
104
|
-
children: /* @__PURE__ */ jsxDEV(Select$1.Popup, {
|
|
105
|
-
"data-slot": "select-content",
|
|
106
|
-
"data-align-trigger": alignItemWithTrigger,
|
|
107
|
-
className: cn("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!", className),
|
|
108
|
-
...props,
|
|
109
|
-
children: [/* @__PURE__ */ jsxDEV(SelectScrollUpButton, {}, void 0, false), /* @__PURE__ */ jsxDEV(Select$1.List, {
|
|
110
|
-
children
|
|
111
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(SelectScrollDownButton, {}, void 0, false)]
|
|
112
|
-
}, void 0, true)
|
|
113
|
-
}, void 0, false)
|
|
114
|
-
}, void 0, false);
|
|
115
|
-
}
|
|
116
|
-
function SelectItem(t0) {
|
|
117
|
-
const $ = c(13);
|
|
118
|
-
let children;
|
|
119
|
-
let className;
|
|
120
|
-
let props;
|
|
121
|
-
if ($[0] !== t0) {
|
|
122
|
-
({
|
|
123
|
-
className,
|
|
124
|
-
children,
|
|
125
|
-
...props
|
|
126
|
-
} = t0);
|
|
127
|
-
$[0] = t0;
|
|
128
|
-
$[1] = children;
|
|
129
|
-
$[2] = className;
|
|
130
|
-
$[3] = props;
|
|
131
|
-
} else {
|
|
132
|
-
children = $[1];
|
|
133
|
-
className = $[2];
|
|
134
|
-
props = $[3];
|
|
135
|
-
}
|
|
136
|
-
let t1;
|
|
137
|
-
if ($[4] !== className) {
|
|
138
|
-
t1 = cn("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className);
|
|
139
|
-
$[4] = className;
|
|
140
|
-
$[5] = t1;
|
|
141
|
-
} else {
|
|
142
|
-
t1 = $[5];
|
|
143
|
-
}
|
|
144
|
-
let t2;
|
|
145
|
-
if ($[6] !== children) {
|
|
146
|
-
t2 = /* @__PURE__ */ jsxDEV(Select$1.ItemText, {
|
|
147
|
-
className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
|
|
148
|
-
children
|
|
149
|
-
}, void 0, false);
|
|
150
|
-
$[6] = children;
|
|
151
|
-
$[7] = t2;
|
|
152
|
-
} else {
|
|
153
|
-
t2 = $[7];
|
|
154
|
-
}
|
|
155
|
-
let t3;
|
|
156
|
-
if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
-
t3 = /* @__PURE__ */ jsxDEV(Select$1.ItemIndicator, {
|
|
158
|
-
render: /* @__PURE__ */ jsxDEV("span", {
|
|
159
|
-
className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center"
|
|
160
|
-
}, void 0, false),
|
|
161
|
-
children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
|
|
162
|
-
icon: Tick02Icon,
|
|
163
|
-
strokeWidth: 2,
|
|
164
|
-
className: "pointer-events-none"
|
|
165
|
-
}, void 0, false)
|
|
166
|
-
}, void 0, false);
|
|
167
|
-
$[8] = t3;
|
|
168
|
-
} else {
|
|
169
|
-
t3 = $[8];
|
|
170
|
-
}
|
|
171
|
-
let t4;
|
|
172
|
-
if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
|
|
173
|
-
t4 = /* @__PURE__ */ jsxDEV(Select$1.Item, {
|
|
174
|
-
"data-slot": "select-item",
|
|
175
|
-
className: t1,
|
|
176
|
-
...props,
|
|
177
|
-
children: [t2, t3]
|
|
178
|
-
}, void 0, true);
|
|
179
|
-
$[9] = props;
|
|
180
|
-
$[10] = t1;
|
|
181
|
-
$[11] = t2;
|
|
182
|
-
$[12] = t4;
|
|
183
|
-
} else {
|
|
184
|
-
t4 = $[12];
|
|
185
|
-
}
|
|
186
|
-
return t4;
|
|
187
|
-
}
|
|
188
|
-
function SelectScrollUpButton(t0) {
|
|
189
|
-
const $ = c(9);
|
|
190
|
-
let className;
|
|
191
|
-
let props;
|
|
192
|
-
if ($[0] !== t0) {
|
|
193
|
-
({
|
|
194
|
-
className,
|
|
195
|
-
...props
|
|
196
|
-
} = t0);
|
|
197
|
-
$[0] = t0;
|
|
198
|
-
$[1] = className;
|
|
199
|
-
$[2] = props;
|
|
200
|
-
} else {
|
|
201
|
-
className = $[1];
|
|
202
|
-
props = $[2];
|
|
203
|
-
}
|
|
204
|
-
let t1;
|
|
205
|
-
if ($[3] !== className) {
|
|
206
|
-
t1 = cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className);
|
|
207
|
-
$[3] = className;
|
|
208
|
-
$[4] = t1;
|
|
209
|
-
} else {
|
|
210
|
-
t1 = $[4];
|
|
211
|
-
}
|
|
212
|
-
let t2;
|
|
213
|
-
if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
214
|
-
t2 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
|
|
215
|
-
icon: ArrowUp01Icon,
|
|
216
|
-
strokeWidth: 2
|
|
217
|
-
}, void 0, false);
|
|
218
|
-
$[5] = t2;
|
|
219
|
-
} else {
|
|
220
|
-
t2 = $[5];
|
|
221
|
-
}
|
|
222
|
-
let t3;
|
|
223
|
-
if ($[6] !== props || $[7] !== t1) {
|
|
224
|
-
t3 = /* @__PURE__ */ jsxDEV(Select$1.ScrollUpArrow, {
|
|
225
|
-
"data-slot": "select-scroll-up-button",
|
|
226
|
-
className: t1,
|
|
227
|
-
...props,
|
|
228
|
-
children: t2
|
|
229
|
-
}, void 0, false);
|
|
230
|
-
$[6] = props;
|
|
231
|
-
$[7] = t1;
|
|
232
|
-
$[8] = t3;
|
|
233
|
-
} else {
|
|
234
|
-
t3 = $[8];
|
|
235
|
-
}
|
|
236
|
-
return t3;
|
|
237
|
-
}
|
|
238
|
-
function SelectScrollDownButton(t0) {
|
|
239
|
-
const $ = c(9);
|
|
240
|
-
let className;
|
|
241
|
-
let props;
|
|
242
|
-
if ($[0] !== t0) {
|
|
243
|
-
({
|
|
244
|
-
className,
|
|
245
|
-
...props
|
|
246
|
-
} = t0);
|
|
247
|
-
$[0] = t0;
|
|
248
|
-
$[1] = className;
|
|
249
|
-
$[2] = props;
|
|
250
|
-
} else {
|
|
251
|
-
className = $[1];
|
|
252
|
-
props = $[2];
|
|
253
|
-
}
|
|
254
|
-
let t1;
|
|
255
|
-
if ($[3] !== className) {
|
|
256
|
-
t1 = cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className);
|
|
257
|
-
$[3] = className;
|
|
258
|
-
$[4] = t1;
|
|
259
|
-
} else {
|
|
260
|
-
t1 = $[4];
|
|
261
|
-
}
|
|
262
|
-
let t2;
|
|
263
|
-
if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
264
|
-
t2 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
|
|
265
|
-
icon: ArrowDown01Icon,
|
|
266
|
-
strokeWidth: 2
|
|
267
|
-
}, void 0, false);
|
|
268
|
-
$[5] = t2;
|
|
269
|
-
} else {
|
|
270
|
-
t2 = $[5];
|
|
271
|
-
}
|
|
272
|
-
let t3;
|
|
273
|
-
if ($[6] !== props || $[7] !== t1) {
|
|
274
|
-
t3 = /* @__PURE__ */ jsxDEV(Select$1.ScrollDownArrow, {
|
|
275
|
-
"data-slot": "select-scroll-down-button",
|
|
276
|
-
className: t1,
|
|
277
|
-
...props,
|
|
278
|
-
children: t2
|
|
279
|
-
}, void 0, false);
|
|
280
|
-
$[6] = props;
|
|
281
|
-
$[7] = t1;
|
|
282
|
-
$[8] = t3;
|
|
283
|
-
} else {
|
|
284
|
-
t3 = $[8];
|
|
285
|
-
}
|
|
286
|
-
return t3;
|
|
287
|
-
}
|
|
20
|
+
import { S as Sparkline } from '../packem_shared/sparkline-BnA1kC9X.js';
|
|
288
21
|
|
|
289
22
|
const performanceLevel = (avgMs) => {
|
|
290
23
|
if (avgMs >= 100) {
|
|
@@ -1205,6 +938,7 @@ const formatDuration = (ms) => {
|
|
|
1205
938
|
}
|
|
1206
939
|
return `${seconds.toString()}s`;
|
|
1207
940
|
};
|
|
941
|
+
const resolveTab = (hasQueryStats, activeTab) => hasQueryStats ? activeTab : "overview";
|
|
1208
942
|
const hitRate = (hits, misses) => {
|
|
1209
943
|
const total = hits + misses;
|
|
1210
944
|
return total === 0 ? "—" : `${(hits / total * 100).toFixed(1)}%`;
|
|
@@ -1297,24 +1031,33 @@ const MetricsPanel = ({
|
|
|
1297
1031
|
const client = useLunora();
|
|
1298
1032
|
const t = useT();
|
|
1299
1033
|
const [shardKey, setShardKey] = useState(initialShardKey ?? "");
|
|
1300
|
-
const [metrics, setMetrics] = useState(null);
|
|
1301
|
-
const [error, setError] = useState(null);
|
|
1302
1034
|
const [activeTab, setActiveTab] = useState("overview");
|
|
1303
|
-
const [liveError, setLiveError] = useState(void 0);
|
|
1304
1035
|
const [history, setHistory] = useState([]);
|
|
1305
|
-
const mountedRef = useRef(true);
|
|
1306
1036
|
const lastRequestsRef = useRef(null);
|
|
1307
1037
|
const lastShardRef = useRef(null);
|
|
1038
|
+
const mountedRef = useRef(true);
|
|
1308
1039
|
useEffect(() => {
|
|
1309
1040
|
mountedRef.current = true;
|
|
1310
1041
|
return () => {
|
|
1311
1042
|
mountedRef.current = false;
|
|
1312
1043
|
};
|
|
1313
1044
|
}, []);
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1045
|
+
const debouncedShard = useDebounced(shardKey.trim(), 400);
|
|
1046
|
+
const {
|
|
1047
|
+
data,
|
|
1048
|
+
error,
|
|
1049
|
+
liveError
|
|
1050
|
+
} = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, {}, {
|
|
1051
|
+
live: true,
|
|
1052
|
+
shardKey: debouncedShard
|
|
1053
|
+
});
|
|
1054
|
+
const metrics = data ?? null;
|
|
1055
|
+
useEffect(() => {
|
|
1056
|
+
if (data === void 0) {
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
recordShard(debouncedShard);
|
|
1060
|
+
const next = data;
|
|
1318
1061
|
const previous = lastRequestsRef.current;
|
|
1319
1062
|
const shardChanged = lastShardRef.current !== null && lastShardRef.current !== next.shard;
|
|
1320
1063
|
lastShardRef.current = next.shard;
|
|
@@ -1326,32 +1069,7 @@ const MetricsPanel = ({
|
|
|
1326
1069
|
if (previous !== null && next.requests >= previous) {
|
|
1327
1070
|
setHistory((prior) => [...prior, next.requests - previous].slice(-30));
|
|
1328
1071
|
}
|
|
1329
|
-
};
|
|
1330
|
-
const refresh = async (shard) => {
|
|
1331
|
-
try {
|
|
1332
|
-
const next_0 = await client.query(GET_METRICS, {}, callOptions(shard));
|
|
1333
|
-
recordShard(shard);
|
|
1334
|
-
if (mountedRef.current) {
|
|
1335
|
-
applySample(next_0);
|
|
1336
|
-
}
|
|
1337
|
-
} catch (error_) {
|
|
1338
|
-
if (mountedRef.current) {
|
|
1339
|
-
setMetrics(null);
|
|
1340
|
-
setError(errorMessage(error_));
|
|
1341
|
-
}
|
|
1342
|
-
throw error_;
|
|
1343
|
-
}
|
|
1344
|
-
};
|
|
1345
|
-
const committedShard = useLiveShardSeed(shardKey, refresh);
|
|
1346
|
-
useLiveAdmin(ADMIN_FUNCTIONS.getMetrics, {}, committedShard ?? "", (next_1) => {
|
|
1347
|
-
if (mountedRef.current) {
|
|
1348
|
-
applySample(next_1);
|
|
1349
|
-
}
|
|
1350
|
-
}, committedShard !== void 0, (message) => {
|
|
1351
|
-
if (mountedRef.current) {
|
|
1352
|
-
setLiveError(message);
|
|
1353
|
-
}
|
|
1354
|
-
});
|
|
1072
|
+
}, [data, debouncedShard]);
|
|
1355
1073
|
const [shardResults, setShardResults] = useState(null);
|
|
1356
1074
|
const [aggregating, setAggregating] = useState(false);
|
|
1357
1075
|
const aggregateAll = async () => {
|
|
@@ -1412,6 +1130,7 @@ const MetricsPanel = ({
|
|
|
1412
1130
|
}
|
|
1413
1131
|
return enrichQueryStats(snapQs);
|
|
1414
1132
|
}, [metrics]);
|
|
1133
|
+
const effectiveTab = resolveTab(queryStats !== void 0, activeTab);
|
|
1415
1134
|
const runAggregate = () => {
|
|
1416
1135
|
fireAndForget(aggregateAll());
|
|
1417
1136
|
};
|
|
@@ -1468,13 +1187,13 @@ const MetricsPanel = ({
|
|
|
1468
1187
|
className: "flex gap-2 border-b",
|
|
1469
1188
|
"data-testid": "mt-tabs",
|
|
1470
1189
|
children: [/* @__PURE__ */ jsxDEV("button", {
|
|
1471
|
-
className: `pb-2 text-sm font-medium transition-colors ${
|
|
1190
|
+
className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "overview" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1472
1191
|
"data-testid": "mt-tab-overview",
|
|
1473
1192
|
onClick: switchToOverview,
|
|
1474
1193
|
type: "button",
|
|
1475
1194
|
children: t("Overview")
|
|
1476
1195
|
}, void 0, false), /* @__PURE__ */ jsxDEV("button", {
|
|
1477
|
-
className: `pb-2 text-sm font-medium transition-colors ${
|
|
1196
|
+
className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "query-insights" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1478
1197
|
"data-testid": "mt-tab-query-insights",
|
|
1479
1198
|
onClick: switchToQueryInsights,
|
|
1480
1199
|
type: "button",
|
|
@@ -1483,9 +1202,9 @@ const MetricsPanel = ({
|
|
|
1483
1202
|
children: queryStats.length
|
|
1484
1203
|
}, void 0, false)]
|
|
1485
1204
|
}, void 0, true)]
|
|
1486
|
-
}, void 0, true),
|
|
1205
|
+
}, void 0, true), effectiveTab === "query-insights" && queryStats !== void 0 && /* @__PURE__ */ jsxDEV(QueryInsights, {
|
|
1487
1206
|
queryStats
|
|
1488
|
-
}, void 0, false),
|
|
1207
|
+
}, void 0, false), effectiveTab === "overview" && metrics !== null && /* @__PURE__ */ jsxDEV("dl", {
|
|
1489
1208
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
1490
1209
|
"data-testid": "mt-stats",
|
|
1491
1210
|
children: [/* @__PURE__ */ jsxDEV(StatCard, {
|
|
@@ -1542,7 +1261,7 @@ const MetricsPanel = ({
|
|
|
1542
1261
|
rate: hitRate(metrics.cache.hits, metrics.cache.misses)
|
|
1543
1262
|
})
|
|
1544
1263
|
}, void 0, false)]
|
|
1545
|
-
}, void 0, true),
|
|
1264
|
+
}, void 0, true), effectiveTab === "overview" && metrics === null && null, effectiveTab === "overview" && aggregate !== null && shardResults !== null && /* @__PURE__ */ jsxDEV("div", {
|
|
1546
1265
|
className: "flex flex-col gap-4",
|
|
1547
1266
|
"data-testid": "mt-aggregate-view",
|
|
1548
1267
|
children: [/* @__PURE__ */ jsxDEV("dl", {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { useLunora } from '@lunora/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ConfirmButton } from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { B as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { ConfirmButton } from '../packem_shared/ConfirmButton-C2eVi2Qv.js';
|
|
4
|
+
import { E as ErrorAlert } from '../packem_shared/error-alert-CXjqyGw9.js';
|
|
5
|
+
import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
|
|
6
|
+
import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
|
|
7
|
+
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
8
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
9
|
+
import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
|
|
10
|
+
import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
11
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
12
|
+
import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
|
|
13
|
+
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';
|
|
14
|
+
import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
|
|
15
|
+
import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
|
|
16
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
17
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
18
|
+
import { i as formatTimestamp, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
|
|
19
|
+
import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
|
|
19
20
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
20
21
|
|
|
21
|
-
const MIGRATION_STATUS = adminRef(ADMIN_FUNCTIONS.migrationStatus);
|
|
22
22
|
const RUN_MIGRATION = adminRef(ADMIN_FUNCTIONS.runMigration);
|
|
23
23
|
const MigrationsPanel = ({
|
|
24
24
|
initialShardKey
|
|
@@ -26,33 +26,29 @@ const MigrationsPanel = ({
|
|
|
26
26
|
const client = useLunora();
|
|
27
27
|
const t = useT();
|
|
28
28
|
const [shardKey, setShardKey] = useState(initialShardKey ?? "");
|
|
29
|
-
const [rows, setRows] = useState(null);
|
|
30
|
-
const [statusError, setStatusError] = useState(null);
|
|
31
|
-
const [liveError, setLiveError] = useState(void 0);
|
|
32
29
|
const [migrationId, setMigrationId] = useState("");
|
|
33
30
|
const [direction, setDirection] = useState("up");
|
|
34
31
|
const [dryRun, setDryRun] = useState(true);
|
|
35
32
|
const [running, setRunning] = useState(false);
|
|
36
33
|
const [runResult, setRunResult] = useState(null);
|
|
37
34
|
const [runError, setRunError] = useState(null);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const debouncedShard = useDebounced(shardKey.trim(), 400);
|
|
36
|
+
const shardSettled = shardKey.trim() === debouncedShard;
|
|
37
|
+
const statusQuery = useAdminQuery(ADMIN_FUNCTIONS.migrationStatus, {}, {
|
|
38
|
+
live: true,
|
|
39
|
+
shardKey: debouncedShard
|
|
40
|
+
});
|
|
41
|
+
const rows = statusQuery.data?.migrations ?? null;
|
|
42
|
+
const statusError = statusQuery.error;
|
|
43
|
+
const {
|
|
44
|
+
errorSource: statusErrorSource,
|
|
45
|
+
liveError
|
|
46
|
+
} = statusQuery;
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (statusQuery.data !== void 0) {
|
|
49
|
+
recordShard(debouncedShard);
|
|
48
50
|
}
|
|
49
|
-
};
|
|
50
|
-
const committedShard = useLiveShardSeed(shardKey, refresh);
|
|
51
|
-
useLiveAdmin(ADMIN_FUNCTIONS.migrationStatus, {}, committedShard ?? "", (result_0) => {
|
|
52
|
-
setStatusError(null);
|
|
53
|
-
setLiveError(void 0);
|
|
54
|
-
setRows(result_0.migrations);
|
|
55
|
-
}, committedShard !== void 0, setLiveError);
|
|
51
|
+
}, [statusQuery.data, debouncedShard]);
|
|
56
52
|
const run = async () => {
|
|
57
53
|
const id = migrationId.trim();
|
|
58
54
|
if (id === "") {
|
|
@@ -63,17 +59,16 @@ const MigrationsPanel = ({
|
|
|
63
59
|
setRunning(true);
|
|
64
60
|
setRunError(null);
|
|
65
61
|
try {
|
|
66
|
-
const
|
|
62
|
+
const result = await client.query(RUN_MIGRATION, {
|
|
67
63
|
direction,
|
|
68
64
|
dryRun,
|
|
69
65
|
id
|
|
70
66
|
}, callOptions(shardKey));
|
|
71
|
-
setRunResult(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} catch (error_0) {
|
|
67
|
+
setRunResult(result);
|
|
68
|
+
statusQuery.refetch();
|
|
69
|
+
} catch (error) {
|
|
75
70
|
setRunResult(null);
|
|
76
|
-
setRunError(errorMessage(
|
|
71
|
+
setRunError(errorMessage(error));
|
|
77
72
|
} finally {
|
|
78
73
|
setRunning(false);
|
|
79
74
|
}
|
|
@@ -103,11 +98,9 @@ const MigrationsPanel = ({
|
|
|
103
98
|
message: liveError,
|
|
104
99
|
prefix: "mg"
|
|
105
100
|
}, void 0, false)]
|
|
106
|
-
}, void 0, true), statusError !== null && /* @__PURE__ */ jsxDEV(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
role: "alert",
|
|
110
|
-
children: statusError
|
|
101
|
+
}, void 0, true), statusError !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
|
|
102
|
+
error: statusErrorSource,
|
|
103
|
+
testId: "mg-status-error"
|
|
111
104
|
}, void 0, false), rows !== null && rows.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
112
105
|
description: t("Data migrations you run against this shard will be tracked here."),
|
|
113
106
|
icon: /* @__PURE__ */ jsxDEV("svg", {
|
|
@@ -212,7 +205,7 @@ const MigrationsPanel = ({
|
|
|
212
205
|
}, void 0, false), t("Dry run")]
|
|
213
206
|
}, void 0, true), dryRun ? /* @__PURE__ */ jsxDEV(Button, {
|
|
214
207
|
"data-testid": "mg-run",
|
|
215
|
-
disabled: running,
|
|
208
|
+
disabled: running || !shardSettled,
|
|
216
209
|
onClick: runMigration,
|
|
217
210
|
size: "sm",
|
|
218
211
|
type: "button",
|
|
@@ -221,7 +214,7 @@ const MigrationsPanel = ({
|
|
|
221
214
|
// A real (non-dry-run) migration mutates rows — guard it.
|
|
222
215
|
/* @__PURE__ */ jsxDEV(ConfirmButton, {
|
|
223
216
|
confirmLabel: running ? t("Running…") : t("Run migration?"),
|
|
224
|
-
disabled: running,
|
|
217
|
+
disabled: running || !shardSettled,
|
|
225
218
|
onConfirm: runMigration,
|
|
226
219
|
testId: "mg-run",
|
|
227
220
|
children: t("Run")
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useLunora } from '@lunora/react';
|
|
2
2
|
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import { ConfirmButton } from '
|
|
4
|
-
import { B as Badge } from '
|
|
5
|
-
import { B as Button } from '
|
|
6
|
-
import { I as Input } from '
|
|
7
|
-
import { L as Label } from '
|
|
8
|
-
import { useAutoRefresh } from '
|
|
9
|
-
import { useT } from '
|
|
10
|
-
import { ADMIN_FUNCTIONS } from '
|
|
11
|
-
import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from '
|
|
3
|
+
import { ConfirmButton } from '../packem_shared/ConfirmButton-C2eVi2Qv.js';
|
|
4
|
+
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
5
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
6
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
7
|
+
import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
|
|
8
|
+
import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
|
|
9
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
10
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
11
|
+
import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
|
|
12
12
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
13
13
|
|
|
14
14
|
const GET_BOOKMARK = adminRef(ADMIN_FUNCTIONS.getPitrBookmark);
|
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
import { c } from 'react/compiler-runtime';
|
|
3
3
|
import { useLunora } from '@lunora/react';
|
|
4
4
|
import { useState, useRef, useEffect } from 'react';
|
|
5
|
-
import { ShardInput } from '
|
|
6
|
-
import { S as StorageTierBadge, T as TIER_META } from '
|
|
7
|
-
import { B as Badge } from '
|
|
8
|
-
import { B as Button } from '
|
|
9
|
-
import { C as Card, b as CardHeader, c as CardTitle, d as CardDescription, a as CardContent } from '
|
|
10
|
-
import { E as EmptyState } from '
|
|
11
|
-
import { I as Input } from '
|
|
12
|
-
import useDebounced from '
|
|
13
|
-
import { useT } from '
|
|
14
|
-
import { ADMIN_FUNCTIONS } from '
|
|
15
|
-
import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '
|
|
16
|
-
import { r as recordShard } from '
|
|
17
|
-
import { c as cn } from '
|
|
5
|
+
import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
|
|
6
|
+
import { S as StorageTierBadge, T as TIER_META } from '../packem_shared/storage-tier-CL98eOvn.js';
|
|
7
|
+
import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
|
|
8
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
9
|
+
import { C as Card, b as CardHeader, c as CardTitle, d as CardDescription, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
|
|
10
|
+
import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
11
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
12
|
+
import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
|
|
13
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
14
|
+
import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
|
|
15
|
+
import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
|
|
16
|
+
import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
|
|
17
|
+
import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
|
|
18
18
|
import { Download01Icon } from '@hugeicons/core-free-icons';
|
|
19
19
|
import { HugeiconsIcon } from '@hugeicons/react';
|
|
20
20
|
import { Handle, Position, getNodesBounds, getViewportForBounds, useNodesState, useEdgesState, Background, Panel, Controls, MiniMap, ReactFlow, useNodes, useReactFlow } from '@xyflow/react';
|
|
21
|
-
import { d as DropdownMenu, D as DropdownMenuTrigger, c as DropdownMenuContent, b as DropdownMenuItem } from '
|
|
21
|
+
import { d as DropdownMenu, D as DropdownMenuTrigger, c as DropdownMenuContent, b as DropdownMenuItem } from '../packem_shared/dropdown-menu-WY4B_eJO.js';
|
|
22
22
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
23
|
+
import { LunoraError } from '@lunora/errors';
|
|
23
24
|
import { toBlob, toSvg } from 'html-to-image';
|
|
24
25
|
import { useNavigate } from '@tanstack/react-router';
|
|
25
|
-
import { L as Label } from '
|
|
26
|
+
import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
|
|
26
27
|
|
|
27
28
|
function BaseNode(t0) {
|
|
28
29
|
const $ = c(10);
|
|
@@ -340,7 +341,7 @@ const exportDiagramAsPng = async (viewportElement, nodes, filename = "schema-dia
|
|
|
340
341
|
width: IMAGE_WIDTH
|
|
341
342
|
});
|
|
342
343
|
if (blob === null) {
|
|
343
|
-
throw new
|
|
344
|
+
throw new LunoraError("INTERNAL", "html-to-image produced no blob");
|
|
344
345
|
}
|
|
345
346
|
const url = globalThis.URL.createObjectURL(blob);
|
|
346
347
|
triggerDownload(url, filename);
|