adonisjs-server-stats 1.9.0 → 1.10.3

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.
Files changed (227) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/formatters-helpers.d.ts +23 -0
  10. package/dist/core/index.js +596 -509
  11. package/dist/core/log-utils-helpers.d.ts +13 -0
  12. package/dist/core/metrics.d.ts +3 -28
  13. package/dist/core/pagination.d.ts +0 -9
  14. package/dist/core/server-stats-controller.d.ts +6 -0
  15. package/dist/core/split-pane.d.ts +18 -0
  16. package/dist/core/trace-utils.d.ts +5 -0
  17. package/dist/core/transmit-helpers.d.ts +7 -0
  18. package/dist/core/types-dashboard.d.ts +178 -0
  19. package/dist/core/types-diagnostics.d.ts +85 -0
  20. package/dist/core/types.d.ts +11 -443
  21. package/dist/react/{CacheSection-xH75hwXu.js → CacheSection-baMZotSn.js} +2 -2
  22. package/dist/react/CacheTab-2cw_rMzj.js +117 -0
  23. package/dist/react/{ConfigSection-D8BO1Ry9.js → ConfigSection-DGgqjAal.js} +1 -1
  24. package/dist/react/{ConfigTab-CcN-tfjv.js → ConfigTab-H3OnYqmK.js} +1 -1
  25. package/dist/react/CustomPaneTab-B6r7ha0u.js +98 -0
  26. package/dist/react/{EmailsSection-BzlsTdPs.js → EmailsSection-C-UZISG-.js} +2 -2
  27. package/dist/react/EmailsTab-DbK4Eobn.js +139 -0
  28. package/dist/react/{EventsSection-CGQWiIdV.js → EventsSection-C7RQW_LY.js} +2 -2
  29. package/dist/react/EventsTab-CfVr7AiM.js +57 -0
  30. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  31. package/dist/react/{JobsSection-D7AHQmZi.js → JobsSection-CQHNK_Ls.js} +2 -2
  32. package/dist/react/{JobsTab-B3Lfdqed.js → JobsTab-znzf6jzk.js} +54 -42
  33. package/dist/react/{LogsSection-Cly1dpvS.js → LogsSection-Dmm3rE2B.js} +9 -3
  34. package/dist/react/LogsTab-D8unMV5P.js +108 -0
  35. package/dist/react/{OverviewSection-CkBGFEWq.js → OverviewSection-ABP9ueBo.js} +1 -1
  36. package/dist/react/{QueriesSection-CfCpnNUD.js → QueriesSection-CnmSkznA.js} +2 -2
  37. package/dist/react/{QueriesTab-DbBmAqzO.js → QueriesTab-BQzcxEiW.js} +37 -40
  38. package/dist/react/RelatedLogs-3A8RuGKH.js +52 -0
  39. package/dist/react/RequestsSection-kW79_M7k.js +341 -0
  40. package/dist/react/{RoutesSection-CRqF-cNM.js → RoutesSection-BRhxrtjZ.js} +2 -2
  41. package/dist/react/RoutesTab-CpYH5lUw.js +68 -0
  42. package/dist/react/TimelineTab-DjLR35Ce.js +214 -0
  43. package/dist/react/index-CsImORX6.js +1121 -0
  44. package/dist/react/index.js +1 -1
  45. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  46. package/dist/react/react/components/shared/RelatedLogs.d.ts +7 -0
  47. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  48. package/dist/react/style.css +1 -1
  49. package/dist/src/collectors/app_collector.d.ts +0 -8
  50. package/dist/src/collectors/app_collector.js +45 -52
  51. package/dist/src/collectors/auto_detect.d.ts +0 -23
  52. package/dist/src/collectors/auto_detect.js +33 -55
  53. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  54. package/dist/src/collectors/db_pool_collector.js +72 -57
  55. package/dist/src/collectors/log_collector.d.ts +0 -47
  56. package/dist/src/collectors/log_collector.js +36 -65
  57. package/dist/src/collectors/queue_collector.d.ts +0 -20
  58. package/dist/src/collectors/queue_collector.js +60 -76
  59. package/dist/src/collectors/redis_collector.d.ts +10 -10
  60. package/dist/src/collectors/redis_collector.js +69 -66
  61. package/dist/src/config/deprecation_migration.d.ts +7 -0
  62. package/dist/src/config/deprecation_migration.js +201 -0
  63. package/dist/src/controller/debug_controller.d.ts +1 -1
  64. package/dist/src/controller/debug_controller.js +87 -81
  65. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  66. package/dist/src/dashboard/cache_handlers.js +52 -0
  67. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  68. package/dist/src/dashboard/chart_aggregator.js +68 -50
  69. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  70. package/dist/src/dashboard/coalesce_cache.js +47 -0
  71. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  72. package/dist/src/dashboard/dashboard_controller.js +52 -532
  73. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  74. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  75. package/dist/src/dashboard/dashboard_store.d.ts +19 -217
  76. package/dist/src/dashboard/dashboard_store.js +115 -1069
  77. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  78. package/dist/src/dashboard/dashboard_types.js +4 -0
  79. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  80. package/dist/src/dashboard/detail_queries.js +98 -0
  81. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  82. package/dist/src/dashboard/email_event_builder.js +65 -0
  83. package/dist/src/dashboard/explain_query.d.ts +8 -0
  84. package/dist/src/dashboard/explain_query.js +22 -0
  85. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  86. package/dist/src/dashboard/filter_handlers.js +56 -0
  87. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  88. package/dist/src/dashboard/filtered_queries.js +155 -0
  89. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  90. package/dist/src/dashboard/flush_manager.js +107 -0
  91. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  92. package/dist/src/dashboard/format_helpers.js +140 -0
  93. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  94. package/dist/src/dashboard/inspector_manager.js +102 -0
  95. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  96. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  97. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  98. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  99. package/dist/src/dashboard/jobs_handlers.js +61 -0
  100. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  101. package/dist/src/dashboard/knex_factory.js +91 -0
  102. package/dist/src/dashboard/migrator.js +30 -153
  103. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  104. package/dist/src/dashboard/migrator_tables.js +153 -0
  105. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  106. package/dist/src/dashboard/overview_queries.js +155 -0
  107. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  108. package/dist/src/dashboard/overview_query_runners.js +84 -0
  109. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  110. package/dist/src/dashboard/overview_store_queries.js +69 -0
  111. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  112. package/dist/src/dashboard/paginate_helper.js +33 -0
  113. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  114. package/dist/src/dashboard/query_explain_handler.js +80 -0
  115. package/dist/src/dashboard/read_queries.d.ts +32 -0
  116. package/dist/src/dashboard/read_queries.js +107 -0
  117. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  118. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  119. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  120. package/dist/src/dashboard/storage_stats.js +81 -0
  121. package/dist/src/dashboard/write_queue.d.ts +106 -0
  122. package/dist/src/dashboard/write_queue.js +225 -0
  123. package/dist/src/data/data_access.d.ts +6 -36
  124. package/dist/src/data/data_access.js +43 -188
  125. package/dist/src/data/data_access_helpers.d.ts +130 -0
  126. package/dist/src/data/data_access_helpers.js +212 -0
  127. package/dist/src/debug/debug_store.js +37 -32
  128. package/dist/src/debug/email_collector.d.ts +1 -10
  129. package/dist/src/debug/email_collector.js +78 -81
  130. package/dist/src/debug/event_collector.d.ts +0 -9
  131. package/dist/src/debug/event_collector.js +79 -62
  132. package/dist/src/debug/query_collector.js +23 -19
  133. package/dist/src/debug/route_inspector.d.ts +1 -5
  134. package/dist/src/debug/route_inspector.js +50 -51
  135. package/dist/src/debug/trace_collector.d.ts +10 -2
  136. package/dist/src/debug/trace_collector.js +23 -16
  137. package/dist/src/debug/types.d.ts +5 -1
  138. package/dist/src/define_config.d.ts +0 -65
  139. package/dist/src/define_config.js +93 -333
  140. package/dist/src/edge/client/dashboard.js +2 -2
  141. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  142. package/dist/src/edge/client/stats-bar.js +1 -1
  143. package/dist/src/edge/client-vue/dashboard.js +5 -5
  144. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  145. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  146. package/dist/src/edge/plugin.d.ts +0 -16
  147. package/dist/src/edge/plugin.js +57 -64
  148. package/dist/src/engine/request_metrics.d.ts +1 -0
  149. package/dist/src/engine/request_metrics.js +32 -42
  150. package/dist/src/middleware/request_tracking_middleware.d.ts +3 -8
  151. package/dist/src/middleware/request_tracking_middleware.js +65 -91
  152. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  153. package/dist/src/provider/auth_middleware_detector.js +97 -0
  154. package/dist/src/provider/boot_helpers.d.ts +20 -0
  155. package/dist/src/provider/boot_helpers.js +91 -0
  156. package/dist/src/provider/boot_initializer.d.ts +28 -0
  157. package/dist/src/provider/boot_initializer.js +35 -0
  158. package/dist/src/provider/dashboard_init.d.ts +30 -0
  159. package/dist/src/provider/dashboard_init.js +138 -0
  160. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  161. package/dist/src/provider/dashboard_setup.js +78 -0
  162. package/dist/src/provider/diagnostics.d.ts +134 -0
  163. package/dist/src/provider/diagnostics.js +127 -0
  164. package/dist/src/provider/email_bridge.d.ts +43 -0
  165. package/dist/src/provider/email_bridge.js +80 -0
  166. package/dist/src/provider/email_helpers.d.ts +13 -0
  167. package/dist/src/provider/email_helpers.js +68 -0
  168. package/dist/src/provider/pino_hook.d.ts +17 -0
  169. package/dist/src/provider/pino_hook.js +35 -0
  170. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  171. package/dist/src/provider/provider_helpers_extra.js +177 -0
  172. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  173. package/dist/src/provider/server_stats_provider.js +131 -936
  174. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  175. package/dist/src/provider/shutdown_helpers.js +70 -0
  176. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  177. package/dist/src/provider/toolbar_setup.js +141 -0
  178. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  179. package/dist/src/routes/dashboard_routes.js +197 -0
  180. package/dist/src/routes/debug_routes.d.ts +14 -0
  181. package/dist/src/routes/debug_routes.js +101 -0
  182. package/dist/src/routes/register_routes.d.ts +0 -78
  183. package/dist/src/routes/register_routes.js +22 -347
  184. package/dist/src/routes/stats_routes.d.ts +5 -0
  185. package/dist/src/routes/stats_routes.js +14 -0
  186. package/dist/src/styles/components.css +177 -0
  187. package/dist/src/styles/dashboard.css +8 -90
  188. package/dist/src/styles/debug-panel.css +10 -31
  189. package/dist/src/types.d.ts +306 -15
  190. package/dist/vue/{CacheSection-Cx-hj09X.js → CacheSection-ITqvpfH5.js} +1 -1
  191. package/dist/vue/{ConfigSection-CMXyryf6.js → ConfigSection-DTn3GslE.js} +1 -1
  192. package/dist/vue/{EmailsSection-DgKl9xGT.js → EmailsSection-DtLJ4XoS.js} +1 -1
  193. package/dist/vue/{EventsSection-BNMCAim1.js → EventsSection-BOYYz0Ty.js} +1 -1
  194. package/dist/vue/{JobsSection-CCMgMlxd.js → JobsSection-BazTxcJL.js} +1 -1
  195. package/dist/vue/{LogsSection-CvOnTxUu.js → LogsSection-D55PjTKX.js} +9 -3
  196. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  197. package/dist/vue/{OverviewSection-CHgaKtUR.js → OverviewSection-1uBKo-Tu.js} +1 -1
  198. package/dist/vue/{QueriesSection-BnHRD98z.js → QueriesSection-rpoZ4ogd.js} +1 -1
  199. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +84 -0
  200. package/dist/vue/RequestsSection-x7LvT0MC.js +401 -0
  201. package/dist/vue/{RoutesSection-BrceOcKQ.js → RoutesSection-CCD0zZqQ.js} +1 -1
  202. package/dist/vue/TimelineTab-zj5Z5OdT.js +338 -0
  203. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +4 -0
  204. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +4 -0
  205. package/dist/vue/components/{Dashboard/sections/TimelineSection.vue.d.ts → shared/RelatedLogs.vue.d.ts} +5 -6
  206. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  207. package/dist/vue/index-C8MxnS7Q.js +1232 -0
  208. package/dist/vue/index.js +1 -1
  209. package/dist/vue/style.css +1 -1
  210. package/package.json +1 -1
  211. package/dist/react/CacheTab-DYmsZJJ1.js +0 -123
  212. package/dist/react/CustomPaneTab-D7_o3Ec6.js +0 -104
  213. package/dist/react/EmailsTab-Uh2CQY3o.js +0 -153
  214. package/dist/react/EventsTab-CC6DQzEm.js +0 -63
  215. package/dist/react/LogsTab-BbYK-iyh.js +0 -103
  216. package/dist/react/RequestsSection-Cb5a6MlT.js +0 -209
  217. package/dist/react/RoutesTab-Bwreij3e.js +0 -74
  218. package/dist/react/TimelineSection-B2y06kRE.js +0 -158
  219. package/dist/react/TimelineTab-6hthfdBB.js +0 -193
  220. package/dist/react/WaterfallChart-Cj73WdfM.js +0 -100
  221. package/dist/react/index-CecA4IdQ.js +0 -1075
  222. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +0 -8
  223. package/dist/vue/RequestsSection-B-uSlM0f.js +0 -243
  224. package/dist/vue/TimelineSection-CfvnA2Oo.js +0 -186
  225. package/dist/vue/TimelineTab-Db6lKKsD.js +0 -250
  226. package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +0 -118
  227. package/dist/vue/index-oLxS08vN.js +0 -1235
@@ -1,6 +1,8 @@
1
1
  import { ServerStats } from '../types.js';
2
2
  export type { ServerStats, MetricValue, ServerStatsConfig, ResolvedServerStatsConfig, DevToolbarOptions, ToolbarConfig, AdvancedConfig, } from '../types.js';
3
3
  export type { DebugPane, DebugPaneColumn, DebugPaneSearch, DebugPaneFormatType, BadgeColor, QueryRecord, EventRecord, EmailRecord, RouteRecord, TraceRecord, TraceSpan, } from '../debug/types.js';
4
+ export type { OverviewMetrics, OverviewData, ChartDataPoint, GroupedQuery, DashboardCacheStats, DashboardCacheKeyEntry, DashboardCacheResponse, JobsApiResponse, JobStats, JobRecord, } from './types-dashboard.js';
5
+ export type { DiagnosticsBufferInfo, DiagnosticsCollectorInfo, DiagnosticsTimerInfo, DiagnosticsResponse, } from './types-diagnostics.js';
4
6
  /**
5
7
  * Props / config for the `<ServerStatsBar />` component.
6
8
  */
@@ -18,63 +20,37 @@ export interface StatsBarProps {
18
20
  /** CSS class overrides for the root element. */
19
21
  className?: string;
20
22
  }
21
- /**
22
- * Props for the `<DebugPanel />` component.
23
- */
23
+ /** Props for the `<DebugPanel />` component. */
24
24
  export interface DebugPanelProps {
25
- /** Base URL for API calls. Defaults to `''` (same origin). */
26
25
  baseUrl?: string;
27
- /** Debug API base path. Defaults to `'/admin/api/debug'`. */
28
26
  debugEndpoint?: string;
29
- /** Optional auth token for Bearer auth. */
30
27
  authToken?: string;
31
- /** CSS class overrides for panel container. */
32
28
  className?: string;
33
29
  }
34
- /**
35
- * Props for the `<DashboardPage />` component.
36
- */
30
+ /** Props for the `<DashboardPage />` component. */
37
31
  export interface DashboardPageProps {
38
- /** Base URL for API calls. Defaults to `''` (same origin). */
39
32
  baseUrl?: string;
40
- /** Dashboard API base path. Defaults to `'/__stats/api'`. */
41
33
  dashboardEndpoint?: string;
42
- /** Optional auth token for Bearer auth. */
43
34
  authToken?: string;
44
- /** Transmit channel name for live updates. Defaults to `'server-stats/dashboard'`. */
45
35
  channelName?: string;
46
- /** CSS class overrides for the root element. */
47
36
  className?: string;
48
37
  }
49
- /**
50
- * Alias for {@link StatsBarProps}. Used by Vue components as config type.
51
- */
38
+ /** Alias for {@link StatsBarProps}. Used by Vue components as config type. */
52
39
  export interface StatsBarConfig extends StatsBarProps {
53
- /** Debug API endpoint path (used for feature detection). */
54
40
  debugEndpoint?: string;
55
41
  }
56
- /**
57
- * Alias for {@link DebugPanelProps}. Used by Vue components as config type.
58
- */
42
+ /** Alias for {@link DebugPanelProps}. Used by Vue components as config type. */
59
43
  export interface DebugPanelConfig extends DebugPanelProps {
60
- /** Path to the full dashboard page. */
61
44
  dashboardPath?: string;
62
- /** Whether tracing is enabled. */
63
45
  tracingEnabled?: boolean;
64
- /** Whether the stats bar is connected via Transmit (SSE) for live updates. */
65
46
  isLive?: boolean;
66
47
  }
67
- /**
68
- * Alias for {@link DashboardPageProps}. Used by Vue components as config type.
69
- */
48
+ /** Alias for {@link DashboardPageProps}. Used by Vue components as config type. */
70
49
  export interface DashboardConfig extends DashboardPageProps {
71
- /** Whether tracing is enabled. */
72
50
  tracingEnabled?: boolean;
73
51
  }
74
52
  /**
75
53
  * Shape returned by `GET {debugEndpoint}/config`.
76
- *
77
- * Tells the UI which sections to render and where to find endpoints.
78
54
  */
79
55
  export interface FeatureFlags {
80
56
  features: {
@@ -105,10 +81,6 @@ export interface FeatureFlags {
105
81
  }
106
82
  /**
107
83
  * Flattened feature config used by Vue composables.
108
- *
109
- * Provides a flat interface for feature flags plus custom panes,
110
- * simplifying access in Vue components (e.g. `features.tracing`
111
- * instead of `features.features.tracing`).
112
84
  */
113
85
  export interface FeatureConfig {
114
86
  tracing: boolean;
@@ -125,114 +97,40 @@ export interface FeatureConfig {
125
97
  dashboard: boolean;
126
98
  customPanes: import('../debug/types.js').DebugPane[];
127
99
  }
128
- /**
129
- * Threshold color result.
130
- */
100
+ /** Threshold color result. */
131
101
  export type ThresholdColor = 'green' | 'amber' | 'red';
132
102
  /**
133
103
  * Definition for a single metric displayed in the stats bar.
134
- *
135
- * Each definition drives rendering in both React and Vue:
136
- * label for display, extract for reading the value from a snapshot,
137
- * format for string output, and threshold config for color coding.
138
104
  */
139
105
  export interface MetricDefinition {
140
- /** Unique metric identifier (e.g. `'cpu'`, `'memory'`). */
141
106
  id: string;
142
- /** Short display label (e.g. `'CPU'`, `'MEM'`). */
143
107
  label: string;
144
- /**
145
- * Longer display title for tooltips (e.g. `'CPU Usage'`, `'Memory'`).
146
- * Falls back to `label` if not provided.
147
- */
148
108
  title?: string;
149
- /**
150
- * Unit string for display and tooltip (e.g. `'%'`, `'ms'`, `'bytes'`).
151
- * Empty string for unitless metrics.
152
- */
153
109
  unit: string;
154
- /**
155
- * Metric group for layout grouping in the stats bar.
156
- * Standard groups: `'core'`, `'db'`, `'redis'`, `'queue'`, `'log'`.
157
- * Defaults to `'core'` if not specified.
158
- */
159
110
  group?: string;
160
- /**
161
- * Value at or above which the metric turns amber.
162
- * For inverse metrics (higher is better), this is the *below* threshold.
163
- * `undefined` means no threshold coloring.
164
- */
165
111
  warnThreshold?: number;
166
- /**
167
- * Value at or above which the metric turns red.
168
- * For inverse metrics (higher is better), this is the *below* threshold.
169
- * `undefined` means no threshold coloring.
170
- */
171
112
  critThreshold?: number;
172
- /**
173
- * Whether the threshold logic is inverted (lower values are worse).
174
- * Used for metrics like cache hit rate where <90% is amber and <70% is red.
175
- */
176
113
  inverseThreshold?: boolean;
177
- /**
178
- * Extract the numeric value from a stats snapshot.
179
- * Returns `undefined` if the metric is not available in this snapshot.
180
- */
181
114
  extract: (stats: ServerStats) => number | undefined;
182
- /**
183
- * Format the extracted value for display (e.g. `"52.3%"`, `"128M"`).
184
- * Alias: `value` (same function, alternate name for React).
185
- */
186
115
  format: (stats: ServerStats) => string;
187
- /**
188
- * Alias for {@link format}. Returns the formatted display string.
189
- */
190
116
  value?: (stats: ServerStats) => string;
191
- /**
192
- * Return a CSS class name for threshold coloring (e.g. `'ss-green'`).
193
- * Used by React components. When not provided, the component should
194
- * compute the color from `warnThreshold`/`critThreshold`.
195
- */
196
117
  color?: (stats: ServerStats) => string;
197
- /**
198
- * Additional detail text (or a function returning detail text)
199
- * shown in the tooltip below the main value.
200
- */
201
118
  detail?: string | ((stats: ServerStats) => string | null);
202
- /**
203
- * Key on `ServerStats` to track in the sparkline history buffer.
204
- * `undefined` means no sparkline for this metric.
205
- * A leading `_` prefix indicates a computed value (e.g. `'_sysMemUsed'`).
206
- */
207
119
  historyKey?: string | undefined;
208
- /**
209
- * Optional predicate to conditionally show/hide this metric
210
- * based on the current stats snapshot.
211
- */
212
120
  show?: (stats: ServerStats) => boolean;
213
121
  }
214
- /**
215
- * Options for SVG sparkline rendering.
216
- */
122
+ /** Options for SVG sparkline rendering. */
217
123
  export interface SparklineOptions {
218
- /** Stroke color (CSS color string). Defaults to `'#34d399'`. */
219
124
  color?: string;
220
- /** Fill gradient top opacity (0-1). Defaults to `0.25`. */
221
125
  fillOpacityTop?: number;
222
- /** Fill gradient bottom opacity (0-1). Defaults to `0.02`. */
223
126
  fillOpacityBottom?: number;
224
- /** Line stroke width. Defaults to `1.5`. */
225
127
  strokeWidth?: number;
226
- /** SVG viewBox width. Defaults to `120`. */
227
128
  width?: number;
228
- /** SVG viewBox height. Defaults to `32`. */
229
129
  height?: number;
230
- /** Inner padding in px. Defaults to `2`. */
231
130
  padding?: number;
232
131
  }
233
132
  /**
234
133
  * Options for the `useDashboardData` hook.
235
- * Extends {@link DashboardPageProps} with pagination, sort, filter, and time range options.
236
134
  */
237
135
  export interface DashboardHookOptions extends DashboardPageProps {
238
136
  page?: number;
@@ -242,28 +140,11 @@ export interface DashboardHookOptions extends DashboardPageProps {
242
140
  sortDir?: 'asc' | 'desc';
243
141
  filters?: Record<string, string>;
244
142
  timeRange?: TimeRange;
245
- /** Incrementing key to trigger a refetch (used by live mode). */
246
143
  refreshKey?: number;
247
144
  }
248
- /**
249
- * Built-in debug panel tab identifiers.
250
- *
251
- * Known tabs are provided for autocomplete; any custom string is also accepted.
252
- */
253
145
  export type DebugTab = 'timeline' | 'queries' | 'events' | 'routes' | 'logs' | 'emails' | 'cache' | 'jobs' | (string & {});
254
- /**
255
- * Built-in dashboard section identifiers.
256
- *
257
- * Known sections are provided for autocomplete; any custom string is also accepted.
258
- */
259
- export type DashboardSection = 'overview' | 'requests' | 'queries' | 'events' | 'routes' | 'logs' | 'emails' | 'timeline' | 'cache' | 'jobs' | 'config' | (string & {});
260
- /**
261
- * Pre-defined time range options for dashboard queries.
262
- */
146
+ export type DashboardSection = 'overview' | 'requests' | 'queries' | 'events' | 'routes' | 'logs' | 'emails' | 'cache' | 'jobs' | 'config' | (string & {});
263
147
  export type TimeRange = '5m' | '15m' | '30m' | '1h' | '6h' | '24h' | '7d';
264
- /**
265
- * Generic paginated API response shape.
266
- */
267
148
  export interface PaginatedResponse<T> {
268
149
  data: T[];
269
150
  meta: {
@@ -273,346 +154,33 @@ export interface PaginatedResponse<T> {
273
154
  lastPage: number;
274
155
  };
275
156
  }
276
- /**
277
- * Aggregate cache statistics returned by the debug cache endpoint.
278
- */
279
157
  export interface CacheStats {
280
158
  hitRate: number;
281
159
  totalHits: number;
282
160
  totalMisses: number;
283
161
  keys: CacheEntry[];
284
- /** Number of cache keys (may differ from `keys.length` when paginated). */
285
162
  keyCount?: number;
286
- /** Memory used by the cache store in megabytes. */
287
163
  memoryUsedMb?: number;
288
164
  }
289
- /**
290
- * Individual cache key metadata.
291
- */
292
165
  export interface CacheEntry {
293
166
  key: string;
294
167
  type: string;
295
168
  ttl: number;
296
169
  size: number;
297
- /** Cached value (populated when inspecting a single key in the debug panel). */
298
170
  value?: string | number | boolean | Record<string, unknown> | unknown[] | null;
299
171
  }
300
- /**
301
- * Redis / cache store statistics returned by the dashboard cache endpoint.
302
- */
303
- export interface DashboardCacheStats {
304
- connected: boolean;
305
- hits: number;
306
- misses: number;
307
- hitRate: number;
308
- memoryUsedBytes: number;
309
- memoryUsedHuman: string;
310
- connectedClients: number;
311
- totalKeys: number;
312
- keyCount?: number;
313
- }
314
- /**
315
- * Individual cache key entry in the dashboard cache inspector.
316
- */
317
- export interface DashboardCacheKeyEntry {
318
- key: string;
319
- type: string;
320
- ttl: number;
321
- size?: number | null;
322
- }
323
- /**
324
- * Full response from the dashboard cache API endpoint.
325
- */
326
- export interface DashboardCacheResponse {
327
- available: boolean;
328
- stats: DashboardCacheStats | null;
329
- keys?: DashboardCacheKeyEntry[];
330
- data?: DashboardCacheKeyEntry[];
331
- cursor: string;
332
- }
333
- /**
334
- * Server response shape from the dashboard API `/api/jobs` endpoint.
335
- *
336
- * The server may return jobs under `jobs` or `data`, and stats under
337
- * `stats` or `overview`. We handle all variants to stay compatible
338
- * with different queue inspector implementations.
339
- */
340
- export interface JobsApiResponse {
341
- available?: boolean;
342
- overview?: JobStats;
343
- stats?: JobStats;
344
- data?: JobRecord[];
345
- jobs?: JobRecord[];
346
- total?: number;
347
- }
348
- /**
349
- * Aggregate queue statistics.
350
- */
351
- export interface JobStats {
352
- active: number;
353
- waiting: number;
354
- delayed: number;
355
- completed: number;
356
- failed: number;
357
- }
358
- /**
359
- * Individual job record from the queue inspector.
360
- */
361
- export interface JobRecord {
362
- id: string;
363
- name: string;
364
- status: string;
365
- data: unknown;
366
- payload: unknown;
367
- attempts: number;
368
- duration: number | null;
369
- timestamp: number | string;
370
- createdAt: number | string;
371
- processedAt: number | string | null;
372
- finishedAt: number | string | null;
373
- failedReason: string | null;
374
- }
375
- /**
376
- * Aggregated overview metrics returned by the dashboard overview endpoint.
377
- */
378
- export interface OverviewMetrics {
379
- avgResponseTime: number;
380
- p95ResponseTime: number;
381
- requestsPerMinute: number;
382
- errorRate: number;
383
- totalRequests: number;
384
- slowestEndpoints: {
385
- url?: string;
386
- pattern?: string;
387
- avgDuration: number;
388
- count: number;
389
- }[];
390
- queryStats: {
391
- total: number;
392
- avgDuration: number;
393
- perRequest: number;
394
- };
395
- recentErrors: {
396
- id?: number;
397
- level: string;
398
- message: string;
399
- timestamp?: number | string;
400
- }[];
401
- topEvents: {
402
- eventName?: string;
403
- name?: string;
404
- event_name?: string;
405
- event?: string;
406
- count: number;
407
- }[];
408
- emailActivity: {
409
- sent: number;
410
- queued: number;
411
- failed: number;
412
- };
413
- logLevelBreakdown: {
414
- error: number;
415
- warn: number;
416
- info: number;
417
- debug: number;
418
- };
419
- cacheStats: {
420
- available: boolean;
421
- totalKeys: number;
422
- hitRate: number;
423
- memoryUsedHuman: string;
424
- } | null;
425
- jobQueueStatus: {
426
- available: boolean;
427
- active: number;
428
- waiting: number;
429
- failed: number;
430
- completed: number;
431
- } | null;
432
- statusDistribution: {
433
- '2xx': number;
434
- '3xx': number;
435
- '4xx': number;
436
- '5xx': number;
437
- };
438
- slowestQueries: {
439
- sqlNormalized?: string;
440
- normalizedSql?: string;
441
- sql_normalized?: string;
442
- sql?: string;
443
- avgDuration: number;
444
- count: number;
445
- }[];
446
- sparklines?: {
447
- avgResponseTime?: number[];
448
- p95ResponseTime?: number[];
449
- requestsPerMinute?: number[];
450
- errorRate?: number[];
451
- };
452
- }
453
- /**
454
- * Extended overview data used by Vue dashboard components.
455
- * Extends {@link OverviewMetrics} with sparkline time-series data.
456
- */
457
- export interface OverviewData extends OverviewMetrics {
458
- avgResponseTimeSeries?: number[];
459
- p95ResponseTimeSeries?: number[];
460
- requestsPerMinuteSeries?: number[];
461
- errorRateSeries?: number[];
462
- recentErrors: {
463
- id?: number;
464
- level: string;
465
- message: string;
466
- timestamp: number | string;
467
- }[];
468
- }
469
- /**
470
- * Single data point for dashboard time-series charts.
471
- */
472
- export interface ChartDataPoint {
473
- bucket: string;
474
- total: number;
475
- count2xx: number;
476
- count3xx: number;
477
- count4xx: number;
478
- count5xx: number;
479
- requestCount?: number;
480
- errorCount?: number;
481
- avgDuration?: number;
482
- p95Duration?: number;
483
- }
484
- /**
485
- * A grouped/aggregated query pattern for the dashboard queries section.
486
- */
487
- export interface GroupedQuery {
488
- pattern: string;
489
- count: number;
490
- avgDuration: number;
491
- minDuration: number;
492
- maxDuration: number;
493
- totalDuration: number;
494
- percentOfTotal: number;
495
- }
496
- export type { Theme } from './theme.js';
497
- /**
498
- * Pagination state for table components.
499
- */
500
172
  export interface PaginationState {
501
- /** Current page number (1-based). */
502
173
  page: number;
503
- /** Number of items per page. */
504
174
  perPage: number;
505
- /** Total number of items across all pages. */
506
175
  total: number;
507
- /** Total number of pages. */
508
176
  totalPages: number;
509
177
  }
510
- /**
511
- * Filter state for table components.
512
- */
513
178
  export interface FilterState {
514
- /** Free-text search query. */
515
179
  search: string;
516
- /** Key-value filter pairs (e.g. `{ status: '500', method: 'GET' }`). */
517
180
  filters: Record<string, string>;
518
181
  }
519
- /**
520
- * Sort state for table components.
521
- */
522
182
  export interface SortState {
523
- /** Column field name to sort by. */
524
183
  field: string;
525
- /** Sort direction. */
526
184
  direction: 'asc' | 'desc';
527
185
  }
528
- /**
529
- * Buffer usage info returned by the diagnostics endpoint.
530
- */
531
- export interface DiagnosticsBufferInfo {
532
- current: number;
533
- max: number;
534
- }
535
- /**
536
- * Collector metadata returned by the diagnostics endpoint.
537
- */
538
- export interface DiagnosticsCollectorInfo {
539
- name: string;
540
- label: string;
541
- status: 'healthy' | 'errored' | 'stopped';
542
- lastError: string | null;
543
- lastErrorAt: number | null;
544
- config: Record<string, unknown>;
545
- }
546
- /**
547
- * Timer state returned by the diagnostics endpoint.
548
- */
549
- export interface DiagnosticsTimerInfo {
550
- active: boolean;
551
- intervalMs?: number;
552
- debounceMs?: number;
553
- }
554
- /**
555
- * Full diagnostics response from `GET {debugEndpoint}/diagnostics`.
556
- *
557
- * Used by both React `InternalsContent` and Vue `InternalsTab` / `InternalsSection`.
558
- */
559
- export interface DiagnosticsResponse {
560
- package: {
561
- version: string;
562
- nodeVersion: string;
563
- adonisVersion: string;
564
- uptime?: number;
565
- };
566
- config: {
567
- intervalMs: number;
568
- transport: string;
569
- channelName: string;
570
- endpoint: string | false;
571
- skipInTest: boolean;
572
- hasOnStatsCallback: boolean;
573
- hasShouldShowCallback: boolean;
574
- };
575
- devToolbar: {
576
- enabled: boolean;
577
- maxQueries: number;
578
- maxEvents: number;
579
- maxEmails: number;
580
- maxTraces: number;
581
- slowQueryThresholdMs: number;
582
- tracing: boolean;
583
- dashboard: boolean;
584
- dashboardPath: string;
585
- debugEndpoint: string;
586
- retentionDays: number;
587
- dbPath: string;
588
- persistDebugData: boolean | string;
589
- renderer: string;
590
- excludeFromTracing: string[];
591
- customPaneCount: number;
592
- };
593
- collectors: DiagnosticsCollectorInfo[];
594
- buffers: Record<string, DiagnosticsBufferInfo>;
595
- timers: Record<string, DiagnosticsTimerInfo>;
596
- transmit: {
597
- available: boolean;
598
- channels: string[];
599
- };
600
- integrations: Record<string, {
601
- active?: boolean;
602
- available?: boolean;
603
- mode?: string;
604
- }>;
605
- storage: {
606
- ready: boolean;
607
- dbPath: string;
608
- fileSizeMb: number;
609
- walSizeMb: number;
610
- retentionDays: number;
611
- tables: Array<{
612
- name: string;
613
- rowCount: number;
614
- }>;
615
- lastCleanupAt: number | null;
616
- } | null;
617
- uptime?: number;
618
- }
186
+ export type { Theme } from './theme.js';
@@ -1,9 +1,9 @@
1
1
  import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as i, useCallback as f } from "react";
3
3
  import { formatCacheSize as x, formatTtl as D } from "adonisjs-server-stats/core";
4
- import { a as S, J as V } from "./index-CecA4IdQ.js";
4
+ import { a as S, J as V } from "./index-CsImORX6.js";
5
5
  import { D as F } from "./DataTable-YyShr5B-.js";
6
- import { F as L } from "./FilterBar-DQRXpWrb.js";
6
+ import { F as L } from "./FilterBar-CQ7bD669.js";
7
7
  function H({ options: k = {} }) {
8
8
  const [r, N] = i(""), [c, h] = i(null), [b, n] = i(null), [w, o] = i(!1), [y, d] = i(null), { data: m, isLoading: g, mutate: u, getApi: p } = S("cache", {
9
9
  ...k,