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.
Files changed (527) hide show
  1. package/README.md +351 -171
  2. package/dist/configure.d.ts.map +1 -1
  3. package/dist/core/api-client.d.ts +73 -0
  4. package/dist/core/api-client.d.ts.map +1 -0
  5. package/dist/core/config-utils.d.ts +109 -0
  6. package/dist/core/config-utils.d.ts.map +1 -0
  7. package/dist/core/constants.d.ts +11 -0
  8. package/dist/core/constants.d.ts.map +1 -0
  9. package/dist/core/dashboard-api.d.ts +65 -0
  10. package/dist/core/dashboard-api.d.ts.map +1 -0
  11. package/dist/core/dashboard-data-controller.d.ts +157 -0
  12. package/dist/core/dashboard-data-controller.d.ts.map +1 -0
  13. package/dist/core/debug-data-controller.d.ts +89 -0
  14. package/dist/core/debug-data-controller.d.ts.map +1 -0
  15. package/dist/core/feature-detect.d.ts +67 -0
  16. package/dist/core/feature-detect.d.ts.map +1 -0
  17. package/dist/core/formatters.d.ts +189 -0
  18. package/dist/core/formatters.d.ts.map +1 -0
  19. package/dist/core/history-buffer.d.ts +23 -0
  20. package/dist/core/history-buffer.d.ts.map +1 -0
  21. package/dist/core/icons.d.ts +36 -0
  22. package/dist/core/icons.d.ts.map +1 -0
  23. package/dist/core/index.d.ts +39 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/index.js +1961 -0
  26. package/dist/core/internals-utils.d.ts +71 -0
  27. package/dist/core/internals-utils.d.ts.map +1 -0
  28. package/dist/core/job-utils.d.ts +45 -0
  29. package/dist/core/job-utils.d.ts.map +1 -0
  30. package/dist/core/log-utils.d.ts +34 -0
  31. package/dist/core/log-utils.d.ts.map +1 -0
  32. package/dist/core/metrics.d.ts +41 -0
  33. package/dist/core/metrics.d.ts.map +1 -0
  34. package/dist/core/pagination.d.ts +128 -0
  35. package/dist/core/pagination.d.ts.map +1 -0
  36. package/dist/core/query-utils.d.ts +35 -0
  37. package/dist/core/query-utils.d.ts.map +1 -0
  38. package/dist/core/resizable-columns.d.ts +18 -0
  39. package/dist/core/resizable-columns.d.ts.map +1 -0
  40. package/dist/core/routes.d.ts +12 -0
  41. package/dist/core/routes.d.ts.map +1 -0
  42. package/dist/core/server-stats-controller.d.ts +106 -0
  43. package/dist/core/server-stats-controller.d.ts.map +1 -0
  44. package/dist/core/sparkline.d.ts +80 -0
  45. package/dist/core/sparkline.d.ts.map +1 -0
  46. package/dist/core/theme.d.ts +42 -0
  47. package/dist/core/theme.d.ts.map +1 -0
  48. package/dist/core/trace-utils.d.ts +62 -0
  49. package/dist/core/trace-utils.d.ts.map +1 -0
  50. package/dist/core/transmit-adapter.d.ts +59 -0
  51. package/dist/core/transmit-adapter.d.ts.map +1 -0
  52. package/dist/core/types.d.ts +619 -0
  53. package/dist/core/types.d.ts.map +1 -0
  54. package/dist/react/CacheSection-DGxMDlWK.js +146 -0
  55. package/dist/react/CacheTab-CnVW5PLs.js +123 -0
  56. package/dist/react/ConfigContent-CnsEI4j3.js +397 -0
  57. package/dist/react/ConfigSection-DPcrfqXY.js +11 -0
  58. package/dist/react/ConfigTab-BSWq_o2p.js +15 -0
  59. package/dist/react/CustomPaneTab-xjkYwTvH.js +104 -0
  60. package/dist/react/DataTable-YyShr5B-.js +55 -0
  61. package/dist/react/EmailsSection-CSyTg1aX.js +262 -0
  62. package/dist/react/EmailsTab-Dh2YSa_f.js +131 -0
  63. package/dist/react/EventsSection-C1pbJDfW.js +86 -0
  64. package/dist/react/EventsTab-eCh02cdd.js +63 -0
  65. package/dist/react/FilterBar-DQRXpWrb.js +50 -0
  66. package/dist/react/InternalsContent-DBzsI0CG.js +346 -0
  67. package/dist/react/InternalsSection-t7ihcWO-.js +32 -0
  68. package/dist/react/InternalsTab-Oij0A2fN.js +30 -0
  69. package/dist/react/JobsSection-CLAin5vU.js +187 -0
  70. package/dist/react/JobsTab-Dl5nrj2z.js +141 -0
  71. package/dist/react/LogsSection-C1p81fXO.js +212 -0
  72. package/dist/react/LogsTab-D-kR7PjX.js +88 -0
  73. package/dist/react/OverviewSection-nm3xdACz.js +539 -0
  74. package/dist/react/Pagination-BkmzUDY8.js +64 -0
  75. package/dist/react/QueriesSection-DB12HMfQ.js +461 -0
  76. package/dist/react/QueriesTab-fyBB1u_Y.js +90 -0
  77. package/dist/react/RequestsSection-DTqB81ac.js +209 -0
  78. package/dist/react/RoutesSection-DJWa4NPV.js +74 -0
  79. package/dist/react/RoutesTab-D3l8TOpu.js +74 -0
  80. package/dist/react/TimelineSection-C4d-jRX1.js +158 -0
  81. package/dist/react/TimelineTab-C5TFaSmQ.js +193 -0
  82. package/dist/react/WaterfallChart-Cj73WdfM.js +100 -0
  83. package/dist/react/core/api-client.d.ts +73 -0
  84. package/dist/react/core/api-client.d.ts.map +1 -0
  85. package/dist/react/core/config-utils.d.ts +109 -0
  86. package/dist/react/core/config-utils.d.ts.map +1 -0
  87. package/dist/react/core/constants.d.ts +11 -0
  88. package/dist/react/core/constants.d.ts.map +1 -0
  89. package/dist/react/core/dashboard-api.d.ts +65 -0
  90. package/dist/react/core/dashboard-api.d.ts.map +1 -0
  91. package/dist/react/core/dashboard-data-controller.d.ts +157 -0
  92. package/dist/react/core/dashboard-data-controller.d.ts.map +1 -0
  93. package/dist/react/core/debug-data-controller.d.ts +89 -0
  94. package/dist/react/core/debug-data-controller.d.ts.map +1 -0
  95. package/dist/react/core/feature-detect.d.ts +67 -0
  96. package/dist/react/core/feature-detect.d.ts.map +1 -0
  97. package/dist/react/core/formatters.d.ts +189 -0
  98. package/dist/react/core/formatters.d.ts.map +1 -0
  99. package/dist/react/core/history-buffer.d.ts +23 -0
  100. package/dist/react/core/history-buffer.d.ts.map +1 -0
  101. package/dist/react/core/icons.d.ts +36 -0
  102. package/dist/react/core/icons.d.ts.map +1 -0
  103. package/dist/react/core/index.d.ts +39 -0
  104. package/dist/react/core/index.d.ts.map +1 -0
  105. package/dist/react/core/internals-utils.d.ts +71 -0
  106. package/dist/react/core/internals-utils.d.ts.map +1 -0
  107. package/dist/react/core/job-utils.d.ts +45 -0
  108. package/dist/react/core/job-utils.d.ts.map +1 -0
  109. package/dist/react/core/log-utils.d.ts +34 -0
  110. package/dist/react/core/log-utils.d.ts.map +1 -0
  111. package/dist/react/core/metrics.d.ts +41 -0
  112. package/dist/react/core/metrics.d.ts.map +1 -0
  113. package/dist/react/core/pagination.d.ts +128 -0
  114. package/dist/react/core/pagination.d.ts.map +1 -0
  115. package/dist/react/core/query-utils.d.ts +35 -0
  116. package/dist/react/core/query-utils.d.ts.map +1 -0
  117. package/dist/react/core/resizable-columns.d.ts +18 -0
  118. package/dist/react/core/resizable-columns.d.ts.map +1 -0
  119. package/dist/react/core/routes.d.ts +12 -0
  120. package/dist/react/core/routes.d.ts.map +1 -0
  121. package/dist/react/core/server-stats-controller.d.ts +106 -0
  122. package/dist/react/core/server-stats-controller.d.ts.map +1 -0
  123. package/dist/react/core/sparkline.d.ts +80 -0
  124. package/dist/react/core/sparkline.d.ts.map +1 -0
  125. package/dist/react/core/theme.d.ts +42 -0
  126. package/dist/react/core/theme.d.ts.map +1 -0
  127. package/dist/react/core/trace-utils.d.ts +62 -0
  128. package/dist/react/core/trace-utils.d.ts.map +1 -0
  129. package/dist/react/core/transmit-adapter.d.ts +59 -0
  130. package/dist/react/core/transmit-adapter.d.ts.map +1 -0
  131. package/dist/react/core/types.d.ts +619 -0
  132. package/dist/react/core/types.d.ts.map +1 -0
  133. package/dist/react/index-UdTfSvtO.js +1074 -0
  134. package/dist/react/index.js +18 -0
  135. package/dist/react/react/components/Dashboard/DashboardPage.d.ts +17 -0
  136. package/dist/react/react/components/Dashboard/DashboardPage.d.ts.map +1 -0
  137. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts +7 -0
  138. package/dist/react/react/components/Dashboard/sections/CacheSection.d.ts.map +1 -0
  139. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts +7 -0
  140. package/dist/react/react/components/Dashboard/sections/ConfigSection.d.ts.map +1 -0
  141. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts +7 -0
  142. package/dist/react/react/components/Dashboard/sections/EmailsSection.d.ts.map +1 -0
  143. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts +7 -0
  144. package/dist/react/react/components/Dashboard/sections/EventsSection.d.ts.map +1 -0
  145. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts +14 -0
  146. package/dist/react/react/components/Dashboard/sections/InternalsSection.d.ts.map +1 -0
  147. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts +7 -0
  148. package/dist/react/react/components/Dashboard/sections/JobsSection.d.ts.map +1 -0
  149. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts +7 -0
  150. package/dist/react/react/components/Dashboard/sections/LogsSection.d.ts.map +1 -0
  151. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts +7 -0
  152. package/dist/react/react/components/Dashboard/sections/OverviewSection.d.ts.map +1 -0
  153. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts +7 -0
  154. package/dist/react/react/components/Dashboard/sections/QueriesSection.d.ts.map +1 -0
  155. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts +7 -0
  156. package/dist/react/react/components/Dashboard/sections/RequestsSection.d.ts.map +1 -0
  157. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts +7 -0
  158. package/dist/react/react/components/Dashboard/sections/RoutesSection.d.ts.map +1 -0
  159. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +9 -0
  160. package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts.map +1 -0
  161. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts +27 -0
  162. package/dist/react/react/components/Dashboard/shared/DataTable.d.ts.map +1 -0
  163. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts +17 -0
  164. package/dist/react/react/components/Dashboard/shared/FilterBar.d.ts.map +1 -0
  165. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts +13 -0
  166. package/dist/react/react/components/Dashboard/shared/Pagination.d.ts.map +1 -0
  167. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts +12 -0
  168. package/dist/react/react/components/Dashboard/shared/TimeRangeSelector.d.ts.map +1 -0
  169. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts +16 -0
  170. package/dist/react/react/components/Dashboard/shared/WaterfallChart.d.ts.map +1 -0
  171. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts +16 -0
  172. package/dist/react/react/components/DebugPanel/DebugPanel.d.ts.map +1 -0
  173. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts +8 -0
  174. package/dist/react/react/components/DebugPanel/tabs/CacheTab.d.ts.map +1 -0
  175. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts +8 -0
  176. package/dist/react/react/components/DebugPanel/tabs/ConfigTab.d.ts.map +1 -0
  177. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts +14 -0
  178. package/dist/react/react/components/DebugPanel/tabs/CustomPaneTab.d.ts.map +1 -0
  179. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts +7 -0
  180. package/dist/react/react/components/DebugPanel/tabs/EmailsTab.d.ts.map +1 -0
  181. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts +7 -0
  182. package/dist/react/react/components/DebugPanel/tabs/EventsTab.d.ts.map +1 -0
  183. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts +12 -0
  184. package/dist/react/react/components/DebugPanel/tabs/InternalsTab.d.ts.map +1 -0
  185. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts +9 -0
  186. package/dist/react/react/components/DebugPanel/tabs/JobsTab.d.ts.map +1 -0
  187. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts +7 -0
  188. package/dist/react/react/components/DebugPanel/tabs/LogsTab.d.ts.map +1 -0
  189. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts +7 -0
  190. package/dist/react/react/components/DebugPanel/tabs/QueriesTab.d.ts.map +1 -0
  191. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts +8 -0
  192. package/dist/react/react/components/DebugPanel/tabs/RoutesTab.d.ts.map +1 -0
  193. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts +7 -0
  194. package/dist/react/react/components/DebugPanel/tabs/TimelineTab.d.ts.map +1 -0
  195. package/dist/react/react/components/StatsBar/MetricCard.d.ts +21 -0
  196. package/dist/react/react/components/StatsBar/MetricCard.d.ts.map +1 -0
  197. package/dist/react/react/components/StatsBar/Sparkline.d.ts +15 -0
  198. package/dist/react/react/components/StatsBar/Sparkline.d.ts.map +1 -0
  199. package/dist/react/react/components/StatsBar/StatsBar.d.ts +22 -0
  200. package/dist/react/react/components/StatsBar/StatsBar.d.ts.map +1 -0
  201. package/dist/react/react/components/shared/Badge.d.ts +32 -0
  202. package/dist/react/react/components/shared/Badge.d.ts.map +1 -0
  203. package/dist/react/react/components/shared/ConfigContent.d.ts +13 -0
  204. package/dist/react/react/components/shared/ConfigContent.d.ts.map +1 -0
  205. package/dist/react/react/components/shared/InternalsContent.d.ts +10 -0
  206. package/dist/react/react/components/shared/InternalsContent.d.ts.map +1 -0
  207. package/dist/react/react/components/shared/JsonViewer.d.ts +12 -0
  208. package/dist/react/react/components/shared/JsonViewer.d.ts.map +1 -0
  209. package/dist/react/react/components/shared/ThemeToggle.d.ts +13 -0
  210. package/dist/react/react/components/shared/ThemeToggle.d.ts.map +1 -0
  211. package/dist/react/react/components/shared/Tooltip.d.ts +16 -0
  212. package/dist/react/react/components/shared/Tooltip.d.ts.map +1 -0
  213. package/dist/react/react/hooks/useApiClient.d.ts +10 -0
  214. package/dist/react/react/hooks/useApiClient.d.ts.map +1 -0
  215. package/dist/react/react/hooks/useDashboardApiBase.d.ts +19 -0
  216. package/dist/react/react/hooks/useDashboardApiBase.d.ts.map +1 -0
  217. package/dist/react/react/hooks/useDashboardData.d.ts +27 -0
  218. package/dist/react/react/hooks/useDashboardData.d.ts.map +1 -0
  219. package/dist/react/react/hooks/useDebugData.d.ts +17 -0
  220. package/dist/react/react/hooks/useDebugData.d.ts.map +1 -0
  221. package/dist/react/react/hooks/useFeatures.d.ts +13 -0
  222. package/dist/react/react/hooks/useFeatures.d.ts.map +1 -0
  223. package/dist/react/react/hooks/useResizableTable.d.ts +13 -0
  224. package/dist/react/react/hooks/useResizableTable.d.ts.map +1 -0
  225. package/dist/react/react/hooks/useServerStats.d.ts +21 -0
  226. package/dist/react/react/hooks/useServerStats.d.ts.map +1 -0
  227. package/dist/react/react/hooks/useTheme.d.ts +12 -0
  228. package/dist/react/react/hooks/useTheme.d.ts.map +1 -0
  229. package/dist/react/react/index.d.ts +14 -0
  230. package/dist/react/react/index.d.ts.map +1 -0
  231. package/dist/react/style.css +1 -0
  232. package/dist/react/useApiClient-BVtNCmnL.js +9 -0
  233. package/dist/react/useDashboardApiBase-Bi36pJ2L.js +14 -0
  234. package/dist/react/useResizableTable-CNJmACdt.js +13 -0
  235. package/dist/src/collectors/app_collector.d.ts.map +1 -1
  236. package/dist/src/collectors/app_collector.js +30 -2
  237. package/dist/src/collectors/auto_detect.d.ts +31 -0
  238. package/dist/src/collectors/auto_detect.d.ts.map +1 -0
  239. package/dist/src/collectors/auto_detect.js +120 -0
  240. package/dist/src/collectors/collector.d.ts +17 -0
  241. package/dist/src/collectors/collector.d.ts.map +1 -1
  242. package/dist/src/collectors/db_pool_collector.d.ts.map +1 -1
  243. package/dist/src/collectors/db_pool_collector.js +35 -1
  244. package/dist/src/collectors/http_collector.d.ts +4 -3
  245. package/dist/src/collectors/http_collector.d.ts.map +1 -1
  246. package/dist/src/collectors/http_collector.js +28 -11
  247. package/dist/src/collectors/index.d.ts +2 -0
  248. package/dist/src/collectors/index.d.ts.map +1 -1
  249. package/dist/src/collectors/index.js +1 -0
  250. package/dist/src/collectors/log_collector.d.ts +11 -4
  251. package/dist/src/collectors/log_collector.d.ts.map +1 -1
  252. package/dist/src/collectors/log_collector.js +51 -5
  253. package/dist/src/collectors/process_collector.d.ts.map +1 -1
  254. package/dist/src/collectors/process_collector.js +4 -0
  255. package/dist/src/collectors/queue_collector.d.ts.map +1 -1
  256. package/dist/src/collectors/queue_collector.js +55 -1
  257. package/dist/src/collectors/redis_collector.d.ts.map +1 -1
  258. package/dist/src/collectors/redis_collector.js +42 -3
  259. package/dist/src/collectors/system_collector.d.ts.map +1 -1
  260. package/dist/src/collectors/system_collector.js +4 -0
  261. package/dist/src/controller/api_controller.d.ts +101 -0
  262. package/dist/src/controller/api_controller.d.ts.map +1 -0
  263. package/dist/src/controller/api_controller.js +131 -0
  264. package/dist/src/controller/debug_controller.d.ts +19 -10
  265. package/dist/src/controller/debug_controller.d.ts.map +1 -1
  266. package/dist/src/controller/debug_controller.js +118 -101
  267. package/dist/src/core/theme.d.ts +42 -0
  268. package/dist/src/core/theme.d.ts.map +1 -0
  269. package/dist/src/core/theme.js +115 -0
  270. package/dist/src/dashboard/chart_aggregator.d.ts.map +1 -1
  271. package/dist/src/dashboard/chart_aggregator.js +3 -2
  272. package/dist/src/dashboard/dashboard_controller.d.ts +10 -14
  273. package/dist/src/dashboard/dashboard_controller.d.ts.map +1 -1
  274. package/dist/src/dashboard/dashboard_controller.js +132 -250
  275. package/dist/src/dashboard/dashboard_store.d.ts +62 -19
  276. package/dist/src/dashboard/dashboard_store.d.ts.map +1 -1
  277. package/dist/src/dashboard/dashboard_store.js +242 -53
  278. package/dist/src/dashboard/integrations/cache_inspector.d.ts +19 -1
  279. package/dist/src/dashboard/integrations/cache_inspector.d.ts.map +1 -1
  280. package/dist/src/dashboard/integrations/config_inspector.d.ts +1 -1
  281. package/dist/src/dashboard/integrations/config_inspector.d.ts.map +1 -1
  282. package/dist/src/dashboard/integrations/config_inspector.js +3 -2
  283. package/dist/src/dashboard/integrations/queue_inspector.d.ts +55 -10
  284. package/dist/src/dashboard/integrations/queue_inspector.d.ts.map +1 -1
  285. package/dist/src/dashboard/integrations/queue_inspector.js +70 -24
  286. package/dist/src/dashboard/migrator.d.ts +5 -0
  287. package/dist/src/dashboard/migrator.d.ts.map +1 -1
  288. package/dist/src/dashboard/migrator.js +44 -9
  289. package/dist/src/dashboard/models/stats_event.d.ts +1 -1
  290. package/dist/src/dashboard/models/stats_event.d.ts.map +1 -1
  291. package/dist/src/dashboard/models/stats_log.d.ts +1 -1
  292. package/dist/src/dashboard/models/stats_log.d.ts.map +1 -1
  293. package/dist/src/dashboard/models/stats_query.d.ts +1 -1
  294. package/dist/src/dashboard/models/stats_query.d.ts.map +1 -1
  295. package/dist/src/dashboard/models/stats_saved_filter.d.ts +1 -1
  296. package/dist/src/dashboard/models/stats_saved_filter.d.ts.map +1 -1
  297. package/dist/src/dashboard/models/stats_trace.d.ts +2 -1
  298. package/dist/src/dashboard/models/stats_trace.d.ts.map +1 -1
  299. package/dist/src/data/data_access.d.ts +105 -0
  300. package/dist/src/data/data_access.d.ts.map +1 -0
  301. package/dist/src/data/data_access.js +310 -0
  302. package/dist/src/data/index.d.ts +3 -0
  303. package/dist/src/data/index.d.ts.map +1 -0
  304. package/dist/src/data/index.js +1 -0
  305. package/dist/src/debug/debug_store.d.ts +20 -1
  306. package/dist/src/debug/debug_store.d.ts.map +1 -1
  307. package/dist/src/debug/debug_store.js +43 -15
  308. package/dist/src/debug/email_collector.d.ts +6 -2
  309. package/dist/src/debug/email_collector.d.ts.map +1 -1
  310. package/dist/src/debug/email_collector.js +3 -0
  311. package/dist/src/debug/event_collector.d.ts +6 -2
  312. package/dist/src/debug/event_collector.d.ts.map +1 -1
  313. package/dist/src/debug/event_collector.js +12 -8
  314. package/dist/src/debug/query_collector.d.ts +6 -2
  315. package/dist/src/debug/query_collector.d.ts.map +1 -1
  316. package/dist/src/debug/query_collector.js +3 -0
  317. package/dist/src/debug/ring_buffer.d.ts +1 -0
  318. package/dist/src/debug/ring_buffer.d.ts.map +1 -1
  319. package/dist/src/debug/ring_buffer.js +5 -2
  320. package/dist/src/debug/route_inspector.d.ts +2 -2
  321. package/dist/src/debug/route_inspector.d.ts.map +1 -1
  322. package/dist/src/debug/route_inspector.js +4 -3
  323. package/dist/src/debug/trace_collector.d.ts +7 -3
  324. package/dist/src/debug/trace_collector.d.ts.map +1 -1
  325. package/dist/src/debug/trace_collector.js +7 -5
  326. package/dist/src/debug/types.d.ts +107 -2
  327. package/dist/src/debug/types.d.ts.map +1 -1
  328. package/dist/src/debug/types.js +1 -1
  329. package/dist/src/define_config.d.ts +49 -5
  330. package/dist/src/define_config.d.ts.map +1 -1
  331. package/dist/src/define_config.js +361 -4
  332. package/dist/src/edge/bootstrap.d.ts +17 -0
  333. package/dist/src/edge/bootstrap.d.ts.map +1 -0
  334. package/dist/src/edge/bootstrap.js +29 -0
  335. package/dist/src/edge/client/dashboard.js +2 -3619
  336. package/dist/src/edge/client/debug-panel-deferred.js +1 -0
  337. package/dist/src/edge/client/debug-panel.js +1 -2140
  338. package/dist/src/edge/client/stats-bar.js +1 -801
  339. package/dist/src/edge/client-vue/dashboard.js +5 -0
  340. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -0
  341. package/dist/src/edge/client-vue/debug-panel.js +4 -0
  342. package/dist/src/edge/client-vue/stats-bar.js +4 -0
  343. package/dist/src/edge/plugin.d.ts +35 -2
  344. package/dist/src/edge/plugin.d.ts.map +1 -1
  345. package/dist/src/edge/plugin.js +30 -66
  346. package/dist/src/edge/types.d.ts +46 -0
  347. package/dist/src/edge/types.d.ts.map +1 -0
  348. package/dist/src/edge/types.js +4 -0
  349. package/dist/src/edge/views/dashboard.edge +1 -358
  350. package/dist/src/edge/views/debug-panel.edge +2 -154
  351. package/dist/src/edge/views/stats-bar.edge +15 -48
  352. package/dist/src/engine/stats_engine.d.ts +18 -0
  353. package/dist/src/engine/stats_engine.d.ts.map +1 -1
  354. package/dist/src/engine/stats_engine.js +45 -2
  355. package/dist/src/index.d.ts +1 -1
  356. package/dist/src/index.d.ts.map +1 -1
  357. package/dist/src/log_stream/log_stream_provider.d.ts.map +1 -1
  358. package/dist/src/log_stream/log_stream_provider.js +21 -4
  359. package/dist/src/log_stream/log_stream_service.d.ts +8 -1
  360. package/dist/src/log_stream/log_stream_service.d.ts.map +1 -1
  361. package/dist/src/log_stream/log_stream_service.js +27 -3
  362. package/dist/src/middleware/request_tracking_middleware.d.ts +1 -1
  363. package/dist/src/middleware/request_tracking_middleware.d.ts.map +1 -1
  364. package/dist/src/middleware/request_tracking_middleware.js +21 -6
  365. package/dist/src/prometheus/prometheus_collector.d.ts +2 -1
  366. package/dist/src/prometheus/prometheus_collector.d.ts.map +1 -1
  367. package/dist/src/provider/server_stats_provider.d.ts +100 -0
  368. package/dist/src/provider/server_stats_provider.d.ts.map +1 -1
  369. package/dist/src/provider/server_stats_provider.js +460 -104
  370. package/dist/src/routes/access_middleware.d.ts +2 -1
  371. package/dist/src/routes/access_middleware.d.ts.map +1 -1
  372. package/dist/src/routes/access_middleware.js +7 -1
  373. package/dist/src/routes/index.d.ts +4 -0
  374. package/dist/src/routes/index.d.ts.map +1 -0
  375. package/dist/src/routes/index.js +1 -0
  376. package/dist/src/routes/register_routes.d.ts +103 -0
  377. package/dist/src/routes/register_routes.d.ts.map +1 -0
  378. package/dist/src/routes/register_routes.js +356 -0
  379. package/dist/src/routes/router_types.d.ts +29 -0
  380. package/dist/src/routes/router_types.d.ts.map +1 -0
  381. package/dist/src/routes/router_types.js +1 -0
  382. package/dist/src/stubs/config.stub +12 -32
  383. package/dist/src/styles/components.css +1048 -0
  384. package/dist/src/{edge/client → styles}/dashboard.css +299 -736
  385. package/dist/src/{edge/client → styles}/debug-panel.css +117 -633
  386. package/dist/src/{edge/client → styles}/stats-bar.css +28 -10
  387. package/dist/src/styles/tokens.css +153 -0
  388. package/dist/src/styles/utilities.css +75 -0
  389. package/dist/src/types.d.ts +119 -16
  390. package/dist/src/types.d.ts.map +1 -1
  391. package/dist/src/utils/app_import.d.ts +23 -0
  392. package/dist/src/utils/app_import.d.ts.map +1 -0
  393. package/dist/src/utils/app_import.js +44 -0
  394. package/dist/src/utils/json_helpers.d.ts +2 -2
  395. package/dist/src/utils/json_helpers.d.ts.map +1 -1
  396. package/dist/src/utils/logger.d.ts +17 -0
  397. package/dist/src/utils/logger.d.ts.map +1 -0
  398. package/dist/src/utils/logger.js +27 -0
  399. package/dist/src/utils/mail_helpers.d.ts +1 -1
  400. package/dist/src/utils/mail_helpers.d.ts.map +1 -1
  401. package/dist/src/utils/mail_helpers.js +1 -1
  402. package/dist/vue/CacheSection-C788Yfai.js +149 -0
  403. package/dist/vue/CacheTab-BPisYYiQ.js +104 -0
  404. package/dist/vue/ConfigSection-CRzYxqW2.js +576 -0
  405. package/dist/vue/ConfigTab-C8cafGUj.js +361 -0
  406. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +172 -0
  407. package/dist/vue/EmailsSection-C8JFMtW7.js +206 -0
  408. package/dist/vue/EmailsTab-DhFhoNmU.js +157 -0
  409. package/dist/vue/EventsSection-C4wXUgxG.js +107 -0
  410. package/dist/vue/EventsTab-DQ4Nd6AK.js +97 -0
  411. package/dist/vue/FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js +62 -0
  412. package/dist/vue/InternalsSection-BJUXE-5F.js +468 -0
  413. package/dist/vue/InternalsTab-DEMjqtlw.js +471 -0
  414. package/dist/vue/JobsSection-CsKWTjgN.js +187 -0
  415. package/dist/vue/JobsTab-BCvhOARO.js +117 -0
  416. package/dist/vue/JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js +67 -0
  417. package/dist/vue/LogsSection-BFVjSZ24.js +227 -0
  418. package/dist/vue/LogsTab-DpEQ7euu.js +122 -0
  419. package/dist/vue/OverviewSection-CbMdAido.js +849 -0
  420. package/dist/vue/PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js +50 -0
  421. package/dist/vue/QueriesSection-BPiv7u3r.js +429 -0
  422. package/dist/vue/QueriesTab-C8_7oprC.js +107 -0
  423. package/dist/vue/RequestsSection-LtImH4rD.js +243 -0
  424. package/dist/vue/RoutesSection-CrxOxmzx.js +106 -0
  425. package/dist/vue/RoutesTab-Dz0MkZuF.js +80 -0
  426. package/dist/vue/TimelineSection-DLxMW2J_.js +186 -0
  427. package/dist/vue/TimelineTab-Db6lKKsD.js +250 -0
  428. package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +118 -0
  429. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts +18 -0
  430. package/dist/vue/components/Dashboard/DashboardPage.vue.d.ts.map +1 -0
  431. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts +5 -0
  432. package/dist/vue/components/Dashboard/sections/CacheSection.vue.d.ts.map +1 -0
  433. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts +3 -0
  434. package/dist/vue/components/Dashboard/sections/ConfigSection.vue.d.ts.map +1 -0
  435. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts +5 -0
  436. package/dist/vue/components/Dashboard/sections/EmailsSection.vue.d.ts.map +1 -0
  437. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts +5 -0
  438. package/dist/vue/components/Dashboard/sections/EventsSection.vue.d.ts.map +1 -0
  439. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts +3 -0
  440. package/dist/vue/components/Dashboard/sections/InternalsSection.vue.d.ts.map +1 -0
  441. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts +5 -0
  442. package/dist/vue/components/Dashboard/sections/JobsSection.vue.d.ts.map +1 -0
  443. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts +3 -0
  444. package/dist/vue/components/Dashboard/sections/LogsSection.vue.d.ts.map +1 -0
  445. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts +5 -0
  446. package/dist/vue/components/Dashboard/sections/OverviewSection.vue.d.ts.map +1 -0
  447. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +45 -0
  448. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts.map +1 -0
  449. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +5 -0
  450. package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts.map +1 -0
  451. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts +5 -0
  452. package/dist/vue/components/Dashboard/sections/RoutesSection.vue.d.ts.map +1 -0
  453. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts +11 -0
  454. package/dist/vue/components/Dashboard/sections/TimelineSection.vue.d.ts.map +1 -0
  455. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts +29 -0
  456. package/dist/vue/components/Dashboard/shared/FilterBar.vue.d.ts.map +1 -0
  457. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts +12 -0
  458. package/dist/vue/components/Dashboard/shared/PaginationControls.vue.d.ts.map +1 -0
  459. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts +11 -0
  460. package/dist/vue/components/Dashboard/shared/TimeRangeSelector.vue.d.ts.map +1 -0
  461. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts +10 -0
  462. package/dist/vue/components/Dashboard/shared/WaterfallChart.vue.d.ts.map +1 -0
  463. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts +21 -0
  464. package/dist/vue/components/DebugPanel/DebugPanel.vue.d.ts.map +1 -0
  465. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts +12 -0
  466. package/dist/vue/components/DebugPanel/tabs/CacheTab.vue.d.ts.map +1 -0
  467. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts +11 -0
  468. package/dist/vue/components/DebugPanel/tabs/ConfigTab.vue.d.ts.map +1 -0
  469. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts +11 -0
  470. package/dist/vue/components/DebugPanel/tabs/CustomPaneTab.vue.d.ts.map +1 -0
  471. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +12 -0
  472. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts.map +1 -0
  473. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts +12 -0
  474. package/dist/vue/components/DebugPanel/tabs/EventsTab.vue.d.ts.map +1 -0
  475. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts +11 -0
  476. package/dist/vue/components/DebugPanel/tabs/InternalsTab.vue.d.ts.map +1 -0
  477. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts +13 -0
  478. package/dist/vue/components/DebugPanel/tabs/JobsTab.vue.d.ts.map +1 -0
  479. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts +15 -0
  480. package/dist/vue/components/DebugPanel/tabs/LogsTab.vue.d.ts.map +1 -0
  481. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts +12 -0
  482. package/dist/vue/components/DebugPanel/tabs/QueriesTab.vue.d.ts.map +1 -0
  483. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts +12 -0
  484. package/dist/vue/components/DebugPanel/tabs/RoutesTab.vue.d.ts.map +1 -0
  485. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +15 -0
  486. package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts.map +1 -0
  487. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts +19 -0
  488. package/dist/vue/components/StatsBar/MetricCard.vue.d.ts.map +1 -0
  489. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts +17 -0
  490. package/dist/vue/components/StatsBar/Sparkline.vue.d.ts.map +1 -0
  491. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts +22 -0
  492. package/dist/vue/components/StatsBar/StatsBar.vue.d.ts.map +1 -0
  493. package/dist/vue/components/shared/JsonViewer.vue.d.ts +13 -0
  494. package/dist/vue/components/shared/JsonViewer.vue.d.ts.map +1 -0
  495. package/dist/vue/components/shared/ThemeToggle.vue.d.ts +8 -0
  496. package/dist/vue/components/shared/ThemeToggle.vue.d.ts.map +1 -0
  497. package/dist/vue/composables/useApiClient.d.ts +9 -0
  498. package/dist/vue/composables/useApiClient.d.ts.map +1 -0
  499. package/dist/vue/composables/useDashboardData.d.ts +53 -0
  500. package/dist/vue/composables/useDashboardData.d.ts.map +1 -0
  501. package/dist/vue/composables/useDebugData.d.ts +25 -0
  502. package/dist/vue/composables/useDebugData.d.ts.map +1 -0
  503. package/dist/vue/composables/useFeatures.d.ts +80 -0
  504. package/dist/vue/composables/useFeatures.d.ts.map +1 -0
  505. package/dist/vue/composables/useResizableTable.d.ts +16 -0
  506. package/dist/vue/composables/useResizableTable.d.ts.map +1 -0
  507. package/dist/vue/composables/useServerStats.d.ts +104 -0
  508. package/dist/vue/composables/useServerStats.d.ts.map +1 -0
  509. package/dist/vue/composables/useTheme.d.ts +6 -0
  510. package/dist/vue/composables/useTheme.d.ts.map +1 -0
  511. package/dist/vue/index-qCQpBftQ.js +1233 -0
  512. package/dist/vue/index.d.ts +10 -0
  513. package/dist/vue/index.d.ts.map +1 -0
  514. package/dist/vue/index.js +11 -0
  515. package/dist/vue/style.css +1 -0
  516. package/dist/vue/useApiClient-BQQ9CF-q.js +10 -0
  517. package/dist/vue/useResizableTable-BoivAevK.js +17 -0
  518. package/package.json +72 -10
  519. package/dist/src/dashboard/dashboard_routes.d.ts +0 -16
  520. package/dist/src/dashboard/dashboard_routes.d.ts.map +0 -1
  521. package/dist/src/dashboard/dashboard_routes.js +0 -77
  522. package/dist/src/routes/debug_routes.d.ts +0 -14
  523. package/dist/src/routes/debug_routes.d.ts.map +0 -1
  524. package/dist/src/routes/debug_routes.js +0 -42
  525. package/dist/src/routes/stats_routes.d.ts +0 -14
  526. package/dist/src/routes/stats_routes.d.ts.map +0 -1
  527. package/dist/src/routes/stats_routes.js +0 -27
@@ -0,0 +1,1233 @@
1
+ import { ref as v, reactive as oe, computed as m, onMounted as X, onUnmounted as te, defineComponent as se, openBlock as t, createElementBlock as o, normalizeStyle as pe, Fragment as W, createElementVNode as l, watch as ee, nextTick as ke, onBeforeUnmount as de, normalizeClass as z, toDisplayString as M, createCommentVNode as E, createBlock as V, Teleport as ye, withModifiers as we, unref as s, createVNode as ue, renderList as ae, defineAsyncComponent as $, createTextVNode as Te, provide as ne, Suspense as _e, withCtx as he, resolveDynamicComponent as Ce } from "vue";
2
+ import { ServerStatsController as Ee, DEFAULT_FEATURES as Se, detectFeatures as xe, getTheme as ve, onThemeChange as $e, toggleTheme as Le, buildSparklineData as Be, computeStats as Me, formatStatNum as re, detectMetricGroupsFromStats as Pe, getVisibleMetricGroups as Ue, getMetricsByGroup as Re, TAB_ICONS as j, DebugDataController as fe, DashboardDataController as De, UnauthorizedError as je, subscribeToChannel as He } from "adonisjs-server-stats/core";
3
+ function Ae(e = {}) {
4
+ const {
5
+ baseUrl: T = "",
6
+ endpoint: a = "/admin/api/server-stats",
7
+ channelName: S = "admin/server-stats",
8
+ authToken: i,
9
+ pollInterval: f = 3e3
10
+ } = e, _ = v(null), k = oe({}), x = v(!1), P = v(!1), U = v(null), C = v(!1), h = v(!1), b = v(!1);
11
+ let u = null;
12
+ const r = m(() => C.value ? "disconnected" : h.value ? "live" : b.value ? "polling" : "disconnected");
13
+ return X(() => {
14
+ C.value || (u = new Ee({
15
+ baseUrl: T,
16
+ endpoint: a,
17
+ channelName: S,
18
+ authToken: i,
19
+ pollInterval: f,
20
+ onStatsUpdate: (p) => {
21
+ _.value = p;
22
+ },
23
+ onConnectionChange: (p) => {
24
+ x.value = p;
25
+ },
26
+ onStaleChange: (p) => {
27
+ P.value = p;
28
+ },
29
+ onError: (p) => {
30
+ U.value = p;
31
+ },
32
+ onUnauthorizedChange: (p) => {
33
+ C.value = p;
34
+ },
35
+ onHistoryChange: (p) => {
36
+ for (const y of Object.keys(p))
37
+ k[y] = p[y];
38
+ },
39
+ onSseActiveChange: (p) => {
40
+ h.value = p;
41
+ },
42
+ onPollActiveChange: (p) => {
43
+ b.value = p;
44
+ }
45
+ }), u.start());
46
+ }), te(() => {
47
+ u?.stop(), u = null;
48
+ }), {
49
+ stats: _,
50
+ history: k,
51
+ isConnected: x,
52
+ isStale: P,
53
+ isUnauthorized: C,
54
+ error: U,
55
+ connectionMode: r
56
+ };
57
+ }
58
+ function ce(e = {}) {
59
+ const { baseUrl: T = "", debugEndpoint: a = "/admin/api/debug", authToken: S } = e, i = v({ ...Se }), f = v(!0);
60
+ return X(async () => {
61
+ i.value = await xe({ baseUrl: T, debugEndpoint: a, authToken: S }), f.value = !1;
62
+ }), {
63
+ features: i,
64
+ loading: f
65
+ };
66
+ }
67
+ function le() {
68
+ const e = v(ve());
69
+ let T = null;
70
+ function a(i) {
71
+ e.value = i;
72
+ }
73
+ function S() {
74
+ const i = Le();
75
+ return e.value = i, i;
76
+ }
77
+ return X(() => {
78
+ e.value = ve(), T = $e(a);
79
+ }), te(() => {
80
+ T?.();
81
+ }), {
82
+ theme: e,
83
+ toggleTheme: S
84
+ };
85
+ }
86
+ const Ie = ["width", "height", "viewBox"], qe = ["id"], Oe = ["stop-color"], ze = ["stop-color"], Ne = ["d", "fill"], Fe = ["d", "stroke"], Ve = ["x", "y"], Ge = /* @__PURE__ */ se({
87
+ __name: "Sparkline",
88
+ props: {
89
+ data: {},
90
+ color: { default: "#34d399" },
91
+ width: { default: 120 },
92
+ height: { default: 32 }
93
+ },
94
+ setup(e) {
95
+ const T = e, a = m(
96
+ () => Be(T.data, {
97
+ width: T.width,
98
+ height: T.height,
99
+ color: T.color
100
+ })
101
+ ), S = m(() => a.value !== null), i = m(() => `sg-${T.color.replace("#", "")}`);
102
+ return (f, _) => (t(), o("div", {
103
+ class: "ss-dash-sparkline",
104
+ style: pe({ "--ss-accent": e.color })
105
+ }, [
106
+ (t(), o("svg", {
107
+ width: e.width,
108
+ height: e.height,
109
+ viewBox: `0 0 ${e.width} ${e.height}`,
110
+ style: { display: "block" }
111
+ }, [
112
+ S.value && a.value ? (t(), o(W, { key: 0 }, [
113
+ l("defs", null, [
114
+ l("linearGradient", {
115
+ id: i.value,
116
+ x1: "0",
117
+ y1: "0",
118
+ x2: "0",
119
+ y2: "1"
120
+ }, [
121
+ l("stop", {
122
+ offset: "0%",
123
+ "stop-color": e.color,
124
+ "stop-opacity": "0.25"
125
+ }, null, 8, Oe),
126
+ l("stop", {
127
+ offset: "100%",
128
+ "stop-color": e.color,
129
+ "stop-opacity": "0.02"
130
+ }, null, 8, ze)
131
+ ], 8, qe)
132
+ ]),
133
+ l("path", {
134
+ d: a.value.areaPath,
135
+ fill: `url(#${i.value})`
136
+ }, null, 8, Ne),
137
+ l("path", {
138
+ class: "ss-dash-sparkline-line",
139
+ d: "M" + a.value.points.replace(/ /g, " L"),
140
+ fill: "none",
141
+ stroke: e.color,
142
+ "stroke-width": "1.5",
143
+ "stroke-linejoin": "round",
144
+ "stroke-linecap": "round"
145
+ }, null, 8, Fe)
146
+ ], 64)) : (t(), o("text", {
147
+ key: 1,
148
+ x: e.width / 2,
149
+ y: e.height / 2 + 3,
150
+ "text-anchor": "middle",
151
+ fill: "#737373",
152
+ "font-size": "9"
153
+ }, " collecting... ", 8, Ve))
154
+ ], 8, Ie))
155
+ ], 4));
156
+ }
157
+ }), Qe = ["id"], Ke = { class: "ss-label" }, Je = {
158
+ class: "ss-tooltip-inner",
159
+ style: { position: "relative" }
160
+ }, We = { class: "ss-tooltip-header" }, Xe = { class: "ss-tooltip-title" }, Ye = {
161
+ key: 0,
162
+ class: "ss-tooltip-unit"
163
+ }, Ze = { class: "ss-tooltip-current" }, et = { class: "ss-tooltip-current-value" }, tt = {
164
+ key: 1,
165
+ class: "ss-tooltip-stats"
166
+ }, st = {
167
+ key: 2,
168
+ class: "ss-tooltip-details"
169
+ }, nt = {
170
+ key: 3,
171
+ class: "ss-tooltip-sparkline"
172
+ }, at = {
173
+ key: 4,
174
+ class: "ss-tooltip-samples"
175
+ }, ot = /* @__PURE__ */ se({
176
+ __name: "MetricCard",
177
+ props: {
178
+ metric: {},
179
+ stats: {},
180
+ history: {}
181
+ },
182
+ emits: ["pin"],
183
+ setup(e, { emit: T }) {
184
+ const a = e, S = T, i = v(!1), f = v(!1), _ = v(null), k = v(null), x = v(null), P = v({
185
+ position: "absolute",
186
+ bottom: "100%",
187
+ left: "0",
188
+ marginBottom: "10px",
189
+ zIndex: "180"
190
+ });
191
+ X(() => {
192
+ _.value && (x.value = _.value.closest(".ss-bar"));
193
+ });
194
+ function U() {
195
+ const L = _.value, F = k.value, Z = x.value;
196
+ if (!L || !F || !Z) return;
197
+ const K = L.getBoundingClientRect(), G = Z.getBoundingClientRect(), J = K.left - G.left + K.width / 2;
198
+ P.value = {
199
+ position: "absolute",
200
+ bottom: "100%",
201
+ left: `${J}px`,
202
+ transform: "translateX(-50%)",
203
+ marginBottom: "10px",
204
+ zIndex: "180"
205
+ }, requestAnimationFrame(() => {
206
+ if (!k.value) return;
207
+ const w = k.value.getBoundingClientRect();
208
+ let A = 0;
209
+ w.left < 8 ? A = 8 - w.left : w.right > window.innerWidth - 8 && (A = window.innerWidth - 8 - w.right), A && (P.value = {
210
+ ...P.value,
211
+ transform: `translateX(calc(-50% + ${A}px))`
212
+ });
213
+ });
214
+ }
215
+ const C = m(() => i.value || f.value);
216
+ ee(C, (L) => {
217
+ L && ke(U);
218
+ });
219
+ let h = null;
220
+ function b() {
221
+ C.value && U();
222
+ }
223
+ function u() {
224
+ C.value && U();
225
+ }
226
+ X(() => {
227
+ h = _.value?.closest(".ss-bar-scroll") ?? null, h?.addEventListener("scroll", b), window.addEventListener("resize", u);
228
+ }), de(() => {
229
+ h?.removeEventListener("scroll", b), window.removeEventListener("resize", u);
230
+ });
231
+ const r = m(() => a.stats ? (a.metric.value || a.metric.format)(a.stats) : "..."), p = m(() => !a.stats || !a.metric.color ? "green" : a.metric.color(a.stats)), y = m(() => !a.stats || !a.metric.show ? !0 : a.metric.show(a.stats)), R = m(() => a.metric.detail ? typeof a.metric.detail == "function" ? a.stats ? a.metric.detail(a.stats) : "" : a.metric.detail : ""), q = m(() => ({
232
+ green: "#34d399",
233
+ amber: "#fbbf24",
234
+ red: "#f87171",
235
+ muted: "#737373"
236
+ })[p.value] || "#34d399"), D = m(() => Me(a.history));
237
+ function c() {
238
+ i.value = !0;
239
+ }
240
+ function g() {
241
+ i.value = !1;
242
+ }
243
+ function O() {
244
+ f.value = !f.value, f.value && S("pin", a.metric.id);
245
+ }
246
+ function H() {
247
+ f.value = !1;
248
+ }
249
+ function Y(L) {
250
+ L.key === "Enter" && O();
251
+ }
252
+ function N(L) {
253
+ const F = L.target;
254
+ _.value && !_.value.contains(F) && k.value && !k.value.contains(F) && (f.value = !1);
255
+ }
256
+ function Q(L) {
257
+ L.key === "Escape" && (f.value = !1);
258
+ }
259
+ return ee(f, (L) => {
260
+ L ? (document.addEventListener("click", N), document.addEventListener("keydown", Q)) : (document.removeEventListener("click", N), document.removeEventListener("keydown", Q));
261
+ }), de(() => {
262
+ document.removeEventListener("click", N), document.removeEventListener("keydown", Q);
263
+ }), (L, F) => (t(), o(W, null, [
264
+ y.value ? (t(), o("div", {
265
+ key: 0,
266
+ ref_key: "badgeRef",
267
+ ref: _,
268
+ id: `ss-b-${e.metric.id}`,
269
+ class: z(["ss-badge", { "ss-pinned": f.value }]),
270
+ role: "button",
271
+ tabindex: 0,
272
+ onMouseenter: c,
273
+ onMouseleave: g,
274
+ onClick: O,
275
+ onKeydown: Y
276
+ }, [
277
+ l("span", Ke, M(e.metric.label), 1),
278
+ l("span", {
279
+ class: z(["ss-value", `ss-${p.value}`])
280
+ }, M(r.value), 3)
281
+ ], 42, Qe)) : E("", !0),
282
+ C.value && x.value ? (t(), V(ye, {
283
+ key: 1,
284
+ to: x.value
285
+ }, [
286
+ l("div", {
287
+ ref_key: "tooltipRef",
288
+ ref: k,
289
+ class: z(["ss-tooltip", { "ss-pinned": f.value }]),
290
+ style: pe(P.value)
291
+ }, [
292
+ l("div", Je, [
293
+ f.value ? (t(), o("button", {
294
+ key: 0,
295
+ class: "ss-tooltip-close",
296
+ onClick: we(H, ["stop"])
297
+ }, "×")) : E("", !0),
298
+ l("div", We, [
299
+ l("span", Xe, M(e.metric.title), 1),
300
+ e.metric.unit ? (t(), o("span", Ye, M(e.metric.unit), 1)) : E("", !0)
301
+ ]),
302
+ l("div", Ze, [
303
+ F[0] || (F[0] = l("span", { class: "ss-tooltip-current-label" }, "Current: ", -1)),
304
+ l("span", et, M(r.value), 1)
305
+ ]),
306
+ D.value ? (t(), o("div", tt, [
307
+ l("span", null, "Min: " + M(s(re)(D.value.min, e.metric.unit)), 1),
308
+ l("span", null, "Max: " + M(s(re)(D.value.max, e.metric.unit)), 1),
309
+ l("span", null, "Avg: " + M(s(re)(D.value.avg, e.metric.unit)), 1)
310
+ ])) : E("", !0),
311
+ R.value ? (t(), o("div", st, M(R.value), 1)) : E("", !0),
312
+ e.history.length > 0 ? (t(), o("div", nt, [
313
+ ue(Ge, {
314
+ data: e.history,
315
+ color: q.value
316
+ }, null, 8, ["data", "color"])
317
+ ])) : E("", !0),
318
+ e.history.length > 0 ? (t(), o("div", at, " Last " + M(Math.min(e.history.length, 60)) + " samples (~" + M(Math.round(Math.min(e.history.length, 60) * 3 / 60)) + " min) ", 1)) : E("", !0)
319
+ ]),
320
+ F[1] || (F[1] = l("div", { class: "ss-tooltip-arrow" }, null, -1))
321
+ ], 6)
322
+ ], 8, ["to"])) : E("", !0)
323
+ ], 64));
324
+ }
325
+ }), lt = ["data-ss-theme"], it = { class: "ss-bar-left" }, rt = ["viewBox", "innerHTML"], ut = { class: "ss-group" }, ct = {
326
+ key: 0,
327
+ class: "ss-group-sep"
328
+ }, dt = ["data-ss-theme", "title"], ht = {
329
+ key: 0,
330
+ class: "ss-toggle-summary",
331
+ style: { display: "flex" }
332
+ }, vt = {
333
+ key: 1,
334
+ class: "ss-value ss-green"
335
+ }, ft = {
336
+ key: 1,
337
+ class: "ss-toggle-label",
338
+ style: { color: "#737373" }
339
+ }, bt = { class: "ss-toggle-arrow" }, be = "admin:stats-bar", as = /* @__PURE__ */ se({
340
+ __name: "StatsBar",
341
+ props: {
342
+ debugEndpoint: { default: "/admin/api/debug" },
343
+ baseUrl: { default: "" },
344
+ endpoint: { default: "/admin/api/server-stats" },
345
+ channelName: { default: "admin/server-stats" },
346
+ authToken: {},
347
+ pollInterval: { default: 3e3 },
348
+ className: {},
349
+ debugPanelOpen: { type: Boolean, default: !1 }
350
+ },
351
+ emits: ["openDebugPanel", "connectionChange"],
352
+ setup(e, { emit: T }) {
353
+ const a = e, S = T, { stats: i, history: f, isStale: _, isUnauthorized: k, isConnected: x, connectionMode: P } = Ae({
354
+ baseUrl: a.baseUrl,
355
+ endpoint: a.endpoint,
356
+ channelName: a.channelName,
357
+ authToken: a.authToken,
358
+ pollInterval: a.pollInterval
359
+ });
360
+ ee(x, (g) => {
361
+ S("connectionChange", g);
362
+ });
363
+ const { features: U } = ce({
364
+ baseUrl: a.baseUrl,
365
+ debugEndpoint: a.debugEndpoint,
366
+ authToken: a.authToken
367
+ }), { theme: C } = le(), h = v(!0), b = v(null);
368
+ X(() => {
369
+ h.value = localStorage.getItem(be) !== "hidden";
370
+ const g = b.value;
371
+ if (g) {
372
+ const O = (H) => {
373
+ Math.abs(H.deltaX) > Math.abs(H.deltaY) || (H.preventDefault(), g.scrollLeft += H.deltaY);
374
+ };
375
+ g.addEventListener("wheel", O, { passive: !1 }), te(() => g.removeEventListener("wheel", O));
376
+ }
377
+ });
378
+ function u() {
379
+ h.value = !h.value, localStorage.setItem(be, h.value ? "visible" : "hidden");
380
+ }
381
+ ee(k, (g) => {
382
+ g && (h.value = !1);
383
+ });
384
+ const r = m(() => i.value ? Pe(i.value) : Ue(U.value)), p = m(() => {
385
+ const g = Re();
386
+ return Array.from(g.entries()).filter(([O]) => r.value.has(O)).map(([O, H]) => ({
387
+ name: O,
388
+ metrics: H
389
+ }));
390
+ });
391
+ function y(g) {
392
+ return g ? f[g] || [] : [];
393
+ }
394
+ const R = m(() => i.value ? `${i.value.cpuPercent.toFixed(0)}%` : "..."), q = m(() => i.value ? i.value.memHeapUsed !== void 0 ? Math.round(i.value.memHeapUsed / (1024 * 1024)) + "M" : "-" : "..."), D = m(() => i.value ? i.value.redisOk ? "✓" : "✗" : "..."), c = m(() => C.value);
395
+ return (g, O) => (t(), o(W, null, [
396
+ s(k) ? E("", !0) : (t(), o("div", {
397
+ key: 0,
398
+ id: "ss-bar",
399
+ class: z(["ss-bar", { "ss-hidden": !h.value }]),
400
+ "data-ss-theme": c.value
401
+ }, [
402
+ l("div", it, [
403
+ s(U).tracing || r.value.has("redis") || r.value.has("queue") ? (t(), o("button", {
404
+ key: 0,
405
+ type: "button",
406
+ class: z(["ss-dbg-btn", { "ss-dbg-active": e.debugPanelOpen }]),
407
+ title: "Toggle debug panel",
408
+ id: "ss-dbg-wrench",
409
+ onClick: O[0] || (O[0] = (H) => S("openDebugPanel"))
410
+ }, [
411
+ (t(), o("svg", {
412
+ width: "14",
413
+ height: "14",
414
+ viewBox: s(j).wrench.viewBox,
415
+ fill: "none",
416
+ stroke: "currentColor",
417
+ "stroke-width": "2",
418
+ "stroke-linecap": "round",
419
+ "stroke-linejoin": "round",
420
+ innerHTML: s(j).wrench.elements.join("")
421
+ }, null, 8, rt))
422
+ ], 2)) : E("", !0),
423
+ l("div", {
424
+ class: z(["ss-dot", { "ss-stale": s(_) }])
425
+ }, null, 2)
426
+ ]),
427
+ l("div", {
428
+ ref_key: "scrollRef",
429
+ ref: b,
430
+ id: "ss-bar-scroll",
431
+ class: "ss-bar-scroll"
432
+ }, [
433
+ (t(!0), o(W, null, ae(p.value, (H, Y) => (t(), o(W, {
434
+ key: H.name
435
+ }, [
436
+ l("div", ut, [
437
+ (t(!0), o(W, null, ae(H.metrics, (N) => (t(), V(ot, {
438
+ key: N.id,
439
+ metric: N,
440
+ stats: s(i),
441
+ history: y(N.historyKey)
442
+ }, null, 8, ["metric", "stats", "history"]))), 128))
443
+ ]),
444
+ Y < p.value.length - 1 ? (t(), o("div", ct)) : E("", !0)
445
+ ], 64))), 128))
446
+ ], 512)
447
+ ], 10, lt)),
448
+ s(k) ? E("", !0) : (t(), o("button", {
449
+ key: 1,
450
+ type: "button",
451
+ class: z(["ss-toggle", h.value ? "ss-visible" : "ss-collapsed"]),
452
+ "data-ss-theme": c.value,
453
+ title: h.value ? "Hide stats bar" : "Show stats bar",
454
+ onClick: u
455
+ }, [
456
+ !h.value && s(i) ? (t(), o("span", ht, [
457
+ r.value.has("process") ? (t(), o("span", {
458
+ key: 0,
459
+ class: z([
460
+ "ss-value",
461
+ s(i).cpuPercent > 80 ? "ss-red" : s(i).cpuPercent > 50 ? "ss-amber" : "ss-green"
462
+ ])
463
+ }, M(R.value), 3)) : E("", !0),
464
+ r.value.has("process") ? (t(), o("span", vt, M(q.value), 1)) : E("", !0),
465
+ r.value.has("redis") && s(i)?.redisOk !== void 0 ? (t(), o("span", {
466
+ key: 2,
467
+ class: z(["ss-value", s(i)?.redisOk ? "ss-green" : "ss-red"])
468
+ }, M(D.value), 3)) : E("", !0)
469
+ ])) : E("", !0),
470
+ h.value ? (t(), o("span", ft, "hide stats")) : E("", !0),
471
+ l("span", bt, M(h.value ? "▼" : "▲"), 1)
472
+ ], 10, dt))
473
+ ], 64));
474
+ }
475
+ }), ge = /* @__PURE__ */ new Set(["cache", "jobs", "config"]);
476
+ function gt(e, T = {}) {
477
+ const {
478
+ baseUrl: a = "",
479
+ debugEndpoint: S = "/admin/api/debug",
480
+ dashboardEndpoint: i,
481
+ authToken: f,
482
+ refreshInterval: _
483
+ } = T, k = v(null), x = v(!1), P = v(null), U = v(!1), C = new fe({
484
+ baseUrl: a,
485
+ endpoint: S,
486
+ authToken: f,
487
+ refreshInterval: _,
488
+ onData: (c) => {
489
+ k.value = c;
490
+ },
491
+ onLoading: (c) => {
492
+ x.value = c;
493
+ },
494
+ onError: (c) => {
495
+ P.value = c;
496
+ },
497
+ onUnauthorized: () => {
498
+ U.value = !0;
499
+ }
500
+ });
501
+ let h = null;
502
+ function b() {
503
+ return !h && i && (h = new fe({
504
+ baseUrl: a,
505
+ endpoint: i,
506
+ authToken: f,
507
+ refreshInterval: _,
508
+ onData: (c) => {
509
+ k.value = c;
510
+ },
511
+ onLoading: (c) => {
512
+ x.value = c;
513
+ },
514
+ onError: (c) => {
515
+ P.value = c;
516
+ },
517
+ onUnauthorized: () => {
518
+ U.value = !0;
519
+ }
520
+ })), h;
521
+ }
522
+ function u() {
523
+ const c = e();
524
+ if (c && !c.startsWith("custom-"))
525
+ if (ge.has(c) && i) {
526
+ const g = b();
527
+ C.stop(), g.start(c);
528
+ } else
529
+ h?.stop(), C.start(c);
530
+ }
531
+ function r() {
532
+ C.stop(), h?.stop();
533
+ }
534
+ async function p(c, g = !1) {
535
+ await C.fetchCustomPane(c, g);
536
+ }
537
+ function y() {
538
+ u();
539
+ }
540
+ function R() {
541
+ r();
542
+ }
543
+ function q() {
544
+ const c = e();
545
+ ge.has(c) && i && h ? h.refresh() : C.refresh();
546
+ }
547
+ function D() {
548
+ k.value = null;
549
+ }
550
+ return ee(e, () => {
551
+ D(), u();
552
+ }), X(() => {
553
+ y();
554
+ }), te(() => {
555
+ r();
556
+ }), {
557
+ data: k,
558
+ loading: x,
559
+ error: P,
560
+ isUnauthorized: U,
561
+ refresh: q,
562
+ clear: D,
563
+ fetchCustomPane: p,
564
+ startRefresh: y,
565
+ stopRefresh: R
566
+ };
567
+ }
568
+ const pt = ["title", "aria-label"], mt = ["viewBox", "innerHTML"], kt = ["viewBox", "innerHTML"], me = /* @__PURE__ */ se({
569
+ __name: "ThemeToggle",
570
+ props: {
571
+ classPrefix: { default: "ss-dbg" }
572
+ },
573
+ setup(e) {
574
+ const T = e, { theme: a, toggleTheme: S } = le(), i = m(() => a.value === "dark"), f = m(() => i.value ? "Switch to light theme" : "Switch to dark theme"), _ = m(
575
+ () => T.classPrefix === "ss-dbg" ? "ss-dbg-theme-toggle" : "ss-dash-theme-btn"
576
+ );
577
+ return (k, x) => (t(), o("button", {
578
+ type: "button",
579
+ class: z(_.value),
580
+ title: f.value,
581
+ "aria-label": f.value,
582
+ onClick: x[0] || (x[0] = //@ts-ignore
583
+ (...P) => s(S) && s(S)(...P))
584
+ }, [
585
+ i.value ? (t(), o("svg", {
586
+ key: 0,
587
+ width: "16",
588
+ height: "16",
589
+ viewBox: s(j).sun.viewBox,
590
+ fill: "none",
591
+ stroke: "currentColor",
592
+ "stroke-width": "2",
593
+ "stroke-linecap": "round",
594
+ "stroke-linejoin": "round",
595
+ innerHTML: s(j).sun.elements.join("")
596
+ }, null, 8, mt)) : (t(), o("svg", {
597
+ key: 1,
598
+ width: "16",
599
+ height: "16",
600
+ viewBox: s(j).moon.viewBox,
601
+ fill: "none",
602
+ stroke: "currentColor",
603
+ "stroke-width": "2",
604
+ "stroke-linecap": "round",
605
+ "stroke-linejoin": "round",
606
+ innerHTML: s(j).moon.elements.join("")
607
+ }, null, 8, kt))
608
+ ], 10, pt));
609
+ }
610
+ }), yt = ["data-ss-theme"], wt = { class: "ss-dbg-tabs" }, Tt = { class: "ss-dbg-tabs-scroll" }, _t = ["onClick"], Ct = ["viewBox", "innerHTML"], Et = { class: "ss-dbg-tabs-right" }, St = ["title"], xt = ["href"], $t = ["viewBox", "innerHTML"], Lt = { class: "ss-dbg-content" }, Bt = {
611
+ key: 0,
612
+ class: "ss-dbg-empty"
613
+ }, Mt = {
614
+ key: 1,
615
+ class: "ss-dbg-empty",
616
+ style: { color: "var(--ss-red-fg)" }
617
+ }, os = /* @__PURE__ */ se({
618
+ __name: "DebugPanel",
619
+ props: {
620
+ dashboardPath: { default: "/__stats" },
621
+ tracingEnabled: { type: Boolean, default: !1 },
622
+ isLive: { type: Boolean, default: !1 },
623
+ baseUrl: { default: "" },
624
+ debugEndpoint: { default: "/admin/api/debug" },
625
+ authToken: {},
626
+ className: {},
627
+ defaultOpen: { type: Boolean, default: !1 }
628
+ },
629
+ setup(e, { expose: T }) {
630
+ const a = $(() => import("./QueriesTab-C8_7oprC.js")), S = $(() => import("./EventsTab-DQ4Nd6AK.js")), i = $(() => import("./EmailsTab-DhFhoNmU.js")), f = $(() => import("./RoutesTab-Dz0MkZuF.js")), _ = $(() => import("./LogsTab-DpEQ7euu.js")), k = $(() => import("./TimelineTab-Db6lKKsD.js")), x = $(() => import("./CacheTab-BPisYYiQ.js")), P = $(() => import("./JobsTab-BCvhOARO.js")), U = $(() => import("./ConfigTab-C8cafGUj.js")), C = $(() => import("./InternalsTab-DEMjqtlw.js")), h = $(() => import("./CustomPaneTab-BJxT5Dp7.js")), b = e, u = v(b.defaultOpen), r = v("queries"), { theme: p } = le(), { features: y } = ce({
631
+ baseUrl: b.baseUrl,
632
+ debugEndpoint: b.debugEndpoint,
633
+ authToken: b.authToken
634
+ }), R = b.dashboardPath ? b.dashboardPath.replace(/\/+$/, "") + "/api" : void 0, q = m(() => r.value.startsWith("custom-")), D = m(() => q.value || r.value === "internals"), { data: c, loading: g, error: O, isUnauthorized: H, refresh: Y, startRefresh: N, stopRefresh: Q } = gt(
635
+ () => r.value,
636
+ {
637
+ baseUrl: b.baseUrl,
638
+ debugEndpoint: b.debugEndpoint,
639
+ dashboardEndpoint: R,
640
+ authToken: b.authToken
641
+ }
642
+ ), L = m(() => {
643
+ const w = [
644
+ { id: "queries", label: "Queries", icon: "Q" },
645
+ { id: "events", label: "Events", icon: "E" },
646
+ { id: "emails", label: "Emails", icon: "M" },
647
+ { id: "routes", label: "Routes", icon: "R" },
648
+ { id: "logs", label: "Logs", icon: "L" }
649
+ ];
650
+ (y.value.tracing || b.tracingEnabled) && w.push({ id: "timeline", label: "Timeline", icon: "T" }), y.value.cache && w.push({ id: "cache", label: "Cache", icon: "C" }), y.value.queues && w.push({ id: "jobs", label: "Jobs", icon: "J" }), w.push({ id: "config", label: "Config", icon: "G" }), w.push({ id: "internals", label: "Internals", icon: "I" });
651
+ for (const A of y.value.customPanes)
652
+ w.push({
653
+ id: `custom-${A.id}`,
654
+ label: A.label,
655
+ icon: A.label.charAt(0).toUpperCase()
656
+ });
657
+ return w;
658
+ });
659
+ function F(w) {
660
+ const A = w.replace("custom-", "");
661
+ return y.value.customPanes.find((n) => n.id === A);
662
+ }
663
+ function Z() {
664
+ u.value = !0, N();
665
+ }
666
+ function K() {
667
+ u.value = !1, Q();
668
+ }
669
+ function G() {
670
+ u.value ? K() : Z();
671
+ }
672
+ function J(w) {
673
+ r.value = w;
674
+ }
675
+ return ee(u, (w) => {
676
+ w ? N() : Q();
677
+ }), T({ toggle: G, open: Z, close: K }), (w, A) => s(H) ? E("", !0) : (t(), o("div", {
678
+ key: 0,
679
+ class: z(["ss-dbg-panel", { "ss-dbg-open": u.value }]),
680
+ "data-ss-theme": s(p)
681
+ }, [
682
+ l("div", wt, [
683
+ l("div", Tt, [
684
+ (t(!0), o(W, null, ae(L.value, (n) => (t(), o("button", {
685
+ key: n.id,
686
+ type: "button",
687
+ class: z(["ss-dbg-tab", { "ss-dbg-active": r.value === n.id }]),
688
+ onClick: (d) => J(n.id)
689
+ }, [
690
+ s(j)[n.id] ? (t(), o("svg", {
691
+ key: 0,
692
+ class: "ss-dbg-tab-icon",
693
+ viewBox: s(j)[n.id].viewBox,
694
+ innerHTML: s(j)[n.id].elements.join("")
695
+ }, null, 8, Ct)) : E("", !0),
696
+ Te(" " + M(n.label), 1)
697
+ ], 10, _t))), 128))
698
+ ]),
699
+ l("div", Et, [
700
+ l("span", {
701
+ class: z(["ss-dbg-conn-mode", e.isLive ? "ss-dbg-conn-live" : "ss-dbg-conn-polling"]),
702
+ title: e.isLive ? "Connected via Transmit (SSE) — real-time updates" : "Polling every 3s"
703
+ }, M(e.isLive ? "live" : "polling"), 11, St),
704
+ e.dashboardPath && s(y).dashboard ? (t(), o("a", {
705
+ key: 0,
706
+ href: e.dashboardPath,
707
+ target: "_blank",
708
+ rel: "noopener noreferrer",
709
+ class: "ss-dbg-dashboard-link",
710
+ title: "Open dashboard"
711
+ }, [
712
+ (t(), o("svg", {
713
+ width: "14",
714
+ height: "14",
715
+ viewBox: s(j)["external-link"].viewBox,
716
+ fill: "none",
717
+ stroke: "currentColor",
718
+ "stroke-width": "2",
719
+ "stroke-linecap": "round",
720
+ "stroke-linejoin": "round",
721
+ innerHTML: s(j)["external-link"].elements.join("")
722
+ }, null, 8, $t))
723
+ ], 8, xt)) : E("", !0),
724
+ ue(me),
725
+ l("button", {
726
+ type: "button",
727
+ class: "ss-dbg-close",
728
+ onClick: K,
729
+ title: "Close panel"
730
+ }, " × ")
731
+ ])
732
+ ]),
733
+ l("div", Lt, [
734
+ s(g) && !s(c) && !D.value ? (t(), o("div", Bt, "Loading...")) : s(O) && !D.value ? (t(), o("div", Mt, " Error: " + M(s(O).message), 1)) : (t(), o(W, { key: 2 }, [
735
+ r.value === "queries" ? (t(), V(s(a), {
736
+ key: 0,
737
+ data: s(c),
738
+ "dashboard-path": e.dashboardPath
739
+ }, null, 8, ["data", "dashboard-path"])) : r.value === "events" ? (t(), V(s(S), {
740
+ key: 1,
741
+ data: s(c),
742
+ "dashboard-path": e.dashboardPath
743
+ }, null, 8, ["data", "dashboard-path"])) : r.value === "emails" ? (t(), V(s(i), {
744
+ key: 2,
745
+ data: s(c),
746
+ "dashboard-path": e.dashboardPath
747
+ }, null, 8, ["data", "dashboard-path"])) : r.value === "routes" ? (t(), V(s(f), {
748
+ key: 3,
749
+ data: s(c)
750
+ }, null, 8, ["data"])) : r.value === "logs" ? (t(), V(s(_), {
751
+ key: 4,
752
+ data: s(c),
753
+ "dashboard-path": e.dashboardPath
754
+ }, null, 8, ["data", "dashboard-path"])) : r.value === "timeline" ? (t(), V(s(k), {
755
+ key: 5,
756
+ data: s(c),
757
+ "dashboard-path": e.dashboardPath,
758
+ "base-url": e.baseUrl,
759
+ "debug-endpoint": e.debugEndpoint,
760
+ "auth-token": e.authToken
761
+ }, null, 8, ["data", "dashboard-path", "base-url", "debug-endpoint", "auth-token"])) : r.value === "cache" ? (t(), V(s(x), {
762
+ key: 6,
763
+ data: s(c)
764
+ }, null, 8, ["data"])) : r.value === "jobs" ? (t(), V(s(P), {
765
+ key: 7,
766
+ data: s(c)
767
+ }, null, 8, ["data"])) : r.value === "config" ? (t(), V(s(U), {
768
+ key: 8,
769
+ data: s(c)
770
+ }, null, 8, ["data"])) : r.value === "internals" ? (t(), V(s(C), {
771
+ key: 9,
772
+ data: s(c),
773
+ "base-url": e.baseUrl,
774
+ "debug-endpoint": e.debugEndpoint,
775
+ "auth-token": e.authToken
776
+ }, null, 8, ["data", "base-url", "debug-endpoint", "auth-token"])) : r.value.startsWith("custom-") ? (t(), V(s(h), {
777
+ key: 10,
778
+ pane: F(r.value),
779
+ "base-url": e.baseUrl,
780
+ "auth-token": e.authToken
781
+ }, null, 8, ["pane", "base-url", "auth-token"])) : E("", !0)
782
+ ], 64))
783
+ ])
784
+ ], 10, yt));
785
+ }
786
+ });
787
+ function Pt(e, T = {}) {
788
+ const {
789
+ baseUrl: a = "",
790
+ dashboardEndpoint: S = "/__stats/api",
791
+ authToken: i,
792
+ perPage: f = 50,
793
+ refreshKey: _
794
+ } = T, k = v(null), x = v(!1), P = v(null), U = v(!1), C = v("1h"), h = oe({
795
+ page: 1,
796
+ perPage: f,
797
+ total: 0,
798
+ totalPages: 1
799
+ }), b = oe({
800
+ search: ""
801
+ }), u = oe({
802
+ column: "",
803
+ direction: "desc"
804
+ }), r = new De({
805
+ baseUrl: a,
806
+ endpoint: S,
807
+ authToken: i,
808
+ section: e(),
809
+ perPage: f,
810
+ callbacks: {
811
+ onData: (n) => {
812
+ p = n;
813
+ },
814
+ onPagination: (n) => {
815
+ n ? (h.total = n.total, h.totalPages = n.lastPage ?? (Math.ceil(n.total / h.perPage) || 1), k.value = { data: p, meta: n }) : k.value = p;
816
+ },
817
+ onLoading: (n) => {
818
+ x.value = n;
819
+ },
820
+ onError: (n) => {
821
+ P.value = n;
822
+ },
823
+ onUnauthorized: () => {
824
+ U.value = !0;
825
+ }
826
+ }
827
+ });
828
+ let p = null;
829
+ const y = r.getApi();
830
+ async function R(n) {
831
+ try {
832
+ return await y.fetchChart(n);
833
+ } catch (d) {
834
+ return d instanceof je && (U.value = !0), null;
835
+ }
836
+ }
837
+ async function q() {
838
+ try {
839
+ return await y.fetchGroupedQueries();
840
+ } catch {
841
+ return null;
842
+ }
843
+ }
844
+ async function D(n) {
845
+ try {
846
+ return await y.explainQuery(n);
847
+ } catch {
848
+ return null;
849
+ }
850
+ }
851
+ async function c(n) {
852
+ try {
853
+ return await y.retryJob(n), !0;
854
+ } catch {
855
+ return !1;
856
+ }
857
+ }
858
+ async function g(n) {
859
+ try {
860
+ return await y.deleteCacheKey(n), !0;
861
+ } catch {
862
+ return !1;
863
+ }
864
+ }
865
+ async function O(n) {
866
+ try {
867
+ return (await y.fetchEmailPreview(n))?.html || null;
868
+ } catch {
869
+ return null;
870
+ }
871
+ }
872
+ function H(n) {
873
+ h.page = n, A();
874
+ }
875
+ function Y(n) {
876
+ b.search = n, h.page = 1, A();
877
+ }
878
+ function N(n, d) {
879
+ b[n] = d, h.page = 1, A();
880
+ }
881
+ function Q(n, d) {
882
+ u.column === n && !d ? u.direction = u.direction === "asc" ? "desc" : "asc" : (u.column = n, u.direction = d || "desc"), A();
883
+ }
884
+ function L(n) {
885
+ C.value = n, A();
886
+ }
887
+ async function F(n, d = "post", I) {
888
+ return r.mutate(n, d, I);
889
+ }
890
+ function Z() {
891
+ w(), r.fetch(!0);
892
+ }
893
+ function K() {
894
+ r.start();
895
+ }
896
+ function G() {
897
+ r.stop();
898
+ }
899
+ function J() {
900
+ const n = {};
901
+ for (const [d, I] of Object.entries(b))
902
+ d !== "search" && I !== "" && I !== void 0 && I !== null && (n[d] = String(I));
903
+ return n;
904
+ }
905
+ function w() {
906
+ const n = e(), d = J();
907
+ r.configure({
908
+ page: h.page,
909
+ perPage: h.perPage,
910
+ search: b.search || void 0,
911
+ sort: u.column || void 0,
912
+ sortDir: u.column ? u.direction : void 0,
913
+ filters: Object.keys(d).length > 0 ? d : void 0,
914
+ timeRange: n.startsWith("overview") ? C.value : void 0
915
+ });
916
+ }
917
+ function A() {
918
+ w(), r.fetch(!1);
919
+ }
920
+ return ee(e, () => {
921
+ h.page = 1;
922
+ for (const n of Object.keys(b))
923
+ n === "search" ? b.search = "" : delete b[n];
924
+ u.column = "", k.value = null, r.setSection(e()), w();
925
+ }), _ && ee(_, () => {
926
+ w(), r.handleRefreshSignal();
927
+ }), X(() => {
928
+ w(), r.start();
929
+ }), te(() => {
930
+ r.stop();
931
+ }), {
932
+ data: k,
933
+ loading: x,
934
+ error: P,
935
+ isUnauthorized: U,
936
+ pagination: h,
937
+ filter: b,
938
+ sort: u,
939
+ timeRange: C,
940
+ goToPage: H,
941
+ setSearch: Y,
942
+ setFilter: N,
943
+ setSort: Q,
944
+ setTimeRange: L,
945
+ refresh: Z,
946
+ startRefresh: K,
947
+ stopRefresh: G,
948
+ mutate: F,
949
+ fetchChart: R,
950
+ fetchGroupedQueries: q,
951
+ explainQuery: D,
952
+ retryJob: c,
953
+ deleteCacheKey: g,
954
+ fetchEmailPreview: O
955
+ };
956
+ }
957
+ const Ut = ["data-theme"], Rt = { class: "ss-dash-header" }, Dt = { class: "ss-dash-header-center" }, jt = { class: "ss-dash-header-right" }, Ht = ["href"], At = { class: "ss-dash-body" }, It = { class: "ss-dash-nav" }, qt = ["data-ss-section", "onClick", "title"], Ot = { class: "ss-dash-nav-icon" }, zt = ["viewBox", "innerHTML"], Nt = { class: "ss-dash-nav-label" }, Ft = {
958
+ key: 0,
959
+ class: "ss-dash-nav-sep"
960
+ }, Vt = ["onClick", "title"], Gt = { class: "ss-dash-nav-icon" }, Qt = ["viewBox", "innerHTML"], Kt = { class: "ss-dash-nav-label" }, Jt = ["title"], Wt = ["viewBox", "innerHTML"], Xt = ["viewBox", "innerHTML"], Yt = { class: "ss-dash-main" }, Zt = ["id"], es = { class: "ss-dash-pane-inner" }, ts = {
961
+ key: 1,
962
+ class: "ss-dash-empty"
963
+ }, ls = /* @__PURE__ */ se({
964
+ __name: "DashboardPage",
965
+ props: {
966
+ baseUrl: { default: "" },
967
+ dashboardEndpoint: { default: "/__stats/api" },
968
+ debugEndpoint: { default: void 0 },
969
+ authToken: { default: void 0 },
970
+ backUrl: { default: "/" },
971
+ channelName: { default: "server-stats/dashboard" }
972
+ },
973
+ setup(e) {
974
+ const T = $(() => import("./OverviewSection-CbMdAido.js")), a = $(() => import("./RequestsSection-LtImH4rD.js")), S = $(() => import("./QueriesSection-BPiv7u3r.js")), i = $(() => import("./EventsSection-C4wXUgxG.js")), f = $(() => import("./RoutesSection-CrxOxmzx.js")), _ = $(() => import("./LogsSection-BFVjSZ24.js")), k = $(() => import("./EmailsSection-C8JFMtW7.js")), x = $(() => import("./TimelineSection-DLxMW2J_.js")), P = $(() => import("./CacheSection-C788Yfai.js")), U = $(() => import("./JobsSection-CsKWTjgN.js")), C = $(() => import("./ConfigSection-CRzYxqW2.js")), h = $(() => import("./InternalsSection-BJUXE-5F.js")), b = [
975
+ "overview",
976
+ "requests",
977
+ "queries",
978
+ "events",
979
+ "routes",
980
+ "logs",
981
+ "emails",
982
+ "timeline",
983
+ "cache",
984
+ "jobs",
985
+ "config",
986
+ "internals"
987
+ ], u = e, { theme: r, toggleTheme: p } = le(), { features: y } = ce({
988
+ baseUrl: u.baseUrl,
989
+ debugEndpoint: u.debugEndpoint,
990
+ authToken: u.authToken
991
+ }), R = v("overview"), q = v(!1), D = v(!1), c = v(0);
992
+ ne("ss-refresh-key", c), ne("ss-base-url", u.baseUrl), ne("ss-dashboard-endpoint", u.dashboardEndpoint), ne("ss-debug-endpoint", u.debugEndpoint), ne("ss-auth-token", u.authToken), typeof window < "u" && (q.value = localStorage.getItem("ss-dash-sidebar") === "collapsed");
993
+ let g = null;
994
+ function O() {
995
+ if (g && (g(), g = null), !u.channelName) return;
996
+ g = He({
997
+ baseUrl: u.baseUrl,
998
+ channelName: u.channelName,
999
+ authToken: u.authToken,
1000
+ onMessage: () => {
1001
+ c.value += 1;
1002
+ },
1003
+ onConnect: () => {
1004
+ D.value = !0;
1005
+ },
1006
+ onDisconnect: () => {
1007
+ D.value = !1;
1008
+ },
1009
+ onError: () => {
1010
+ D.value = !1;
1011
+ }
1012
+ }).unsubscribe;
1013
+ }
1014
+ X(() => {
1015
+ O();
1016
+ }), te(() => {
1017
+ g && (g(), g = null);
1018
+ });
1019
+ const H = m(() => y.value.customPanes || []);
1020
+ function Y(d) {
1021
+ const I = d.replace("#", "").split("?")[0];
1022
+ return I && [...b, ...H.value.map((ie) => ie.id)].includes(I) ? I : "overview";
1023
+ }
1024
+ function N() {
1025
+ const d = Y(window.location.hash);
1026
+ d !== R.value && (R.value = d);
1027
+ }
1028
+ X(() => {
1029
+ if (typeof window > "u") return;
1030
+ const d = Y(window.location.hash);
1031
+ (d !== "overview" || window.location.hash) && (R.value = d), window.addEventListener("hashchange", N);
1032
+ }), te(() => {
1033
+ window.removeEventListener("hashchange", N);
1034
+ }), ee(R, (d) => {
1035
+ typeof window < "u" && (window.location.hash = d);
1036
+ });
1037
+ function Q() {
1038
+ q.value = !q.value, localStorage.setItem("ss-dash-sidebar", q.value ? "collapsed" : "expanded");
1039
+ }
1040
+ function L(d) {
1041
+ d !== R.value && (R.value = d);
1042
+ }
1043
+ const F = m(() => [
1044
+ { id: "overview", label: "Overview", visible: !0 },
1045
+ { id: "requests", label: "Requests", visible: !0 },
1046
+ { id: "queries", label: "Queries", visible: !0 },
1047
+ { id: "events", label: "Events", visible: !0 },
1048
+ { id: "routes", label: "Routes", visible: !0 },
1049
+ { id: "logs", label: "Logs", visible: !0 },
1050
+ { id: "emails", label: "Emails", visible: !0 },
1051
+ { id: "timeline", label: "Timeline", visible: y.value.tracing },
1052
+ { id: "cache", label: "Cache", visible: y.value.cache },
1053
+ { id: "jobs", label: "Jobs", visible: y.value.queues },
1054
+ { id: "config", label: "Config", visible: !0 },
1055
+ { id: "internals", label: "Internals", visible: !0 }
1056
+ ]), Z = m(() => F.value.filter((d) => d.visible)), { data: K } = Pt(() => "overview", {
1057
+ baseUrl: u.baseUrl,
1058
+ dashboardEndpoint: u.dashboardEndpoint,
1059
+ authToken: u.authToken,
1060
+ refreshKey: c
1061
+ }), G = m(() => K.value), J = m(() => {
1062
+ const d = {};
1063
+ if (!G.value) return d;
1064
+ if (G.value.totalRequests > 0 && (d.requests = { count: G.value.totalRequests }), G.value.queryStats?.total > 0 && (d.queries = { count: G.value.queryStats.total }), G.value.logLevelBreakdown) {
1065
+ const I = G.value.logLevelBreakdown, B = I.error + I.warn + I.info + I.debug;
1066
+ B > 0 && (d.logs = { count: B });
1067
+ }
1068
+ return d;
1069
+ }), w = {
1070
+ overview: T,
1071
+ requests: a,
1072
+ queries: S,
1073
+ events: i,
1074
+ routes: f,
1075
+ logs: _,
1076
+ emails: k,
1077
+ timeline: x,
1078
+ cache: P,
1079
+ jobs: U,
1080
+ config: C,
1081
+ internals: h
1082
+ }, A = m(() => w[R.value] || null);
1083
+ function n(d) {
1084
+ return d === "timeline" ? "dashboard-timeline" : d;
1085
+ }
1086
+ return (d, I) => (t(), o("div", {
1087
+ class: "ss-dash",
1088
+ "data-theme": s(r),
1089
+ id: "ss-dash"
1090
+ }, [
1091
+ l("div", Rt, [
1092
+ I[0] || (I[0] = l("div", { class: "ss-dash-header-left" }, [
1093
+ l("span", { class: "ss-dash-logo" }, "Server Stats"),
1094
+ l("span", { class: "ss-dash-logo-sub" }, "Dashboard")
1095
+ ], -1)),
1096
+ l("div", Dt, [
1097
+ l("span", {
1098
+ class: z(["ss-dash-live-dot", { "ss-dash-connected": D.value }]),
1099
+ id: "ss-dash-live-dot"
1100
+ }, null, 2),
1101
+ l("span", {
1102
+ class: z(["ss-dash-live-label", { "ss-dash-connected": D.value }]),
1103
+ id: "ss-dash-live-label"
1104
+ }, M(D.value ? "Live" : "Polling"), 3)
1105
+ ]),
1106
+ l("div", jt, [
1107
+ ue(me, { "class-prefix": "ss-dash" }),
1108
+ e.backUrl ? (t(), o("a", {
1109
+ key: 0,
1110
+ href: e.backUrl,
1111
+ class: "ss-dash-back-link",
1112
+ title: "Back to app"
1113
+ }, " ← App ", 8, Ht)) : E("", !0)
1114
+ ])
1115
+ ]),
1116
+ l("div", At, [
1117
+ l("div", {
1118
+ class: z(["ss-dash-sidebar", { "ss-dash-collapsed": q.value }]),
1119
+ id: "ss-dash-sidebar"
1120
+ }, [
1121
+ l("nav", It, [
1122
+ (t(!0), o(W, null, ae(Z.value, (B) => (t(), o("button", {
1123
+ key: B.id,
1124
+ type: "button",
1125
+ class: z(["ss-dash-nav-item", { "ss-dash-active": R.value === B.id }]),
1126
+ "data-ss-section": B.id,
1127
+ onClick: (ie) => L(B.id),
1128
+ title: q.value ? B.label : void 0
1129
+ }, [
1130
+ l("span", Ot, [
1131
+ (t(), o("svg", {
1132
+ width: "20",
1133
+ height: "20",
1134
+ viewBox: (s(j)[n(B.id)] || s(j).config).viewBox,
1135
+ fill: "none",
1136
+ stroke: "currentColor",
1137
+ "stroke-width": "2",
1138
+ "stroke-linecap": "round",
1139
+ "stroke-linejoin": "round",
1140
+ innerHTML: (s(j)[n(B.id)] || s(j).config).elements.join("")
1141
+ }, null, 8, zt))
1142
+ ]),
1143
+ l("span", Nt, M(B.label), 1),
1144
+ J.value[B.id] && J.value[B.id].count > 0 ? (t(), o("span", {
1145
+ key: 0,
1146
+ class: z(["ss-dash-nav-badge", J.value[B.id].variant || ""])
1147
+ }, M(J.value[B.id].count), 3)) : E("", !0)
1148
+ ], 10, qt))), 128)),
1149
+ H.value.length > 0 ? (t(), o("div", Ft)) : E("", !0),
1150
+ (t(!0), o(W, null, ae(H.value, (B) => (t(), o("button", {
1151
+ key: B.id,
1152
+ type: "button",
1153
+ class: z(["ss-dash-nav-item", { "ss-dash-active": R.value === B.id }]),
1154
+ onClick: (ie) => L(B.id),
1155
+ title: q.value ? B.label : void 0
1156
+ }, [
1157
+ l("span", Gt, [
1158
+ (t(), o("svg", {
1159
+ width: "20",
1160
+ height: "20",
1161
+ viewBox: s(j)["custom-pane"].viewBox,
1162
+ fill: "none",
1163
+ stroke: "currentColor",
1164
+ "stroke-width": "2",
1165
+ "stroke-linecap": "round",
1166
+ "stroke-linejoin": "round",
1167
+ innerHTML: s(j)["custom-pane"].elements.join("")
1168
+ }, null, 8, Qt))
1169
+ ]),
1170
+ l("span", Kt, M(B.label), 1)
1171
+ ], 10, Vt))), 128))
1172
+ ]),
1173
+ l("button", {
1174
+ type: "button",
1175
+ class: "ss-dash-sidebar-toggle",
1176
+ id: "ss-dash-sidebar-toggle",
1177
+ onClick: Q,
1178
+ title: q.value ? "Expand sidebar" : "Collapse sidebar"
1179
+ }, [
1180
+ q.value ? (t(), o("svg", {
1181
+ key: 0,
1182
+ width: "16",
1183
+ height: "16",
1184
+ viewBox: s(j)["chevron-right"].viewBox,
1185
+ fill: "none",
1186
+ stroke: "currentColor",
1187
+ "stroke-width": "1.5",
1188
+ innerHTML: s(j)["chevron-right"].elements.join("")
1189
+ }, null, 8, Wt)) : (t(), o("svg", {
1190
+ key: 1,
1191
+ width: "16",
1192
+ height: "16",
1193
+ viewBox: s(j)["chevron-left"].viewBox,
1194
+ fill: "none",
1195
+ stroke: "currentColor",
1196
+ "stroke-width": "1.5",
1197
+ innerHTML: s(j)["chevron-left"].elements.join("")
1198
+ }, null, 8, Xt))
1199
+ ], 8, Jt)
1200
+ ], 2),
1201
+ l("div", Yt, [
1202
+ l("div", {
1203
+ class: "ss-dash-pane ss-dash-active",
1204
+ id: `ss-dash-pane-${R.value}`
1205
+ }, [
1206
+ l("div", es, [
1207
+ (t(), V(_e, null, {
1208
+ fallback: he(() => [...I[1] || (I[1] = [
1209
+ l("div", { class: "ss-dash-empty" }, "Loading...", -1)
1210
+ ])]),
1211
+ default: he(() => [
1212
+ A.value ? (t(), V(Ce(A.value), { key: 0 })) : (t(), o("div", ts, "Unknown section"))
1213
+ ]),
1214
+ _: 1
1215
+ }))
1216
+ ])
1217
+ ], 8, Zt)
1218
+ ])
1219
+ ])
1220
+ ], 8, Ut));
1221
+ }
1222
+ });
1223
+ export {
1224
+ Ge as _,
1225
+ ls as a,
1226
+ os as b,
1227
+ as as c,
1228
+ gt as d,
1229
+ ce as e,
1230
+ Ae as f,
1231
+ le as g,
1232
+ Pt as u
1233
+ };