@lunora/studio 1.0.0-alpha.7 → 1.0.0-alpha.71
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/dist/index.d.ts +762 -779
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/MigrationsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +2 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +4 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-bRPJhby-.d.ts +254 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-2F7G7IWQ.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2Y36BVVM.js +4 -0
- package/dist/standalone/chunk-34UVAASH.js +1 -0
- package/dist/standalone/chunk-35II7U25.js +11 -0
- package/dist/standalone/chunk-3FUFEZ65.js +1 -0
- package/dist/standalone/chunk-3QRTYSSX.js +1 -0
- package/dist/standalone/chunk-3RTTXLMU.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4CGALXS3.js +19 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-4WLYA3XE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5L2MD6F6.js +1 -0
- package/dist/standalone/chunk-5OWIOACV.js +13 -0
- package/dist/standalone/chunk-5RF4QDDA.js +6 -0
- package/dist/standalone/chunk-5U2THBI7.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-65OTWFS3.js +1 -0
- package/dist/standalone/chunk-6DWCIIHE.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-7J5N6DGQ.js +1 -0
- package/dist/standalone/chunk-7LQWFOEU.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7RXOPYR5.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-7YEFOSPH.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-B43FTQJ7.js +1 -0
- package/dist/standalone/chunk-BEH5N5ZA.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BNUJ7QMG.js +3 -0
- package/dist/standalone/chunk-C43X4M5U.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-D7XXWV4E.js +1 -0
- package/dist/standalone/chunk-DVOBKIUX.js +1 -0
- package/dist/standalone/chunk-EKRN4ZQM.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-EVN46TVV.js +1 -0
- package/dist/standalone/chunk-EXFBIISG.js +2 -0
- package/dist/standalone/chunk-F5QWLENA.js +1 -0
- package/dist/standalone/chunk-F6GOKFMU.js +3 -0
- package/dist/standalone/chunk-FGTK44LR.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSPTEMYN.js +1 -0
- package/dist/standalone/chunk-GXZAXNZI.js +1 -0
- package/dist/standalone/chunk-H7NIIBHH.js +1 -0
- package/dist/standalone/chunk-HP2UCWND.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IDNNI63H.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KDOC2DP5.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KYF2E5CJ.js +1 -0
- package/dist/standalone/chunk-L7N7F3DA.js +1 -0
- package/dist/standalone/chunk-LE56LPNH.js +13 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-LFXFP4IF.js +1 -0
- package/dist/standalone/chunk-LJDP7NRB.js +1 -0
- package/dist/standalone/chunk-LLXFYRGQ.js +1 -0
- package/dist/standalone/chunk-M536Y2KX.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OHKRN65U.js +1 -0
- package/dist/standalone/chunk-P24JBHEZ.js +4 -0
- package/dist/standalone/chunk-PF7V3G2Z.js +62 -0
- package/dist/standalone/chunk-PWWHP76O.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QGKAJTQQ.js +1 -0
- package/dist/standalone/chunk-QLJJ5YYZ.js +1 -0
- package/dist/standalone/chunk-QVEHPYA5.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QWJ3NPE3.js +1 -0
- package/dist/standalone/chunk-RAA2RGG6.js +1 -0
- package/dist/standalone/chunk-RBU52M5T.js +1 -0
- package/dist/standalone/chunk-SA3MDZC3.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T2JIUFOD.js +4 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
- package/dist/standalone/chunk-TLHJRWNK.js +1 -0
- package/dist/standalone/chunk-UIS34ZPB.js +8 -0
- package/dist/standalone/chunk-UNUU7CJJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VPAXCQ2Y.js +4 -0
- package/dist/standalone/chunk-X2FQ6B5V.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XEDU5FO4.js +1 -0
- package/dist/standalone/chunk-XQBTNJUQ.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XQGANNLS.js +1 -0
- package/dist/standalone/chunk-XSD4Y6SQ.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-YD5NF6UT.js +1 -0
- package/dist/standalone/chunk-YI3WYUXK.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZNNAGR6N.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
- package/dist/packem_shared/AuditPanel-Bq4o_IqT.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-CtBe1So9.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-dxY56TDF.js +0 -193
- package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
- package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
- package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
- package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
- package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CdErL7EJ.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-LJDcmNIO.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
- package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-ChfUOZec.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-BFRpzj6r.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useLunora } from '@lunora/react';
|
|
3
|
-
import { useNavigate, useRouter, useSearch } from '@tanstack/react-router';
|
|
4
|
-
import { useRef, useState, useEffect } from 'react';
|
|
5
|
-
import { T as TIER_META } from './storage-tier-CL98eOvn.js';
|
|
6
|
-
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
7
|
-
import { f as fireAndForget } from './internal-rXJEAhXS.js';
|
|
8
|
-
import { DataBrowser } from './DataBrowser-CtBe1So9.js';
|
|
9
|
-
import { GlobalDataBrowser } from './GlobalDataBrowser-BTEmGrph.js';
|
|
10
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
11
|
-
|
|
12
|
-
const VALID_OPERATORS = /* @__PURE__ */ new Set(["contains", "eq", "gt", "gte", "lt", "lte", "ne"]);
|
|
13
|
-
const isFilterClause = (entry) => {
|
|
14
|
-
if (entry === null || typeof entry !== "object") {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
const candidate = entry;
|
|
18
|
-
return typeof candidate.column === "string" && typeof candidate.operator === "string" && VALID_OPERATORS.has(candidate.operator);
|
|
19
|
-
};
|
|
20
|
-
const parseFilters = (raw) => {
|
|
21
|
-
if (typeof raw !== "string" || raw === "") {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
const parsed = JSON.parse(raw);
|
|
26
|
-
return Array.isArray(parsed) ? parsed.filter(isFilterClause) : [];
|
|
27
|
-
} catch {
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const parseOrder = (raw) => {
|
|
32
|
-
if (typeof raw !== "string" || raw === "") {
|
|
33
|
-
return void 0;
|
|
34
|
-
}
|
|
35
|
-
const separator = raw.lastIndexOf(":");
|
|
36
|
-
if (separator <= 0) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
const column = raw.slice(0, separator);
|
|
40
|
-
const direction = raw.slice(separator + 1);
|
|
41
|
-
if (direction !== "asc" && direction !== "desc") {
|
|
42
|
-
return void 0;
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
column,
|
|
46
|
-
direction
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const searchToDataView = (search) => {
|
|
50
|
-
const filters = parseFilters(search["filters"]);
|
|
51
|
-
const orderBy = parseOrder(search["order"]);
|
|
52
|
-
return {
|
|
53
|
-
filters: filters.length > 0 ? filters : void 0,
|
|
54
|
-
orderBy,
|
|
55
|
-
search: typeof search["search"] === "string" && search["search"] !== "" ? search["search"] : void 0,
|
|
56
|
-
shard: typeof search["shard"] === "string" && search["shard"] !== "" ? search["shard"] : void 0,
|
|
57
|
-
table: typeof search["table"] === "string" && search["table"] !== "" ? search["table"] : void 0,
|
|
58
|
-
tier: search["schema"] === "global" ? "global" : "shard"
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
const dataViewToSearch = (view) => {
|
|
62
|
-
const filters = view.filters ?? [];
|
|
63
|
-
return {
|
|
64
|
-
filters: filters.length > 0 ? JSON.stringify(filters) : void 0,
|
|
65
|
-
order: view.orderBy === void 0 ? void 0 : `${view.orderBy.column}:${view.orderBy.direction}`,
|
|
66
|
-
schema: view.tier === "global" ? "global" : void 0,
|
|
67
|
-
search: view.search !== void 0 && view.search !== "" ? view.search : void 0,
|
|
68
|
-
shard: view.shard !== void 0 && view.shard !== "" ? view.shard : void 0,
|
|
69
|
-
table: view.table !== void 0 && view.table !== "" ? view.table : void 0
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const STORAGE_KEY = "lunora-studio-saved-queries";
|
|
74
|
-
const MAX_SAVED = 50;
|
|
75
|
-
const store = () => {
|
|
76
|
-
try {
|
|
77
|
-
return globalThis.localStorage;
|
|
78
|
-
} catch {
|
|
79
|
-
return void 0;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const isSavedQuery = (entry) => entry !== null && typeof entry === "object" && typeof entry.name === "string" && typeof entry.view === "object" && entry.view !== null;
|
|
83
|
-
const loadSavedQueries = () => {
|
|
84
|
-
try {
|
|
85
|
-
const raw = store()?.getItem(STORAGE_KEY);
|
|
86
|
-
if (raw === null || raw === void 0) {
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
const parsed = JSON.parse(raw);
|
|
90
|
-
return Array.isArray(parsed) ? parsed.filter(isSavedQuery) : [];
|
|
91
|
-
} catch {
|
|
92
|
-
return [];
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const persist = (queries) => {
|
|
96
|
-
const storage = store();
|
|
97
|
-
if (storage !== void 0) {
|
|
98
|
-
try {
|
|
99
|
-
storage.setItem(STORAGE_KEY, JSON.stringify(queries));
|
|
100
|
-
} catch {
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const saveQuery = (name, view) => {
|
|
105
|
-
const trimmed = name.trim();
|
|
106
|
-
if (trimmed === "") {
|
|
107
|
-
return loadSavedQueries();
|
|
108
|
-
}
|
|
109
|
-
const next = [{
|
|
110
|
-
name: trimmed,
|
|
111
|
-
view
|
|
112
|
-
}, ...loadSavedQueries().filter((entry) => entry.name !== trimmed)].slice(0, MAX_SAVED);
|
|
113
|
-
persist(next);
|
|
114
|
-
return next;
|
|
115
|
-
};
|
|
116
|
-
const deleteSavedQuery = (name) => {
|
|
117
|
-
const next = loadSavedQueries().filter((entry) => entry.name !== name);
|
|
118
|
-
persist(next);
|
|
119
|
-
return next;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const SchemaSwitch = (t0) => {
|
|
123
|
-
const $ = c(15);
|
|
124
|
-
const {
|
|
125
|
-
onChange,
|
|
126
|
-
tier
|
|
127
|
-
} = t0;
|
|
128
|
-
const t = useT();
|
|
129
|
-
let t1;
|
|
130
|
-
if ($[0] !== onChange) {
|
|
131
|
-
t1 = (event) => {
|
|
132
|
-
onChange(event.target.value);
|
|
133
|
-
};
|
|
134
|
-
$[0] = onChange;
|
|
135
|
-
$[1] = t1;
|
|
136
|
-
} else {
|
|
137
|
-
t1 = $[1];
|
|
138
|
-
}
|
|
139
|
-
const onSelect = t1;
|
|
140
|
-
let t2;
|
|
141
|
-
if ($[2] !== t) {
|
|
142
|
-
t2 = t("Storage tier");
|
|
143
|
-
$[2] = t;
|
|
144
|
-
$[3] = t2;
|
|
145
|
-
} else {
|
|
146
|
-
t2 = $[3];
|
|
147
|
-
}
|
|
148
|
-
let t3;
|
|
149
|
-
if ($[4] !== t2) {
|
|
150
|
-
t3 = /* @__PURE__ */ jsxDEV("span", {
|
|
151
|
-
className: "font-mono text-[11px] tracking-wide uppercase text-muted-foreground",
|
|
152
|
-
children: t2
|
|
153
|
-
}, void 0, false);
|
|
154
|
-
$[4] = t2;
|
|
155
|
-
$[5] = t3;
|
|
156
|
-
} else {
|
|
157
|
-
t3 = $[5];
|
|
158
|
-
}
|
|
159
|
-
const t4 = TIER_META[tier];
|
|
160
|
-
let t5;
|
|
161
|
-
let t6;
|
|
162
|
-
if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
-
t5 = /* @__PURE__ */ jsxDEV("option", {
|
|
164
|
-
value: "shard",
|
|
165
|
-
children: TIER_META.shard.label
|
|
166
|
-
}, void 0, false);
|
|
167
|
-
t6 = /* @__PURE__ */ jsxDEV("option", {
|
|
168
|
-
value: "global",
|
|
169
|
-
children: TIER_META.global.label
|
|
170
|
-
}, void 0, false);
|
|
171
|
-
$[6] = t5;
|
|
172
|
-
$[7] = t6;
|
|
173
|
-
} else {
|
|
174
|
-
t5 = $[6];
|
|
175
|
-
t6 = $[7];
|
|
176
|
-
}
|
|
177
|
-
let t7;
|
|
178
|
-
if ($[8] !== onSelect || $[9] !== t4.title || $[10] !== tier) {
|
|
179
|
-
t7 = /* @__PURE__ */ jsxDEV("select", {
|
|
180
|
-
className: "h-8 w-full rounded-md border border-border bg-background px-2 text-sm outline-none focus-visible:border-ring",
|
|
181
|
-
"data-testid": "table-editor-schema",
|
|
182
|
-
id: "table-editor-schema",
|
|
183
|
-
onChange: onSelect,
|
|
184
|
-
title: t4.title,
|
|
185
|
-
value: tier,
|
|
186
|
-
children: [t5, t6]
|
|
187
|
-
}, void 0, true);
|
|
188
|
-
$[8] = onSelect;
|
|
189
|
-
$[9] = t4.title;
|
|
190
|
-
$[10] = tier;
|
|
191
|
-
$[11] = t7;
|
|
192
|
-
} else {
|
|
193
|
-
t7 = $[11];
|
|
194
|
-
}
|
|
195
|
-
let t8;
|
|
196
|
-
if ($[12] !== t3 || $[13] !== t7) {
|
|
197
|
-
t8 = /* @__PURE__ */ jsxDEV("label", {
|
|
198
|
-
className: "flex w-full flex-col gap-1",
|
|
199
|
-
htmlFor: "table-editor-schema",
|
|
200
|
-
children: [t3, t7]
|
|
201
|
-
}, void 0, true);
|
|
202
|
-
$[12] = t3;
|
|
203
|
-
$[13] = t7;
|
|
204
|
-
$[14] = t8;
|
|
205
|
-
} else {
|
|
206
|
-
t8 = $[14];
|
|
207
|
-
}
|
|
208
|
-
return t8;
|
|
209
|
-
};
|
|
210
|
-
const TableEditor = ({
|
|
211
|
-
editable = false,
|
|
212
|
-
initialShardKey
|
|
213
|
-
}) => {
|
|
214
|
-
const client = useLunora();
|
|
215
|
-
const navigate = useNavigate();
|
|
216
|
-
const router = useRouter();
|
|
217
|
-
const search = useSearch({
|
|
218
|
-
strict: false
|
|
219
|
-
});
|
|
220
|
-
const view = searchToDataView(search);
|
|
221
|
-
const searchRef = useRef(search);
|
|
222
|
-
searchRef.current = search;
|
|
223
|
-
const onDataRoute = () => router.state.location.pathname.split("/").findLast(Boolean) === "data";
|
|
224
|
-
const tier = view.tier ?? "shard";
|
|
225
|
-
const tableParameter = view.table;
|
|
226
|
-
const [savedQueries, setSavedQueries] = useState(() => loadSavedQueries());
|
|
227
|
-
const [globalTableNames, setGlobalTableNames] = useState(() => /* @__PURE__ */ new Set());
|
|
228
|
-
useEffect(() => {
|
|
229
|
-
fireAndForget((async () => {
|
|
230
|
-
try {
|
|
231
|
-
const tables = await client.listGlobalTables();
|
|
232
|
-
setGlobalTableNames(new Set(tables.map((table) => table.name)));
|
|
233
|
-
} catch {
|
|
234
|
-
}
|
|
235
|
-
})());
|
|
236
|
-
}, [client]);
|
|
237
|
-
useEffect(() => {
|
|
238
|
-
if (tier === "shard" && tableParameter !== void 0 && globalTableNames.has(tableParameter)) {
|
|
239
|
-
fireAndForget(navigate({
|
|
240
|
-
replace: true,
|
|
241
|
-
search: (previous) => {
|
|
242
|
-
return {
|
|
243
|
-
...previous,
|
|
244
|
-
schema: "global"
|
|
245
|
-
};
|
|
246
|
-
},
|
|
247
|
-
to: "/data"
|
|
248
|
-
}));
|
|
249
|
-
}
|
|
250
|
-
}, [globalTableNames, navigate, tableParameter, tier]);
|
|
251
|
-
const selectTier = (next) => {
|
|
252
|
-
fireAndForget(navigate({
|
|
253
|
-
search: (previous_0) => {
|
|
254
|
-
return {
|
|
255
|
-
...previous_0,
|
|
256
|
-
schema: next === "global" ? "global" : void 0,
|
|
257
|
-
table: void 0
|
|
258
|
-
};
|
|
259
|
-
},
|
|
260
|
-
to: "/data"
|
|
261
|
-
}));
|
|
262
|
-
};
|
|
263
|
-
const onSelectTable = (table_0) => {
|
|
264
|
-
if (!onDataRoute()) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
fireAndForget(navigate({
|
|
268
|
-
search: (previous_1) => {
|
|
269
|
-
return {
|
|
270
|
-
...previous_1,
|
|
271
|
-
table: table_0
|
|
272
|
-
};
|
|
273
|
-
},
|
|
274
|
-
to: "/data"
|
|
275
|
-
}));
|
|
276
|
-
};
|
|
277
|
-
const onNavigateToGlobal = (table_1) => {
|
|
278
|
-
fireAndForget(navigate({
|
|
279
|
-
search: (previous_2) => {
|
|
280
|
-
return {
|
|
281
|
-
...previous_2,
|
|
282
|
-
schema: "global",
|
|
283
|
-
table: table_1
|
|
284
|
-
};
|
|
285
|
-
},
|
|
286
|
-
to: "/data"
|
|
287
|
-
}));
|
|
288
|
-
};
|
|
289
|
-
const onViewChange = (next_0) => {
|
|
290
|
-
const patch = dataViewToSearch(next_0);
|
|
291
|
-
const {
|
|
292
|
-
current
|
|
293
|
-
} = searchRef;
|
|
294
|
-
const unchanged = (current["filters"] ?? void 0) === patch.filters && (current["order"] ?? void 0) === patch.order && (current["search"] ?? void 0) === patch.search && (current["shard"] ?? void 0) === patch.shard;
|
|
295
|
-
if (unchanged || !onDataRoute()) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
fireAndForget(navigate({
|
|
299
|
-
replace: true,
|
|
300
|
-
search: (previous_3) => {
|
|
301
|
-
return {
|
|
302
|
-
...previous_3,
|
|
303
|
-
filters: patch.filters,
|
|
304
|
-
order: patch.order,
|
|
305
|
-
search: patch.search,
|
|
306
|
-
shard: patch.shard
|
|
307
|
-
};
|
|
308
|
-
},
|
|
309
|
-
to: "/data"
|
|
310
|
-
}));
|
|
311
|
-
};
|
|
312
|
-
const onCopyLink = () => {
|
|
313
|
-
try {
|
|
314
|
-
fireAndForget(globalThis.navigator.clipboard.writeText(globalThis.location.href));
|
|
315
|
-
} catch {
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
const onSaveQuery = (name, snapshot) => {
|
|
319
|
-
setSavedQueries(saveQuery(name, snapshot));
|
|
320
|
-
};
|
|
321
|
-
const onDeleteQuery = (name_0) => {
|
|
322
|
-
setSavedQueries(deleteSavedQuery(name_0));
|
|
323
|
-
};
|
|
324
|
-
const onApplyQuery = (query) => {
|
|
325
|
-
const patch_0 = dataViewToSearch(query.view);
|
|
326
|
-
fireAndForget(navigate({
|
|
327
|
-
search: () => {
|
|
328
|
-
return {
|
|
329
|
-
filters: patch_0.filters,
|
|
330
|
-
order: patch_0.order,
|
|
331
|
-
schema: patch_0.schema,
|
|
332
|
-
search: patch_0.search,
|
|
333
|
-
shard: patch_0.shard,
|
|
334
|
-
table: patch_0.table
|
|
335
|
-
};
|
|
336
|
-
},
|
|
337
|
-
to: "/data"
|
|
338
|
-
}));
|
|
339
|
-
};
|
|
340
|
-
const queryBar = {
|
|
341
|
-
onApplyQuery,
|
|
342
|
-
onCopyLink,
|
|
343
|
-
onDeleteQuery,
|
|
344
|
-
onSaveQuery,
|
|
345
|
-
saved: savedQueries
|
|
346
|
-
};
|
|
347
|
-
const schemaSwitch = /* @__PURE__ */ jsxDEV(SchemaSwitch, {
|
|
348
|
-
onChange: selectTier,
|
|
349
|
-
tier
|
|
350
|
-
}, void 0, false);
|
|
351
|
-
return tier === "global" ? /* @__PURE__ */ jsxDEV(GlobalDataBrowser, {
|
|
352
|
-
initialTable: tableParameter,
|
|
353
|
-
onSelectTable,
|
|
354
|
-
schemaSwitch
|
|
355
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV(DataBrowser, {
|
|
356
|
-
editable,
|
|
357
|
-
globalTableNames,
|
|
358
|
-
initialFilters: view.filters,
|
|
359
|
-
initialOrderBy: view.orderBy,
|
|
360
|
-
initialSearch: view.search,
|
|
361
|
-
initialShardKey: view.shard ?? initialShardKey,
|
|
362
|
-
onNavigateToGlobal,
|
|
363
|
-
onSelectTable,
|
|
364
|
-
onViewChange,
|
|
365
|
-
queryBar,
|
|
366
|
-
schemaSwitch,
|
|
367
|
-
tableParam: tableParameter
|
|
368
|
-
}, void 0, false);
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
export { TableEditor };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { useState, useMemo } from 'react';
|
|
2
|
-
import { C as Card, a as CardContent } from './card-DURq3ElK.js';
|
|
3
|
-
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
|
|
4
|
-
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
5
|
-
import { c as cn } from './utils-B05Dmz_H.js';
|
|
6
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
7
|
-
|
|
8
|
-
const ADVISORY_LEVEL = {
|
|
9
|
-
ERROR: "error",
|
|
10
|
-
INFO: "info",
|
|
11
|
-
WARN: "warning"
|
|
12
|
-
};
|
|
13
|
-
const advisoryRow = (finding) => {
|
|
14
|
-
const table = typeof finding.metadata["table"] === "string" ? finding.metadata["table"] : void 0;
|
|
15
|
-
return {
|
|
16
|
-
description: `${finding.detail} ${finding.remediation}`,
|
|
17
|
-
entity: table,
|
|
18
|
-
issueType: finding.title,
|
|
19
|
-
key: finding.cacheKey,
|
|
20
|
-
level: ADVISORY_LEVEL[finding.level]
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const LEVELS = ["error", "warning", "info"];
|
|
24
|
-
const LEVEL_DOT = {
|
|
25
|
-
error: "bg-destructive",
|
|
26
|
-
info: "bg-info",
|
|
27
|
-
warning: "bg-warning"
|
|
28
|
-
};
|
|
29
|
-
const levelLabel = (t, level) => ({
|
|
30
|
-
error: t("Errors"),
|
|
31
|
-
info: t("Info"),
|
|
32
|
-
warning: t("Warnings")
|
|
33
|
-
})[level];
|
|
34
|
-
const levelCount = (t, level, count) => ({
|
|
35
|
-
error: t("{count} errors", {
|
|
36
|
-
count
|
|
37
|
-
}),
|
|
38
|
-
info: t("{count} suggestions", {
|
|
39
|
-
count
|
|
40
|
-
}),
|
|
41
|
-
warning: t("{count} warnings", {
|
|
42
|
-
count
|
|
43
|
-
})
|
|
44
|
-
})[level];
|
|
45
|
-
const emptyTitle = (t, level) => ({
|
|
46
|
-
error: t("No errors detected"),
|
|
47
|
-
info: t("No suggestions"),
|
|
48
|
-
warning: t("No warnings detected")
|
|
49
|
-
})[level];
|
|
50
|
-
const AdvisorView = ({
|
|
51
|
-
error = null,
|
|
52
|
-
rows,
|
|
53
|
-
testId,
|
|
54
|
-
toolbar
|
|
55
|
-
}) => {
|
|
56
|
-
const t = useT();
|
|
57
|
-
const [active, setActive] = useState("error");
|
|
58
|
-
const counts = useMemo(() => {
|
|
59
|
-
const tally = {
|
|
60
|
-
error: 0,
|
|
61
|
-
info: 0,
|
|
62
|
-
warning: 0
|
|
63
|
-
};
|
|
64
|
-
for (const row of rows ?? []) {
|
|
65
|
-
tally[row.level] += 1;
|
|
66
|
-
}
|
|
67
|
-
return tally;
|
|
68
|
-
}, [rows]);
|
|
69
|
-
const visible = (rows ?? []).filter((row_0) => row_0.level === active);
|
|
70
|
-
const selectTab = (event) => {
|
|
71
|
-
setActive(event.currentTarget.dataset.level);
|
|
72
|
-
};
|
|
73
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
74
|
-
className: "flex flex-col gap-3",
|
|
75
|
-
"data-testid": testId,
|
|
76
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
77
|
-
className: "flex border-b border-border",
|
|
78
|
-
role: "tablist",
|
|
79
|
-
children: LEVELS.map((level) => /* @__PURE__ */ jsxDEV("button", {
|
|
80
|
-
"aria-selected": active === level,
|
|
81
|
-
className: "flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground",
|
|
82
|
-
"data-level": level,
|
|
83
|
-
"data-testid": `${testId}-tab-${level}`,
|
|
84
|
-
onClick: selectTab,
|
|
85
|
-
role: "tab",
|
|
86
|
-
type: "button",
|
|
87
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
88
|
-
className: "flex items-center gap-2 text-sm font-medium text-foreground",
|
|
89
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
90
|
-
"aria-hidden": "true",
|
|
91
|
-
className: cn("size-2 rounded-sm", LEVEL_DOT[level])
|
|
92
|
-
}, void 0, false), levelLabel(t, level)]
|
|
93
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("span", {
|
|
94
|
-
className: "ps-4 text-xs text-muted-foreground",
|
|
95
|
-
children: levelCount(t, level, counts[level])
|
|
96
|
-
}, void 0, false)]
|
|
97
|
-
}, level, true))
|
|
98
|
-
}, void 0, false), toolbar !== void 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
99
|
-
className: "flex flex-wrap items-center gap-2",
|
|
100
|
-
children: toolbar
|
|
101
|
-
}, void 0, false), error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
102
|
-
className: "text-sm text-destructive",
|
|
103
|
-
"data-testid": `${testId}-error`,
|
|
104
|
-
role: "alert",
|
|
105
|
-
children: error
|
|
106
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(Card, {
|
|
107
|
-
className: "overflow-hidden py-0",
|
|
108
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
109
|
-
className: "px-0",
|
|
110
|
-
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
111
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
112
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
113
|
-
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
114
|
-
children: t("Issue type")
|
|
115
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
116
|
-
children: t("Entity/item")
|
|
117
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
118
|
-
children: t("Description")
|
|
119
|
-
}, void 0, false)]
|
|
120
|
-
}, void 0, true)
|
|
121
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
122
|
-
children: visible.length === 0 ? /* @__PURE__ */ jsxDEV(TableRow, {
|
|
123
|
-
children: /* @__PURE__ */ jsxDEV(TableCell, {
|
|
124
|
-
className: "h-40 text-center align-middle text-muted-foreground",
|
|
125
|
-
colSpan: 3,
|
|
126
|
-
"data-testid": `${testId}-empty`,
|
|
127
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
128
|
-
className: "block text-sm font-medium text-foreground",
|
|
129
|
-
children: emptyTitle(t, active)
|
|
130
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
131
|
-
className: "block text-sm",
|
|
132
|
-
children: t("Nothing to report for this deployment.")
|
|
133
|
-
}, void 0, false)]
|
|
134
|
-
}, void 0, true)
|
|
135
|
-
}, void 0, false) : visible.map((row_1) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
136
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
137
|
-
className: "font-medium text-foreground",
|
|
138
|
-
children: row_1.issueType
|
|
139
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
140
|
-
className: "font-mono text-xs text-muted-foreground",
|
|
141
|
-
children: row_1.entity ?? "—"
|
|
142
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
143
|
-
className: "text-muted-foreground",
|
|
144
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
145
|
-
children: row_1.description
|
|
146
|
-
}, void 0, false), row_1.action !== void 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
147
|
-
className: "mt-1.5 flex flex-wrap items-center gap-1.5",
|
|
148
|
-
children: row_1.action
|
|
149
|
-
}, void 0, false)]
|
|
150
|
-
}, void 0, true)]
|
|
151
|
-
}, row_1.key, true))
|
|
152
|
-
}, void 0, false)]
|
|
153
|
-
}, void 0, true)
|
|
154
|
-
}, void 0, false)
|
|
155
|
-
}, void 0, false)]
|
|
156
|
-
}, void 0, true);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export { AdvisorView as A, advisoryRow as a };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
const aggregateMetrics = (results) => {
|
|
2
|
-
let totalRequests = 0;
|
|
3
|
-
let totalErrors = 0;
|
|
4
|
-
let totalDatabaseSize = 0;
|
|
5
|
-
let reachable = 0;
|
|
6
|
-
let failed = 0;
|
|
7
|
-
let cacheHits = 0;
|
|
8
|
-
let cacheTotal = 0;
|
|
9
|
-
for (const {
|
|
10
|
-
metrics
|
|
11
|
-
} of results) {
|
|
12
|
-
if (metrics === null) {
|
|
13
|
-
failed += 1;
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
reachable += 1;
|
|
17
|
-
totalRequests += metrics.requests;
|
|
18
|
-
totalErrors += metrics.errors;
|
|
19
|
-
totalDatabaseSize += metrics.databaseSize ?? 0;
|
|
20
|
-
if (metrics.cache !== null) {
|
|
21
|
-
cacheHits += metrics.cache.hits;
|
|
22
|
-
cacheTotal += metrics.cache.hits + metrics.cache.misses;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
failed,
|
|
27
|
-
// eslint-disable-next-line unicorn/no-null -- hitRate is part of the public AggregateMetrics type, which models "no cache" as null
|
|
28
|
-
hitRate: cacheTotal === 0 ? null : cacheHits / cacheTotal,
|
|
29
|
-
reachable,
|
|
30
|
-
totalDatabaseSize,
|
|
31
|
-
totalErrors,
|
|
32
|
-
totalRequests
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const shardsToAggregate = (current, recents) => {
|
|
36
|
-
const seen = /* @__PURE__ */ new Set();
|
|
37
|
-
const out = [];
|
|
38
|
-
for (const shard of ["", current.trim(), ...recents]) {
|
|
39
|
-
if (!seen.has(shard)) {
|
|
40
|
-
seen.add(shard);
|
|
41
|
-
out.push(shard);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return out;
|
|
45
|
-
};
|
|
46
|
-
const percentile = (values, p) => {
|
|
47
|
-
if (values.length === 0) {
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
values.sort((a, b) => a - b);
|
|
51
|
-
if (p <= 0) {
|
|
52
|
-
return values[0] ?? 0;
|
|
53
|
-
}
|
|
54
|
-
if (p >= 100) {
|
|
55
|
-
return values.at(-1) ?? 0;
|
|
56
|
-
}
|
|
57
|
-
const index = Math.ceil(p / 100 * values.length) - 1;
|
|
58
|
-
return values[index] ?? 0;
|
|
59
|
-
};
|
|
60
|
-
const computeLatencyPercentiles = (snapshot) => {
|
|
61
|
-
const snap = snapshot;
|
|
62
|
-
const functionList = snap.functions;
|
|
63
|
-
if (!functionList || functionList.length === 0) {
|
|
64
|
-
return {
|
|
65
|
-
p90: 0,
|
|
66
|
-
p95: 0
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
const CAP = 1e3;
|
|
70
|
-
const samples = [];
|
|
71
|
-
for (const functionStat of functionList) {
|
|
72
|
-
if (functionStat.calls <= 0) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
const avg = functionStat.totalDurationMs / functionStat.calls;
|
|
76
|
-
const reps = Math.min(functionStat.calls, CAP);
|
|
77
|
-
for (let index = 0; index < reps; index += 1) {
|
|
78
|
-
samples.push(avg);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (samples.length === 0) {
|
|
82
|
-
return {
|
|
83
|
-
p90: 0,
|
|
84
|
-
p95: 0
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
p90: percentile([...samples], 90),
|
|
89
|
-
p95: percentile([...samples], 95)
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
const computeDelta = (baseline, current, direction = "neutral") => {
|
|
93
|
-
const delta = current - baseline;
|
|
94
|
-
const pct = baseline === 0 ? null : delta / baseline * 100;
|
|
95
|
-
return {
|
|
96
|
-
delta,
|
|
97
|
-
direction,
|
|
98
|
-
pct
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
const enrichQueryStats = (entries) => entries.map((entry) => {
|
|
102
|
-
return {
|
|
103
|
-
...entry,
|
|
104
|
-
avgDurationMs: entry.execCount > 0 ? entry.totalDurationMs / entry.execCount : 0
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
export { aggregateMetrics, computeDelta, computeLatencyPercentiles, enrichQueryStats, percentile, shardsToAggregate };
|