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
|
@@ -1,24 +1,381 @@
|
|
|
1
|
+
import { bold, dim } from './utils/logger.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve `toolbar`, `dashboard`, and `advanced` aliases into a
|
|
4
|
+
* {@link DevToolbarOptions} object, merging with any existing
|
|
5
|
+
* `devToolbar` settings the user provided.
|
|
6
|
+
*/
|
|
7
|
+
function resolveToolbarAliases(config, existing) {
|
|
8
|
+
const toolbar = config.toolbar;
|
|
9
|
+
const dashboard = config.dashboard;
|
|
10
|
+
const advanced = config.advanced;
|
|
11
|
+
// Start from existing devToolbar or a new object
|
|
12
|
+
const result = { ...existing, enabled: existing?.enabled ?? false };
|
|
13
|
+
// toolbar: true | ToolbarConfig enables the toolbar
|
|
14
|
+
if (toolbar === true) {
|
|
15
|
+
result.enabled = true;
|
|
16
|
+
}
|
|
17
|
+
else if (toolbar && typeof toolbar === 'object') {
|
|
18
|
+
result.enabled = true;
|
|
19
|
+
if (toolbar.slowQueryThreshold !== undefined)
|
|
20
|
+
result.slowQueryThresholdMs = toolbar.slowQueryThreshold;
|
|
21
|
+
if (toolbar.tracing !== undefined)
|
|
22
|
+
result.tracing = toolbar.tracing;
|
|
23
|
+
if (toolbar.persist !== undefined)
|
|
24
|
+
result.persistDebugData = toolbar.persist;
|
|
25
|
+
if (toolbar.panes !== undefined)
|
|
26
|
+
result.panes = toolbar.panes;
|
|
27
|
+
if (toolbar.excludeFromTracing !== undefined)
|
|
28
|
+
result.excludeFromTracing = toolbar.excludeFromTracing;
|
|
29
|
+
}
|
|
30
|
+
else if (toolbar === false) {
|
|
31
|
+
result.enabled = false;
|
|
32
|
+
}
|
|
33
|
+
// dashboard: true | DashboardConfig
|
|
34
|
+
if (dashboard === true) {
|
|
35
|
+
result.enabled = true; // dashboard implies toolbar enabled
|
|
36
|
+
result.dashboard = true;
|
|
37
|
+
}
|
|
38
|
+
else if (dashboard && typeof dashboard === 'object') {
|
|
39
|
+
result.enabled = true;
|
|
40
|
+
result.dashboard = true;
|
|
41
|
+
if (dashboard.path !== undefined)
|
|
42
|
+
result.dashboardPath = dashboard.path;
|
|
43
|
+
if (dashboard.retentionDays !== undefined)
|
|
44
|
+
result.retentionDays = dashboard.retentionDays;
|
|
45
|
+
}
|
|
46
|
+
// advanced options
|
|
47
|
+
if (advanced) {
|
|
48
|
+
if (advanced.debugEndpoint !== undefined)
|
|
49
|
+
result.debugEndpoint = advanced.debugEndpoint;
|
|
50
|
+
if (advanced.renderer !== undefined)
|
|
51
|
+
result.renderer = advanced.renderer;
|
|
52
|
+
if (advanced.dbPath !== undefined)
|
|
53
|
+
result.dbPath = advanced.dbPath;
|
|
54
|
+
if (advanced.persistPath !== undefined) {
|
|
55
|
+
result.persistDebugData = advanced.persistPath;
|
|
56
|
+
}
|
|
57
|
+
if (advanced.maxQueries !== undefined)
|
|
58
|
+
result.maxQueries = advanced.maxQueries;
|
|
59
|
+
if (advanced.maxEvents !== undefined)
|
|
60
|
+
result.maxEvents = advanced.maxEvents;
|
|
61
|
+
if (advanced.maxEmails !== undefined)
|
|
62
|
+
result.maxEmails = advanced.maxEmails;
|
|
63
|
+
if (advanced.maxTraces !== undefined)
|
|
64
|
+
result.maxTraces = advanced.maxTraces;
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build a concrete migration hint for `devToolbar` based on which sub-fields
|
|
70
|
+
* the user actually configured. The result splits `devToolbar` into the new
|
|
71
|
+
* `toolbar`, `dashboard`, and `advanced` config sections.
|
|
72
|
+
*/
|
|
73
|
+
function buildDevToolbarMigration(dt) {
|
|
74
|
+
const beforeParts = [];
|
|
75
|
+
const afterParts = [];
|
|
76
|
+
// Reconstruct a readable "before" snapshot
|
|
77
|
+
beforeParts.push('devToolbar: {');
|
|
78
|
+
if (dt.enabled !== undefined)
|
|
79
|
+
beforeParts.push(` enabled: ${dt.enabled},`);
|
|
80
|
+
if (dt.dashboard !== undefined)
|
|
81
|
+
beforeParts.push(` dashboard: ${dt.dashboard},`);
|
|
82
|
+
if (dt.dashboardPath !== undefined)
|
|
83
|
+
beforeParts.push(` dashboardPath: '${dt.dashboardPath}',`);
|
|
84
|
+
if (dt.retentionDays !== undefined)
|
|
85
|
+
beforeParts.push(` retentionDays: ${dt.retentionDays},`);
|
|
86
|
+
if (dt.slowQueryThresholdMs !== undefined)
|
|
87
|
+
beforeParts.push(` slowQueryThresholdMs: ${dt.slowQueryThresholdMs},`);
|
|
88
|
+
if (dt.tracing !== undefined)
|
|
89
|
+
beforeParts.push(` tracing: ${dt.tracing},`);
|
|
90
|
+
if (dt.persistDebugData !== undefined)
|
|
91
|
+
beforeParts.push(` persistDebugData: ${JSON.stringify(dt.persistDebugData)},`);
|
|
92
|
+
if (dt.maxQueries !== undefined)
|
|
93
|
+
beforeParts.push(` maxQueries: ${dt.maxQueries},`);
|
|
94
|
+
if (dt.maxEvents !== undefined)
|
|
95
|
+
beforeParts.push(` maxEvents: ${dt.maxEvents},`);
|
|
96
|
+
if (dt.maxEmails !== undefined)
|
|
97
|
+
beforeParts.push(` maxEmails: ${dt.maxEmails},`);
|
|
98
|
+
if (dt.maxTraces !== undefined)
|
|
99
|
+
beforeParts.push(` maxTraces: ${dt.maxTraces},`);
|
|
100
|
+
if (dt.renderer !== undefined)
|
|
101
|
+
beforeParts.push(` renderer: '${dt.renderer}',`);
|
|
102
|
+
if (dt.panes !== undefined)
|
|
103
|
+
beforeParts.push(` panes: [...],`);
|
|
104
|
+
if (dt.excludeFromTracing !== undefined)
|
|
105
|
+
beforeParts.push(` excludeFromTracing: [...],`);
|
|
106
|
+
if (dt.debugEndpoint !== undefined)
|
|
107
|
+
beforeParts.push(` debugEndpoint: '${dt.debugEndpoint}',`);
|
|
108
|
+
if (dt.dbPath !== undefined)
|
|
109
|
+
beforeParts.push(` dbPath: '${dt.dbPath}',`);
|
|
110
|
+
beforeParts.push('}');
|
|
111
|
+
// -- toolbar --
|
|
112
|
+
const hasSlowQuery = dt.slowQueryThresholdMs !== undefined;
|
|
113
|
+
const hasTracing = dt.tracing !== undefined;
|
|
114
|
+
const hasPersist = dt.persistDebugData !== undefined;
|
|
115
|
+
const hasPanes = dt.panes !== undefined;
|
|
116
|
+
const hasExclude = dt.excludeFromTracing !== undefined;
|
|
117
|
+
const hasToolbarDetails = hasSlowQuery || hasTracing || hasPersist || hasPanes || hasExclude;
|
|
118
|
+
if (dt.enabled && hasToolbarDetails) {
|
|
119
|
+
const parts = [];
|
|
120
|
+
if (hasSlowQuery)
|
|
121
|
+
parts.push(` slowQueryThreshold: ${dt.slowQueryThresholdMs},`);
|
|
122
|
+
if (hasTracing)
|
|
123
|
+
parts.push(` tracing: ${dt.tracing},`);
|
|
124
|
+
if (hasPersist)
|
|
125
|
+
parts.push(` persist: ${JSON.stringify(dt.persistDebugData)},`);
|
|
126
|
+
if (hasPanes)
|
|
127
|
+
parts.push(` panes: [...],`);
|
|
128
|
+
if (hasExclude)
|
|
129
|
+
parts.push(` excludeFromTracing: [...],`);
|
|
130
|
+
afterParts.push('toolbar: {');
|
|
131
|
+
afterParts.push(...parts);
|
|
132
|
+
afterParts.push('}');
|
|
133
|
+
}
|
|
134
|
+
else if (dt.enabled) {
|
|
135
|
+
afterParts.push('toolbar: true');
|
|
136
|
+
}
|
|
137
|
+
// -- dashboard --
|
|
138
|
+
const hasCustomPath = dt.dashboardPath !== undefined;
|
|
139
|
+
const hasRetention = dt.retentionDays !== undefined;
|
|
140
|
+
const hasDashboardDetails = hasCustomPath || hasRetention;
|
|
141
|
+
if (dt.dashboard && hasDashboardDetails) {
|
|
142
|
+
const parts = [];
|
|
143
|
+
if (hasCustomPath)
|
|
144
|
+
parts.push(` path: '${dt.dashboardPath}',`);
|
|
145
|
+
if (hasRetention)
|
|
146
|
+
parts.push(` retentionDays: ${dt.retentionDays},`);
|
|
147
|
+
afterParts.push('dashboard: {');
|
|
148
|
+
afterParts.push(...parts);
|
|
149
|
+
afterParts.push('}');
|
|
150
|
+
}
|
|
151
|
+
else if (dt.dashboard) {
|
|
152
|
+
afterParts.push('dashboard: true');
|
|
153
|
+
}
|
|
154
|
+
// -- advanced --
|
|
155
|
+
const advancedParts = [];
|
|
156
|
+
if (dt.maxQueries !== undefined)
|
|
157
|
+
advancedParts.push(` maxQueries: ${dt.maxQueries},`);
|
|
158
|
+
if (dt.maxEvents !== undefined)
|
|
159
|
+
advancedParts.push(` maxEvents: ${dt.maxEvents},`);
|
|
160
|
+
if (dt.maxEmails !== undefined)
|
|
161
|
+
advancedParts.push(` maxEmails: ${dt.maxEmails},`);
|
|
162
|
+
if (dt.maxTraces !== undefined)
|
|
163
|
+
advancedParts.push(` maxTraces: ${dt.maxTraces},`);
|
|
164
|
+
if (dt.renderer !== undefined)
|
|
165
|
+
advancedParts.push(` renderer: '${dt.renderer}',`);
|
|
166
|
+
if (dt.debugEndpoint !== undefined)
|
|
167
|
+
advancedParts.push(` debugEndpoint: '${dt.debugEndpoint}',`);
|
|
168
|
+
if (dt.dbPath !== undefined)
|
|
169
|
+
advancedParts.push(` dbPath: '${dt.dbPath}',`);
|
|
170
|
+
if (advancedParts.length > 0) {
|
|
171
|
+
afterParts.push('advanced: {');
|
|
172
|
+
afterParts.push(...advancedParts);
|
|
173
|
+
afterParts.push('}');
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
old: 'devToolbar',
|
|
177
|
+
new: [
|
|
178
|
+
dt.enabled !== undefined ? 'toolbar' : '',
|
|
179
|
+
dt.dashboard ? 'dashboard' : '',
|
|
180
|
+
advancedParts.length > 0 ? 'advanced' : '',
|
|
181
|
+
]
|
|
182
|
+
.filter(Boolean)
|
|
183
|
+
.join(' + ') || 'toolbar + dashboard + advanced',
|
|
184
|
+
before: beforeParts,
|
|
185
|
+
after: afterParts,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Detect deprecated config names and log a single grouped warning block.
|
|
190
|
+
*
|
|
191
|
+
* Only warns for fields the user **actually set** (not undefined).
|
|
192
|
+
* The output is designed to be immediately actionable: each deprecated
|
|
193
|
+
* field gets a before/after code snippet so users can copy-paste.
|
|
194
|
+
*/
|
|
195
|
+
function logDeprecationWarnings(config) {
|
|
196
|
+
const entries = [];
|
|
197
|
+
// intervalMs -> pollInterval
|
|
198
|
+
if (config.intervalMs !== undefined) {
|
|
199
|
+
entries.push({
|
|
200
|
+
old: 'intervalMs',
|
|
201
|
+
new: 'pollInterval',
|
|
202
|
+
before: [`intervalMs: ${config.intervalMs}`],
|
|
203
|
+
after: [`pollInterval: ${config.intervalMs}`],
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
// transport -> realtime
|
|
207
|
+
if (config.transport !== undefined) {
|
|
208
|
+
const realtimeValue = config.transport === 'transmit';
|
|
209
|
+
entries.push({
|
|
210
|
+
old: 'transport',
|
|
211
|
+
new: 'realtime',
|
|
212
|
+
before: [`transport: '${config.transport}'`],
|
|
213
|
+
after: [`realtime: ${realtimeValue}`],
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
// endpoint -> statsEndpoint
|
|
217
|
+
if (config.endpoint !== undefined) {
|
|
218
|
+
const endpointDisplay = config.endpoint === false ? 'false' : `'${config.endpoint}'`;
|
|
219
|
+
entries.push({
|
|
220
|
+
old: 'endpoint',
|
|
221
|
+
new: 'statsEndpoint',
|
|
222
|
+
before: [`endpoint: ${endpointDisplay}`],
|
|
223
|
+
after: [`statsEndpoint: ${endpointDisplay}`],
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
// shouldShow -> authorize
|
|
227
|
+
if (config.shouldShow !== undefined) {
|
|
228
|
+
entries.push({
|
|
229
|
+
old: 'shouldShow',
|
|
230
|
+
new: 'authorize',
|
|
231
|
+
before: ['shouldShow: (ctx) => ...'],
|
|
232
|
+
after: ['authorize: (ctx) => ...'],
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// channelName -> advanced.channelName
|
|
236
|
+
if (config.channelName !== undefined) {
|
|
237
|
+
entries.push({
|
|
238
|
+
old: 'channelName',
|
|
239
|
+
new: 'advanced.channelName',
|
|
240
|
+
before: [`channelName: '${config.channelName}'`],
|
|
241
|
+
after: [`advanced: { channelName: '${config.channelName}' }`],
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
// skipInTest -> advanced.skipInTest
|
|
245
|
+
if (config.skipInTest !== undefined) {
|
|
246
|
+
entries.push({
|
|
247
|
+
old: 'skipInTest',
|
|
248
|
+
new: 'advanced.skipInTest',
|
|
249
|
+
before: [`skipInTest: ${config.skipInTest}`],
|
|
250
|
+
after: [`advanced: { skipInTest: ${config.skipInTest} }`],
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
// devToolbar -> toolbar + dashboard + advanced
|
|
254
|
+
if (config.devToolbar !== undefined) {
|
|
255
|
+
entries.push(buildDevToolbarMigration(config.devToolbar));
|
|
256
|
+
}
|
|
257
|
+
if (entries.length === 0)
|
|
258
|
+
return;
|
|
259
|
+
// Build the warning block
|
|
260
|
+
const TAG = '\x1b[36m[ \x1b[1m\uD83D\uDD0D server-stats\x1b[0m\x1b[36m ]\x1b[0m';
|
|
261
|
+
const lines = [];
|
|
262
|
+
lines.push('');
|
|
263
|
+
lines.push(`${TAG} Some config options have been renamed — here's how to update:`);
|
|
264
|
+
lines.push('');
|
|
265
|
+
for (const entry of entries) {
|
|
266
|
+
lines.push(` ${dim(entry.old)} ${dim('\u2192')} ${bold(entry.new)}`);
|
|
267
|
+
lines.push('');
|
|
268
|
+
for (const line of entry.before) {
|
|
269
|
+
lines.push(` ${dim('before:')} ${dim(line)}`);
|
|
270
|
+
}
|
|
271
|
+
for (const line of entry.after) {
|
|
272
|
+
lines.push(` ${dim('after:')} ${line}`);
|
|
273
|
+
}
|
|
274
|
+
lines.push('');
|
|
275
|
+
}
|
|
276
|
+
lines.push(` ${dim('No rush — the old names still work. They will be removed in the next major version.')}`);
|
|
277
|
+
lines.push(` ${dim('Update')} ${bold('config/server_stats.ts')} ${dim('when you get a chance.')}`);
|
|
278
|
+
lines.push('');
|
|
279
|
+
console.log(lines.join('\n'));
|
|
280
|
+
}
|
|
1
281
|
/**
|
|
2
282
|
* Define the server stats configuration with full type safety.
|
|
3
283
|
*
|
|
284
|
+
* All top-level fields are optional. Sensible defaults are applied
|
|
285
|
+
* for any omitted fields:
|
|
286
|
+
*
|
|
287
|
+
* | Field | Default |
|
|
288
|
+
* |---------------|--------------------------------|
|
|
289
|
+
* | `intervalMs` | `3000` |
|
|
290
|
+
* | `transport` | `'transmit'` |
|
|
291
|
+
* | `channelName` | `'admin/server-stats'` |
|
|
292
|
+
* | `endpoint` | `'/admin/api/server-stats'` |
|
|
293
|
+
* | `collectors` | `'auto'` |
|
|
294
|
+
* | `skipInTest` | `true` |
|
|
295
|
+
*
|
|
296
|
+
* New simplified aliases (Phase 1) are also supported. When both the
|
|
297
|
+
* old name and its alias are provided, the **new name takes precedence**.
|
|
298
|
+
*
|
|
299
|
+
* | Alias | Resolves to |
|
|
300
|
+
* |------------------|------------------|
|
|
301
|
+
* | `pollInterval` | `intervalMs` |
|
|
302
|
+
* | `realtime` | `transport` |
|
|
303
|
+
* | `statsEndpoint` | `endpoint` |
|
|
304
|
+
* | `authorize` | `shouldShow` |
|
|
305
|
+
* | `toolbar` | `devToolbar` |
|
|
306
|
+
* | `dashboard` | `devToolbar` |
|
|
307
|
+
* | `advanced` | various |
|
|
308
|
+
*
|
|
4
309
|
* This is the main entry point for configuring `adonisjs-server-stats`.
|
|
5
310
|
* Call it in `config/server_stats.ts` and export the result as default.
|
|
6
311
|
*
|
|
7
312
|
* @example
|
|
8
313
|
* ```ts
|
|
9
|
-
* // config/server_stats.ts
|
|
314
|
+
* // config/server_stats.ts — minimal (all defaults)
|
|
315
|
+
* import { defineConfig } from 'adonisjs-server-stats'
|
|
316
|
+
*
|
|
317
|
+
* export default defineConfig({})
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```ts
|
|
322
|
+
* // config/server_stats.ts — explicit collectors
|
|
10
323
|
* import { defineConfig } from 'adonisjs-server-stats'
|
|
11
324
|
* import { processCollector, httpCollector } from 'adonisjs-server-stats/collectors'
|
|
12
325
|
*
|
|
13
326
|
* export default defineConfig({
|
|
14
327
|
* intervalMs: 3000,
|
|
15
328
|
* transport: 'transmit',
|
|
16
|
-
* channelName: 'admin/server-stats',
|
|
17
|
-
* endpoint: '/admin/api/server-stats',
|
|
18
329
|
* collectors: [processCollector(), httpCollector()],
|
|
19
330
|
* })
|
|
20
331
|
* ```
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```ts
|
|
335
|
+
* // config/server_stats.ts — new simplified aliases
|
|
336
|
+
* import { defineConfig } from 'adonisjs-server-stats'
|
|
337
|
+
*
|
|
338
|
+
* export default defineConfig({
|
|
339
|
+
* pollInterval: 3000,
|
|
340
|
+
* realtime: true,
|
|
341
|
+
* toolbar: true,
|
|
342
|
+
* dashboard: true,
|
|
343
|
+
* })
|
|
344
|
+
* ```
|
|
21
345
|
*/
|
|
22
346
|
export function defineConfig(config) {
|
|
23
|
-
|
|
347
|
+
// Resolve aliases (new names take precedence over old)
|
|
348
|
+
const intervalMs = config.pollInterval ?? config.intervalMs ?? 3000;
|
|
349
|
+
let transport;
|
|
350
|
+
if (config.realtime !== undefined) {
|
|
351
|
+
transport = config.realtime ? 'transmit' : 'none';
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
transport = config.transport ?? 'transmit';
|
|
355
|
+
}
|
|
356
|
+
const endpoint = config.statsEndpoint ?? config.endpoint ?? '/admin/api/server-stats';
|
|
357
|
+
const shouldShow = config.authorize ?? config.shouldShow;
|
|
358
|
+
// Resolve toolbar/dashboard aliases into devToolbar
|
|
359
|
+
let devToolbar = config.devToolbar;
|
|
360
|
+
if (config.toolbar !== undefined ||
|
|
361
|
+
config.dashboard !== undefined ||
|
|
362
|
+
config.advanced !== undefined) {
|
|
363
|
+
devToolbar = resolveToolbarAliases(config, devToolbar);
|
|
364
|
+
}
|
|
365
|
+
// Resolve advanced.channelName, advanced.skipInTest etc
|
|
366
|
+
const channelName = config.advanced?.channelName ?? config.channelName ?? 'admin/server-stats';
|
|
367
|
+
const skipInTest = config.advanced?.skipInTest ?? config.skipInTest ?? true;
|
|
368
|
+
// Log friendly deprecation warnings for any old config names the user set
|
|
369
|
+
logDeprecationWarnings(config);
|
|
370
|
+
return {
|
|
371
|
+
intervalMs,
|
|
372
|
+
transport,
|
|
373
|
+
channelName,
|
|
374
|
+
endpoint,
|
|
375
|
+
collectors: config.collectors ?? 'auto',
|
|
376
|
+
skipInTest,
|
|
377
|
+
onStats: config.onStats,
|
|
378
|
+
devToolbar,
|
|
379
|
+
shouldShow,
|
|
380
|
+
};
|
|
24
381
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a JSON config object from a `<script>` tag embedded in the page.
|
|
3
|
+
*
|
|
4
|
+
* Edge templates serialise config into a hidden `<script type="application/json">`
|
|
5
|
+
* element. This helper locates it by `id`, parses the JSON, and returns a typed
|
|
6
|
+
* config object.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readConfig<T>(elementId: string): T;
|
|
9
|
+
/**
|
|
10
|
+
* Synchronise the persisted theme preference to the `<html>` element.
|
|
11
|
+
*
|
|
12
|
+
* Sets `data-theme` on `document.documentElement` immediately and subscribes
|
|
13
|
+
* to future changes so that dashboard CSS `:root` / `[data-theme]` selectors
|
|
14
|
+
* stay in sync.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setupThemeSync(): void;
|
|
17
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/edge/bootstrap.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,CAGlD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAMrC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Shared bootstrap utilities for Edge entry points (Preact & Vue)
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
import { getTheme, onThemeChange } from '../core/theme.js';
|
|
5
|
+
/**
|
|
6
|
+
* Read a JSON config object from a `<script>` tag embedded in the page.
|
|
7
|
+
*
|
|
8
|
+
* Edge templates serialise config into a hidden `<script type="application/json">`
|
|
9
|
+
* element. This helper locates it by `id`, parses the JSON, and returns a typed
|
|
10
|
+
* config object.
|
|
11
|
+
*/
|
|
12
|
+
export function readConfig(elementId) {
|
|
13
|
+
const el = document.getElementById(elementId);
|
|
14
|
+
return el ? JSON.parse(el.textContent || '{}') : {};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Synchronise the persisted theme preference to the `<html>` element.
|
|
18
|
+
*
|
|
19
|
+
* Sets `data-theme` on `document.documentElement` immediately and subscribes
|
|
20
|
+
* to future changes so that dashboard CSS `:root` / `[data-theme]` selectors
|
|
21
|
+
* stay in sync.
|
|
22
|
+
*/
|
|
23
|
+
export function setupThemeSync() {
|
|
24
|
+
function syncTheme(theme) {
|
|
25
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
26
|
+
}
|
|
27
|
+
syncTheme(getTheme());
|
|
28
|
+
onThemeChange(syncTheme);
|
|
29
|
+
}
|