@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,640 +0,0 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useLunora } from '@lunora/react';
|
|
3
|
-
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
4
|
-
import ConnectionBadge from './ConnectionBadge-B2DDM2Tn.js';
|
|
5
|
-
import { L as LiveError } from './live-status-FZ0psC1z.js';
|
|
6
|
-
import { B as Badge } from './badge-B2PKA1-5.js';
|
|
7
|
-
import { C as Card } from './card-DURq3ElK.js';
|
|
8
|
-
import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
|
|
9
|
-
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
10
|
-
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
|
|
11
|
-
import { f as fireAndForget, b as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
|
|
12
|
-
import { l as loadRecentShards } from './shard-history-DyebH1R5.js';
|
|
13
|
-
import { c as cn } from './utils-B05Dmz_H.js';
|
|
14
|
-
import { shardsToAggregate } from './aggregateMetrics-D4nUHEKU.js';
|
|
15
|
-
import { S as Sparkline } from './sparkline-10dG-_f0.js';
|
|
16
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
17
|
-
|
|
18
|
-
const STATUS_RANK = {
|
|
19
|
-
completed: 0,
|
|
20
|
-
failed: 2,
|
|
21
|
-
in_progress: 1
|
|
22
|
-
};
|
|
23
|
-
const sumShardMetrics = (results) => {
|
|
24
|
-
let requests = 0;
|
|
25
|
-
let errors = 0;
|
|
26
|
-
let reachable = 0;
|
|
27
|
-
let failed = 0;
|
|
28
|
-
const history = [];
|
|
29
|
-
for (const {
|
|
30
|
-
metrics
|
|
31
|
-
} of results) {
|
|
32
|
-
if (metrics === null) {
|
|
33
|
-
failed += 1;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
reachable += 1;
|
|
37
|
-
requests += metrics.requests;
|
|
38
|
-
errors += metrics.errors;
|
|
39
|
-
history.push(...metrics.history ?? []);
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
errors,
|
|
43
|
-
failed,
|
|
44
|
-
history,
|
|
45
|
-
reachable,
|
|
46
|
-
requests
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
const mergeFunctionStats = (perShard) => {
|
|
50
|
-
const byPath = /* @__PURE__ */ new Map();
|
|
51
|
-
for (const shard of perShard) {
|
|
52
|
-
for (const stat of shard) {
|
|
53
|
-
const existing = byPath.get(stat.path);
|
|
54
|
-
if (existing === void 0) {
|
|
55
|
-
byPath.set(stat.path, {
|
|
56
|
-
...stat
|
|
57
|
-
});
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
existing.calls += stat.calls;
|
|
61
|
-
existing.errors += stat.errors;
|
|
62
|
-
existing.totalDurationMs += stat.totalDurationMs;
|
|
63
|
-
existing.scans = (existing.scans ?? 0) + (stat.scans ?? 0);
|
|
64
|
-
existing.maxDurationMs = Math.max(existing.maxDurationMs, stat.maxDurationMs);
|
|
65
|
-
existing.lastCalledAt = Math.max(existing.lastCalledAt, stat.lastCalledAt);
|
|
66
|
-
if ((stat.lastErrorAt ?? 0) > (existing.lastErrorAt ?? 0)) {
|
|
67
|
-
existing.lastErrorAt = stat.lastErrorAt;
|
|
68
|
-
existing.lastErrorMessage = stat.lastErrorMessage;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return [...byPath.values()];
|
|
73
|
-
};
|
|
74
|
-
const dedupeMigrations = (perShard) => {
|
|
75
|
-
const byId = /* @__PURE__ */ new Map();
|
|
76
|
-
for (const shard of perShard) {
|
|
77
|
-
for (const row of shard) {
|
|
78
|
-
const existing = byId.get(row.id);
|
|
79
|
-
if (existing === void 0) {
|
|
80
|
-
byId.set(row.id, row);
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
const rankDelta = STATUS_RANK[row.status] - STATUS_RANK[existing.status];
|
|
84
|
-
if (rankDelta > 0 || rankDelta === 0 && (row.updatedAt ?? 0) > (existing.updatedAt ?? 0)) {
|
|
85
|
-
byId.set(row.id, row);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return [...byId.values()];
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const GET_AUTH_METRICS = adminRef(ADMIN_FUNCTIONS.getAuthMetrics);
|
|
93
|
-
const GET_FUNCTION_STATS = adminRef(ADMIN_FUNCTIONS.getFunctionStats);
|
|
94
|
-
const GET_LOGS = adminRef(ADMIN_FUNCTIONS.getLogs);
|
|
95
|
-
const GET_METRICS = adminRef(ADMIN_FUNCTIONS.getMetrics);
|
|
96
|
-
const MIGRATION_STATUS = adminRef(ADMIN_FUNCTIONS.migrationStatus);
|
|
97
|
-
const RECENT_ERROR_LIMIT = 5;
|
|
98
|
-
const MIN_FANOUT_INTERVAL_MS = 2e3;
|
|
99
|
-
const TOP_FUNCTION_LIMIT = 5;
|
|
100
|
-
const REQUEST_ERROR_WARN = 0.01;
|
|
101
|
-
const REQUEST_ERROR_CRIT = 0.05;
|
|
102
|
-
const AUTH_FAIL_WARN = 0.1;
|
|
103
|
-
const AUTH_FAIL_CRIT = 0.3;
|
|
104
|
-
const BACKLOG_WARN = 1;
|
|
105
|
-
const BACKLOG_CRIT = 50;
|
|
106
|
-
const rateLevel = (rate, warn, crit) => {
|
|
107
|
-
if (rate >= crit) {
|
|
108
|
-
return "crit";
|
|
109
|
-
}
|
|
110
|
-
return rate >= warn ? "warn" : "ok";
|
|
111
|
-
};
|
|
112
|
-
const countLevel = (count, warn, crit) => {
|
|
113
|
-
if (count >= crit) {
|
|
114
|
-
return "crit";
|
|
115
|
-
}
|
|
116
|
-
return count >= warn ? "warn" : "ok";
|
|
117
|
-
};
|
|
118
|
-
const LEVEL_VARIANT = {
|
|
119
|
-
crit: "destructive",
|
|
120
|
-
ok: "secondary",
|
|
121
|
-
warn: "default"
|
|
122
|
-
};
|
|
123
|
-
const ratePercent = (numerator, denominator) => {
|
|
124
|
-
if (denominator === 0) {
|
|
125
|
-
return "—";
|
|
126
|
-
}
|
|
127
|
-
return `${(numerator / denominator * 100).toFixed(1)}%`;
|
|
128
|
-
};
|
|
129
|
-
const requestErrorSeries = (history) => {
|
|
130
|
-
const byBucket = /* @__PURE__ */ new Map();
|
|
131
|
-
for (const bucket of history ?? []) {
|
|
132
|
-
const slot = byBucket.get(bucket.bucketMs) ?? {
|
|
133
|
-
calls: 0,
|
|
134
|
-
errors: 0
|
|
135
|
-
};
|
|
136
|
-
slot.calls += bucket.calls;
|
|
137
|
-
slot.errors += bucket.errors;
|
|
138
|
-
byBucket.set(bucket.bucketMs, slot);
|
|
139
|
-
}
|
|
140
|
-
const ordered = [...byBucket.entries()].toSorted((a, b) => a[0] - b[0]);
|
|
141
|
-
return {
|
|
142
|
-
errors: ordered.map(([, slot]) => slot.errors),
|
|
143
|
-
requests: ordered.map(([, slot]) => slot.calls)
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
const migrationSummary = (rows) => {
|
|
147
|
-
let failed = 0;
|
|
148
|
-
let running = 0;
|
|
149
|
-
for (const row of rows) {
|
|
150
|
-
if (row.status === "failed") {
|
|
151
|
-
failed += 1;
|
|
152
|
-
} else if (row.status === "in_progress") {
|
|
153
|
-
running += 1;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
let level = "ok";
|
|
157
|
-
if (failed > 0) {
|
|
158
|
-
level = "crit";
|
|
159
|
-
} else if (running > 0) {
|
|
160
|
-
level = "warn";
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
failed,
|
|
164
|
-
level,
|
|
165
|
-
running
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
const migrationTileValue = (summary, t) => {
|
|
169
|
-
if (summary.failed > 0) {
|
|
170
|
-
return t("{count} failed", {
|
|
171
|
-
count: summary.failed.toString()
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
if (summary.running > 0) {
|
|
175
|
-
return t("{count} running", {
|
|
176
|
-
count: summary.running.toString()
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
return t("OK");
|
|
180
|
-
};
|
|
181
|
-
const LEVEL_DOT = {
|
|
182
|
-
crit: "bg-destructive",
|
|
183
|
-
ok: "bg-success",
|
|
184
|
-
warn: "bg-warning"
|
|
185
|
-
};
|
|
186
|
-
const LEVEL_TEXT = {
|
|
187
|
-
crit: "text-destructive",
|
|
188
|
-
ok: "text-foreground",
|
|
189
|
-
warn: "text-warning"
|
|
190
|
-
};
|
|
191
|
-
const LEVEL_RING = {
|
|
192
|
-
crit: "bg-destructive/10 text-destructive",
|
|
193
|
-
ok: "bg-success/10 text-success",
|
|
194
|
-
warn: "bg-warning/10 text-warning"
|
|
195
|
-
};
|
|
196
|
-
const worstLevel = (levels) => {
|
|
197
|
-
if (levels.includes("crit")) {
|
|
198
|
-
return "crit";
|
|
199
|
-
}
|
|
200
|
-
return levels.includes("warn") ? "warn" : "ok";
|
|
201
|
-
};
|
|
202
|
-
const SloCard = (t0) => {
|
|
203
|
-
const $ = c(19);
|
|
204
|
-
const {
|
|
205
|
-
chart,
|
|
206
|
-
label,
|
|
207
|
-
level,
|
|
208
|
-
testId,
|
|
209
|
-
value
|
|
210
|
-
} = t0;
|
|
211
|
-
const t1 = LEVEL_DOT[level];
|
|
212
|
-
let t2;
|
|
213
|
-
if ($[0] !== t1) {
|
|
214
|
-
t2 = cn("size-1.5 shrink-0 rounded-full", t1);
|
|
215
|
-
$[0] = t1;
|
|
216
|
-
$[1] = t2;
|
|
217
|
-
} else {
|
|
218
|
-
t2 = $[1];
|
|
219
|
-
}
|
|
220
|
-
let t3;
|
|
221
|
-
if ($[2] !== t2) {
|
|
222
|
-
t3 = /* @__PURE__ */ jsxDEV("span", {
|
|
223
|
-
"aria-hidden": "true",
|
|
224
|
-
className: t2
|
|
225
|
-
}, void 0, false);
|
|
226
|
-
$[2] = t2;
|
|
227
|
-
$[3] = t3;
|
|
228
|
-
} else {
|
|
229
|
-
t3 = $[3];
|
|
230
|
-
}
|
|
231
|
-
let t4;
|
|
232
|
-
if ($[4] !== label || $[5] !== t3) {
|
|
233
|
-
t4 = /* @__PURE__ */ jsxDEV("span", {
|
|
234
|
-
className: "flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
235
|
-
children: [t3, label]
|
|
236
|
-
}, void 0, true);
|
|
237
|
-
$[4] = label;
|
|
238
|
-
$[5] = t3;
|
|
239
|
-
$[6] = t4;
|
|
240
|
-
} else {
|
|
241
|
-
t4 = $[6];
|
|
242
|
-
}
|
|
243
|
-
const t5 = LEVEL_TEXT[level];
|
|
244
|
-
let t6;
|
|
245
|
-
if ($[7] !== t5) {
|
|
246
|
-
t6 = cn("truncate text-2xl font-semibold tabular-nums", t5);
|
|
247
|
-
$[7] = t5;
|
|
248
|
-
$[8] = t6;
|
|
249
|
-
} else {
|
|
250
|
-
t6 = $[8];
|
|
251
|
-
}
|
|
252
|
-
let t7;
|
|
253
|
-
if ($[9] !== t6 || $[10] !== testId || $[11] !== value) {
|
|
254
|
-
t7 = /* @__PURE__ */ jsxDEV("span", {
|
|
255
|
-
className: t6,
|
|
256
|
-
"data-testid": testId,
|
|
257
|
-
children: value
|
|
258
|
-
}, void 0, false);
|
|
259
|
-
$[9] = t6;
|
|
260
|
-
$[10] = testId;
|
|
261
|
-
$[11] = value;
|
|
262
|
-
$[12] = t7;
|
|
263
|
-
} else {
|
|
264
|
-
t7 = $[12];
|
|
265
|
-
}
|
|
266
|
-
let t8;
|
|
267
|
-
if ($[13] !== chart || $[14] !== t7) {
|
|
268
|
-
t8 = /* @__PURE__ */ jsxDEV("div", {
|
|
269
|
-
className: "flex items-center justify-between gap-3",
|
|
270
|
-
children: [t7, chart]
|
|
271
|
-
}, void 0, true);
|
|
272
|
-
$[13] = chart;
|
|
273
|
-
$[14] = t7;
|
|
274
|
-
$[15] = t8;
|
|
275
|
-
} else {
|
|
276
|
-
t8 = $[15];
|
|
277
|
-
}
|
|
278
|
-
let t9;
|
|
279
|
-
if ($[16] !== t4 || $[17] !== t8) {
|
|
280
|
-
t9 = /* @__PURE__ */ jsxDEV(Card, {
|
|
281
|
-
className: "gap-0 py-0",
|
|
282
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
283
|
-
className: "flex flex-col gap-2.5 p-4",
|
|
284
|
-
children: [t4, t8]
|
|
285
|
-
}, void 0, true)
|
|
286
|
-
}, void 0, false);
|
|
287
|
-
$[16] = t4;
|
|
288
|
-
$[17] = t8;
|
|
289
|
-
$[18] = t9;
|
|
290
|
-
} else {
|
|
291
|
-
t9 = $[18];
|
|
292
|
-
}
|
|
293
|
-
return t9;
|
|
294
|
-
};
|
|
295
|
-
const loadSloData = async (client, rootShard, shards) => {
|
|
296
|
-
const perShardSettled = await Promise.all(shards.map((shard) => {
|
|
297
|
-
const shardOptions = callOptions(shard);
|
|
298
|
-
return Promise.allSettled([client.query(GET_METRICS, {}, shardOptions), client.query(GET_FUNCTION_STATS, {}, shardOptions), client.query(MIGRATION_STATUS, {}, shardOptions)]);
|
|
299
|
-
}));
|
|
300
|
-
const rootOptions = callOptions(rootShard);
|
|
301
|
-
const schedulerStatus = typeof client.schedulerStatus === "function" ? client.schedulerStatus() : Promise.reject(new Error("scheduler status unavailable"));
|
|
302
|
-
const [logs, authMetrics, schedulerState] = await Promise.allSettled([client.query(GET_LOGS, {}, rootOptions), client.query(GET_AUTH_METRICS, {}, rootOptions), schedulerStatus]);
|
|
303
|
-
const perShard = perShardSettled.map(([m, f, mig]) => {
|
|
304
|
-
return {
|
|
305
|
-
functions: f.status === "fulfilled" ? f.value.functions : [],
|
|
306
|
-
metrics: m.status === "fulfilled" ? m.value : null,
|
|
307
|
-
migrations: mig.status === "fulfilled" ? mig.value.migrations : []
|
|
308
|
-
};
|
|
309
|
-
});
|
|
310
|
-
const totals = sumShardMetrics(perShard);
|
|
311
|
-
const rootMetrics = perShardSettled[0]?.[0];
|
|
312
|
-
return {
|
|
313
|
-
auth: authMetrics.status === "fulfilled" ? authMetrics.value : null,
|
|
314
|
-
entries: logs.status === "fulfilled" ? logs.value.entries : [],
|
|
315
|
-
functions: mergeFunctionStats(perShard.map((shardResult) => shardResult.functions)),
|
|
316
|
-
logsError: logs.status === "rejected" ? errorMessage(logs.reason) : null,
|
|
317
|
-
metricsError: totals.reachable === 0 && rootMetrics?.status === "rejected" ? errorMessage(rootMetrics.reason) : null,
|
|
318
|
-
migrations: dedupeMigrations(perShard.map((shardResult) => shardResult.migrations)),
|
|
319
|
-
scheduler: schedulerState.status === "fulfilled" ? schedulerState.value : null,
|
|
320
|
-
totals
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
const HealthPanel = ({
|
|
324
|
-
initialShardKey
|
|
325
|
-
}) => {
|
|
326
|
-
const client = useLunora();
|
|
327
|
-
const t = useT();
|
|
328
|
-
const [entries, setEntries] = useState([]);
|
|
329
|
-
const [logsError, setLogsError] = useState(null);
|
|
330
|
-
const [totals, setTotals] = useState(null);
|
|
331
|
-
const [metricsError, setMetricsError] = useState(null);
|
|
332
|
-
const [functions, setFunctions] = useState([]);
|
|
333
|
-
const [auth, setAuth] = useState(null);
|
|
334
|
-
const [scheduler, setScheduler] = useState(null);
|
|
335
|
-
const [migrations, setMigrations] = useState([]);
|
|
336
|
-
const [liveError, setLiveError] = useState(void 0);
|
|
337
|
-
const [recentShards] = useState(loadRecentShards);
|
|
338
|
-
const inFlightRef = useRef(false);
|
|
339
|
-
const mountedRef = useRef(true);
|
|
340
|
-
useEffect(() => {
|
|
341
|
-
mountedRef.current = true;
|
|
342
|
-
return () => {
|
|
343
|
-
mountedRef.current = false;
|
|
344
|
-
};
|
|
345
|
-
}, []);
|
|
346
|
-
const rootShard = initialShardKey ?? "";
|
|
347
|
-
const refresh = useCallback(async () => {
|
|
348
|
-
if (inFlightRef.current) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
inFlightRef.current = true;
|
|
352
|
-
const result = await loadSloData(client, rootShard, shardsToAggregate(rootShard, recentShards));
|
|
353
|
-
if (!mountedRef.current) {
|
|
354
|
-
inFlightRef.current = false;
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
setTotals(result.totals);
|
|
358
|
-
setMetricsError(result.metricsError);
|
|
359
|
-
setFunctions(result.functions);
|
|
360
|
-
setMigrations(result.migrations);
|
|
361
|
-
setEntries(result.entries);
|
|
362
|
-
setLogsError(result.logsError);
|
|
363
|
-
setAuth(result.auth);
|
|
364
|
-
setScheduler(result.scheduler);
|
|
365
|
-
inFlightRef.current = false;
|
|
366
|
-
}, [client, recentShards, rootShard]);
|
|
367
|
-
useEffect(() => {
|
|
368
|
-
fireAndForget(refresh());
|
|
369
|
-
}, [refresh]);
|
|
370
|
-
const lastFanOutRef = useRef(0);
|
|
371
|
-
const trailingTimerRef = useRef(null);
|
|
372
|
-
const scheduleFanOut = () => {
|
|
373
|
-
const elapsed = Date.now() - lastFanOutRef.current;
|
|
374
|
-
if (elapsed >= MIN_FANOUT_INTERVAL_MS) {
|
|
375
|
-
lastFanOutRef.current = Date.now();
|
|
376
|
-
fireAndForget(refresh());
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
trailingTimerRef.current ??= setTimeout(() => {
|
|
380
|
-
trailingTimerRef.current = null;
|
|
381
|
-
lastFanOutRef.current = Date.now();
|
|
382
|
-
fireAndForget(refresh());
|
|
383
|
-
}, MIN_FANOUT_INTERVAL_MS - elapsed);
|
|
384
|
-
};
|
|
385
|
-
useEffect(() => () => {
|
|
386
|
-
if (trailingTimerRef.current !== null) {
|
|
387
|
-
clearTimeout(trailingTimerRef.current);
|
|
388
|
-
}
|
|
389
|
-
}, []);
|
|
390
|
-
useLiveAdmin(ADMIN_FUNCTIONS.getMetrics, {}, rootShard, () => {
|
|
391
|
-
setLiveError(void 0);
|
|
392
|
-
scheduleFanOut();
|
|
393
|
-
}, true, setLiveError);
|
|
394
|
-
const recentErrors = entries.filter((entry) => entry.level === "error");
|
|
395
|
-
const topErrors = recentErrors.slice(0, RECENT_ERROR_LIMIT);
|
|
396
|
-
const trend = requestErrorSeries(totals?.history);
|
|
397
|
-
const authTrend = useMemo(() => {
|
|
398
|
-
const buckets = auth?.history ?? [];
|
|
399
|
-
return {
|
|
400
|
-
attempts: buckets.map((bucket) => bucket.attempts),
|
|
401
|
-
failures: buckets.map((bucket_0) => bucket_0.failures)
|
|
402
|
-
};
|
|
403
|
-
}, [auth?.history]);
|
|
404
|
-
const worstFunctions = functions.filter((stat) => stat.calls > 0).toSorted((a, b) => b.errors / b.calls - a.errors / a.calls || b.calls - a.calls).slice(0, TOP_FUNCTION_LIMIT);
|
|
405
|
-
const migration = migrationSummary(migrations);
|
|
406
|
-
const appErrorRate = totals === null || totals.requests === 0 ? 0 : totals.errors / totals.requests;
|
|
407
|
-
const errorLevel = rateLevel(appErrorRate, REQUEST_ERROR_WARN, REQUEST_ERROR_CRIT);
|
|
408
|
-
const authLevel = auth === null ? "ok" : rateLevel(auth.failureRate, AUTH_FAIL_WARN, AUTH_FAIL_CRIT);
|
|
409
|
-
const backlogLevel = scheduler === null ? "ok" : countLevel(scheduler.backlog, BACKLOG_WARN, BACKLOG_CRIT);
|
|
410
|
-
const overall = worstLevel([errorLevel, authLevel, backlogLevel, migration.level]);
|
|
411
|
-
let statusLabel;
|
|
412
|
-
let statusDescription;
|
|
413
|
-
if (overall === "crit") {
|
|
414
|
-
statusLabel = t("Critical");
|
|
415
|
-
statusDescription = t("One or more service levels are breached.");
|
|
416
|
-
} else if (overall === "warn") {
|
|
417
|
-
statusLabel = t("Degraded");
|
|
418
|
-
statusDescription = t("Some service levels need attention.");
|
|
419
|
-
} else {
|
|
420
|
-
statusLabel = t("All systems healthy");
|
|
421
|
-
statusDescription = t("All service levels are within target.");
|
|
422
|
-
}
|
|
423
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
424
|
-
className: "flex flex-col gap-6",
|
|
425
|
-
"data-testid": "lunora-health",
|
|
426
|
-
children: [/* @__PURE__ */ jsxDEV(Card, {
|
|
427
|
-
className: "gap-0 py-0",
|
|
428
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
429
|
-
className: "flex flex-wrap items-center justify-between gap-4 p-4",
|
|
430
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
431
|
-
className: "flex items-center gap-3",
|
|
432
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
433
|
-
"aria-hidden": "true",
|
|
434
|
-
className: cn("flex size-10 shrink-0 items-center justify-center rounded-full", LEVEL_RING[overall]),
|
|
435
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
436
|
-
className: cn("size-3 rounded-full", LEVEL_DOT[overall])
|
|
437
|
-
}, void 0, false)
|
|
438
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
439
|
-
className: "grid leading-tight",
|
|
440
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
441
|
-
className: "text-sm font-semibold text-foreground",
|
|
442
|
-
"data-testid": "hl-status",
|
|
443
|
-
children: statusLabel
|
|
444
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
445
|
-
className: "text-[13px] text-muted-foreground",
|
|
446
|
-
children: statusDescription
|
|
447
|
-
}, void 0, false)]
|
|
448
|
-
}, void 0, true)]
|
|
449
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
450
|
-
className: "flex flex-wrap items-center gap-4",
|
|
451
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
452
|
-
className: "text-end",
|
|
453
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
454
|
-
className: "font-mono text-[10px] tracking-wide text-muted-foreground uppercase",
|
|
455
|
-
children: t("Requests")
|
|
456
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
457
|
-
className: "flex items-center justify-end gap-2",
|
|
458
|
-
children: [trend.requests.length >= 2 && /* @__PURE__ */ jsxDEV(Sparkline, {
|
|
459
|
-
ariaLabel: t("Requests over time"),
|
|
460
|
-
className: "h-6 w-20 text-foreground",
|
|
461
|
-
series: trend.requests,
|
|
462
|
-
testId: "hl-spark-requests"
|
|
463
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
464
|
-
className: "text-lg font-semibold tabular-nums text-foreground",
|
|
465
|
-
"data-testid": "hl-requests",
|
|
466
|
-
children: (totals?.requests ?? 0).toString()
|
|
467
|
-
}, void 0, false)]
|
|
468
|
-
}, void 0, true)]
|
|
469
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("span", {
|
|
470
|
-
"aria-hidden": "true",
|
|
471
|
-
className: "h-9 w-px bg-border"
|
|
472
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
473
|
-
className: "text-end",
|
|
474
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
475
|
-
className: "font-mono text-[10px] tracking-wide text-muted-foreground uppercase",
|
|
476
|
-
children: t("Error rate")
|
|
477
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
478
|
-
className: cn("text-lg font-semibold tabular-nums", LEVEL_TEXT[errorLevel]),
|
|
479
|
-
"data-testid": "hl-error-rate",
|
|
480
|
-
children: totals === null ? "—" : ratePercent(totals.errors, totals.requests)
|
|
481
|
-
}, void 0, false)]
|
|
482
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("span", {
|
|
483
|
-
"aria-hidden": "true",
|
|
484
|
-
className: "h-9 w-px bg-border"
|
|
485
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
486
|
-
className: "flex items-center gap-2",
|
|
487
|
-
children: [/* @__PURE__ */ jsxDEV(ConnectionBadge, {}, void 0, false), /* @__PURE__ */ jsxDEV(LiveError, {
|
|
488
|
-
message: liveError,
|
|
489
|
-
prefix: "hl"
|
|
490
|
-
}, void 0, false)]
|
|
491
|
-
}, void 0, true)]
|
|
492
|
-
}, void 0, true)]
|
|
493
|
-
}, void 0, true), metricsError !== null && /* @__PURE__ */ jsxDEV("div", {
|
|
494
|
-
className: "border-t border-border bg-destructive/5 px-4 py-2 text-sm text-destructive",
|
|
495
|
-
"data-testid": "hl-metrics-error",
|
|
496
|
-
role: "alert",
|
|
497
|
-
children: metricsError
|
|
498
|
-
}, void 0, false)]
|
|
499
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
500
|
-
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-4",
|
|
501
|
-
"data-testid": "hl-slo",
|
|
502
|
-
children: [/* @__PURE__ */ jsxDEV(SloCard, {
|
|
503
|
-
chart: trend.errors.length >= 2 ? /* @__PURE__ */ jsxDEV(Sparkline, {
|
|
504
|
-
ariaLabel: t("Errors over time"),
|
|
505
|
-
className: "h-7 w-20 text-destructive",
|
|
506
|
-
series: trend.errors,
|
|
507
|
-
testId: "hl-spark-errors"
|
|
508
|
-
}, void 0, false) : void 0,
|
|
509
|
-
label: t("Error rate"),
|
|
510
|
-
level: errorLevel,
|
|
511
|
-
testId: "hl-slo-errorrate",
|
|
512
|
-
value: totals === null ? "—" : ratePercent(totals.errors, totals.requests)
|
|
513
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(SloCard, {
|
|
514
|
-
chart: authTrend.failures.length >= 2 ? /* @__PURE__ */ jsxDEV(Sparkline, {
|
|
515
|
-
ariaLabel: t("Auth failures over time"),
|
|
516
|
-
className: "h-7 w-20 text-destructive",
|
|
517
|
-
series: authTrend.failures,
|
|
518
|
-
testId: "hl-spark-auth"
|
|
519
|
-
}, void 0, false) : void 0,
|
|
520
|
-
label: t("Auth failures"),
|
|
521
|
-
level: authLevel,
|
|
522
|
-
testId: "hl-slo-auth",
|
|
523
|
-
value: auth === null ? "—" : ratePercent(auth.failures, auth.attempts)
|
|
524
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(SloCard, {
|
|
525
|
-
label: t("Scheduler backlog"),
|
|
526
|
-
level: backlogLevel,
|
|
527
|
-
testId: "hl-slo-backlog",
|
|
528
|
-
value: scheduler === null ? "—" : scheduler.backlog.toString()
|
|
529
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(SloCard, {
|
|
530
|
-
label: t("Migrations"),
|
|
531
|
-
level: migration.level,
|
|
532
|
-
testId: "hl-slo-migrations",
|
|
533
|
-
value: migrationTileValue(migration, t)
|
|
534
|
-
}, void 0, false)]
|
|
535
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
536
|
-
className: "grid gap-3 lg:grid-cols-2",
|
|
537
|
-
children: [/* @__PURE__ */ jsxDEV(Card, {
|
|
538
|
-
className: "gap-0 py-0",
|
|
539
|
-
"data-testid": "hl-functions",
|
|
540
|
-
children: [/* @__PURE__ */ jsxDEV("header", {
|
|
541
|
-
className: "border-b border-border px-4 py-3",
|
|
542
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
543
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
544
|
-
children: t("Functions by error rate")
|
|
545
|
-
}, void 0, false)
|
|
546
|
-
}, void 0, false), worstFunctions.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
547
|
-
className: "px-4 py-8 text-center text-sm text-muted-foreground",
|
|
548
|
-
"data-testid": "hl-functions-empty",
|
|
549
|
-
children: t("No function activity yet.")
|
|
550
|
-
}, void 0, false) : /* @__PURE__ */ jsxDEV("ul", {
|
|
551
|
-
className: "divide-y divide-border",
|
|
552
|
-
children: worstFunctions.map((stat_0) => /* @__PURE__ */ jsxDEV("li", {
|
|
553
|
-
className: "flex flex-wrap items-center justify-between gap-2 px-4 py-2 text-xs",
|
|
554
|
-
"data-testid": "hl-fn-row",
|
|
555
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
556
|
-
className: "truncate font-mono text-foreground",
|
|
557
|
-
children: stat_0.path
|
|
558
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
559
|
-
className: "flex shrink-0 items-center gap-2",
|
|
560
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
561
|
-
className: "tabular-nums text-muted-foreground",
|
|
562
|
-
children: t("{count} calls", {
|
|
563
|
-
count: stat_0.calls.toString()
|
|
564
|
-
})
|
|
565
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
|
|
566
|
-
variant: LEVEL_VARIANT[rateLevel(stat_0.errors / stat_0.calls, REQUEST_ERROR_WARN, REQUEST_ERROR_CRIT)],
|
|
567
|
-
children: ratePercent(stat_0.errors, stat_0.calls)
|
|
568
|
-
}, void 0, false)]
|
|
569
|
-
}, void 0, true)]
|
|
570
|
-
}, stat_0.path, true))
|
|
571
|
-
}, void 0, false)]
|
|
572
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
|
|
573
|
-
className: "gap-0 py-0",
|
|
574
|
-
children: [/* @__PURE__ */ jsxDEV("header", {
|
|
575
|
-
className: "flex items-center justify-between gap-2 border-b border-border px-4 py-3",
|
|
576
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
577
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
578
|
-
children: t("Recent errors")
|
|
579
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
|
|
580
|
-
"data-testid": "hl-error-count",
|
|
581
|
-
variant: recentErrors.length > 0 ? "destructive" : "outline",
|
|
582
|
-
children: recentErrors.length
|
|
583
|
-
}, void 0, false)]
|
|
584
|
-
}, void 0, true), logsError !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
585
|
-
className: "px-4 py-8 text-center text-sm text-destructive",
|
|
586
|
-
"data-testid": "hl-logs-error",
|
|
587
|
-
role: "alert",
|
|
588
|
-
children: logsError
|
|
589
|
-
}, void 0, false), logsError === null && topErrors.length === 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
590
|
-
className: "px-4 py-8 text-center text-sm text-muted-foreground",
|
|
591
|
-
"data-testid": "hl-errors-empty",
|
|
592
|
-
children: t("No recent errors.")
|
|
593
|
-
}, void 0, false), topErrors.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
|
|
594
|
-
className: "divide-y divide-border",
|
|
595
|
-
children: topErrors.map((entry_0, index) => /* @__PURE__ */ jsxDEV("li", {
|
|
596
|
-
className: "flex flex-col gap-0.5 px-4 py-2 text-xs",
|
|
597
|
-
"data-testid": "hl-error-row",
|
|
598
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
599
|
-
className: "flex items-center gap-2",
|
|
600
|
-
children: [/* @__PURE__ */ jsxDEV("time", {
|
|
601
|
-
className: "shrink-0 text-muted-foreground",
|
|
602
|
-
children: formatTimestamp(entry_0.timestamp)
|
|
603
|
-
}, void 0, false), entry_0.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("span", {
|
|
604
|
-
className: "truncate font-mono text-foreground",
|
|
605
|
-
children: entry_0.functionPath
|
|
606
|
-
}, void 0, false)]
|
|
607
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV("span", {
|
|
608
|
-
className: "text-destructive",
|
|
609
|
-
children: entry_0.message
|
|
610
|
-
}, void 0, false)]
|
|
611
|
-
}, `${entry_0.timestamp.toString()}-${index.toString()}`, true))
|
|
612
|
-
}, void 0, false)]
|
|
613
|
-
}, void 0, true)]
|
|
614
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
|
|
615
|
-
className: "gap-0 py-0",
|
|
616
|
-
children: [/* @__PURE__ */ jsxDEV("header", {
|
|
617
|
-
className: "flex items-center justify-between gap-2 border-b border-border px-4 py-3",
|
|
618
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
619
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
620
|
-
children: t("Shards seen")
|
|
621
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(Badge, {
|
|
622
|
-
"data-testid": "hl-shard-count",
|
|
623
|
-
variant: "outline",
|
|
624
|
-
children: recentShards.length
|
|
625
|
-
}, void 0, false)]
|
|
626
|
-
}, void 0, true), recentShards.length > 0 && /* @__PURE__ */ jsxDEV("ul", {
|
|
627
|
-
className: "flex flex-wrap gap-1.5 p-4",
|
|
628
|
-
children: recentShards.map((shard) => /* @__PURE__ */ jsxDEV("li", {
|
|
629
|
-
"data-testid": "hl-shard",
|
|
630
|
-
children: /* @__PURE__ */ jsxDEV(Badge, {
|
|
631
|
-
variant: "secondary",
|
|
632
|
-
children: shard
|
|
633
|
-
}, void 0, false)
|
|
634
|
-
}, shard, false))
|
|
635
|
-
}, void 0, false)]
|
|
636
|
-
}, void 0, true)]
|
|
637
|
-
}, void 0, true);
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
export { HealthPanel };
|