adonisjs-server-stats 1.5.4 → 1.6.2
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/README.md +351 -171
- package/dist/configure.d.ts.map +1 -1
- package/dist/core/api-client.d.ts +73 -0
- package/dist/core/api-client.d.ts.map +1 -0
- package/dist/core/config-utils.d.ts +109 -0
- package/dist/core/config-utils.d.ts.map +1 -0
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/dashboard-api.d.ts +65 -0
- package/dist/core/dashboard-api.d.ts.map +1 -0
- package/dist/core/dashboard-data-controller.d.ts +157 -0
- package/dist/core/dashboard-data-controller.d.ts.map +1 -0
- package/dist/core/debug-data-controller.d.ts +89 -0
- package/dist/core/debug-data-controller.d.ts.map +1 -0
- package/dist/core/feature-detect.d.ts +67 -0
- package/dist/core/feature-detect.d.ts.map +1 -0
- package/dist/core/formatters.d.ts +189 -0
- package/dist/core/formatters.d.ts.map +1 -0
- package/dist/core/history-buffer.d.ts +23 -0
- package/dist/core/history-buffer.d.ts.map +1 -0
- package/dist/core/icons.d.ts +36 -0
- package/dist/core/icons.d.ts.map +1 -0
- package/dist/core/index.d.ts +39 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +1961 -0
- package/dist/core/internals-utils.d.ts +71 -0
- package/dist/core/internals-utils.d.ts.map +1 -0
- package/dist/core/job-utils.d.ts +45 -0
- package/dist/core/job-utils.d.ts.map +1 -0
- package/dist/core/log-utils.d.ts +34 -0
- package/dist/core/log-utils.d.ts.map +1 -0
- package/dist/core/metrics.d.ts +41 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/pagination.d.ts +128 -0
- package/dist/core/pagination.d.ts.map +1 -0
- package/dist/core/query-utils.d.ts +35 -0
- package/dist/core/query-utils.d.ts.map +1 -0
- package/dist/core/resizable-columns.d.ts +18 -0
- package/dist/core/resizable-columns.d.ts.map +1 -0
- package/dist/core/routes.d.ts +12 -0
- package/dist/core/routes.d.ts.map +1 -0
- package/dist/core/server-stats-controller.d.ts +106 -0
- package/dist/core/server-stats-controller.d.ts.map +1 -0
- package/dist/core/sparkline.d.ts +80 -0
- package/dist/core/sparkline.d.ts.map +1 -0
- package/dist/core/theme.d.ts +42 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/trace-utils.d.ts +62 -0
- package/dist/core/trace-utils.d.ts.map +1 -0
- package/dist/core/transmit-adapter.d.ts +59 -0
- package/dist/core/transmit-adapter.d.ts.map +1 -0
- package/dist/core/types.d.ts +619 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/react/CacheSection-DGxMDlWK.js +146 -0
- package/dist/react/CacheTab-CnVW5PLs.js +123 -0
- package/dist/react/ConfigContent-CnsEI4j3.js +397 -0
- package/dist/react/ConfigSection-DPcrfqXY.js +11 -0
- package/dist/react/ConfigTab-BSWq_o2p.js +15 -0
- package/dist/react/CustomPaneTab-xjkYwTvH.js +104 -0
- package/dist/react/DataTable-YyShr5B-.js +55 -0
- package/dist/react/EmailsSection-CSyTg1aX.js +262 -0
- package/dist/react/EmailsTab-Dh2YSa_f.js +131 -0
- package/dist/react/EventsSection-C1pbJDfW.js +86 -0
- package/dist/react/EventsTab-eCh02cdd.js +63 -0
- package/dist/react/FilterBar-DQRXpWrb.js +50 -0
- package/dist/react/InternalsContent-DBzsI0CG.js +346 -0
- package/dist/react/InternalsSection-t7ihcWO-.js +32 -0
- package/dist/react/InternalsTab-Oij0A2fN.js +30 -0
- package/dist/react/JobsSection-CLAin5vU.js +187 -0
- package/dist/react/JobsTab-Dl5nrj2z.js +141 -0
- package/dist/react/LogsSection-C1p81fXO.js +212 -0
- package/dist/react/LogsTab-D-kR7PjX.js +88 -0
- package/dist/react/OverviewSection-nm3xdACz.js +539 -0
- package/dist/react/Pagination-BkmzUDY8.js +64 -0
- package/dist/react/QueriesSection-DB12HMfQ.js +461 -0
- package/dist/react/QueriesTab-fyBB1u_Y.js +90 -0
- package/dist/react/RequestsSection-DTqB81ac.js +209 -0
- package/dist/react/RoutesSection-DJWa4NPV.js +74 -0
- package/dist/react/RoutesTab-D3l8TOpu.js +74 -0
- package/dist/react/TimelineSection-C4d-jRX1.js +158 -0
- package/dist/react/TimelineTab-C5TFaSmQ.js +193 -0
- package/dist/react/WaterfallChart-Cj73WdfM.js +100 -0
- package/dist/react/core/api-client.d.ts +73 -0
- package/dist/react/core/api-client.d.ts.map +1 -0
- package/dist/react/core/config-utils.d.ts +109 -0
- package/dist/react/core/config-utils.d.ts.map +1 -0
- package/dist/react/core/constants.d.ts +11 -0
- package/dist/react/core/constants.d.ts.map +1 -0
- package/dist/react/core/dashboard-api.d.ts +65 -0
- package/dist/react/core/dashboard-api.d.ts.map +1 -0
- package/dist/react/core/dashboard-data-controller.d.ts +157 -0
- package/dist/react/core/dashboard-data-controller.d.ts.map +1 -0
- package/dist/react/core/debug-data-controller.d.ts +89 -0
- package/dist/react/core/debug-data-controller.d.ts.map +1 -0
- package/dist/react/core/feature-detect.d.ts +67 -0
- package/dist/react/core/feature-detect.d.ts.map +1 -0
- package/dist/react/core/formatters.d.ts +189 -0
- package/dist/react/core/formatters.d.ts.map +1 -0
- package/dist/react/core/history-buffer.d.ts +23 -0
- package/dist/react/core/history-buffer.d.ts.map +1 -0
- package/dist/react/core/icons.d.ts +36 -0
- package/dist/react/core/icons.d.ts.map +1 -0
- package/dist/react/core/index.d.ts +39 -0
- package/dist/react/core/index.d.ts.map +1 -0
- package/dist/react/core/internals-utils.d.ts +71 -0
- package/dist/react/core/internals-utils.d.ts.map +1 -0
- package/dist/react/core/job-utils.d.ts +45 -0
- package/dist/react/core/job-utils.d.ts.map +1 -0
- package/dist/react/core/log-utils.d.ts +34 -0
- package/dist/react/core/log-utils.d.ts.map +1 -0
- package/dist/react/core/metrics.d.ts +41 -0
- package/dist/react/core/metrics.d.ts.map +1 -0
- package/dist/react/core/pagination.d.ts +128 -0
- package/dist/react/core/pagination.d.ts.map +1 -0
- package/dist/react/core/query-utils.d.ts +35 -0
- package/dist/react/core/query-utils.d.ts.map +1 -0
- package/dist/react/core/resizable-columns.d.ts +18 -0
- package/dist/react/core/resizable-columns.d.ts.map +1 -0
- package/dist/react/core/routes.d.ts +12 -0
- package/dist/react/core/routes.d.ts.map +1 -0
- package/dist/react/core/server-stats-controller.d.ts +106 -0
- package/dist/react/core/server-stats-controller.d.ts.map +1 -0
- package/dist/react/core/sparkline.d.ts +80 -0
- package/dist/react/core/sparkline.d.ts.map +1 -0
- package/dist/react/core/theme.d.ts +42 -0
- package/dist/react/core/theme.d.ts.map +1 -0
- package/dist/react/core/trace-utils.d.ts +62 -0
- package/dist/react/core/trace-utils.d.ts.map +1 -0
- package/dist/react/core/transmit-adapter.d.ts +59 -0
- package/dist/react/core/transmit-adapter.d.ts.map +1 -0
- package/dist/react/core/types.d.ts +619 -0
- package/dist/react/core/types.d.ts.map +1 -0
- package/dist/react/index-UdTfSvtO.js +1074 -0
- package/dist/react/index.js +18 -0
- package/dist/react/react/components/Dashboard/DashboardPage.d.ts +17 -0
- package/dist/react/react/components/Dashboard/DashboardPage.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts +14 -0
- package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts +7 -0
- package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +9 -0
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/DataTable.d.ts +27 -0
- package/dist/react/react/components/Dashboard/shared/DataTable.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts +17 -0
- package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/Pagination.d.ts +13 -0
- package/dist/react/react/components/Dashboard/shared/Pagination.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts +12 -0
- package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts.map +1 -0
- package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts +16 -0
- package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/DebugPanel.d.ts +16 -0
- package/dist/react/react/components/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts +14 -0
- package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts +12 -0
- package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts +9 -0
- package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts +8 -0
- package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts.map +1 -0
- package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts +7 -0
- package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/MetricCard.d.ts +21 -0
- package/dist/react/react/components/StatsBar/MetricCard.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/Sparkline.d.ts +15 -0
- package/dist/react/react/components/StatsBar/Sparkline.d.ts.map +1 -0
- package/dist/react/react/components/StatsBar/StatsBar.d.ts +22 -0
- package/dist/react/react/components/StatsBar/StatsBar.d.ts.map +1 -0
- package/dist/react/react/components/shared/Badge.d.ts +32 -0
- package/dist/react/react/components/shared/Badge.d.ts.map +1 -0
- package/dist/react/react/components/shared/ConfigContent.d.ts +13 -0
- package/dist/react/react/components/shared/ConfigContent.d.ts.map +1 -0
- package/dist/react/react/components/shared/InternalsContent.d.ts +10 -0
- package/dist/react/react/components/shared/InternalsContent.d.ts.map +1 -0
- package/dist/react/react/components/shared/JsonViewer.d.ts +12 -0
- package/dist/react/react/components/shared/JsonViewer.d.ts.map +1 -0
- package/dist/react/react/components/shared/ThemeToggle.d.ts +13 -0
- package/dist/react/react/components/shared/ThemeToggle.d.ts.map +1 -0
- package/dist/react/react/components/shared/Tooltip.d.ts +16 -0
- package/dist/react/react/components/shared/Tooltip.d.ts.map +1 -0
- package/dist/react/react/hooks/useApiClient.d.ts +10 -0
- package/dist/react/react/hooks/useApiClient.d.ts.map +1 -0
- package/dist/react/react/hooks/useDashboardApiBase.d.ts +19 -0
- package/dist/react/react/hooks/useDashboardApiBase.d.ts.map +1 -0
- package/dist/react/react/hooks/useDashboardData.d.ts +27 -0
- package/dist/react/react/hooks/useDashboardData.d.ts.map +1 -0
- package/dist/react/react/hooks/useDebugData.d.ts +17 -0
- package/dist/react/react/hooks/useDebugData.d.ts.map +1 -0
- package/dist/react/react/hooks/useFeatures.d.ts +13 -0
- package/dist/react/react/hooks/useFeatures.d.ts.map +1 -0
- package/dist/react/react/hooks/useResizableTable.d.ts +13 -0
- package/dist/react/react/hooks/useResizableTable.d.ts.map +1 -0
- package/dist/react/react/hooks/useServerStats.d.ts +21 -0
- package/dist/react/react/hooks/useServerStats.d.ts.map +1 -0
- package/dist/react/react/hooks/useTheme.d.ts +12 -0
- package/dist/react/react/hooks/useTheme.d.ts.map +1 -0
- package/dist/react/react/index.d.ts +14 -0
- package/dist/react/react/index.d.ts.map +1 -0
- package/dist/react/style.css +1 -0
- package/dist/react/useApiClient-BVtNCmnL.js +9 -0
- package/dist/react/useDashboardApiBase-Bi36pJ2L.js +14 -0
- package/dist/react/useResizableTable-CNJmACdt.js +13 -0
- package/dist/src/collectors/app_collector.d.ts.map +1 -1
- package/dist/src/collectors/app_collector.js +30 -2
- package/dist/src/collectors/auto_detect.d.ts +31 -0
- package/dist/src/collectors/auto_detect.d.ts.map +1 -0
- package/dist/src/collectors/auto_detect.js +120 -0
- package/dist/src/collectors/collector.d.ts +17 -0
- package/dist/src/collectors/collector.d.ts.map +1 -1
- package/dist/src/collectors/db_pool_collector.d.ts.map +1 -1
- package/dist/src/collectors/db_pool_collector.js +35 -1
- package/dist/src/collectors/http_collector.d.ts +4 -3
- package/dist/src/collectors/http_collector.d.ts.map +1 -1
- package/dist/src/collectors/http_collector.js +28 -11
- package/dist/src/collectors/index.d.ts +2 -0
- package/dist/src/collectors/index.d.ts.map +1 -1
- package/dist/src/collectors/index.js +1 -0
- package/dist/src/collectors/log_collector.d.ts +11 -4
- package/dist/src/collectors/log_collector.d.ts.map +1 -1
- package/dist/src/collectors/log_collector.js +51 -5
- package/dist/src/collectors/process_collector.d.ts.map +1 -1
- package/dist/src/collectors/process_collector.js +4 -0
- package/dist/src/collectors/queue_collector.d.ts.map +1 -1
- package/dist/src/collectors/queue_collector.js +55 -1
- package/dist/src/collectors/redis_collector.d.ts.map +1 -1
- package/dist/src/collectors/redis_collector.js +42 -3
- package/dist/src/collectors/system_collector.d.ts.map +1 -1
- package/dist/src/collectors/system_collector.js +4 -0
- package/dist/src/controller/api_controller.d.ts +101 -0
- package/dist/src/controller/api_controller.d.ts.map +1 -0
- package/dist/src/controller/api_controller.js +131 -0
- package/dist/src/controller/debug_controller.d.ts +19 -10
- package/dist/src/controller/debug_controller.d.ts.map +1 -1
- package/dist/src/controller/debug_controller.js +118 -101
- package/dist/src/core/theme.d.ts +42 -0
- package/dist/src/core/theme.d.ts.map +1 -0
- package/dist/src/core/theme.js +115 -0
- package/dist/src/dashboard/chart_aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/chart_aggregator.js +3 -2
- package/dist/src/dashboard/dashboard_controller.d.ts +10 -14
- package/dist/src/dashboard/dashboard_controller.d.ts.map +1 -1
- package/dist/src/dashboard/dashboard_controller.js +132 -250
- package/dist/src/dashboard/dashboard_store.d.ts +62 -19
- package/dist/src/dashboard/dashboard_store.d.ts.map +1 -1
- package/dist/src/dashboard/dashboard_store.js +242 -53
- package/dist/src/dashboard/integrations/cache_inspector.d.ts +19 -1
- package/dist/src/dashboard/integrations/cache_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/config_inspector.d.ts +1 -1
- package/dist/src/dashboard/integrations/config_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/config_inspector.js +3 -2
- package/dist/src/dashboard/integrations/queue_inspector.d.ts +55 -10
- package/dist/src/dashboard/integrations/queue_inspector.d.ts.map +1 -1
- package/dist/src/dashboard/integrations/queue_inspector.js +70 -24
- package/dist/src/dashboard/migrator.d.ts +5 -0
- package/dist/src/dashboard/migrator.d.ts.map +1 -1
- package/dist/src/dashboard/migrator.js +44 -9
- package/dist/src/dashboard/models/stats_event.d.ts +1 -1
- package/dist/src/dashboard/models/stats_event.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_log.d.ts +1 -1
- package/dist/src/dashboard/models/stats_log.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_query.d.ts +1 -1
- package/dist/src/dashboard/models/stats_query.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_saved_filter.d.ts +1 -1
- package/dist/src/dashboard/models/stats_saved_filter.d.ts.map +1 -1
- package/dist/src/dashboard/models/stats_trace.d.ts +2 -1
- package/dist/src/dashboard/models/stats_trace.d.ts.map +1 -1
- package/dist/src/data/data_access.d.ts +105 -0
- package/dist/src/data/data_access.d.ts.map +1 -0
- package/dist/src/data/data_access.js +310 -0
- package/dist/src/data/index.d.ts +3 -0
- package/dist/src/data/index.d.ts.map +1 -0
- package/dist/src/data/index.js +1 -0
- package/dist/src/debug/debug_store.d.ts +20 -1
- package/dist/src/debug/debug_store.d.ts.map +1 -1
- package/dist/src/debug/debug_store.js +43 -15
- package/dist/src/debug/email_collector.d.ts +6 -2
- package/dist/src/debug/email_collector.d.ts.map +1 -1
- package/dist/src/debug/email_collector.js +3 -0
- package/dist/src/debug/event_collector.d.ts +6 -2
- package/dist/src/debug/event_collector.d.ts.map +1 -1
- package/dist/src/debug/event_collector.js +12 -8
- package/dist/src/debug/query_collector.d.ts +6 -2
- package/dist/src/debug/query_collector.d.ts.map +1 -1
- package/dist/src/debug/query_collector.js +3 -0
- package/dist/src/debug/ring_buffer.d.ts +1 -0
- package/dist/src/debug/ring_buffer.d.ts.map +1 -1
- package/dist/src/debug/ring_buffer.js +5 -2
- package/dist/src/debug/route_inspector.d.ts +2 -2
- package/dist/src/debug/route_inspector.d.ts.map +1 -1
- package/dist/src/debug/route_inspector.js +4 -3
- package/dist/src/debug/trace_collector.d.ts +7 -3
- package/dist/src/debug/trace_collector.d.ts.map +1 -1
- package/dist/src/debug/trace_collector.js +7 -5
- package/dist/src/debug/types.d.ts +107 -2
- package/dist/src/debug/types.d.ts.map +1 -1
- package/dist/src/debug/types.js +1 -1
- package/dist/src/define_config.d.ts +49 -5
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js +361 -4
- package/dist/src/edge/bootstrap.d.ts +17 -0
- package/dist/src/edge/bootstrap.d.ts.map +1 -0
- package/dist/src/edge/bootstrap.js +29 -0
- package/dist/src/edge/client/dashboard.js +2 -3619
- package/dist/src/edge/client/debug-panel-deferred.js +1 -0
- package/dist/src/edge/client/debug-panel.js +1 -2140
- package/dist/src/edge/client/stats-bar.js +1 -801
- package/dist/src/edge/client-vue/dashboard.js +5 -0
- package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -0
- package/dist/src/edge/client-vue/debug-panel.js +4 -0
- package/dist/src/edge/client-vue/stats-bar.js +4 -0
- package/dist/src/edge/plugin.d.ts +35 -2
- package/dist/src/edge/plugin.d.ts.map +1 -1
- package/dist/src/edge/plugin.js +30 -66
- package/dist/src/edge/types.d.ts +46 -0
- package/dist/src/edge/types.d.ts.map +1 -0
- package/dist/src/edge/types.js +4 -0
- package/dist/src/edge/views/dashboard.edge +1 -358
- package/dist/src/edge/views/debug-panel.edge +2 -154
- package/dist/src/edge/views/stats-bar.edge +15 -48
- package/dist/src/engine/stats_engine.d.ts +18 -0
- package/dist/src/engine/stats_engine.d.ts.map +1 -1
- package/dist/src/engine/stats_engine.js +45 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_provider.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_provider.js +21 -4
- package/dist/src/log_stream/log_stream_service.d.ts +8 -1
- package/dist/src/log_stream/log_stream_service.d.ts.map +1 -1
- package/dist/src/log_stream/log_stream_service.js +27 -3
- package/dist/src/middleware/request_tracking_middleware.d.ts +1 -1
- package/dist/src/middleware/request_tracking_middleware.d.ts.map +1 -1
- package/dist/src/middleware/request_tracking_middleware.js +21 -6
- package/dist/src/prometheus/prometheus_collector.d.ts +2 -1
- package/dist/src/prometheus/prometheus_collector.d.ts.map +1 -1
- package/dist/src/provider/server_stats_provider.d.ts +100 -0
- package/dist/src/provider/server_stats_provider.d.ts.map +1 -1
- package/dist/src/provider/server_stats_provider.js +460 -104
- package/dist/src/routes/access_middleware.d.ts +2 -1
- package/dist/src/routes/access_middleware.d.ts.map +1 -1
- package/dist/src/routes/access_middleware.js +7 -1
- package/dist/src/routes/index.d.ts +4 -0
- package/dist/src/routes/index.d.ts.map +1 -0
- package/dist/src/routes/index.js +1 -0
- package/dist/src/routes/register_routes.d.ts +103 -0
- package/dist/src/routes/register_routes.d.ts.map +1 -0
- package/dist/src/routes/register_routes.js +356 -0
- package/dist/src/routes/router_types.d.ts +29 -0
- package/dist/src/routes/router_types.d.ts.map +1 -0
- package/dist/src/routes/router_types.js +1 -0
- package/dist/src/stubs/config.stub +12 -32
- package/dist/src/styles/components.css +1048 -0
- package/dist/src/{edge/client → styles}/dashboard.css +299 -736
- package/dist/src/{edge/client → styles}/debug-panel.css +117 -633
- package/dist/src/{edge/client → styles}/stats-bar.css +28 -10
- package/dist/src/styles/tokens.css +153 -0
- package/dist/src/styles/utilities.css +75 -0
- package/dist/src/types.d.ts +119 -16
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/app_import.d.ts +23 -0
- package/dist/src/utils/app_import.d.ts.map +1 -0
- package/dist/src/utils/app_import.js +44 -0
- package/dist/src/utils/json_helpers.d.ts +2 -2
- package/dist/src/utils/json_helpers.d.ts.map +1 -1
- package/dist/src/utils/logger.d.ts +17 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +27 -0
- package/dist/src/utils/mail_helpers.d.ts +1 -1
- package/dist/src/utils/mail_helpers.d.ts.map +1 -1
- package/dist/src/utils/mail_helpers.js +1 -1
- package/dist/vue/CacheSection-C788Yfai.js +149 -0
- package/dist/vue/CacheTab-BPisYYiQ.js +104 -0
- package/dist/vue/ConfigSection-CRzYxqW2.js +576 -0
- package/dist/vue/ConfigTab-C8cafGUj.js +361 -0
- package/dist/vue/CustomPaneTab-BJxT5Dp7.js +172 -0
- package/dist/vue/EmailsSection-C8JFMtW7.js +206 -0
- package/dist/vue/EmailsTab-DhFhoNmU.js +157 -0
- package/dist/vue/EventsSection-C4wXUgxG.js +107 -0
- package/dist/vue/EventsTab-DQ4Nd6AK.js +97 -0
- package/dist/vue/FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js +62 -0
- package/dist/vue/InternalsSection-BJUXE-5F.js +468 -0
- package/dist/vue/InternalsTab-DEMjqtlw.js +471 -0
- package/dist/vue/JobsSection-CsKWTjgN.js +187 -0
- package/dist/vue/JobsTab-BCvhOARO.js +117 -0
- package/dist/vue/JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js +67 -0
- package/dist/vue/LogsSection-BFVjSZ24.js +227 -0
- package/dist/vue/LogsTab-DpEQ7euu.js +122 -0
- package/dist/vue/OverviewSection-CbMdAido.js +849 -0
- package/dist/vue/PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js +50 -0
- package/dist/vue/QueriesSection-BPiv7u3r.js +429 -0
- package/dist/vue/QueriesTab-C8_7oprC.js +107 -0
- package/dist/vue/RequestsSection-LtImH4rD.js +243 -0
- package/dist/vue/RoutesSection-CrxOxmzx.js +106 -0
- package/dist/vue/RoutesTab-Dz0MkZuF.js +80 -0
- package/dist/vue/TimelineSection-DLxMW2J_.js +186 -0
- package/dist/vue/TimelineTab-Db6lKKsD.js +250 -0
- package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +118 -0
- package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts +18 -0
- package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts +3 -0
- package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +45 -0
- package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts +5 -0
- package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts +11 -0
- package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts +29 -0
- package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts +12 -0
- package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts +11 -0
- package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts.map +1 -0
- package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts +10 -0
- package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts +21 -0
- package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts +11 -0
- package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts +13 -0
- package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts +15 -0
- package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts +12 -0
- package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts.map +1 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +15 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/MetricCard.vue.d.ts +19 -0
- package/dist/vue/components/StatsBar/MetricCard.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/Sparkline.vue.d.ts +17 -0
- package/dist/vue/components/StatsBar/Sparkline.vue.d.ts.map +1 -0
- package/dist/vue/components/StatsBar/StatsBar.vue.d.ts +22 -0
- package/dist/vue/components/StatsBar/StatsBar.vue.d.ts.map +1 -0
- package/dist/vue/components/shared/JsonViewer.vue.d.ts +13 -0
- package/dist/vue/components/shared/JsonViewer.vue.d.ts.map +1 -0
- package/dist/vue/components/shared/ThemeToggle.vue.d.ts +8 -0
- package/dist/vue/components/shared/ThemeToggle.vue.d.ts.map +1 -0
- package/dist/vue/composables/useApiClient.d.ts +9 -0
- package/dist/vue/composables/useApiClient.d.ts.map +1 -0
- package/dist/vue/composables/useDashboardData.d.ts +53 -0
- package/dist/vue/composables/useDashboardData.d.ts.map +1 -0
- package/dist/vue/composables/useDebugData.d.ts +25 -0
- package/dist/vue/composables/useDebugData.d.ts.map +1 -0
- package/dist/vue/composables/useFeatures.d.ts +80 -0
- package/dist/vue/composables/useFeatures.d.ts.map +1 -0
- package/dist/vue/composables/useResizableTable.d.ts +16 -0
- package/dist/vue/composables/useResizableTable.d.ts.map +1 -0
- package/dist/vue/composables/useServerStats.d.ts +104 -0
- package/dist/vue/composables/useServerStats.d.ts.map +1 -0
- package/dist/vue/composables/useTheme.d.ts +6 -0
- package/dist/vue/composables/useTheme.d.ts.map +1 -0
- package/dist/vue/index-qCQpBftQ.js +1233 -0
- package/dist/vue/index.d.ts +10 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +11 -0
- package/dist/vue/style.css +1 -0
- package/dist/vue/useApiClient-BQQ9CF-q.js +10 -0
- package/dist/vue/useResizableTable-BoivAevK.js +17 -0
- package/package.json +72 -10
- package/dist/src/dashboard/dashboard_routes.d.ts +0 -16
- package/dist/src/dashboard/dashboard_routes.d.ts.map +0 -1
- package/dist/src/dashboard/dashboard_routes.js +0 -77
- package/dist/src/routes/debug_routes.d.ts +0 -14
- package/dist/src/routes/debug_routes.d.ts.map +0 -1
- package/dist/src/routes/debug_routes.js +0 -42
- package/dist/src/routes/stats_routes.d.ts +0 -14
- package/dist/src/routes/stats_routes.d.ts.map +0 -1
- package/dist/src/routes/stats_routes.js +0 -27
|
@@ -0,0 +1,1961 @@
|
|
|
1
|
+
class b extends Error {
|
|
2
|
+
status;
|
|
3
|
+
constructor(t = 403) {
|
|
4
|
+
super(`Unauthorized (HTTP ${t})`), this.name = "UnauthorizedError", this.status = t;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
class I extends Error {
|
|
8
|
+
status;
|
|
9
|
+
body;
|
|
10
|
+
constructor(t, r) {
|
|
11
|
+
super(`API error (HTTP ${t})`), this.name = "ApiError", this.status = t, this.body = r;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class w {
|
|
15
|
+
baseUrl;
|
|
16
|
+
authToken;
|
|
17
|
+
constructor(t) {
|
|
18
|
+
this.baseUrl = t.baseUrl.replace(/\/+$/, ""), this.authToken = t.authToken;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Perform a JSON fetch against the configured base URL.
|
|
22
|
+
*
|
|
23
|
+
* @param path - URL path appended to `baseUrl` (must start with `/`).
|
|
24
|
+
* @param init - Optional `RequestInit` overrides. Headers are merged.
|
|
25
|
+
* @returns Parsed JSON response body typed as `T`.
|
|
26
|
+
*/
|
|
27
|
+
async fetch(t, r) {
|
|
28
|
+
const i = {
|
|
29
|
+
...{
|
|
30
|
+
Accept: "application/json",
|
|
31
|
+
...this.authToken ? { Authorization: `Bearer ${this.authToken}` } : {}
|
|
32
|
+
},
|
|
33
|
+
...r?.headers
|
|
34
|
+
}, s = await globalThis.fetch(`${this.baseUrl}${t}`, {
|
|
35
|
+
...r,
|
|
36
|
+
headers: i,
|
|
37
|
+
credentials: this.authToken ? "omit" : "include"
|
|
38
|
+
});
|
|
39
|
+
if (s.status === 401 || s.status === 403)
|
|
40
|
+
throw new b(s.status);
|
|
41
|
+
if (!s.ok) {
|
|
42
|
+
const o = await s.text().catch(() => "");
|
|
43
|
+
throw new I(s.status, o);
|
|
44
|
+
}
|
|
45
|
+
return s.json();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Perform a GET request.
|
|
49
|
+
*
|
|
50
|
+
* @param path - URL path appended to `baseUrl`.
|
|
51
|
+
* @param query - Optional query string (without leading `?`).
|
|
52
|
+
* @returns Parsed JSON response body typed as `T`.
|
|
53
|
+
*/
|
|
54
|
+
async get(t, r) {
|
|
55
|
+
const n = r ? `${t}?${r}` : t;
|
|
56
|
+
return this.fetch(n);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Perform a POST request with an optional JSON body.
|
|
60
|
+
*
|
|
61
|
+
* @param path - URL path appended to `baseUrl`.
|
|
62
|
+
* @param body - Optional request body (will be JSON-serialized).
|
|
63
|
+
* @returns Parsed JSON response body typed as `T`.
|
|
64
|
+
*/
|
|
65
|
+
async post(t, r) {
|
|
66
|
+
const n = {
|
|
67
|
+
method: "POST",
|
|
68
|
+
...r !== void 0 ? {
|
|
69
|
+
body: JSON.stringify(r),
|
|
70
|
+
headers: { "Content-Type": "application/json" }
|
|
71
|
+
} : {}
|
|
72
|
+
};
|
|
73
|
+
return this.fetch(t, n);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Perform a DELETE request.
|
|
77
|
+
*
|
|
78
|
+
* @param path - URL path appended to `baseUrl`.
|
|
79
|
+
* @returns Parsed JSON response body typed as `T`.
|
|
80
|
+
*/
|
|
81
|
+
async delete(t) {
|
|
82
|
+
return this.fetch(t, { method: "DELETE" });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function O() {
|
|
86
|
+
if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
|
|
87
|
+
return window.Transmit;
|
|
88
|
+
try {
|
|
89
|
+
const e = await import("@adonisjs/transmit-client");
|
|
90
|
+
return e.Transmit ?? e.default ?? null;
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function _(e) {
|
|
96
|
+
let t = null, r = null, n = !1;
|
|
97
|
+
return { subscribe: async () => {
|
|
98
|
+
try {
|
|
99
|
+
const o = await O();
|
|
100
|
+
if (!o)
|
|
101
|
+
throw new Error(
|
|
102
|
+
"Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
|
|
103
|
+
);
|
|
104
|
+
if (n) return;
|
|
105
|
+
t = new o({
|
|
106
|
+
baseUrl: e.baseUrl || window.location.origin,
|
|
107
|
+
...e.authToken ? {
|
|
108
|
+
beforeSubscribe(a) {
|
|
109
|
+
return {
|
|
110
|
+
headers: {
|
|
111
|
+
Authorization: `Bearer ${e.authToken}`
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
beforeUnsubscribe(a) {
|
|
116
|
+
return {
|
|
117
|
+
headers: {
|
|
118
|
+
Authorization: `Bearer ${e.authToken}`
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
} : {}
|
|
123
|
+
}), r = t.subscription(e.channelName), r.onMessage((a) => {
|
|
124
|
+
n || e.onMessage(a);
|
|
125
|
+
}), await r.create();
|
|
126
|
+
} catch (o) {
|
|
127
|
+
e.onError && e.onError(o);
|
|
128
|
+
}
|
|
129
|
+
}, unsubscribe: async () => {
|
|
130
|
+
n = !0;
|
|
131
|
+
try {
|
|
132
|
+
r && (await r.delete(), r = null), t && (t = null);
|
|
133
|
+
} catch {
|
|
134
|
+
}
|
|
135
|
+
} };
|
|
136
|
+
}
|
|
137
|
+
function B(e) {
|
|
138
|
+
let t = !1;
|
|
139
|
+
const r = _({
|
|
140
|
+
baseUrl: e.baseUrl,
|
|
141
|
+
channelName: e.channelName,
|
|
142
|
+
authToken: e.authToken,
|
|
143
|
+
onMessage: e.onMessage,
|
|
144
|
+
onError: (n) => {
|
|
145
|
+
t = !0, e.onError?.(n), e.onDisconnect?.();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return r.subscribe().then(() => {
|
|
149
|
+
t || e.onConnect?.();
|
|
150
|
+
}).catch((n) => {
|
|
151
|
+
e.onError?.(n), e.onDisconnect?.();
|
|
152
|
+
}), {
|
|
153
|
+
unsubscribe: () => {
|
|
154
|
+
r.unsubscribe().catch(() => {
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
const S = "ss-dash-theme", C = "ss-theme-change";
|
|
160
|
+
function R() {
|
|
161
|
+
if (typeof window > "u") return "light";
|
|
162
|
+
const e = localStorage.getItem(S);
|
|
163
|
+
return e === "dark" || e === "light" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
164
|
+
}
|
|
165
|
+
function H(e) {
|
|
166
|
+
typeof window > "u" || (localStorage.setItem(S, e), window.dispatchEvent(new CustomEvent(C, { detail: e })));
|
|
167
|
+
}
|
|
168
|
+
function Ae() {
|
|
169
|
+
const t = R() === "dark" ? "light" : "dark";
|
|
170
|
+
return H(t), t;
|
|
171
|
+
}
|
|
172
|
+
function Le(e) {
|
|
173
|
+
if (typeof window > "u") return () => {
|
|
174
|
+
};
|
|
175
|
+
const t = (s) => {
|
|
176
|
+
const o = s.detail;
|
|
177
|
+
(o === "dark" || o === "light") && e(o);
|
|
178
|
+
}, r = (s) => {
|
|
179
|
+
if (s.key === S) {
|
|
180
|
+
const o = s.newValue;
|
|
181
|
+
e(o === "dark" || o === "light" ? o : R());
|
|
182
|
+
}
|
|
183
|
+
}, n = window.matchMedia("(prefers-color-scheme: dark)"), i = (s) => {
|
|
184
|
+
localStorage.getItem(S) || e(s.matches ? "dark" : "light");
|
|
185
|
+
};
|
|
186
|
+
return window.addEventListener(C, t), window.addEventListener("storage", r), n.addEventListener("change", i), () => {
|
|
187
|
+
window.removeEventListener(C, t), window.removeEventListener("storage", r), n.removeEventListener("change", i);
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
const f = {
|
|
191
|
+
color: "#34d399",
|
|
192
|
+
fillOpacityTop: 0.25,
|
|
193
|
+
fillOpacityBottom: 0.02,
|
|
194
|
+
strokeWidth: 1.5,
|
|
195
|
+
width: 120,
|
|
196
|
+
height: 32,
|
|
197
|
+
padding: 2
|
|
198
|
+
};
|
|
199
|
+
function N(e) {
|
|
200
|
+
return { ...f, ...e };
|
|
201
|
+
}
|
|
202
|
+
function q(e, t = f.width, r = f.height, n = f.padding) {
|
|
203
|
+
if (e.length < 2) return null;
|
|
204
|
+
const i = t - n * 2, s = r - n * 2, o = Math.min(...e), l = Math.max(...e) - o || 1;
|
|
205
|
+
return e.map((y, h) => {
|
|
206
|
+
const p = n + h / (e.length - 1) * i, u = n + s - (y - o) / l * s;
|
|
207
|
+
return `${p.toFixed(1)},${u.toFixed(1)}`;
|
|
208
|
+
}).join(" ");
|
|
209
|
+
}
|
|
210
|
+
function K(e, t = f.width, r = f.height, n = f.padding) {
|
|
211
|
+
if (e.length < 2) return null;
|
|
212
|
+
const i = t - n * 2, s = r - n * 2, o = Math.min(...e), l = Math.max(...e) - o || 1, g = e.map((u, v) => {
|
|
213
|
+
const T = n + v / (e.length - 1) * i, F = n + s - (u - o) / l * s;
|
|
214
|
+
return `${T.toFixed(1)},${F.toFixed(1)}`;
|
|
215
|
+
}), y = (n + i).toFixed(1), h = (n + s).toFixed(1), p = n.toFixed(1);
|
|
216
|
+
return `M${g[0]} ` + g.slice(1).map((u) => `L${u}`).join(" ") + ` L${y},${h} L${p},${h} Z`;
|
|
217
|
+
}
|
|
218
|
+
let z = 0;
|
|
219
|
+
function W() {
|
|
220
|
+
return `ss-grad-${z++}`;
|
|
221
|
+
}
|
|
222
|
+
function V(e) {
|
|
223
|
+
if (e.length === 0) return null;
|
|
224
|
+
const t = Math.min(...e), r = Math.max(...e), n = e.reduce((i, s) => i + s, 0) / e.length;
|
|
225
|
+
return { min: t, max: r, avg: n };
|
|
226
|
+
}
|
|
227
|
+
function Re(e, t) {
|
|
228
|
+
const r = N(t), n = q(e, r.width, r.height, r.padding), i = K(e, r.width, r.height, r.padding);
|
|
229
|
+
return !n || !i ? null : {
|
|
230
|
+
points: n,
|
|
231
|
+
areaPath: i,
|
|
232
|
+
gradientId: W(),
|
|
233
|
+
options: r,
|
|
234
|
+
stats: V(e)
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const j = 5e3, G = 1e4, J = 3e3, Q = 100, X = 500;
|
|
238
|
+
function Y(e) {
|
|
239
|
+
if (!e && e !== 0) return "-";
|
|
240
|
+
const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), i = Math.floor(t % 3600 / 60);
|
|
241
|
+
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${i}m` : i > 0 ? `${i}m ${t % 60}s` : `${t}s`;
|
|
242
|
+
}
|
|
243
|
+
function M(e) {
|
|
244
|
+
const t = e / 1048576;
|
|
245
|
+
return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(0)}M`;
|
|
246
|
+
}
|
|
247
|
+
function k(e) {
|
|
248
|
+
return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(1)}M`;
|
|
249
|
+
}
|
|
250
|
+
function Z(e) {
|
|
251
|
+
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : `${e}`;
|
|
252
|
+
}
|
|
253
|
+
function Ue(e) {
|
|
254
|
+
return e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : e >= 1 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`;
|
|
255
|
+
}
|
|
256
|
+
function De(e) {
|
|
257
|
+
if (!e) return "-";
|
|
258
|
+
const t = typeof e == "string" ? new Date(e) : new Date(e);
|
|
259
|
+
return Number.isNaN(t.getTime()) ? "-" : t.toLocaleTimeString("en-US", {
|
|
260
|
+
hour12: !1,
|
|
261
|
+
hour: "2-digit",
|
|
262
|
+
minute: "2-digit",
|
|
263
|
+
second: "2-digit"
|
|
264
|
+
}) + "." + String(t.getMilliseconds()).padStart(3, "0");
|
|
265
|
+
}
|
|
266
|
+
function Fe(e) {
|
|
267
|
+
if (!e) return "-";
|
|
268
|
+
const t = typeof e == "string" ? new Date(e).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
|
|
269
|
+
return r < 0 ? "just now" : r < 60 ? `${r}s ago` : r < 3600 ? `${Math.floor(r / 60)}m ago` : r < 86400 ? `${Math.floor(r / 3600)}h ago` : `${Math.floor(r / 86400)}d ago`;
|
|
270
|
+
}
|
|
271
|
+
function Ie(e, t) {
|
|
272
|
+
switch (t) {
|
|
273
|
+
case "%":
|
|
274
|
+
return `${e.toFixed(1)}%`;
|
|
275
|
+
case "ms":
|
|
276
|
+
return `${e.toFixed(0)}ms`;
|
|
277
|
+
case "MB":
|
|
278
|
+
return `${e.toFixed(1)}M`;
|
|
279
|
+
case "bytes":
|
|
280
|
+
return M(e);
|
|
281
|
+
case "/s":
|
|
282
|
+
case "/m":
|
|
283
|
+
return e.toFixed(1);
|
|
284
|
+
default:
|
|
285
|
+
return e.toFixed(1);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function x(e, t, r) {
|
|
289
|
+
return e > r ? "red" : e > t ? "amber" : "green";
|
|
290
|
+
}
|
|
291
|
+
function ee(e, t, r) {
|
|
292
|
+
return e < r ? "red" : e < t ? "amber" : "green";
|
|
293
|
+
}
|
|
294
|
+
function $(e, t) {
|
|
295
|
+
if (t === 0) return "green";
|
|
296
|
+
const r = e / t;
|
|
297
|
+
return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
|
|
298
|
+
}
|
|
299
|
+
const te = {
|
|
300
|
+
green: "ss-green",
|
|
301
|
+
amber: "ss-amber",
|
|
302
|
+
red: "ss-red"
|
|
303
|
+
}, Oe = {
|
|
304
|
+
green: "#34d399",
|
|
305
|
+
amber: "#fbbf24",
|
|
306
|
+
red: "#f87171"
|
|
307
|
+
}, _e = {
|
|
308
|
+
green: "--ss-accent",
|
|
309
|
+
amber: "--ss-amber-fg",
|
|
310
|
+
red: "--ss-red-fg"
|
|
311
|
+
};
|
|
312
|
+
function Be(e) {
|
|
313
|
+
return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
|
|
314
|
+
}
|
|
315
|
+
function He(e) {
|
|
316
|
+
return e > X ? "very-slow" : e > Q ? "slow" : "normal";
|
|
317
|
+
}
|
|
318
|
+
function Ne(e) {
|
|
319
|
+
return e ? e.length <= 8 ? e : e.slice(0, 8) + "…" : "--";
|
|
320
|
+
}
|
|
321
|
+
function A(e, t = 100) {
|
|
322
|
+
if (e === null) return "null";
|
|
323
|
+
if (e === void 0) return "-";
|
|
324
|
+
if (typeof e == "string")
|
|
325
|
+
return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
|
|
326
|
+
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
327
|
+
if (Array.isArray(e)) {
|
|
328
|
+
if (e.length === 0) return "[]";
|
|
329
|
+
const n = "[" + e.slice(0, 3).map((i) => A(i, 30)).join(", ") + (e.length > 3 ? ", ..." + e.length + " items" : "") + "]";
|
|
330
|
+
return n.length > t ? "[" + e.length + " items]" : n;
|
|
331
|
+
}
|
|
332
|
+
if (typeof e == "object") {
|
|
333
|
+
const r = Object.keys(e);
|
|
334
|
+
if (r.length === 0) return "{}";
|
|
335
|
+
const n = [];
|
|
336
|
+
for (let s = 0; s < Math.min(r.length, 4); s++)
|
|
337
|
+
n.push(r[s] + ": " + A(e[r[s]], 30));
|
|
338
|
+
const i = "{ " + n.join(", ") + (r.length > 4 ? ", ...+" + (r.length - 4) : "") + " }";
|
|
339
|
+
return i.length > t ? "{ " + r.slice(0, 6).join(", ") + (r.length > 6 ? ", ..." : "") + " }" : i;
|
|
340
|
+
}
|
|
341
|
+
return String(e);
|
|
342
|
+
}
|
|
343
|
+
function qe(e) {
|
|
344
|
+
return e < 0 ? "no expiry" : e < 60 ? `${e}s` : e < 3600 ? `${Math.floor(e / 60)}m` : e < 86400 ? `${Math.floor(e / 3600)}h` : `${Math.floor(e / 86400)}d`;
|
|
345
|
+
}
|
|
346
|
+
function Ke(e) {
|
|
347
|
+
return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / (1024 * 1024)).toFixed(1)}MB`;
|
|
348
|
+
}
|
|
349
|
+
const U = 50;
|
|
350
|
+
function ze(e, t, r) {
|
|
351
|
+
const n = new URLSearchParams();
|
|
352
|
+
if (n.set("page", String(e.page)), n.set("perPage", String(e.perPage)), t) {
|
|
353
|
+
t.search && n.set("search", t.search);
|
|
354
|
+
for (const [i, s] of Object.entries(t.filters))
|
|
355
|
+
s && n.set(i, s);
|
|
356
|
+
}
|
|
357
|
+
return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
|
|
358
|
+
}
|
|
359
|
+
function We(e, t = U) {
|
|
360
|
+
const r = e.data ?? e.items ?? [], n = e.total ?? 0, i = e.page ?? 1, s = e.perPage ?? e.limit ?? t, o = e.totalPages ?? (Math.ceil(n / s) || 1);
|
|
361
|
+
return {
|
|
362
|
+
data: r,
|
|
363
|
+
pagination: {
|
|
364
|
+
page: i,
|
|
365
|
+
perPage: s,
|
|
366
|
+
total: n,
|
|
367
|
+
totalPages: o
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function Ve(e = U) {
|
|
372
|
+
return {
|
|
373
|
+
page: 1,
|
|
374
|
+
perPage: e,
|
|
375
|
+
total: 0,
|
|
376
|
+
totalPages: 1
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function je() {
|
|
380
|
+
return {
|
|
381
|
+
search: "",
|
|
382
|
+
filters: {}
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function Ge(e = "id", t = "desc") {
|
|
386
|
+
return { field: e, direction: t };
|
|
387
|
+
}
|
|
388
|
+
function re(e) {
|
|
389
|
+
const t = new URLSearchParams();
|
|
390
|
+
if (e.page !== null && e.page !== void 0 && t.set("page", String(e.page)), e.perPage !== null && e.perPage !== void 0 && t.set("perPage", String(e.perPage)), e.search && t.set("search", e.search), e.sort && t.set("sort", e.sort), e.sortDir && t.set("direction", e.sortDir), e.timeRange && t.set("range", e.timeRange), e.filters)
|
|
391
|
+
for (const [r, n] of Object.entries(e.filters))
|
|
392
|
+
n && t.set(r, n);
|
|
393
|
+
return t.toString();
|
|
394
|
+
}
|
|
395
|
+
function Je(e) {
|
|
396
|
+
const t = Math.max(1, Math.ceil(e.total / e.perPage)), r = Math.min(e.page, t), n = e.total === 0 ? 0 : (r - 1) * e.perPage + 1, i = Math.min(r * e.perPage, e.total);
|
|
397
|
+
return {
|
|
398
|
+
page: r,
|
|
399
|
+
perPage: e.perPage,
|
|
400
|
+
total: e.total,
|
|
401
|
+
lastPage: t,
|
|
402
|
+
from: n,
|
|
403
|
+
to: i,
|
|
404
|
+
hasPrev: r > 1,
|
|
405
|
+
hasNext: r < t
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
function Qe(e, t, r = 2) {
|
|
409
|
+
if (t <= 1) return [1];
|
|
410
|
+
const n = [], i = Math.max(2, e - r), s = Math.min(t - 1, e + r);
|
|
411
|
+
n.push(1), i > 2 && n.push("...");
|
|
412
|
+
for (let o = i; o <= s; o++)
|
|
413
|
+
n.push(o);
|
|
414
|
+
return s < t - 1 && n.push("..."), t > 1 && n.push(t), n;
|
|
415
|
+
}
|
|
416
|
+
const D = "/admin/api/debug", ne = {
|
|
417
|
+
tracing: !1,
|
|
418
|
+
process: !1,
|
|
419
|
+
system: !1,
|
|
420
|
+
http: !1,
|
|
421
|
+
db: !1,
|
|
422
|
+
redis: !1,
|
|
423
|
+
queues: !1,
|
|
424
|
+
cache: !1,
|
|
425
|
+
app: !1,
|
|
426
|
+
log: !1,
|
|
427
|
+
emails: !1,
|
|
428
|
+
dashboard: !1,
|
|
429
|
+
customPanes: []
|
|
430
|
+
};
|
|
431
|
+
function se(e) {
|
|
432
|
+
return {
|
|
433
|
+
tracing: e.features?.tracing ?? !1,
|
|
434
|
+
process: e.features?.process ?? !1,
|
|
435
|
+
system: e.features?.system ?? !1,
|
|
436
|
+
http: e.features?.http ?? !1,
|
|
437
|
+
db: e.features?.db ?? !1,
|
|
438
|
+
redis: e.features?.redis ?? !1,
|
|
439
|
+
queues: e.features?.queues ?? !1,
|
|
440
|
+
cache: e.features?.cache ?? !1,
|
|
441
|
+
app: e.features?.app ?? !1,
|
|
442
|
+
log: e.features?.log ?? !1,
|
|
443
|
+
emails: e.features?.emails ?? !1,
|
|
444
|
+
dashboard: e.features?.dashboard ?? !1,
|
|
445
|
+
customPanes: e.customPanes ?? []
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
async function ie(e, t = D) {
|
|
449
|
+
const r = `${t.replace(/\/+$/, "")}/config`;
|
|
450
|
+
return e.fetch(r);
|
|
451
|
+
}
|
|
452
|
+
async function Xe(e) {
|
|
453
|
+
const { baseUrl: t = "", debugEndpoint: r = D, authToken: n } = e, i = new w({ baseUrl: t, authToken: n });
|
|
454
|
+
try {
|
|
455
|
+
const s = await ie(i, r);
|
|
456
|
+
return se(s);
|
|
457
|
+
} catch {
|
|
458
|
+
return ne;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function Ye(e) {
|
|
462
|
+
const t = /* @__PURE__ */ new Set(), r = "features" in e && typeof e.features == "object" && e.features !== null ? e.features : e;
|
|
463
|
+
return "process" in r && r.process && t.add("process"), ("process" in r && r.process || "system" in r && r.system) && t.add("memory"), "http" in r && r.http && t.add("http"), "db" in r && r.db && t.add("db"), "redis" in r && r.redis && t.add("redis"), "queues" in r && r.queues && t.add("queue"), "app" in r && r.app && t.add("app"), "log" in r && r.log && t.add("log"), t;
|
|
464
|
+
}
|
|
465
|
+
function Ze(e) {
|
|
466
|
+
const t = /* @__PURE__ */ new Set();
|
|
467
|
+
return (c(e.cpuPercent) || c(e.uptime) || oe(e.nodeVersion)) && t.add("process"), (c(e.memHeapUsed) || c(e.memRss)) && t.add("memory"), (c(e.systemMemoryTotalMb) || c(e.systemMemoryFreeMb)) && t.add("memory"), (c(e.requestsPerSecond) || c(e.avgResponseTimeMs) || c(e.errorRate) || c(e.activeHttpConnections)) && t.add("http"), (c(e.dbPoolMax) || c(e.dbPoolUsed) || c(e.dbPoolFree) || c(e.dbPoolPending)) && t.add("db"), e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), (c(e.queueActive) || c(e.queueWaiting) || c(e.queueWorkerCount)) && t.add("queue"), (c(e.onlineUsers) || c(e.pendingWebhooks) || c(e.pendingEmails)) && t.add("app"), (c(e.logErrorsLast5m) || c(e.logEntriesPerMinute)) && t.add("log"), t;
|
|
468
|
+
}
|
|
469
|
+
function c(e) {
|
|
470
|
+
return typeof e == "number" && !Number.isNaN(e);
|
|
471
|
+
}
|
|
472
|
+
function oe(e) {
|
|
473
|
+
return typeof e == "string" && e.length > 0;
|
|
474
|
+
}
|
|
475
|
+
function d(e) {
|
|
476
|
+
return te[e] || "";
|
|
477
|
+
}
|
|
478
|
+
const P = [
|
|
479
|
+
// ── Process group ─────────────────────────────────────────────────────────
|
|
480
|
+
// -- Node version ---------------------------------------------------------
|
|
481
|
+
{
|
|
482
|
+
id: "node",
|
|
483
|
+
label: "NODE",
|
|
484
|
+
title: "Node.js Runtime",
|
|
485
|
+
unit: "",
|
|
486
|
+
group: "process",
|
|
487
|
+
extract: (e) => 0,
|
|
488
|
+
format: (e) => e.nodeVersion,
|
|
489
|
+
color: () => ""
|
|
490
|
+
},
|
|
491
|
+
// -- Uptime ---------------------------------------------------------------
|
|
492
|
+
{
|
|
493
|
+
id: "uptime",
|
|
494
|
+
label: "UP",
|
|
495
|
+
title: "Process Uptime",
|
|
496
|
+
unit: "",
|
|
497
|
+
group: "process",
|
|
498
|
+
extract: (e) => e.uptime,
|
|
499
|
+
format: (e) => Y(e.uptime),
|
|
500
|
+
color: () => ""
|
|
501
|
+
},
|
|
502
|
+
// -- CPU ------------------------------------------------------------------
|
|
503
|
+
{
|
|
504
|
+
id: "cpu",
|
|
505
|
+
label: "CPU",
|
|
506
|
+
title: "CPU Usage",
|
|
507
|
+
unit: "%",
|
|
508
|
+
group: "process",
|
|
509
|
+
warnThreshold: 50,
|
|
510
|
+
critThreshold: 80,
|
|
511
|
+
extract: (e) => e.cpuPercent,
|
|
512
|
+
format: (e) => `${e.cpuPercent.toFixed(1)}%`,
|
|
513
|
+
color: (e) => d(x(e.cpuPercent, 50, 80)),
|
|
514
|
+
historyKey: "cpuPercent"
|
|
515
|
+
},
|
|
516
|
+
// -- Event loop -----------------------------------------------------------
|
|
517
|
+
{
|
|
518
|
+
id: "eventLoop",
|
|
519
|
+
label: "EVT",
|
|
520
|
+
title: "Event Loop Latency",
|
|
521
|
+
unit: "ms",
|
|
522
|
+
group: "process",
|
|
523
|
+
warnThreshold: 20,
|
|
524
|
+
critThreshold: 50,
|
|
525
|
+
extract: (e) => e.eventLoopLag,
|
|
526
|
+
format: (e) => `${e.eventLoopLag.toFixed(1)}ms`,
|
|
527
|
+
color: (e) => d(x(e.eventLoopLag, 20, 50)),
|
|
528
|
+
historyKey: "eventLoopLag"
|
|
529
|
+
},
|
|
530
|
+
// ── Memory group ──────────────────────────────────────────────────────────
|
|
531
|
+
// -- Heap memory ----------------------------------------------------------
|
|
532
|
+
{
|
|
533
|
+
id: "memory",
|
|
534
|
+
label: "HEAP",
|
|
535
|
+
title: "V8 Heap Usage",
|
|
536
|
+
unit: "bytes",
|
|
537
|
+
group: "memory",
|
|
538
|
+
extract: (e) => e.memHeapUsed,
|
|
539
|
+
format: (e) => M(e.memHeapUsed),
|
|
540
|
+
color: () => "",
|
|
541
|
+
historyKey: "memHeapUsed"
|
|
542
|
+
},
|
|
543
|
+
// -- RSS ------------------------------------------------------------------
|
|
544
|
+
{
|
|
545
|
+
id: "rss",
|
|
546
|
+
label: "RSS",
|
|
547
|
+
title: "Resident Set Size",
|
|
548
|
+
unit: "bytes",
|
|
549
|
+
group: "memory",
|
|
550
|
+
extract: (e) => e.memRss,
|
|
551
|
+
format: (e) => M(e.memRss),
|
|
552
|
+
color: () => "",
|
|
553
|
+
historyKey: "memRss"
|
|
554
|
+
},
|
|
555
|
+
// -- System memory --------------------------------------------------------
|
|
556
|
+
{
|
|
557
|
+
id: "systemMemory",
|
|
558
|
+
label: "SYS",
|
|
559
|
+
title: "System Memory",
|
|
560
|
+
unit: "MB",
|
|
561
|
+
group: "memory",
|
|
562
|
+
extract: (e) => e.systemMemoryTotalMb - e.systemMemoryFreeMb,
|
|
563
|
+
format: (e) => `${k(e.systemMemoryTotalMb - e.systemMemoryFreeMb)}/${k(e.systemMemoryTotalMb)}`,
|
|
564
|
+
color: (e) => {
|
|
565
|
+
const t = e.systemMemoryTotalMb;
|
|
566
|
+
if (t === 0) return "";
|
|
567
|
+
const r = t - e.systemMemoryFreeMb;
|
|
568
|
+
return d($(r, t));
|
|
569
|
+
},
|
|
570
|
+
historyKey: "_sysMemUsed",
|
|
571
|
+
show: (e) => e.systemMemoryTotalMb !== null && e.systemMemoryTotalMb !== void 0
|
|
572
|
+
},
|
|
573
|
+
// ── HTTP group ────────────────────────────────────────────────────────────
|
|
574
|
+
// -- Requests per second --------------------------------------------------
|
|
575
|
+
{
|
|
576
|
+
id: "reqPerSec",
|
|
577
|
+
label: "REQ/s",
|
|
578
|
+
title: "Requests per Second",
|
|
579
|
+
unit: "/s",
|
|
580
|
+
group: "http",
|
|
581
|
+
extract: (e) => e.requestsPerSecond,
|
|
582
|
+
format: (e) => e.requestsPerSecond.toFixed(1),
|
|
583
|
+
color: () => "",
|
|
584
|
+
historyKey: "requestsPerSecond"
|
|
585
|
+
},
|
|
586
|
+
// -- Average response time ------------------------------------------------
|
|
587
|
+
{
|
|
588
|
+
id: "avgResponse",
|
|
589
|
+
label: "AVG",
|
|
590
|
+
title: "Avg Response Time",
|
|
591
|
+
unit: "ms",
|
|
592
|
+
group: "http",
|
|
593
|
+
warnThreshold: 200,
|
|
594
|
+
critThreshold: 500,
|
|
595
|
+
extract: (e) => e.avgResponseTimeMs,
|
|
596
|
+
format: (e) => `${e.avgResponseTimeMs.toFixed(0)}ms`,
|
|
597
|
+
color: (e) => d(x(e.avgResponseTimeMs, 200, 500)),
|
|
598
|
+
historyKey: "avgResponseTimeMs"
|
|
599
|
+
},
|
|
600
|
+
// -- Error rate -----------------------------------------------------------
|
|
601
|
+
{
|
|
602
|
+
id: "errorRate",
|
|
603
|
+
label: "ERR",
|
|
604
|
+
title: "Error Rate",
|
|
605
|
+
unit: "%",
|
|
606
|
+
group: "http",
|
|
607
|
+
warnThreshold: 1,
|
|
608
|
+
critThreshold: 5,
|
|
609
|
+
extract: (e) => e.errorRate,
|
|
610
|
+
format: (e) => `${e.errorRate.toFixed(1)}%`,
|
|
611
|
+
color: (e) => d(x(e.errorRate, 1, 5)),
|
|
612
|
+
historyKey: "errorRate"
|
|
613
|
+
},
|
|
614
|
+
// -- Active connections ---------------------------------------------------
|
|
615
|
+
{
|
|
616
|
+
id: "connections",
|
|
617
|
+
label: "CONN",
|
|
618
|
+
title: "Active Connections",
|
|
619
|
+
unit: "",
|
|
620
|
+
group: "http",
|
|
621
|
+
extract: (e) => e.activeHttpConnections,
|
|
622
|
+
format: (e) => `${e.activeHttpConnections}`,
|
|
623
|
+
color: () => "",
|
|
624
|
+
historyKey: "activeHttpConnections"
|
|
625
|
+
},
|
|
626
|
+
// ── DB group ──────────────────────────────────────────────────────────────
|
|
627
|
+
// -- Database pool --------------------------------------------------------
|
|
628
|
+
{
|
|
629
|
+
id: "dbPool",
|
|
630
|
+
label: "DB",
|
|
631
|
+
title: "Database Pool",
|
|
632
|
+
unit: "",
|
|
633
|
+
group: "db",
|
|
634
|
+
extract: (e) => e.dbPoolUsed,
|
|
635
|
+
format: (e) => `${e.dbPoolUsed}/${e.dbPoolFree}/${e.dbPoolMax}`,
|
|
636
|
+
color: (e) => d($(e.dbPoolUsed, e.dbPoolMax)),
|
|
637
|
+
historyKey: "dbPoolUsed"
|
|
638
|
+
},
|
|
639
|
+
// ── Redis group ───────────────────────────────────────────────────────────
|
|
640
|
+
// -- Redis status ---------------------------------------------------------
|
|
641
|
+
{
|
|
642
|
+
id: "redis",
|
|
643
|
+
label: "REDIS",
|
|
644
|
+
title: "Redis Status",
|
|
645
|
+
unit: "",
|
|
646
|
+
group: "redis",
|
|
647
|
+
extract: (e) => e.redisOk ? 1 : 0,
|
|
648
|
+
format: (e) => e.redisOk ? "✓" : "✗",
|
|
649
|
+
color: (e) => e.redisOk ? "ss-green" : "ss-red"
|
|
650
|
+
},
|
|
651
|
+
// -- Redis memory ---------------------------------------------------------
|
|
652
|
+
{
|
|
653
|
+
id: "redisMem",
|
|
654
|
+
label: "MEM",
|
|
655
|
+
title: "Redis Memory",
|
|
656
|
+
unit: "MB",
|
|
657
|
+
group: "redis",
|
|
658
|
+
extract: (e) => e.redisMemoryUsedMb,
|
|
659
|
+
format: (e) => `${e.redisMemoryUsedMb.toFixed(1)}M`,
|
|
660
|
+
color: () => "",
|
|
661
|
+
historyKey: "redisMemoryUsedMb",
|
|
662
|
+
show: (e) => e.redisOk
|
|
663
|
+
},
|
|
664
|
+
// -- Redis keys -----------------------------------------------------------
|
|
665
|
+
{
|
|
666
|
+
id: "redisKeys",
|
|
667
|
+
label: "KEYS",
|
|
668
|
+
title: "Redis Keys",
|
|
669
|
+
unit: "",
|
|
670
|
+
group: "redis",
|
|
671
|
+
extract: (e) => e.redisKeysCount,
|
|
672
|
+
format: (e) => Z(e.redisKeysCount),
|
|
673
|
+
color: () => "",
|
|
674
|
+
historyKey: "redisKeysCount",
|
|
675
|
+
show: (e) => e.redisOk
|
|
676
|
+
},
|
|
677
|
+
// -- Redis hit rate -------------------------------------------------------
|
|
678
|
+
{
|
|
679
|
+
id: "redisHitRate",
|
|
680
|
+
label: "HIT",
|
|
681
|
+
title: "Redis Hit Rate",
|
|
682
|
+
unit: "%",
|
|
683
|
+
group: "redis",
|
|
684
|
+
warnThreshold: 90,
|
|
685
|
+
critThreshold: 70,
|
|
686
|
+
inverseThreshold: !0,
|
|
687
|
+
extract: (e) => e.redisHitRate,
|
|
688
|
+
format: (e) => `${e.redisHitRate.toFixed(0)}%`,
|
|
689
|
+
color: (e) => d(ee(e.redisHitRate, 90, 70)),
|
|
690
|
+
historyKey: "redisHitRate",
|
|
691
|
+
show: (e) => e.redisOk
|
|
692
|
+
},
|
|
693
|
+
// ── Queue group ───────────────────────────────────────────────────────────
|
|
694
|
+
// -- Queue ----------------------------------------------------------------
|
|
695
|
+
{
|
|
696
|
+
id: "queue",
|
|
697
|
+
label: "Q",
|
|
698
|
+
title: "Job Queue",
|
|
699
|
+
unit: "",
|
|
700
|
+
group: "queue",
|
|
701
|
+
extract: (e) => e.queueActive,
|
|
702
|
+
format: (e) => `${e.queueActive}/${e.queueWaiting}/${e.queueDelayed}`,
|
|
703
|
+
color: (e) => e.queueFailed > 0 ? "ss-amber" : "ss-green",
|
|
704
|
+
historyKey: "queueActive"
|
|
705
|
+
},
|
|
706
|
+
// -- Queue workers --------------------------------------------------------
|
|
707
|
+
{
|
|
708
|
+
id: "queueWorkers",
|
|
709
|
+
label: "WORKERS",
|
|
710
|
+
title: "Queue Workers",
|
|
711
|
+
unit: "",
|
|
712
|
+
group: "queue",
|
|
713
|
+
extract: (e) => e.queueWorkerCount,
|
|
714
|
+
format: (e) => `${e.queueWorkerCount}`,
|
|
715
|
+
color: () => ""
|
|
716
|
+
},
|
|
717
|
+
// ── App group ─────────────────────────────────────────────────────────────
|
|
718
|
+
// -- Online users ---------------------------------------------------------
|
|
719
|
+
{
|
|
720
|
+
id: "onlineUsers",
|
|
721
|
+
label: "USERS",
|
|
722
|
+
title: "Online Users",
|
|
723
|
+
unit: "",
|
|
724
|
+
group: "app",
|
|
725
|
+
extract: (e) => e.onlineUsers,
|
|
726
|
+
format: (e) => `${e.onlineUsers}`,
|
|
727
|
+
color: () => "",
|
|
728
|
+
historyKey: "onlineUsers"
|
|
729
|
+
},
|
|
730
|
+
// -- Pending webhooks -----------------------------------------------------
|
|
731
|
+
{
|
|
732
|
+
id: "pendingWebhooks",
|
|
733
|
+
label: "HOOKS",
|
|
734
|
+
title: "Pending Webhooks",
|
|
735
|
+
unit: "",
|
|
736
|
+
group: "app",
|
|
737
|
+
extract: (e) => e.pendingWebhooks,
|
|
738
|
+
format: (e) => `${e.pendingWebhooks}`,
|
|
739
|
+
color: (e) => e.pendingWebhooks > 0 ? "ss-amber" : "",
|
|
740
|
+
historyKey: "pendingWebhooks"
|
|
741
|
+
},
|
|
742
|
+
// -- Pending emails -------------------------------------------------------
|
|
743
|
+
{
|
|
744
|
+
id: "pendingEmails",
|
|
745
|
+
label: "MAIL",
|
|
746
|
+
title: "Pending Emails",
|
|
747
|
+
unit: "",
|
|
748
|
+
group: "app",
|
|
749
|
+
extract: (e) => e.pendingEmails,
|
|
750
|
+
format: (e) => `${e.pendingEmails}`,
|
|
751
|
+
color: (e) => e.pendingEmails > 0 ? "ss-amber" : "",
|
|
752
|
+
historyKey: "pendingEmails"
|
|
753
|
+
},
|
|
754
|
+
// ── Logs group ────────────────────────────────────────────────────────────
|
|
755
|
+
// -- Logs (errors) --------------------------------------------------------
|
|
756
|
+
{
|
|
757
|
+
id: "logErrors",
|
|
758
|
+
label: "LOG ERR",
|
|
759
|
+
title: "Log Errors (5m)",
|
|
760
|
+
unit: "",
|
|
761
|
+
group: "log",
|
|
762
|
+
extract: (e) => e.logErrorsLast5m,
|
|
763
|
+
format: (e) => `${e.logErrorsLast5m}`,
|
|
764
|
+
color: (e) => e.logErrorsLast5m > 0 ? "ss-red" : e.logWarningsLast5m > 0 ? "ss-amber" : "",
|
|
765
|
+
historyKey: "logErrorsLast5m"
|
|
766
|
+
},
|
|
767
|
+
// -- Log rate -------------------------------------------------------------
|
|
768
|
+
{
|
|
769
|
+
id: "logRate",
|
|
770
|
+
label: "LOG/m",
|
|
771
|
+
title: "Log Entries / Minute",
|
|
772
|
+
unit: "/m",
|
|
773
|
+
group: "log",
|
|
774
|
+
extract: (e) => e.logEntriesPerMinute,
|
|
775
|
+
format: (e) => `${e.logEntriesPerMinute}`,
|
|
776
|
+
color: () => "",
|
|
777
|
+
historyKey: "logEntriesPerMinute"
|
|
778
|
+
}
|
|
779
|
+
];
|
|
780
|
+
function et(e) {
|
|
781
|
+
return P.find((t) => t.id === e);
|
|
782
|
+
}
|
|
783
|
+
function tt() {
|
|
784
|
+
const e = /* @__PURE__ */ new Map();
|
|
785
|
+
for (const t of P) {
|
|
786
|
+
const r = t.group || "core";
|
|
787
|
+
e.has(r) || e.set(r, []), e.get(r).push(t);
|
|
788
|
+
}
|
|
789
|
+
return e;
|
|
790
|
+
}
|
|
791
|
+
const ae = 60, ce = 1e4, le = {
|
|
792
|
+
queries: "/queries",
|
|
793
|
+
events: "/events",
|
|
794
|
+
emails: "/emails",
|
|
795
|
+
routes: "/routes",
|
|
796
|
+
logs: "/logs",
|
|
797
|
+
timeline: "/traces",
|
|
798
|
+
cache: "/cache",
|
|
799
|
+
jobs: "/jobs",
|
|
800
|
+
config: "/config",
|
|
801
|
+
internals: "/diagnostics"
|
|
802
|
+
};
|
|
803
|
+
function he(e) {
|
|
804
|
+
return le[e] || `/${e}`;
|
|
805
|
+
}
|
|
806
|
+
const ue = {
|
|
807
|
+
overview: "/overview",
|
|
808
|
+
requests: "/requests",
|
|
809
|
+
queries: "/queries",
|
|
810
|
+
events: "/events",
|
|
811
|
+
routes: "/routes",
|
|
812
|
+
logs: "/logs",
|
|
813
|
+
emails: "/emails",
|
|
814
|
+
timeline: "/traces",
|
|
815
|
+
cache: "/cache",
|
|
816
|
+
jobs: "/jobs",
|
|
817
|
+
config: "/config"
|
|
818
|
+
};
|
|
819
|
+
function de(e) {
|
|
820
|
+
return ue[e] || `/${e}`;
|
|
821
|
+
}
|
|
822
|
+
function fe(e = ae) {
|
|
823
|
+
const t = {};
|
|
824
|
+
return {
|
|
825
|
+
push(r) {
|
|
826
|
+
for (const n of P) {
|
|
827
|
+
const i = n.historyKey;
|
|
828
|
+
if (!i) continue;
|
|
829
|
+
const s = n.extract(r);
|
|
830
|
+
typeof s == "number" && (t[i] || (t[i] = []), t[i].push(s), t[i].length > e && t[i].shift());
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
get(r) {
|
|
834
|
+
return t[r] || [];
|
|
835
|
+
},
|
|
836
|
+
getAll() {
|
|
837
|
+
return t;
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
class rt {
|
|
842
|
+
// -- Configuration --------------------------------------------------------
|
|
843
|
+
baseUrl;
|
|
844
|
+
endpoint;
|
|
845
|
+
channelName;
|
|
846
|
+
authToken;
|
|
847
|
+
pollInterval;
|
|
848
|
+
// -- Callbacks ------------------------------------------------------------
|
|
849
|
+
onStatsUpdate;
|
|
850
|
+
onConnectionChange;
|
|
851
|
+
onStaleChange;
|
|
852
|
+
onError;
|
|
853
|
+
onUnauthorizedChange;
|
|
854
|
+
onHistoryChange;
|
|
855
|
+
onSseActiveChange;
|
|
856
|
+
onPollActiveChange;
|
|
857
|
+
// -- Internal state -------------------------------------------------------
|
|
858
|
+
historyBuffer;
|
|
859
|
+
client = null;
|
|
860
|
+
sseHandle = null;
|
|
861
|
+
pollTimer = null;
|
|
862
|
+
staleTimer = null;
|
|
863
|
+
lastSuccess = 0;
|
|
864
|
+
unauthorized = !1;
|
|
865
|
+
sseActive = !1;
|
|
866
|
+
isConnected = !1;
|
|
867
|
+
isStale = !1;
|
|
868
|
+
constructor(t = {}) {
|
|
869
|
+
this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer = fe();
|
|
870
|
+
}
|
|
871
|
+
// -- Public API -----------------------------------------------------------
|
|
872
|
+
/**
|
|
873
|
+
* Start the SSE subscription + polling lifecycle.
|
|
874
|
+
*
|
|
875
|
+
* Safe to call multiple times (subsequent calls are no-ops).
|
|
876
|
+
*/
|
|
877
|
+
start() {
|
|
878
|
+
if (this.unauthorized) return;
|
|
879
|
+
let t = !1;
|
|
880
|
+
try {
|
|
881
|
+
const r = B({
|
|
882
|
+
baseUrl: this.baseUrl,
|
|
883
|
+
channelName: this.channelName,
|
|
884
|
+
authToken: this.authToken,
|
|
885
|
+
onMessage: (n) => {
|
|
886
|
+
n && typeof n == "object" && "timestamp" in n && this.processStats(n);
|
|
887
|
+
},
|
|
888
|
+
onConnect: () => {
|
|
889
|
+
this.setSseActive(!0), this.setConnected(!0), this.stopPolling();
|
|
890
|
+
},
|
|
891
|
+
onDisconnect: () => {
|
|
892
|
+
this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && this.startPollInterval();
|
|
893
|
+
},
|
|
894
|
+
onError: () => {
|
|
895
|
+
t = !0;
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
this.sseHandle = r;
|
|
899
|
+
} catch {
|
|
900
|
+
t = !0;
|
|
901
|
+
}
|
|
902
|
+
if (this.poll(), t || !this.sseHandle)
|
|
903
|
+
this.startPollInterval();
|
|
904
|
+
else {
|
|
905
|
+
const r = setTimeout(() => {
|
|
906
|
+
!this.isConnected && !this.pollTimer && this.startPollInterval();
|
|
907
|
+
}, 3e3), n = this.sseHandle?.unsubscribe;
|
|
908
|
+
this.sseHandle && (this.sseHandle.unsubscribe = () => {
|
|
909
|
+
clearTimeout(r), n?.();
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
this.staleTimer = setInterval(() => {
|
|
913
|
+
this.lastSuccess > 0 && Date.now() - this.lastSuccess > ce && this.setStale(!0);
|
|
914
|
+
}, 2e3);
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Stop all timers and subscriptions. Call on unmount.
|
|
918
|
+
*/
|
|
919
|
+
stop() {
|
|
920
|
+
this.sseHandle?.unsubscribe(), this.sseHandle = null, this.stopPolling(), this.staleTimer && (clearInterval(this.staleTimer), this.staleTimer = null);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Get the history array for a single metric key.
|
|
924
|
+
*/
|
|
925
|
+
getHistory(t) {
|
|
926
|
+
return this.historyBuffer.get(t);
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Get the entire history map (all keys).
|
|
930
|
+
*/
|
|
931
|
+
getAllHistory() {
|
|
932
|
+
return this.historyBuffer.getAll();
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Get the current connection mode.
|
|
936
|
+
*/
|
|
937
|
+
getConnectionMode() {
|
|
938
|
+
return this.unauthorized ? "disconnected" : this.sseActive ? "live" : this.pollTimer ? "polling" : "disconnected";
|
|
939
|
+
}
|
|
940
|
+
// -- Internal helpers -----------------------------------------------------
|
|
941
|
+
/** Process incoming stats data from either SSE or polling. */
|
|
942
|
+
processStats(t) {
|
|
943
|
+
this.onStatsUpdate?.(t), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(t), this.onHistoryChange?.(this.historyBuffer.getAll());
|
|
944
|
+
}
|
|
945
|
+
/** Poll the HTTP endpoint once. */
|
|
946
|
+
async poll() {
|
|
947
|
+
if (!this.unauthorized) {
|
|
948
|
+
this.client || (this.client = new w({ baseUrl: this.baseUrl, authToken: this.authToken }));
|
|
949
|
+
try {
|
|
950
|
+
const t = await this.client.get(this.endpoint);
|
|
951
|
+
this.processStats(t);
|
|
952
|
+
} catch (t) {
|
|
953
|
+
t instanceof b && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(t), this.stopPolling());
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
/** Start the poll interval timer. */
|
|
958
|
+
startPollInterval() {
|
|
959
|
+
this.pollTimer || (this.pollTimer = setInterval(() => this.poll(), this.pollInterval), this.onPollActiveChange?.(!0));
|
|
960
|
+
}
|
|
961
|
+
/** Stop the poll interval timer. */
|
|
962
|
+
stopPolling() {
|
|
963
|
+
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null, this.onPollActiveChange?.(!1));
|
|
964
|
+
}
|
|
965
|
+
/** Update SSE active state and notify. */
|
|
966
|
+
setSseActive(t) {
|
|
967
|
+
this.sseActive !== t && (this.sseActive = t, this.onSseActiveChange?.(t));
|
|
968
|
+
}
|
|
969
|
+
/** Update connected state and notify. */
|
|
970
|
+
setConnected(t) {
|
|
971
|
+
this.isConnected !== t && (this.isConnected = t, this.onConnectionChange?.(t));
|
|
972
|
+
}
|
|
973
|
+
/** Update stale state and notify. */
|
|
974
|
+
setStale(t) {
|
|
975
|
+
this.isStale !== t && (this.isStale = t, this.onStaleChange?.(t));
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
class pe {
|
|
979
|
+
constructor(t, r) {
|
|
980
|
+
this.client = t, this.basePath = r;
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Fetch data for a dashboard section, optionally with a query string.
|
|
984
|
+
*
|
|
985
|
+
* @param section - Section identifier (e.g. `'overview'`, `'queries'`).
|
|
986
|
+
* @param queryString - Optional query string (without leading `?`).
|
|
987
|
+
*/
|
|
988
|
+
async fetchSection(t, r) {
|
|
989
|
+
const n = de(t), i = r ? `${this.basePath}${n}?${r}` : `${this.basePath}${n}`;
|
|
990
|
+
return this.client.fetch(i);
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Fetch chart time-series data for the overview section.
|
|
994
|
+
*
|
|
995
|
+
* @param range - Time range identifier (e.g. `'1h'`, `'24h'`).
|
|
996
|
+
*/
|
|
997
|
+
async fetchChart(t) {
|
|
998
|
+
return this.client.fetch(
|
|
999
|
+
`${this.basePath}/overview/chart?range=${t}`
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Fetch grouped/aggregated query patterns.
|
|
1004
|
+
*/
|
|
1005
|
+
async fetchGroupedQueries() {
|
|
1006
|
+
return this.client.fetch(`${this.basePath}/queries/grouped`);
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Run EXPLAIN on a specific query by ID.
|
|
1010
|
+
*
|
|
1011
|
+
* @param id - Query record ID.
|
|
1012
|
+
*/
|
|
1013
|
+
async explainQuery(t) {
|
|
1014
|
+
return this.client.fetch(`${this.basePath}/queries/${t}/explain`);
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Retry a failed job by ID.
|
|
1018
|
+
*
|
|
1019
|
+
* @param id - Job record ID.
|
|
1020
|
+
*/
|
|
1021
|
+
async retryJob(t) {
|
|
1022
|
+
return this.client.fetch(`${this.basePath}/jobs/${t}/retry`, {
|
|
1023
|
+
method: "POST"
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Fetch the value of a specific cache key.
|
|
1028
|
+
*
|
|
1029
|
+
* @param key - Cache key (will be URI-encoded).
|
|
1030
|
+
*/
|
|
1031
|
+
async fetchCacheKey(t) {
|
|
1032
|
+
return this.client.fetch(
|
|
1033
|
+
`${this.basePath}/cache/${encodeURIComponent(t)}`
|
|
1034
|
+
);
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Delete a cache entry by key.
|
|
1038
|
+
*
|
|
1039
|
+
* @param key - Cache key (will be URI-encoded).
|
|
1040
|
+
*/
|
|
1041
|
+
async deleteCacheKey(t) {
|
|
1042
|
+
return this.client.fetch(
|
|
1043
|
+
`${this.basePath}/cache/${encodeURIComponent(t)}`,
|
|
1044
|
+
{
|
|
1045
|
+
method: "DELETE"
|
|
1046
|
+
}
|
|
1047
|
+
);
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Fetch the HTML preview for an email record.
|
|
1051
|
+
*
|
|
1052
|
+
* @param id - Email record ID.
|
|
1053
|
+
*/
|
|
1054
|
+
async fetchEmailPreview(t) {
|
|
1055
|
+
return this.client.fetch(`${this.basePath}/emails/${t}/preview`);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
class nt {
|
|
1059
|
+
// -- Dependencies ---------------------------------------------------------
|
|
1060
|
+
client;
|
|
1061
|
+
api;
|
|
1062
|
+
callbacks;
|
|
1063
|
+
// -- Configuration --------------------------------------------------------
|
|
1064
|
+
endpoint;
|
|
1065
|
+
perPage;
|
|
1066
|
+
// -- Mutable state --------------------------------------------------------
|
|
1067
|
+
section;
|
|
1068
|
+
page = 1;
|
|
1069
|
+
search;
|
|
1070
|
+
sort;
|
|
1071
|
+
sortDir;
|
|
1072
|
+
filters;
|
|
1073
|
+
timeRange;
|
|
1074
|
+
// -- Internal bookkeeping -------------------------------------------------
|
|
1075
|
+
timer = null;
|
|
1076
|
+
/** Monotonically increasing fetch ID to discard stale responses. */
|
|
1077
|
+
fetchId = 0;
|
|
1078
|
+
/** Whether a non-silent (explicit) fetch is currently in-flight. */
|
|
1079
|
+
explicitFetchPending = !1;
|
|
1080
|
+
/** Whether we have successfully fetched data at least once. */
|
|
1081
|
+
hasFetched = !1;
|
|
1082
|
+
/** Whether the controller has been stopped (disposed). */
|
|
1083
|
+
stopped = !1;
|
|
1084
|
+
constructor(t) {
|
|
1085
|
+
this.client = new w({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new pe(this.client, t.endpoint), this.endpoint = t.endpoint, this.section = t.section, this.perPage = t.perPage, this.callbacks = t.callbacks;
|
|
1086
|
+
}
|
|
1087
|
+
// -- Public API -----------------------------------------------------------
|
|
1088
|
+
/**
|
|
1089
|
+
* Start the controller: perform an initial fetch and begin auto-refresh.
|
|
1090
|
+
*/
|
|
1091
|
+
start() {
|
|
1092
|
+
this.stopped = !1, this.fetch(!1), this.startRefreshTimer();
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Stop the controller: clear timers and mark as disposed.
|
|
1096
|
+
* Outstanding in-flight responses will be discarded via fetchId.
|
|
1097
|
+
*/
|
|
1098
|
+
stop() {
|
|
1099
|
+
this.stopped = !0, this.stopRefreshTimer();
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Perform a data fetch.
|
|
1103
|
+
*
|
|
1104
|
+
* @param silent - When `true`, errors are swallowed (keeps stale data)
|
|
1105
|
+
* and loading state is not modified.
|
|
1106
|
+
*/
|
|
1107
|
+
async fetch(t = !0) {
|
|
1108
|
+
if (t && this.explicitFetchPending) return;
|
|
1109
|
+
const r = ++this.fetchId, n = this.section;
|
|
1110
|
+
if (!n) return;
|
|
1111
|
+
const i = this.filters, s = this.sort ? this.sort.replace(/[A-Z]/g, (a) => "_" + a.toLowerCase()) : void 0, o = re({
|
|
1112
|
+
page: this.page,
|
|
1113
|
+
perPage: this.perPage,
|
|
1114
|
+
search: this.search,
|
|
1115
|
+
sort: s,
|
|
1116
|
+
sortDir: this.sort ? this.sortDir : void 0,
|
|
1117
|
+
filters: i && Object.keys(i).length > 0 ? i : void 0,
|
|
1118
|
+
timeRange: n.startsWith("overview") ? this.timeRange : void 0
|
|
1119
|
+
});
|
|
1120
|
+
t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0);
|
|
1121
|
+
try {
|
|
1122
|
+
const a = await this.api.fetchSection(n, o || void 0);
|
|
1123
|
+
if (r !== this.fetchId || this.stopped) return;
|
|
1124
|
+
if (a && typeof a == "object" && a.data !== void 0 && a.meta !== void 0) {
|
|
1125
|
+
const l = a;
|
|
1126
|
+
this.callbacks.onData(l.data), this.callbacks.onPagination(l.meta);
|
|
1127
|
+
} else
|
|
1128
|
+
this.callbacks.onData(a), this.callbacks.onPagination(null);
|
|
1129
|
+
this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
|
|
1130
|
+
} catch (a) {
|
|
1131
|
+
if (r !== this.fetchId || this.stopped) return;
|
|
1132
|
+
if (a instanceof b) {
|
|
1133
|
+
this.callbacks.onError(a), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
t || (this.callbacks.onError(a instanceof Error ? a : new Error(String(a))), this.callbacks.onLoading(!1));
|
|
1137
|
+
} finally {
|
|
1138
|
+
t || (this.explicitFetchPending = !1);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Change the active section. Resets pagination, filters, sort, and
|
|
1143
|
+
* performs a full (non-silent) fetch.
|
|
1144
|
+
*/
|
|
1145
|
+
setSection(t) {
|
|
1146
|
+
this.section !== t && (this.section = t, this.page = 1, this.search = void 0, this.sort = void 0, this.sortDir = void 0, this.filters = void 0, this.hasFetched = !1, this.callbacks.onData(null), this.callbacks.onPagination(null), this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetch(!1), this.startRefreshTimer());
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Navigate to a specific page. Triggers a non-silent fetch.
|
|
1150
|
+
*/
|
|
1151
|
+
setPage(t) {
|
|
1152
|
+
this.page = t, this.fetch(!1);
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Update the search query. Resets to page 1. Triggers a non-silent fetch.
|
|
1156
|
+
*/
|
|
1157
|
+
setSearch(t) {
|
|
1158
|
+
this.search = t || void 0, this.page = 1, this.fetch(!1);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Set a filter key-value pair. Resets to page 1. Triggers a non-silent fetch.
|
|
1162
|
+
*/
|
|
1163
|
+
setFilter(t, r) {
|
|
1164
|
+
this.filters || (this.filters = {}), this.filters[t] = String(r), this.page = 1, this.fetch(!1);
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Update sort column and direction. Triggers a non-silent fetch.
|
|
1168
|
+
*
|
|
1169
|
+
* If the same column is passed without a direction, toggles asc/desc.
|
|
1170
|
+
*/
|
|
1171
|
+
setSort(t, r) {
|
|
1172
|
+
this.sort === t && !r ? this.sortDir = this.sortDir === "asc" ? "desc" : "asc" : (this.sort = t, this.sortDir = r || "desc"), this.fetch(!1);
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Update the time range. Triggers a non-silent fetch.
|
|
1176
|
+
*/
|
|
1177
|
+
setTimeRange(t) {
|
|
1178
|
+
this.timeRange = t, this.fetch(!1);
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Execute a mutation (POST/DELETE) against the dashboard API,
|
|
1182
|
+
* then silently refresh the current data.
|
|
1183
|
+
*/
|
|
1184
|
+
async mutate(t, r = "post", n) {
|
|
1185
|
+
const i = `${this.endpoint}/${t}`;
|
|
1186
|
+
try {
|
|
1187
|
+
const s = r === "post" ? await this.client.post(i, n) : await this.client.delete(i);
|
|
1188
|
+
return await this.fetch(!0), s;
|
|
1189
|
+
} catch (s) {
|
|
1190
|
+
throw s instanceof Error ? s : new Error(String(s));
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Bulk-update query parameters without triggering a fetch.
|
|
1195
|
+
*
|
|
1196
|
+
* Used by props-driven frameworks (React) where the host component
|
|
1197
|
+
* controls pagination/search/sort state externally and passes it in
|
|
1198
|
+
* as props on each render cycle.
|
|
1199
|
+
*/
|
|
1200
|
+
configure(t) {
|
|
1201
|
+
t.page !== void 0 && (this.page = t.page), t.perPage !== void 0 && (this.perPage = t.perPage), this.search = t.search, this.sort = t.sort, this.sortDir = t.sortDir, this.filters = t.filters, this.timeRange = t.timeRange;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Whether data has been fetched at least once.
|
|
1205
|
+
*/
|
|
1206
|
+
hasData() {
|
|
1207
|
+
return this.hasFetched;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Handle an external signal (e.g. SSE refreshKey) by performing
|
|
1211
|
+
* a silent refresh if data has already been fetched once.
|
|
1212
|
+
*/
|
|
1213
|
+
handleRefreshSignal() {
|
|
1214
|
+
this.hasFetched && this.fetch(!0);
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Get the underlying `DashboardApi` instance for direct API calls.
|
|
1218
|
+
*/
|
|
1219
|
+
getApi() {
|
|
1220
|
+
return this.api;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Get the underlying `ApiClient` instance.
|
|
1224
|
+
*/
|
|
1225
|
+
getClient() {
|
|
1226
|
+
return this.client;
|
|
1227
|
+
}
|
|
1228
|
+
// -- Timer management (private) -------------------------------------------
|
|
1229
|
+
startRefreshTimer() {
|
|
1230
|
+
this.stopRefreshTimer();
|
|
1231
|
+
const t = this.section === "overview" ? j : G;
|
|
1232
|
+
this.timer = setInterval(() => this.fetch(!0), t);
|
|
1233
|
+
}
|
|
1234
|
+
stopRefreshTimer() {
|
|
1235
|
+
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
const st = {
|
|
1239
|
+
// ---------------------------------------------------------------------------
|
|
1240
|
+
// Debug-panel tabs / Dashboard sidebar sections (shared)
|
|
1241
|
+
// ---------------------------------------------------------------------------
|
|
1242
|
+
queries: {
|
|
1243
|
+
viewBox: "0 0 24 24",
|
|
1244
|
+
elements: [
|
|
1245
|
+
'<ellipse cx="12" cy="5" rx="9" ry="3"/>',
|
|
1246
|
+
'<path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>',
|
|
1247
|
+
'<path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>'
|
|
1248
|
+
]
|
|
1249
|
+
},
|
|
1250
|
+
events: {
|
|
1251
|
+
viewBox: "0 0 24 24",
|
|
1252
|
+
elements: ['<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>']
|
|
1253
|
+
},
|
|
1254
|
+
emails: {
|
|
1255
|
+
viewBox: "0 0 24 24",
|
|
1256
|
+
elements: [
|
|
1257
|
+
'<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>',
|
|
1258
|
+
'<polyline points="22,6 12,13 2,6"/>'
|
|
1259
|
+
]
|
|
1260
|
+
},
|
|
1261
|
+
routes: {
|
|
1262
|
+
viewBox: "0 0 24 24",
|
|
1263
|
+
elements: [
|
|
1264
|
+
'<circle cx="12" cy="12" r="10"/>',
|
|
1265
|
+
'<line x1="2" y1="12" x2="22" y2="12"/>',
|
|
1266
|
+
'<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>'
|
|
1267
|
+
]
|
|
1268
|
+
},
|
|
1269
|
+
logs: {
|
|
1270
|
+
viewBox: "0 0 24 24",
|
|
1271
|
+
elements: [
|
|
1272
|
+
'<line x1="8" y1="6" x2="21" y2="6"/>',
|
|
1273
|
+
'<line x1="8" y1="12" x2="21" y2="12"/>',
|
|
1274
|
+
'<line x1="8" y1="18" x2="21" y2="18"/>',
|
|
1275
|
+
'<line x1="3" y1="6" x2="3.01" y2="6"/>',
|
|
1276
|
+
'<line x1="3" y1="12" x2="3.01" y2="12"/>',
|
|
1277
|
+
'<line x1="3" y1="18" x2="3.01" y2="18"/>'
|
|
1278
|
+
]
|
|
1279
|
+
},
|
|
1280
|
+
timeline: {
|
|
1281
|
+
viewBox: "0 0 24 24",
|
|
1282
|
+
elements: ['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']
|
|
1283
|
+
},
|
|
1284
|
+
cache: {
|
|
1285
|
+
viewBox: "0 0 24 24",
|
|
1286
|
+
elements: [
|
|
1287
|
+
'<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>',
|
|
1288
|
+
'<rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>',
|
|
1289
|
+
'<line x1="6" y1="6" x2="6.01" y2="6"/>',
|
|
1290
|
+
'<line x1="6" y1="18" x2="6.01" y2="18"/>'
|
|
1291
|
+
]
|
|
1292
|
+
},
|
|
1293
|
+
jobs: {
|
|
1294
|
+
viewBox: "0 0 24 24",
|
|
1295
|
+
elements: [
|
|
1296
|
+
'<rect x="2" y="7" width="20" height="14" rx="2" ry="2"/>',
|
|
1297
|
+
'<path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>'
|
|
1298
|
+
]
|
|
1299
|
+
},
|
|
1300
|
+
config: {
|
|
1301
|
+
viewBox: "0 0 24 24",
|
|
1302
|
+
elements: [
|
|
1303
|
+
'<circle cx="12" cy="12" r="3"/>',
|
|
1304
|
+
'<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>'
|
|
1305
|
+
]
|
|
1306
|
+
},
|
|
1307
|
+
internals: {
|
|
1308
|
+
viewBox: "0 0 24 24",
|
|
1309
|
+
elements: [
|
|
1310
|
+
'<rect x="4" y="4" width="16" height="16" rx="2"/>',
|
|
1311
|
+
'<rect x="9" y="9" width="6" height="6"/>',
|
|
1312
|
+
'<line x1="9" y1="1" x2="9" y2="4"/>',
|
|
1313
|
+
'<line x1="15" y1="1" x2="15" y2="4"/>',
|
|
1314
|
+
'<line x1="9" y1="20" x2="9" y2="23"/>',
|
|
1315
|
+
'<line x1="15" y1="20" x2="15" y2="23"/>',
|
|
1316
|
+
'<line x1="20" y1="9" x2="23" y2="9"/>',
|
|
1317
|
+
'<line x1="20" y1="14" x2="23" y2="14"/>',
|
|
1318
|
+
'<line x1="1" y1="9" x2="4" y2="9"/>',
|
|
1319
|
+
'<line x1="1" y1="14" x2="4" y2="14"/>'
|
|
1320
|
+
]
|
|
1321
|
+
},
|
|
1322
|
+
// ---------------------------------------------------------------------------
|
|
1323
|
+
// Dashboard-only sidebar sections
|
|
1324
|
+
// ---------------------------------------------------------------------------
|
|
1325
|
+
/** Overview grid (4 equal squares). */
|
|
1326
|
+
overview: {
|
|
1327
|
+
viewBox: "0 0 24 24",
|
|
1328
|
+
elements: [
|
|
1329
|
+
'<rect x="3" y="3" width="7" height="7"/>',
|
|
1330
|
+
'<rect x="14" y="3" width="7" height="7"/>',
|
|
1331
|
+
'<rect x="14" y="14" width="7" height="7"/>',
|
|
1332
|
+
'<rect x="3" y="14" width="7" height="7"/>'
|
|
1333
|
+
]
|
|
1334
|
+
},
|
|
1335
|
+
/** Requests activity line (same shape as debug-panel timeline). */
|
|
1336
|
+
requests: {
|
|
1337
|
+
viewBox: "0 0 24 24",
|
|
1338
|
+
elements: ['<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>']
|
|
1339
|
+
},
|
|
1340
|
+
/**
|
|
1341
|
+
* Dashboard timeline -- clock face variant used in the sidebar.
|
|
1342
|
+
* Distinct from the debug-panel `timeline` (activity line).
|
|
1343
|
+
*/
|
|
1344
|
+
"dashboard-timeline": {
|
|
1345
|
+
viewBox: "0 0 24 24",
|
|
1346
|
+
elements: ['<circle cx="12" cy="12" r="10"/>', '<polyline points="12 6 12 12 16 14"/>']
|
|
1347
|
+
},
|
|
1348
|
+
/** Custom pane placeholder (sidebar layout). */
|
|
1349
|
+
"custom-pane": {
|
|
1350
|
+
viewBox: "0 0 24 24",
|
|
1351
|
+
elements: ['<rect x="3" y="3" width="18" height="18" rx="2"/>', '<path d="M9 3v18"/>']
|
|
1352
|
+
},
|
|
1353
|
+
// ---------------------------------------------------------------------------
|
|
1354
|
+
// Toolbar / utility icons
|
|
1355
|
+
// ---------------------------------------------------------------------------
|
|
1356
|
+
/** Wrench icon for debug panel toggle. */
|
|
1357
|
+
wrench: {
|
|
1358
|
+
viewBox: "0 0 24 24",
|
|
1359
|
+
elements: [
|
|
1360
|
+
'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>'
|
|
1361
|
+
]
|
|
1362
|
+
},
|
|
1363
|
+
/** External link (open in new window). */
|
|
1364
|
+
"external-link": {
|
|
1365
|
+
viewBox: "0 0 24 24",
|
|
1366
|
+
elements: [
|
|
1367
|
+
'<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
|
|
1368
|
+
'<polyline points="15 3 21 3 21 9"/>',
|
|
1369
|
+
'<line x1="10" y1="14" x2="21" y2="3"/>'
|
|
1370
|
+
]
|
|
1371
|
+
},
|
|
1372
|
+
/** Sun icon (light theme indicator). */
|
|
1373
|
+
sun: {
|
|
1374
|
+
viewBox: "0 0 24 24",
|
|
1375
|
+
elements: [
|
|
1376
|
+
'<circle cx="12" cy="12" r="5"/>',
|
|
1377
|
+
'<line x1="12" y1="1" x2="12" y2="3"/>',
|
|
1378
|
+
'<line x1="12" y1="21" x2="12" y2="23"/>',
|
|
1379
|
+
'<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>',
|
|
1380
|
+
'<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>',
|
|
1381
|
+
'<line x1="1" y1="12" x2="3" y2="12"/>',
|
|
1382
|
+
'<line x1="21" y1="12" x2="23" y2="12"/>',
|
|
1383
|
+
'<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>',
|
|
1384
|
+
'<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>'
|
|
1385
|
+
]
|
|
1386
|
+
},
|
|
1387
|
+
/** Moon icon (dark theme indicator). */
|
|
1388
|
+
moon: {
|
|
1389
|
+
viewBox: "0 0 24 24",
|
|
1390
|
+
elements: ['<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>']
|
|
1391
|
+
},
|
|
1392
|
+
/** Search / magnifying glass. */
|
|
1393
|
+
search: {
|
|
1394
|
+
viewBox: "0 0 24 24",
|
|
1395
|
+
elements: ['<circle cx="11" cy="11" r="8"/>', '<line x1="21" y1="21" x2="16.65" y2="16.65"/>']
|
|
1396
|
+
},
|
|
1397
|
+
/** Eye icon (reveal / show). */
|
|
1398
|
+
eye: {
|
|
1399
|
+
viewBox: "0 0 24 24",
|
|
1400
|
+
elements: [
|
|
1401
|
+
'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>',
|
|
1402
|
+
'<circle cx="12" cy="12" r="3"/>'
|
|
1403
|
+
]
|
|
1404
|
+
},
|
|
1405
|
+
/** Eye-off icon (hide / conceal). */
|
|
1406
|
+
"eye-off": {
|
|
1407
|
+
viewBox: "0 0 24 24",
|
|
1408
|
+
elements: [
|
|
1409
|
+
'<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/>',
|
|
1410
|
+
'<path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/>',
|
|
1411
|
+
'<line x1="1" y1="1" x2="23" y2="23"/>',
|
|
1412
|
+
'<path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/>'
|
|
1413
|
+
]
|
|
1414
|
+
},
|
|
1415
|
+
/** Chevron right (expand / next). */
|
|
1416
|
+
"chevron-right": {
|
|
1417
|
+
viewBox: "0 0 24 24",
|
|
1418
|
+
elements: ['<path d="M9 18l6-6-6-6"/>']
|
|
1419
|
+
},
|
|
1420
|
+
/** Chevron left (collapse / previous). */
|
|
1421
|
+
"chevron-left": {
|
|
1422
|
+
viewBox: "0 0 24 24",
|
|
1423
|
+
elements: ['<path d="M15 18l-6-6 6-6"/>']
|
|
1424
|
+
},
|
|
1425
|
+
/** Small external link for debug-panel "view in dashboard" links. */
|
|
1426
|
+
"open-external": {
|
|
1427
|
+
viewBox: "0 0 16 16",
|
|
1428
|
+
elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
|
|
1429
|
+
}
|
|
1430
|
+
}, me = "ss-col-resize", L = "ss-resizing";
|
|
1431
|
+
function it(e) {
|
|
1432
|
+
const t = Array.from(e.querySelectorAll("thead th"));
|
|
1433
|
+
if (t.length === 0) return () => {
|
|
1434
|
+
};
|
|
1435
|
+
const r = [];
|
|
1436
|
+
let n = !1;
|
|
1437
|
+
function i() {
|
|
1438
|
+
if (!n) {
|
|
1439
|
+
n = !0;
|
|
1440
|
+
for (const s of t)
|
|
1441
|
+
s.style.width = s.offsetWidth + "px";
|
|
1442
|
+
e.style.tableLayout = "fixed";
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
for (const s of t) {
|
|
1446
|
+
let o = function(l) {
|
|
1447
|
+
l.preventDefault(), l.stopPropagation(), i();
|
|
1448
|
+
const g = l.clientX, y = s.offsetWidth;
|
|
1449
|
+
a.classList.add(L), a.setPointerCapture(l.pointerId);
|
|
1450
|
+
function h(u) {
|
|
1451
|
+
const v = u.clientX - g, T = Math.max(30, y + v);
|
|
1452
|
+
s.style.width = T + "px";
|
|
1453
|
+
}
|
|
1454
|
+
function p() {
|
|
1455
|
+
a.classList.remove(L), a.removeEventListener("pointermove", h), a.removeEventListener("pointerup", p);
|
|
1456
|
+
}
|
|
1457
|
+
a.addEventListener("pointermove", h), a.addEventListener("pointerup", p);
|
|
1458
|
+
};
|
|
1459
|
+
if (!s.textContent?.trim()) continue;
|
|
1460
|
+
const a = document.createElement("div");
|
|
1461
|
+
a.className = me, s.appendChild(a), a.addEventListener("pointerdown", o), r.push(() => {
|
|
1462
|
+
a.removeEventListener("pointerdown", o), a.remove();
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
return () => {
|
|
1466
|
+
for (const s of r) s();
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
class ot {
|
|
1470
|
+
client;
|
|
1471
|
+
endpoint;
|
|
1472
|
+
refreshInterval;
|
|
1473
|
+
callbacks;
|
|
1474
|
+
timer = null;
|
|
1475
|
+
currentTab = null;
|
|
1476
|
+
fetchOnceCache = {};
|
|
1477
|
+
constructor(t) {
|
|
1478
|
+
this.client = new w({
|
|
1479
|
+
baseUrl: t.baseUrl,
|
|
1480
|
+
authToken: t.authToken
|
|
1481
|
+
}), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? J, this.callbacks = {
|
|
1482
|
+
onData: t.onData,
|
|
1483
|
+
onLoading: t.onLoading,
|
|
1484
|
+
onError: t.onError,
|
|
1485
|
+
onUnauthorized: t.onUnauthorized
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
// -------------------------------------------------------------------------
|
|
1489
|
+
// Public API
|
|
1490
|
+
// -------------------------------------------------------------------------
|
|
1491
|
+
/**
|
|
1492
|
+
* Begin fetching data for `tab` and start the auto-refresh timer.
|
|
1493
|
+
*
|
|
1494
|
+
* If a timer is already running it will be stopped first.
|
|
1495
|
+
*/
|
|
1496
|
+
start(t) {
|
|
1497
|
+
this.stop(), this.currentTab = t, this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetchData(), this.timer = setInterval(() => this.fetchData(), this.refreshInterval);
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Stop the auto-refresh timer.
|
|
1501
|
+
*/
|
|
1502
|
+
stop() {
|
|
1503
|
+
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* Switch to a different tab.
|
|
1507
|
+
*
|
|
1508
|
+
* Stops the current timer, resets loading/error state, and starts
|
|
1509
|
+
* fetching for the new tab.
|
|
1510
|
+
*/
|
|
1511
|
+
switchTab(t) {
|
|
1512
|
+
this.start(t);
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* Force an immediate re-fetch of the current tab (ignoring the
|
|
1516
|
+
* fetchOnce cache).
|
|
1517
|
+
*/
|
|
1518
|
+
refresh() {
|
|
1519
|
+
this.currentTab && this.fetchData();
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Fetch a custom pane endpoint. Optionally honours the fetchOnce
|
|
1523
|
+
* cache so a pane that has already been loaded is not re-requested.
|
|
1524
|
+
*/
|
|
1525
|
+
async fetchCustomPane(t, r = !1) {
|
|
1526
|
+
if (r && this.fetchOnceCache[t] !== void 0) {
|
|
1527
|
+
this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1);
|
|
1528
|
+
return;
|
|
1529
|
+
}
|
|
1530
|
+
this.callbacks.onLoading(!0);
|
|
1531
|
+
try {
|
|
1532
|
+
const n = await this.client.fetch(t);
|
|
1533
|
+
this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[t] = n);
|
|
1534
|
+
} catch (n) {
|
|
1535
|
+
if (n instanceof b) {
|
|
1536
|
+
this.callbacks.onUnauthorized(n);
|
|
1537
|
+
return;
|
|
1538
|
+
}
|
|
1539
|
+
this.callbacks.onError(n instanceof Error ? n : new Error(String(n)));
|
|
1540
|
+
} finally {
|
|
1541
|
+
this.callbacks.onLoading(!1);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Store a value in the fetchOnce cache for a given tab name.
|
|
1546
|
+
* Subsequent `start()` / `switchTab()` calls for this tab will
|
|
1547
|
+
* serve the cached value instead of hitting the network.
|
|
1548
|
+
*/
|
|
1549
|
+
cacheForTab(t, r) {
|
|
1550
|
+
this.fetchOnceCache[t] = r;
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Clear all cached fetchOnce data.
|
|
1554
|
+
*/
|
|
1555
|
+
clearCache() {
|
|
1556
|
+
this.fetchOnceCache = {};
|
|
1557
|
+
}
|
|
1558
|
+
// -------------------------------------------------------------------------
|
|
1559
|
+
// Internal
|
|
1560
|
+
// -------------------------------------------------------------------------
|
|
1561
|
+
async fetchData() {
|
|
1562
|
+
const t = this.currentTab;
|
|
1563
|
+
if (t) {
|
|
1564
|
+
if (this.fetchOnceCache[t] !== void 0) {
|
|
1565
|
+
this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1);
|
|
1566
|
+
return;
|
|
1567
|
+
}
|
|
1568
|
+
try {
|
|
1569
|
+
const r = `${this.endpoint}${he(t)}`, n = await this.client.fetch(r);
|
|
1570
|
+
this.callbacks.onData(n), this.callbacks.onError(null), this.callbacks.onLoading(!1);
|
|
1571
|
+
} catch (r) {
|
|
1572
|
+
if (r instanceof b) {
|
|
1573
|
+
this.callbacks.onError(r), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(r);
|
|
1574
|
+
return;
|
|
1575
|
+
}
|
|
1576
|
+
this.callbacks.onError(r instanceof Error ? r : new Error(String(r))), this.callbacks.onLoading(!1);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
const at = ["all", "error", "warn", "info", "debug"];
|
|
1582
|
+
function ge(e) {
|
|
1583
|
+
return (e.levelName || e.level_name || (typeof e.level == "string" ? e.level : "") || "info").toLowerCase();
|
|
1584
|
+
}
|
|
1585
|
+
function ct(e) {
|
|
1586
|
+
return e.msg || e.message || JSON.stringify(e);
|
|
1587
|
+
}
|
|
1588
|
+
function lt(e) {
|
|
1589
|
+
return e.createdAt || e.created_at || e.time || e.timestamp || 0;
|
|
1590
|
+
}
|
|
1591
|
+
function ht(e) {
|
|
1592
|
+
const t = e.data || {};
|
|
1593
|
+
return e.requestId || e.request_id || e["x-request-id"] || t.requestId || t.request_id || t["x-request-id"] || "";
|
|
1594
|
+
}
|
|
1595
|
+
function ut(e, t = "ss-dbg-log-level") {
|
|
1596
|
+
switch (e) {
|
|
1597
|
+
case "error":
|
|
1598
|
+
case "fatal":
|
|
1599
|
+
return `${t}-error`;
|
|
1600
|
+
case "warn":
|
|
1601
|
+
return `${t}-warn`;
|
|
1602
|
+
case "info":
|
|
1603
|
+
return `${t}-info`;
|
|
1604
|
+
case "debug":
|
|
1605
|
+
return `${t}-debug`;
|
|
1606
|
+
case "trace":
|
|
1607
|
+
return `${t}-trace`;
|
|
1608
|
+
default:
|
|
1609
|
+
return `${t}-info`;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
function dt(e, t) {
|
|
1613
|
+
return t === "all" ? e : e.filter((r) => {
|
|
1614
|
+
const n = ge(r);
|
|
1615
|
+
return t === "error" ? n === "error" || n === "fatal" : n === t;
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
function ft(e, t) {
|
|
1619
|
+
if (!t) return e;
|
|
1620
|
+
const r = t.toLowerCase();
|
|
1621
|
+
return e.filter(
|
|
1622
|
+
(n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
function pt(e) {
|
|
1626
|
+
const t = {};
|
|
1627
|
+
for (const r of e)
|
|
1628
|
+
t[r.sql] = (t[r.sql] || 0) + 1;
|
|
1629
|
+
return t;
|
|
1630
|
+
}
|
|
1631
|
+
function mt(e, t) {
|
|
1632
|
+
const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length, i = e.length > 0 ? e.reduce((s, o) => s + o.duration, 0) / e.length : 0;
|
|
1633
|
+
return { slowCount: r, dupCount: n, avgDuration: i, totalCount: e.length };
|
|
1634
|
+
}
|
|
1635
|
+
const gt = [
|
|
1636
|
+
"all",
|
|
1637
|
+
"active",
|
|
1638
|
+
"waiting",
|
|
1639
|
+
"delayed",
|
|
1640
|
+
"completed",
|
|
1641
|
+
"failed"
|
|
1642
|
+
];
|
|
1643
|
+
function yt(e, t = "ss-dbg-job-status") {
|
|
1644
|
+
switch (e) {
|
|
1645
|
+
case "completed":
|
|
1646
|
+
case "failed":
|
|
1647
|
+
case "active":
|
|
1648
|
+
case "waiting":
|
|
1649
|
+
case "delayed":
|
|
1650
|
+
return `${t}-${e}`;
|
|
1651
|
+
default:
|
|
1652
|
+
return "ss-dbg-badge-muted";
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
function bt(e) {
|
|
1656
|
+
switch (e) {
|
|
1657
|
+
case "active":
|
|
1658
|
+
return "blue";
|
|
1659
|
+
case "waiting":
|
|
1660
|
+
return "amber";
|
|
1661
|
+
case "delayed":
|
|
1662
|
+
return "purple";
|
|
1663
|
+
case "completed":
|
|
1664
|
+
return "green";
|
|
1665
|
+
case "failed":
|
|
1666
|
+
return "red";
|
|
1667
|
+
default:
|
|
1668
|
+
return "muted";
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
function xt(e) {
|
|
1672
|
+
if (!e) return [];
|
|
1673
|
+
if (Array.isArray(e)) return e;
|
|
1674
|
+
const t = e;
|
|
1675
|
+
return t.jobs || t.data || [];
|
|
1676
|
+
}
|
|
1677
|
+
function St(e) {
|
|
1678
|
+
if (!e || Array.isArray(e)) return null;
|
|
1679
|
+
const t = e;
|
|
1680
|
+
return t.stats || t.overview || null;
|
|
1681
|
+
}
|
|
1682
|
+
function ye(e) {
|
|
1683
|
+
if (!e) return [];
|
|
1684
|
+
if (typeof e == "string")
|
|
1685
|
+
try {
|
|
1686
|
+
return JSON.parse(e);
|
|
1687
|
+
} catch {
|
|
1688
|
+
return [];
|
|
1689
|
+
}
|
|
1690
|
+
return Array.isArray(e) ? e : [];
|
|
1691
|
+
}
|
|
1692
|
+
function be(e) {
|
|
1693
|
+
if (!e) return [];
|
|
1694
|
+
if (typeof e == "string")
|
|
1695
|
+
try {
|
|
1696
|
+
return JSON.parse(e);
|
|
1697
|
+
} catch {
|
|
1698
|
+
return [];
|
|
1699
|
+
}
|
|
1700
|
+
return Array.isArray(e) ? e : [];
|
|
1701
|
+
}
|
|
1702
|
+
function E(e, t, r, n = 0) {
|
|
1703
|
+
return e[t] || e[r] || n;
|
|
1704
|
+
}
|
|
1705
|
+
function wt(e) {
|
|
1706
|
+
return {
|
|
1707
|
+
method: e.method || "",
|
|
1708
|
+
url: e.url || "",
|
|
1709
|
+
statusCode: E(e, "status_code", "statusCode"),
|
|
1710
|
+
totalDuration: E(e, "total_duration", "totalDuration") || e.duration || 0,
|
|
1711
|
+
spanCount: E(e, "span_count", "spanCount"),
|
|
1712
|
+
spans: ye(e.spans),
|
|
1713
|
+
warnings: be(e.warnings)
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
const xe = ["password", "secret", "token", "key", "credential", "auth"];
|
|
1717
|
+
function Se(e) {
|
|
1718
|
+
const t = e.toLowerCase();
|
|
1719
|
+
return xe.some((r) => t.includes(r));
|
|
1720
|
+
}
|
|
1721
|
+
function we(e) {
|
|
1722
|
+
if (e == null) return "-";
|
|
1723
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1724
|
+
return String(e);
|
|
1725
|
+
if (Array.isArray(e)) return e.join(", ") || "-";
|
|
1726
|
+
try {
|
|
1727
|
+
return JSON.stringify(e);
|
|
1728
|
+
} catch {
|
|
1729
|
+
return String(e);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
const ve = {
|
|
1733
|
+
collectionInterval: "Stats Collection",
|
|
1734
|
+
dashboardBroadcast: "Dashboard Broadcast",
|
|
1735
|
+
debugBroadcast: "Debug Broadcast",
|
|
1736
|
+
persistFlush: "Persist Flush",
|
|
1737
|
+
retentionCleanup: "Retention Cleanup"
|
|
1738
|
+
};
|
|
1739
|
+
function vt(e) {
|
|
1740
|
+
return ve[e] || e;
|
|
1741
|
+
}
|
|
1742
|
+
const Te = {
|
|
1743
|
+
prometheus: "Prometheus",
|
|
1744
|
+
pinoHook: "Pino Log Hook",
|
|
1745
|
+
edgePlugin: "Edge Plugin",
|
|
1746
|
+
cacheInspector: "Cache Inspector",
|
|
1747
|
+
queueInspector: "Queue Inspector"
|
|
1748
|
+
};
|
|
1749
|
+
function Tt(e) {
|
|
1750
|
+
return Te[e] || e;
|
|
1751
|
+
}
|
|
1752
|
+
function Et(e) {
|
|
1753
|
+
return "active" in e ? e.active ? "active" : "inactive" : "available" in e ? e.available ? "available" : "unavailable" : "unknown";
|
|
1754
|
+
}
|
|
1755
|
+
function Ct(e, t) {
|
|
1756
|
+
return t.mode ? `Mode: ${t.mode}` : e === "edgePlugin" && t.active ? "@serverStats() tag registered" : e === "cacheInspector" ? t.available ? "Redis dependency detected" : "Redis not installed" : e === "queueInspector" ? t.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
|
|
1757
|
+
}
|
|
1758
|
+
function Mt(e) {
|
|
1759
|
+
return Object.entries(e).map(([t, r]) => ({
|
|
1760
|
+
key: t,
|
|
1761
|
+
value: we(r),
|
|
1762
|
+
secret: Se(t)
|
|
1763
|
+
}));
|
|
1764
|
+
}
|
|
1765
|
+
function Pt(e, t) {
|
|
1766
|
+
return t ? Math.min(100, Math.round(e / t * 100)) : 0;
|
|
1767
|
+
}
|
|
1768
|
+
const Ee = ["healthy", "active", "connected", "available", "ready"], Ce = ["errored", "unavailable"];
|
|
1769
|
+
function kt(e) {
|
|
1770
|
+
return Ee.includes(e) ? "ok" : Ce.includes(e) ? "err" : "";
|
|
1771
|
+
}
|
|
1772
|
+
function m(e) {
|
|
1773
|
+
return e !== null && typeof e == "object" && !Array.isArray(e) && e.__redacted === !0;
|
|
1774
|
+
}
|
|
1775
|
+
function Me(e, t = "") {
|
|
1776
|
+
if (typeof e != "object" || e === null || e === void 0)
|
|
1777
|
+
return [{ path: t, value: e }];
|
|
1778
|
+
if (Array.isArray(e) || m(e))
|
|
1779
|
+
return [{ path: t, value: e }];
|
|
1780
|
+
const r = [];
|
|
1781
|
+
for (const n of Object.keys(e)) {
|
|
1782
|
+
const i = t ? `${t}.${n}` : n, s = e[n];
|
|
1783
|
+
typeof s == "object" && s !== null && !Array.isArray(s) && !m(s) ? r.push(...Me(s, i)) : r.push({ path: i, value: s });
|
|
1784
|
+
}
|
|
1785
|
+
return r;
|
|
1786
|
+
}
|
|
1787
|
+
function $t(e) {
|
|
1788
|
+
return e == null ? { text: "null", color: "var(--ss-dim)" } : typeof e == "boolean" ? {
|
|
1789
|
+
text: String(e),
|
|
1790
|
+
color: e ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
|
|
1791
|
+
} : typeof e == "number" ? { text: String(e), color: "var(--ss-amber-fg)" } : Array.isArray(e) ? { text: `[${e.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof e == "object" ? { text: JSON.stringify(e), color: "var(--ss-dim)" } : { text: String(e) };
|
|
1792
|
+
}
|
|
1793
|
+
function Pe(e) {
|
|
1794
|
+
if (e == null || typeof e != "object" || Array.isArray(e) || m(e))
|
|
1795
|
+
return 1;
|
|
1796
|
+
let t = 0;
|
|
1797
|
+
for (const r of Object.keys(e))
|
|
1798
|
+
t += Pe(e[r]);
|
|
1799
|
+
return t;
|
|
1800
|
+
}
|
|
1801
|
+
function At(e) {
|
|
1802
|
+
if (e == null || typeof e != "object" || Array.isArray(e) || m(e))
|
|
1803
|
+
return [];
|
|
1804
|
+
const t = [];
|
|
1805
|
+
for (const r of Object.keys(e)) {
|
|
1806
|
+
const n = e[r];
|
|
1807
|
+
n !== null && typeof n == "object" && !Array.isArray(n) && !m(n) && t.push(r);
|
|
1808
|
+
}
|
|
1809
|
+
return t;
|
|
1810
|
+
}
|
|
1811
|
+
function Lt(e, t, r) {
|
|
1812
|
+
return !r || e.toLowerCase().includes(r) ? !0 : (m(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
|
|
1813
|
+
}
|
|
1814
|
+
function Rt(e, t, r) {
|
|
1815
|
+
t && navigator.clipboard.writeText(e).then(() => {
|
|
1816
|
+
const n = t.textContent;
|
|
1817
|
+
t.textContent = "✓", t.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
|
|
1818
|
+
t.textContent = n, t.classList.remove(`${r}-copy-row-ok`);
|
|
1819
|
+
}, 1200);
|
|
1820
|
+
}).catch(() => {
|
|
1821
|
+
});
|
|
1822
|
+
}
|
|
1823
|
+
const ke = /* @__PURE__ */ new Set([
|
|
1824
|
+
"secret",
|
|
1825
|
+
"key",
|
|
1826
|
+
"token",
|
|
1827
|
+
"password",
|
|
1828
|
+
"pass",
|
|
1829
|
+
"pwd",
|
|
1830
|
+
"auth",
|
|
1831
|
+
"credential",
|
|
1832
|
+
"credentials",
|
|
1833
|
+
"apikey",
|
|
1834
|
+
"private",
|
|
1835
|
+
"encryption"
|
|
1836
|
+
]);
|
|
1837
|
+
function $e(e) {
|
|
1838
|
+
const t = e.split(/[._-]/), r = [];
|
|
1839
|
+
for (const n of t) {
|
|
1840
|
+
const i = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
|
|
1841
|
+
for (const s of i)
|
|
1842
|
+
s && r.push(s);
|
|
1843
|
+
}
|
|
1844
|
+
return r;
|
|
1845
|
+
}
|
|
1846
|
+
function Ut(e) {
|
|
1847
|
+
return $e(e).some((r) => ke.has(r.toLowerCase()));
|
|
1848
|
+
}
|
|
1849
|
+
const Dt = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
|
|
1850
|
+
export {
|
|
1851
|
+
w as ApiClient,
|
|
1852
|
+
I as ApiError,
|
|
1853
|
+
ue as DASHBOARD_SECTION_PATHS,
|
|
1854
|
+
J as DEBUG_REFRESH_MS,
|
|
1855
|
+
le as DEBUG_TAB_PATHS,
|
|
1856
|
+
ne as DEFAULT_FEATURES,
|
|
1857
|
+
U as DEFAULT_PER_PAGE,
|
|
1858
|
+
pe as DashboardApi,
|
|
1859
|
+
nt as DashboardDataController,
|
|
1860
|
+
ot as DebugDataController,
|
|
1861
|
+
Ce as ERROR_STATUSES,
|
|
1862
|
+
Te as INTEGRATION_LABELS,
|
|
1863
|
+
gt as JOB_STATUS_FILTERS,
|
|
1864
|
+
at as LOG_LEVELS,
|
|
1865
|
+
ae as MAX_HISTORY,
|
|
1866
|
+
P as METRIC_DEFINITIONS,
|
|
1867
|
+
Ee as OK_STATUSES,
|
|
1868
|
+
j as OVERVIEW_REFRESH_MS,
|
|
1869
|
+
Dt as REDACT_PATTERN,
|
|
1870
|
+
G as SECTION_REFRESH_MS,
|
|
1871
|
+
Q as SLOW_DURATION_MS,
|
|
1872
|
+
ce as STALE_MS,
|
|
1873
|
+
rt as ServerStatsController,
|
|
1874
|
+
st as TAB_ICONS,
|
|
1875
|
+
te as THRESHOLD_CSS_CLASS,
|
|
1876
|
+
_e as THRESHOLD_CSS_VAR,
|
|
1877
|
+
Oe as THRESHOLD_HEX_FALLBACK,
|
|
1878
|
+
ve as TIMER_LABELS,
|
|
1879
|
+
b as UnauthorizedError,
|
|
1880
|
+
X as VERY_SLOW_DURATION_MS,
|
|
1881
|
+
re as buildQueryParams,
|
|
1882
|
+
ze as buildQueryString,
|
|
1883
|
+
Re as buildSparklineData,
|
|
1884
|
+
kt as classifyStatus,
|
|
1885
|
+
At as collectTopLevelObjectKeys,
|
|
1886
|
+
A as compactPreview,
|
|
1887
|
+
Je as computePagination,
|
|
1888
|
+
mt as computeQuerySummary,
|
|
1889
|
+
V as computeStats,
|
|
1890
|
+
Rt as copyWithFeedback,
|
|
1891
|
+
pt as countDuplicateQueries,
|
|
1892
|
+
Pe as countLeaves,
|
|
1893
|
+
je as createFilterState,
|
|
1894
|
+
fe as createHistoryBuffer,
|
|
1895
|
+
Ve as createPaginationState,
|
|
1896
|
+
Ge as createSortState,
|
|
1897
|
+
_ as createTransmitSubscription,
|
|
1898
|
+
Xe as detectFeatures,
|
|
1899
|
+
Ze as detectMetricGroupsFromStats,
|
|
1900
|
+
He as durationSeverity,
|
|
1901
|
+
St as extractJobStats,
|
|
1902
|
+
xt as extractJobs,
|
|
1903
|
+
ie as fetchFeatures,
|
|
1904
|
+
Pt as fillPercent,
|
|
1905
|
+
dt as filterLogsByLevel,
|
|
1906
|
+
ft as filterQueries,
|
|
1907
|
+
Me as flattenConfig,
|
|
1908
|
+
M as formatBytes,
|
|
1909
|
+
Ke as formatCacheSize,
|
|
1910
|
+
Mt as formatCollectorConfig,
|
|
1911
|
+
we as formatConfigVal,
|
|
1912
|
+
Z as formatCount,
|
|
1913
|
+
Ue as formatDuration,
|
|
1914
|
+
$t as formatFlatValue,
|
|
1915
|
+
k as formatMb,
|
|
1916
|
+
Ie as formatStatNum,
|
|
1917
|
+
De as formatTime,
|
|
1918
|
+
qe as formatTtl,
|
|
1919
|
+
Y as formatUptime,
|
|
1920
|
+
W as generateGradientId,
|
|
1921
|
+
K as generateSparklinePath,
|
|
1922
|
+
q as generateSparklinePoints,
|
|
1923
|
+
de as getDashboardSectionPath,
|
|
1924
|
+
he as getDebugTabPath,
|
|
1925
|
+
Ct as getIntegrationDetails,
|
|
1926
|
+
Tt as getIntegrationLabel,
|
|
1927
|
+
Et as getIntegrationStatus,
|
|
1928
|
+
bt as getJobStatusBadgeColor,
|
|
1929
|
+
yt as getJobStatusCssClass,
|
|
1930
|
+
ut as getLogLevelCssClass,
|
|
1931
|
+
et as getMetricById,
|
|
1932
|
+
tt as getMetricsByGroup,
|
|
1933
|
+
Qe as getPageNumbers,
|
|
1934
|
+
$ as getRatioColor,
|
|
1935
|
+
R as getTheme,
|
|
1936
|
+
x as getThresholdColor,
|
|
1937
|
+
ee as getThresholdColorInverse,
|
|
1938
|
+
vt as getTimerLabel,
|
|
1939
|
+
Ye as getVisibleMetricGroups,
|
|
1940
|
+
it as initResizableColumns,
|
|
1941
|
+
m as isRedactedValue,
|
|
1942
|
+
Se as isSecretKey,
|
|
1943
|
+
Lt as matchesConfigSearch,
|
|
1944
|
+
wt as normalizeTraceFields,
|
|
1945
|
+
Le as onThemeChange,
|
|
1946
|
+
We as parsePaginatedResponse,
|
|
1947
|
+
ye as parseTraceSpans,
|
|
1948
|
+
be as parseTraceWarnings,
|
|
1949
|
+
ge as resolveLogLevel,
|
|
1950
|
+
ct as resolveLogMessage,
|
|
1951
|
+
ht as resolveLogRequestId,
|
|
1952
|
+
lt as resolveLogTimestamp,
|
|
1953
|
+
E as resolveTraceField,
|
|
1954
|
+
H as setTheme,
|
|
1955
|
+
Ne as shortReqId,
|
|
1956
|
+
Ut as shouldRedact,
|
|
1957
|
+
Be as statusColor,
|
|
1958
|
+
B as subscribeToChannel,
|
|
1959
|
+
Fe as timeAgo,
|
|
1960
|
+
Ae as toggleTheme
|
|
1961
|
+
};
|