@lunora/studio 1.0.0-alpha.7 → 1.0.0-alpha.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/LICENSE.md +6 -0
  2. package/dist/index.d.ts +762 -779
  3. package/dist/index.js +1 -41
  4. package/dist/mount.d.ts +10 -10
  5. package/dist/mount.js +1 -26
  6. package/dist/packem_chunks/ApiTab.js +1 -0
  7. package/dist/packem_chunks/AuditPanel.js +1 -0
  8. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
  9. package/dist/packem_chunks/ExportImportPanel.js +3 -0
  10. package/dist/packem_chunks/FileBrowser.js +4 -0
  11. package/dist/packem_chunks/FunctionRunner.js +1 -0
  12. package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
  13. package/dist/packem_chunks/HealthPanel.js +1 -0
  14. package/dist/packem_chunks/InsightsPanel.js +1 -0
  15. package/dist/packem_chunks/LogsPanel.js +1 -0
  16. package/dist/packem_chunks/MailPanel.js +2 -0
  17. package/dist/packem_chunks/MetricsPanel.js +1 -0
  18. package/dist/packem_chunks/MigrationsPanel.js +1 -0
  19. package/dist/packem_chunks/NotificationsPanel.js +1 -0
  20. package/dist/packem_chunks/PitrPanel.js +1 -0
  21. package/dist/packem_chunks/SchemaViewer.js +2 -0
  22. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
  23. package/dist/packem_chunks/SettingsPanel.js +1 -0
  24. package/dist/packem_chunks/SqlEditorPanel.js +4 -0
  25. package/dist/packem_chunks/TableEditor.js +1 -0
  26. package/dist/packem_chunks/agents-panel.js +1 -0
  27. package/dist/packem_chunks/analytics-panel.js +1 -0
  28. package/dist/packem_chunks/auth-audit-panel.js +1 -0
  29. package/dist/packem_chunks/auth-config-panel.js +1 -0
  30. package/dist/packem_chunks/auth-sessions-panel.js +1 -0
  31. package/dist/packem_chunks/containers-panel.js +1 -0
  32. package/dist/packem_chunks/dashboards-panel.js +1 -0
  33. package/dist/packem_chunks/fanout-panel.js +1 -0
  34. package/dist/packem_chunks/flags-panel.js +1 -0
  35. package/dist/packem_chunks/issues-panel.js +1 -0
  36. package/dist/packem_chunks/kv-browser.js +1 -0
  37. package/dist/packem_chunks/log-drains-panel.js +4 -0
  38. package/dist/packem_chunks/organizations-panel.js +1 -0
  39. package/dist/packem_chunks/payments-panel.js +1 -0
  40. package/dist/packem_chunks/permissions-panel.js +1 -0
  41. package/dist/packem_chunks/queues-panel.js +1 -0
  42. package/dist/packem_chunks/rls-panel.js +1 -0
  43. package/dist/packem_chunks/schedule-panel.js +1 -0
  44. package/dist/packem_chunks/sparkline.js +1 -0
  45. package/dist/packem_chunks/storage-rules-panel.js +1 -0
  46. package/dist/packem_chunks/subscriptions-panel.js +1 -0
  47. package/dist/packem_chunks/sync-client-panel.js +1 -0
  48. package/dist/packem_chunks/traces-panel.js +1 -0
  49. package/dist/packem_chunks/users-panel.js +1 -0
  50. package/dist/packem_chunks/vector-browser.js +1 -0
  51. package/dist/packem_chunks/workflows-panel.js +1 -0
  52. package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
  53. package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
  54. package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
  55. package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
  56. package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
  57. package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
  58. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
  59. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
  60. package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
  61. package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
  62. package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
  63. package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
  64. package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
  65. package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
  66. package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
  67. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
  68. package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
  69. package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
  70. package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
  71. package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
  72. package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
  73. package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
  74. package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
  75. package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
  76. package/dist/packem_shared/app.d-bRPJhby-.d.ts +254 -0
  77. package/dist/packem_shared/badge-BbuuAio7.js +1 -0
  78. package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
  79. package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
  80. package/dist/packem_shared/button-BkCrNcAs.js +1 -0
  81. package/dist/packem_shared/card-CIDGUN6K.js +1 -0
  82. package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
  83. package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
  84. package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
  85. package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
  86. package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
  87. package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
  88. package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
  89. package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
  90. package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
  91. package/dist/packem_shared/input-JHu63lTv.js +1 -0
  92. package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
  93. package/dist/packem_shared/label-6uP1obNF.js +1 -0
  94. package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
  95. package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
  96. package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
  97. package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
  98. package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
  99. package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
  100. package/dist/packem_shared/select-Bul-DeII.js +2 -0
  101. package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
  102. package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
  103. package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
  104. package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
  105. package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
  106. package/dist/packem_shared/table-DdJBrClo.js +2 -0
  107. package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
  108. package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
  109. package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
  110. package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
  111. package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
  112. package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
  113. package/dist/packem_shared/utils-bhneXptQ.js +1 -0
  114. package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
  115. package/dist/standalone/chunk-2F7G7IWQ.js +1 -0
  116. package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
  117. package/dist/standalone/chunk-2PJNAWB3.js +1 -0
  118. package/dist/standalone/chunk-2Y36BVVM.js +4 -0
  119. package/dist/standalone/chunk-34UVAASH.js +1 -0
  120. package/dist/standalone/chunk-35II7U25.js +11 -0
  121. package/dist/standalone/chunk-3FUFEZ65.js +1 -0
  122. package/dist/standalone/chunk-3QRTYSSX.js +1 -0
  123. package/dist/standalone/chunk-3RTTXLMU.js +1 -0
  124. package/dist/standalone/chunk-3XIESWL4.js +1 -0
  125. package/dist/standalone/chunk-4CGALXS3.js +19 -0
  126. package/dist/standalone/chunk-4UOFSGUS.js +1 -0
  127. package/dist/standalone/chunk-4WLYA3XE.js +1 -0
  128. package/dist/standalone/chunk-54MMVNPT.js +1 -0
  129. package/dist/standalone/chunk-5L2MD6F6.js +1 -0
  130. package/dist/standalone/chunk-5OWIOACV.js +13 -0
  131. package/dist/standalone/chunk-5RF4QDDA.js +6 -0
  132. package/dist/standalone/chunk-5U2THBI7.js +1 -0
  133. package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
  134. package/dist/standalone/chunk-65OTWFS3.js +1 -0
  135. package/dist/standalone/chunk-6DWCIIHE.js +1 -0
  136. package/dist/standalone/chunk-6ST5ECQA.js +1 -0
  137. package/dist/standalone/chunk-7J5N6DGQ.js +1 -0
  138. package/dist/standalone/chunk-7LQWFOEU.js +1 -0
  139. package/dist/standalone/chunk-7QIFDWQV.js +1 -0
  140. package/dist/standalone/chunk-7RXOPYR5.js +1 -0
  141. package/dist/standalone/chunk-7T7UOTYK.js +1 -0
  142. package/dist/standalone/chunk-7YEFOSPH.js +1 -0
  143. package/dist/standalone/chunk-AVAC26HJ.js +1 -0
  144. package/dist/standalone/chunk-B43FTQJ7.js +1 -0
  145. package/dist/standalone/chunk-BEH5N5ZA.js +1 -0
  146. package/dist/standalone/chunk-BGBLQ563.js +1 -0
  147. package/dist/standalone/chunk-BNUJ7QMG.js +3 -0
  148. package/dist/standalone/chunk-C43X4M5U.js +1 -0
  149. package/dist/standalone/chunk-CFPZYHPY.js +2 -0
  150. package/dist/standalone/chunk-D7XXWV4E.js +1 -0
  151. package/dist/standalone/chunk-DVOBKIUX.js +1 -0
  152. package/dist/standalone/chunk-EKRN4ZQM.js +1 -0
  153. package/dist/standalone/chunk-ESVP44Y3.js +1 -0
  154. package/dist/standalone/chunk-EVN46TVV.js +1 -0
  155. package/dist/standalone/chunk-EXFBIISG.js +2 -0
  156. package/dist/standalone/chunk-F5QWLENA.js +1 -0
  157. package/dist/standalone/chunk-F6GOKFMU.js +3 -0
  158. package/dist/standalone/chunk-FGTK44LR.js +1 -0
  159. package/dist/standalone/chunk-FXCBF4XT.js +1 -0
  160. package/dist/standalone/chunk-GMR677FL.js +1 -0
  161. package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
  162. package/dist/standalone/chunk-GSPTEMYN.js +1 -0
  163. package/dist/standalone/chunk-GXZAXNZI.js +1 -0
  164. package/dist/standalone/chunk-H7NIIBHH.js +1 -0
  165. package/dist/standalone/chunk-HP2UCWND.js +1 -0
  166. package/dist/standalone/chunk-HPFLBYRI.js +1 -0
  167. package/dist/standalone/chunk-IC4L6G56.js +1 -0
  168. package/dist/standalone/chunk-IDNNI63H.js +1 -0
  169. package/dist/standalone/chunk-ILNELDFC.js +1 -0
  170. package/dist/standalone/chunk-IVFHIQOT.js +1 -0
  171. package/dist/standalone/chunk-JN2Y24PY.js +1 -0
  172. package/dist/standalone/chunk-KDOC2DP5.js +1 -0
  173. package/dist/standalone/chunk-KUVMORDQ.js +1 -0
  174. package/dist/standalone/chunk-KYF2E5CJ.js +1 -0
  175. package/dist/standalone/chunk-L7N7F3DA.js +1 -0
  176. package/dist/standalone/chunk-LE56LPNH.js +13 -0
  177. package/dist/standalone/chunk-LEDWUPXM.js +1 -0
  178. package/dist/standalone/chunk-LFKCLLPT.js +1 -0
  179. package/dist/standalone/chunk-LFXFP4IF.js +1 -0
  180. package/dist/standalone/chunk-LJDP7NRB.js +1 -0
  181. package/dist/standalone/chunk-LLXFYRGQ.js +1 -0
  182. package/dist/standalone/chunk-M536Y2KX.js +1 -0
  183. package/dist/standalone/chunk-MIQTKZAR.js +1 -0
  184. package/dist/standalone/chunk-OHKRN65U.js +1 -0
  185. package/dist/standalone/chunk-P24JBHEZ.js +4 -0
  186. package/dist/standalone/chunk-PF7V3G2Z.js +62 -0
  187. package/dist/standalone/chunk-PWWHP76O.js +1 -0
  188. package/dist/standalone/chunk-QBWRC5YX.js +1 -0
  189. package/dist/standalone/chunk-QGKAJTQQ.js +1 -0
  190. package/dist/standalone/chunk-QLJJ5YYZ.js +1 -0
  191. package/dist/standalone/chunk-QVEHPYA5.js +1 -0
  192. package/dist/standalone/chunk-QWGT25SE.js +1 -0
  193. package/dist/standalone/chunk-QWJ3NPE3.js +1 -0
  194. package/dist/standalone/chunk-RAA2RGG6.js +1 -0
  195. package/dist/standalone/chunk-RBU52M5T.js +1 -0
  196. package/dist/standalone/chunk-SA3MDZC3.js +1 -0
  197. package/dist/standalone/chunk-SD4BERSA.js +1 -0
  198. package/dist/standalone/chunk-SFDOII3B.js +1 -0
  199. package/dist/standalone/chunk-SKHEGARW.js +1 -0
  200. package/dist/standalone/chunk-SMIESS7P.js +1 -0
  201. package/dist/standalone/chunk-T2JIUFOD.js +4 -0
  202. package/dist/standalone/chunk-T6VMSOBB.js +1 -0
  203. package/dist/standalone/chunk-THIXMMZD.js +1 -0
  204. package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
  205. package/dist/standalone/chunk-TLHJRWNK.js +1 -0
  206. package/dist/standalone/chunk-UIS34ZPB.js +8 -0
  207. package/dist/standalone/chunk-UNUU7CJJ.js +1 -0
  208. package/dist/standalone/chunk-UZERI5YC.js +1 -0
  209. package/dist/standalone/chunk-V53KNYRN.js +1 -0
  210. package/dist/standalone/chunk-VPAXCQ2Y.js +4 -0
  211. package/dist/standalone/chunk-X2FQ6B5V.js +1 -0
  212. package/dist/standalone/chunk-XBDKZZ67.js +1 -0
  213. package/dist/standalone/chunk-XEDU5FO4.js +1 -0
  214. package/dist/standalone/chunk-XQBTNJUQ.js +1 -0
  215. package/dist/standalone/chunk-XQCVZAGU.js +1 -0
  216. package/dist/standalone/chunk-XQGANNLS.js +1 -0
  217. package/dist/standalone/chunk-XSD4Y6SQ.js +1 -0
  218. package/dist/standalone/chunk-XXQUMVWH.js +1 -0
  219. package/dist/standalone/chunk-YD5NF6UT.js +1 -0
  220. package/dist/standalone/chunk-YI3WYUXK.js +1 -0
  221. package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
  222. package/dist/standalone/chunk-ZNNAGR6N.js +1 -0
  223. package/dist/standalone/studio.js +9 -356
  224. package/dist/styles.css +2 -2
  225. package/package.json +17 -15
  226. package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
  227. package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
  228. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  229. package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
  230. package/dist/packem_shared/AuditPanel-Bq4o_IqT.js +0 -212
  231. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  232. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  233. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  234. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  235. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  236. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  237. package/dist/packem_shared/DataBrowser-CtBe1So9.js +0 -4542
  238. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  239. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  240. package/dist/packem_shared/ExportImportPanel-dxY56TDF.js +0 -193
  241. package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
  242. package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
  243. package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
  244. package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
  245. package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
  246. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  247. package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
  248. package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
  249. package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
  250. package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
  251. package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
  252. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  253. package/dist/packem_shared/PitrPanel-CdErL7EJ.js +0 -252
  254. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  255. package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
  256. package/dist/packem_shared/SchemaViewer-LJDcmNIO.js +0 -2512
  257. package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
  258. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  259. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  260. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  261. package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
  262. package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
  263. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  264. package/dist/packem_shared/TableEditor-ChfUOZec.js +0 -371
  265. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  266. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  267. package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
  268. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  269. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  270. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  271. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  272. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  273. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  274. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  275. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  276. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  277. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  278. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  279. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  280. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  281. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  282. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  283. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  284. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  285. package/dist/packem_shared/sql-editor-panel-BFRpzj6r.js +0 -2562
  286. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  287. package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
  288. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  289. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  290. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  291. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  292. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
  293. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  294. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  295. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -1,839 +0,0 @@
1
- import { c } from 'react/compiler-runtime';
2
- import { useLunora } from '@lunora/react';
3
- import { useVirtualizer } from '@tanstack/react-virtual';
4
- import { useState, useMemo, useRef } from 'react';
5
- import { L as LiveError } from './live-status-FZ0psC1z.js';
6
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
7
- import { B as Badge } from './badge-B2PKA1-5.js';
8
- import { E as EmptyState } from './empty-state-DY_oe0k6.js';
9
- import { I as Input } from './input-XH4r1Pt1.js';
10
- import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
11
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
12
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
13
- import { C as CLOUDFLARE_OBSERVABILITY_URL } from './cf-links-2cktDedA.js';
14
- import { c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
15
- import { r as recordShard } from './shard-history-DyebH1R5.js';
16
- import { c as cn } from './utils-B05Dmz_H.js';
17
- import { f as flooredRectObserver } from './virtual-rect-CVMUskSm.js';
18
- import { u as useLiveShardSeed } from './use-live-shard-seed-Cuk3dnH0.js';
19
- import { jsxDEV } from 'react/jsx-dev-runtime';
20
-
21
- const SCROLL_HEIGHT = 400;
22
- const ROW_HEIGHT = 36;
23
- const SCROLL_STYLE = {
24
- height: SCROLL_HEIGHT,
25
- overflow: "auto"
26
- };
27
- const ROW_BASE_STYLE = {
28
- left: 0,
29
- position: "absolute",
30
- top: 0,
31
- width: "100%"
32
- };
33
- const LEVEL_VARIANT = {
34
- debug: "secondary",
35
- error: "destructive",
36
- info: "outline",
37
- warn: "secondary"
38
- };
39
- const OUTCOME_VARIANT = {
40
- error: "destructive",
41
- ok: "secondary"
42
- };
43
- const LogRow = (t0) => {
44
- const $ = c(21);
45
- const {
46
- entry,
47
- index,
48
- measureRef,
49
- start
50
- } = t0;
51
- const t1 = `translateY(${String(start)}px)`;
52
- let t2;
53
- if ($[0] !== t1) {
54
- t2 = {
55
- ...ROW_BASE_STYLE,
56
- transform: t1
57
- };
58
- $[0] = t1;
59
- $[1] = t2;
60
- } else {
61
- t2 = $[1];
62
- }
63
- const style = t2;
64
- let t3;
65
- if ($[2] !== entry.timestamp) {
66
- t3 = new Date(entry.timestamp).toLocaleString();
67
- $[2] = entry.timestamp;
68
- $[3] = t3;
69
- } else {
70
- t3 = $[3];
71
- }
72
- let t4;
73
- if ($[4] !== t3) {
74
- t4 = /* @__PURE__ */ jsxDEV("span", {
75
- className: "w-44 shrink-0 tabular-nums text-muted-foreground",
76
- role: "gridcell",
77
- children: t3
78
- }, void 0, false);
79
- $[4] = t3;
80
- $[5] = t4;
81
- } else {
82
- t4 = $[5];
83
- }
84
- const t5 = LEVEL_VARIANT[entry.level];
85
- let t6;
86
- if ($[6] !== entry.level || $[7] !== t5) {
87
- t6 = /* @__PURE__ */ jsxDEV("span", {
88
- className: "w-20 shrink-0",
89
- role: "gridcell",
90
- children: /* @__PURE__ */ jsxDEV(Badge, {
91
- variant: t5,
92
- children: entry.level
93
- }, void 0, false)
94
- }, void 0, false);
95
- $[6] = entry.level;
96
- $[7] = t5;
97
- $[8] = t6;
98
- } else {
99
- t6 = $[8];
100
- }
101
- const t7 = entry.functionPath ?? "—";
102
- let t8;
103
- if ($[9] !== t7) {
104
- t8 = /* @__PURE__ */ jsxDEV("span", {
105
- className: "w-48 shrink-0 truncate text-muted-foreground",
106
- role: "gridcell",
107
- children: t7
108
- }, void 0, false);
109
- $[9] = t7;
110
- $[10] = t8;
111
- } else {
112
- t8 = $[10];
113
- }
114
- let t9;
115
- if ($[11] !== entry.message) {
116
- t9 = /* @__PURE__ */ jsxDEV("span", {
117
- className: "flex-1 truncate",
118
- role: "gridcell",
119
- children: entry.message
120
- }, void 0, false);
121
- $[11] = entry.message;
122
- $[12] = t9;
123
- } else {
124
- t9 = $[12];
125
- }
126
- let t10;
127
- if ($[13] !== index || $[14] !== measureRef || $[15] !== style || $[16] !== t4 || $[17] !== t6 || $[18] !== t8 || $[19] !== t9) {
128
- t10 = /* @__PURE__ */ jsxDEV("div", {
129
- className: "flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50",
130
- "data-index": index,
131
- "data-testid": "lg-row",
132
- ref: measureRef,
133
- role: "row",
134
- style,
135
- children: [t4, t6, t8, t9]
136
- }, void 0, true);
137
- $[13] = index;
138
- $[14] = measureRef;
139
- $[15] = style;
140
- $[16] = t4;
141
- $[17] = t6;
142
- $[18] = t8;
143
- $[19] = t9;
144
- $[20] = t10;
145
- } else {
146
- t10 = $[20];
147
- }
148
- return t10;
149
- };
150
- const tablesLabel = (tables) => tables.length === 0 ? "—" : tables.join(", ");
151
- const RequestRow = (t0) => {
152
- const $ = c(37);
153
- const {
154
- entry,
155
- index,
156
- measureRef,
157
- start
158
- } = t0;
159
- const t1 = `translateY(${String(start)}px)`;
160
- let t2;
161
- if ($[0] !== t1) {
162
- t2 = {
163
- ...ROW_BASE_STYLE,
164
- transform: t1
165
- };
166
- $[0] = t1;
167
- $[1] = t2;
168
- } else {
169
- t2 = $[1];
170
- }
171
- const style = t2;
172
- let t3;
173
- if ($[2] !== entry.ts) {
174
- t3 = new Date(entry.ts).toLocaleString();
175
- $[2] = entry.ts;
176
- $[3] = t3;
177
- } else {
178
- t3 = $[3];
179
- }
180
- let t4;
181
- if ($[4] !== t3) {
182
- t4 = /* @__PURE__ */ jsxDEV("span", {
183
- className: "w-40 shrink-0 tabular-nums text-muted-foreground",
184
- role: "gridcell",
185
- children: t3
186
- }, void 0, false);
187
- $[4] = t3;
188
- $[5] = t4;
189
- } else {
190
- t4 = $[5];
191
- }
192
- const t5 = OUTCOME_VARIANT[entry.outcome];
193
- let t6;
194
- if ($[6] !== entry.outcome || $[7] !== t5) {
195
- t6 = /* @__PURE__ */ jsxDEV("span", {
196
- className: "w-16 shrink-0",
197
- role: "gridcell",
198
- children: /* @__PURE__ */ jsxDEV(Badge, {
199
- variant: t5,
200
- children: entry.outcome
201
- }, void 0, false)
202
- }, void 0, false);
203
- $[6] = entry.outcome;
204
- $[7] = t5;
205
- $[8] = t6;
206
- } else {
207
- t6 = $[8];
208
- }
209
- let t7;
210
- if ($[9] !== entry.functionPath) {
211
- t7 = /* @__PURE__ */ jsxDEV("span", {
212
- className: "w-44 shrink-0 truncate",
213
- role: "gridcell",
214
- title: entry.functionPath,
215
- children: entry.functionPath
216
- }, void 0, false);
217
- $[9] = entry.functionPath;
218
- $[10] = t7;
219
- } else {
220
- t7 = $[10];
221
- }
222
- const t8 = entry.shardKey ?? "—";
223
- let t9;
224
- if ($[11] !== t8) {
225
- t9 = /* @__PURE__ */ jsxDEV("span", {
226
- className: "w-24 shrink-0 truncate text-muted-foreground",
227
- role: "gridcell",
228
- children: t8
229
- }, void 0, false);
230
- $[11] = t8;
231
- $[12] = t9;
232
- } else {
233
- t9 = $[12];
234
- }
235
- const t10 = entry.userId ?? "—";
236
- let t11;
237
- if ($[13] !== t10) {
238
- t11 = /* @__PURE__ */ jsxDEV("span", {
239
- className: "w-24 shrink-0 truncate text-muted-foreground",
240
- role: "gridcell",
241
- children: t10
242
- }, void 0, false);
243
- $[13] = t10;
244
- $[14] = t11;
245
- } else {
246
- t11 = $[14];
247
- }
248
- let t12;
249
- if ($[15] !== entry.durationMs) {
250
- t12 = Math.round(entry.durationMs);
251
- $[15] = entry.durationMs;
252
- $[16] = t12;
253
- } else {
254
- t12 = $[16];
255
- }
256
- const t13 = `${String(t12)}ms`;
257
- let t14;
258
- if ($[17] !== t13) {
259
- t14 = /* @__PURE__ */ jsxDEV("span", {
260
- className: "w-16 shrink-0 tabular-nums text-muted-foreground",
261
- role: "gridcell",
262
- children: t13
263
- }, void 0, false);
264
- $[17] = t13;
265
- $[18] = t14;
266
- } else {
267
- t14 = $[18];
268
- }
269
- let t15;
270
- if ($[19] !== entry.errorMessage || $[20] !== entry.outcome || $[21] !== entry.tablesRead || $[22] !== entry.tablesWritten) {
271
- t15 = entry.outcome === "error" && entry.errorMessage !== void 0 ? entry.errorMessage : `r:${tablesLabel(entry.tablesRead)} · w:${tablesLabel(entry.tablesWritten)}`;
272
- $[19] = entry.errorMessage;
273
- $[20] = entry.outcome;
274
- $[21] = entry.tablesRead;
275
- $[22] = entry.tablesWritten;
276
- $[23] = t15;
277
- } else {
278
- t15 = $[23];
279
- }
280
- let t16;
281
- if ($[24] !== t15) {
282
- t16 = /* @__PURE__ */ jsxDEV("span", {
283
- className: "flex-1 truncate text-muted-foreground",
284
- role: "gridcell",
285
- children: t15
286
- }, void 0, false);
287
- $[24] = t15;
288
- $[25] = t16;
289
- } else {
290
- t16 = $[25];
291
- }
292
- let t17;
293
- if ($[26] !== index || $[27] !== measureRef || $[28] !== style || $[29] !== t11 || $[30] !== t14 || $[31] !== t16 || $[32] !== t4 || $[33] !== t6 || $[34] !== t7 || $[35] !== t9) {
294
- t17 = /* @__PURE__ */ jsxDEV("div", {
295
- className: "flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50",
296
- "data-index": index,
297
- "data-testid": "lg-req-row",
298
- ref: measureRef,
299
- role: "row",
300
- style,
301
- children: [t4, t6, t7, t9, t11, t14, t16]
302
- }, void 0, true);
303
- $[26] = index;
304
- $[27] = measureRef;
305
- $[28] = style;
306
- $[29] = t11;
307
- $[30] = t14;
308
- $[31] = t16;
309
- $[32] = t4;
310
- $[33] = t6;
311
- $[34] = t7;
312
- $[35] = t9;
313
- $[36] = t17;
314
- } else {
315
- t17 = $[36];
316
- }
317
- return t17;
318
- };
319
- const GET_LOGS = adminRef(ADMIN_FUNCTIONS.getLogs);
320
- const GET_REQUEST_LOG = adminRef(ADMIN_FUNCTIONS.getRequestLog);
321
- const entriesOf = (result) => {
322
- const {
323
- entries
324
- } = result ?? {};
325
- return Array.isArray(entries) ? entries : [];
326
- };
327
- const buildRequestQuery = (filters) => {
328
- const query = {};
329
- if (filters.functionPathPrefix.trim() !== "") {
330
- query.functionPathPrefix = filters.functionPathPrefix.trim();
331
- }
332
- if (filters.userId.trim() !== "") {
333
- query.userId = filters.userId.trim();
334
- }
335
- if (filters.tableTouched.trim() !== "") {
336
- query.tableTouched = filters.tableTouched.trim();
337
- }
338
- if (filters.outcome === "ok" || filters.outcome === "error") {
339
- query.outcome = filters.outcome;
340
- }
341
- return query;
342
- };
343
- const LOG_LEVELS = ["debug", "info", "warn", "error"];
344
- const TIME_RANGE_MS = {
345
- "5m": 5 * 60 * 1e3,
346
- "15m": 15 * 60 * 1e3,
347
- "1h": 60 * 60 * 1e3
348
- };
349
- const filterLogs = (entries, criteria) => {
350
- const needle = criteria.search.trim().toLowerCase();
351
- const pathNeedle = criteria.path.trim().toLowerCase();
352
- const floor = criteria.range === "all" ? Number.NEGATIVE_INFINITY : criteria.now - TIME_RANGE_MS[criteria.range];
353
- return entries.filter((entry) => {
354
- if (criteria.levels.size > 0 && !criteria.levels.has(entry.level)) {
355
- return false;
356
- }
357
- if (entry.timestamp < floor) {
358
- return false;
359
- }
360
- if (pathNeedle !== "" && !(entry.functionPath ?? "").toLowerCase().includes(pathNeedle)) {
361
- return false;
362
- }
363
- return needle === "" || entry.message.toLowerCase().includes(needle);
364
- });
365
- };
366
- const NO_PATH_KEY = "—";
367
- const summarizeLogs = (entries) => {
368
- const levelCounts = /* @__PURE__ */ new Map();
369
- const pathCounts = /* @__PURE__ */ new Map();
370
- for (const entry of entries) {
371
- levelCounts.set(entry.level, (levelCounts.get(entry.level) ?? 0) + 1);
372
- const pathKey = entry.functionPath ?? NO_PATH_KEY;
373
- pathCounts.set(pathKey, (pathCounts.get(pathKey) ?? 0) + 1);
374
- }
375
- const byLevel = LOG_LEVELS.filter((level) => levelCounts.has(level)).map((level) => {
376
- return {
377
- count: levelCounts.get(level) ?? 0,
378
- key: level
379
- };
380
- });
381
- const byPath = [...pathCounts.entries()].map(([key, count]) => {
382
- return {
383
- count,
384
- key
385
- };
386
- }).toSorted((a, b) => b.count === a.count ? a.key.localeCompare(b.key) : b.count - a.count);
387
- return {
388
- byLevel,
389
- byPath,
390
- total: entries.length
391
- };
392
- };
393
- const LevelToggle = (t0) => {
394
- const $ = c(11);
395
- const {
396
- level,
397
- onToggle,
398
- selected
399
- } = t0;
400
- let t1;
401
- if ($[0] !== level || $[1] !== onToggle) {
402
- t1 = () => {
403
- onToggle(level);
404
- };
405
- $[0] = level;
406
- $[1] = onToggle;
407
- $[2] = t1;
408
- } else {
409
- t1 = $[2];
410
- }
411
- const onClick = t1;
412
- const t2 = selected ? "border-border bg-muted font-medium" : "border-input text-muted-foreground";
413
- let t3;
414
- if ($[3] !== t2) {
415
- t3 = cn("rounded-md border px-2 py-1 text-xs", t2);
416
- $[3] = t2;
417
- $[4] = t3;
418
- } else {
419
- t3 = $[4];
420
- }
421
- const t4 = `logs-level-${level}`;
422
- let t5;
423
- if ($[5] !== level || $[6] !== onClick || $[7] !== selected || $[8] !== t3 || $[9] !== t4) {
424
- t5 = /* @__PURE__ */ jsxDEV("button", {
425
- "aria-pressed": selected,
426
- className: t3,
427
- "data-testid": t4,
428
- onClick,
429
- type: "button",
430
- children: level
431
- }, void 0, false);
432
- $[5] = level;
433
- $[6] = onClick;
434
- $[7] = selected;
435
- $[8] = t3;
436
- $[9] = t4;
437
- $[10] = t5;
438
- } else {
439
- t5 = $[10];
440
- }
441
- return t5;
442
- };
443
- const SummaryBucketRow = (t0) => {
444
- const $ = c(7);
445
- const {
446
- bucket
447
- } = t0;
448
- let t1;
449
- if ($[0] !== bucket.key) {
450
- t1 = /* @__PURE__ */ jsxDEV("span", {
451
- className: "truncate text-muted-foreground",
452
- role: "gridcell",
453
- children: bucket.key
454
- }, void 0, false);
455
- $[0] = bucket.key;
456
- $[1] = t1;
457
- } else {
458
- t1 = $[1];
459
- }
460
- let t2;
461
- if ($[2] !== bucket.count) {
462
- t2 = /* @__PURE__ */ jsxDEV("span", {
463
- className: "shrink-0 tabular-nums",
464
- role: "gridcell",
465
- children: bucket.count
466
- }, void 0, false);
467
- $[2] = bucket.count;
468
- $[3] = t2;
469
- } else {
470
- t2 = $[3];
471
- }
472
- let t3;
473
- if ($[4] !== t1 || $[5] !== t2) {
474
- t3 = /* @__PURE__ */ jsxDEV("div", {
475
- className: "flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs",
476
- "data-testid": "logs-summary-row",
477
- role: "row",
478
- children: [t1, t2]
479
- }, void 0, true);
480
- $[4] = t1;
481
- $[5] = t2;
482
- $[6] = t3;
483
- } else {
484
- t3 = $[6];
485
- }
486
- return t3;
487
- };
488
- const LogsPanel = ({
489
- initialShardKey
490
- }) => {
491
- const client = useLunora();
492
- const t = useT();
493
- const [view, setView] = useState("requests");
494
- const [shardKey, setShardKey] = useState(initialShardKey ?? "");
495
- const [entries, setEntries] = useState([]);
496
- const [requests, setRequests] = useState([]);
497
- const [error, setError] = useState(null);
498
- const [search, setSearch] = useState("");
499
- const [levelFilter, setLevelFilter] = useState(() => /* @__PURE__ */ new Set());
500
- const [pathFilter, setPathFilter] = useState("");
501
- const [timeRange, setTimeRange] = useState("all");
502
- const [showSummary, setShowSummary] = useState(false);
503
- const [pathPrefix, setPathPrefix] = useState("");
504
- const [userIdFilter, setUserIdFilter] = useState("");
505
- const [tableFilter, setTableFilter] = useState("");
506
- const [outcomeFilter, setOutcomeFilter] = useState("all");
507
- const [liveError, setLiveError] = useState(void 0);
508
- const requestQuery = buildRequestQuery({
509
- functionPathPrefix: pathPrefix,
510
- outcome: outcomeFilter,
511
- tableTouched: tableFilter,
512
- userId: userIdFilter
513
- });
514
- const refresh = async (shard) => {
515
- setError(null);
516
- try {
517
- if (view === "requests") {
518
- const result = await client.query(GET_REQUEST_LOG, requestQuery, callOptions(shard));
519
- recordShard(shard);
520
- setRequests(entriesOf(result));
521
- } else {
522
- const result_0 = await client.query(GET_LOGS, {}, callOptions(shard));
523
- recordShard(shard);
524
- setEntries(entriesOf(result_0));
525
- }
526
- } catch (error_) {
527
- setEntries([]);
528
- setRequests([]);
529
- setError(errorMessage(error_));
530
- throw error_;
531
- }
532
- };
533
- const committedShard = useLiveShardSeed(shardKey, refresh, [view, requestQuery]);
534
- useLiveAdmin(ADMIN_FUNCTIONS.getRequestLog, requestQuery, committedShard ?? "", (result_1) => {
535
- setError(null);
536
- setLiveError(void 0);
537
- setRequests(entriesOf(result_1));
538
- }, view === "requests" && committedShard !== void 0, setLiveError);
539
- useLiveAdmin(ADMIN_FUNCTIONS.getLogs, {}, committedShard ?? "", (result_2) => {
540
- setError(null);
541
- setLiveError(void 0);
542
- setEntries(entriesOf(result_2));
543
- }, view === "errors" && committedShard !== void 0, setLiveError);
544
- const filtered = filterLogs(entries, {
545
- levels: levelFilter,
546
- now: Date.now(),
547
- path: pathFilter,
548
- range: timeRange,
549
- search
550
- });
551
- const summary = summarizeLogs(filtered);
552
- const activeCount = view === "requests" ? requests.length : filtered.length;
553
- const summaryVisible = view === "errors" && showSummary;
554
- const readout = useMemo(() => {
555
- if (error !== null) {
556
- return "error";
557
- }
558
- if (activeCount === 0) {
559
- return "empty";
560
- }
561
- return summaryVisible ? "summary" : "list";
562
- }, [activeCount, error, summaryVisible]);
563
- const scrollRef = useRef(null);
564
- const virtualizer = useVirtualizer({
565
- count: activeCount,
566
- estimateSize: () => ROW_HEIGHT,
567
- getScrollElement: () => scrollRef.current,
568
- initialRect: {
569
- height: SCROLL_HEIGHT,
570
- width: 800
571
- },
572
- observeElementRect: (instance, callback) => flooredRectObserver(instance, callback, SCROLL_HEIGHT),
573
- overscan: 8
574
- });
575
- const virtualRows = virtualizer.getVirtualItems();
576
- const totalSize = virtualizer.getTotalSize();
577
- const gridStyle = {
578
- height: totalSize,
579
- position: "relative",
580
- width: "100%"
581
- };
582
- const onSearchChange = (event) => {
583
- setSearch(event.target.value);
584
- };
585
- const toggleLevel = (level) => {
586
- setLevelFilter((previous) => {
587
- const next = new Set(previous);
588
- if (next.has(level)) {
589
- next.delete(level);
590
- } else {
591
- next.add(level);
592
- }
593
- return next;
594
- });
595
- };
596
- const onLogPathChange = (event_0) => {
597
- setPathFilter(event_0.target.value);
598
- };
599
- const onTimeRangeChange = (event_1) => {
600
- setTimeRange(event_1.target.value);
601
- };
602
- const toggleSummary = () => {
603
- setShowSummary((previous_0) => !previous_0);
604
- };
605
- const onPathChange = (event_2) => {
606
- setPathPrefix(event_2.target.value);
607
- };
608
- const onUserChange = (event_3) => {
609
- setUserIdFilter(event_3.target.value);
610
- };
611
- const onTableChange = (event_4) => {
612
- setTableFilter(event_4.target.value);
613
- };
614
- const onOutcomeChange = (event_5) => {
615
- setOutcomeFilter(event_5.target.value);
616
- };
617
- const showRequests = () => {
618
- setView("requests");
619
- setShowSummary(false);
620
- };
621
- const showErrors = () => {
622
- setView("errors");
623
- setShowSummary(false);
624
- };
625
- return /* @__PURE__ */ jsxDEV("div", {
626
- className: "flex flex-col gap-4",
627
- "data-testid": "lunora-logs",
628
- children: [/* @__PURE__ */ jsxDEV("div", {
629
- className: "flex flex-wrap items-center gap-2",
630
- children: [/* @__PURE__ */ jsxDEV("div", {
631
- className: "inline-flex overflow-hidden rounded-lg border border-border",
632
- role: "tablist",
633
- children: [/* @__PURE__ */ jsxDEV("button", {
634
- "aria-selected": view === "requests",
635
- className: cn("px-3 py-1 text-sm", view === "requests" ? "bg-muted font-medium" : "text-muted-foreground"),
636
- "data-testid": "lg-view-requests",
637
- onClick: showRequests,
638
- role: "tab",
639
- type: "button",
640
- children: t("Requests")
641
- }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
642
- "aria-selected": view === "errors",
643
- className: cn("px-3 py-1 text-sm", view === "errors" ? "bg-muted font-medium" : "text-muted-foreground"),
644
- "data-testid": "lg-view-errors",
645
- onClick: showErrors,
646
- role: "tab",
647
- type: "button",
648
- children: t("Errors")
649
- }, void 0, false)]
650
- }, void 0, true), /* @__PURE__ */ jsxDEV(ShardInput, {
651
- onChange: setShardKey,
652
- testId: "lg-shard-input",
653
- value: shardKey
654
- }, void 0, false), /* @__PURE__ */ jsxDEV(LiveError, {
655
- message: liveError,
656
- prefix: "lg"
657
- }, void 0, false), /* @__PURE__ */ jsxDEV("a", {
658
- className: "text-sm text-primary underline-offset-4 hover:underline",
659
- "data-testid": "lg-cf-link",
660
- href: CLOUDFLARE_OBSERVABILITY_URL,
661
- rel: "noreferrer",
662
- target: "_blank",
663
- children: t("Open in Cloudflare")
664
- }, void 0, false)]
665
- }, void 0, true), view === "errors" && /* @__PURE__ */ jsxDEV("div", {
666
- className: "flex flex-wrap items-center gap-2",
667
- children: [/* @__PURE__ */ jsxDEV(Input, {
668
- "aria-label": t("Search messages"),
669
- className: "h-8 w-48",
670
- "data-testid": "lg-search",
671
- onChange: onSearchChange,
672
- placeholder: t("search message"),
673
- value: search
674
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
675
- "aria-label": t("Function path"),
676
- className: "h-8 w-40",
677
- "data-testid": "logs-path-filter",
678
- onChange: onLogPathChange,
679
- placeholder: t("filter path"),
680
- value: pathFilter
681
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
682
- "aria-label": t("Level filter"),
683
- className: "inline-flex items-center gap-1",
684
- "data-testid": "logs-level-filter",
685
- role: "group",
686
- children: LOG_LEVELS.map((level_0) => /* @__PURE__ */ jsxDEV(LevelToggle, {
687
- level: level_0,
688
- onToggle: toggleLevel,
689
- selected: levelFilter.has(level_0)
690
- }, level_0, false))
691
- }, void 0, false), /* @__PURE__ */ jsxDEV("select", {
692
- "aria-label": t("Time range"),
693
- className: "h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
694
- "data-testid": "logs-time-range",
695
- onChange: onTimeRangeChange,
696
- value: timeRange,
697
- children: [/* @__PURE__ */ jsxDEV("option", {
698
- value: "all",
699
- children: t("All time")
700
- }, void 0, false), /* @__PURE__ */ jsxDEV("option", {
701
- value: "5m",
702
- children: t("Last 5m")
703
- }, void 0, false), /* @__PURE__ */ jsxDEV("option", {
704
- value: "15m",
705
- children: t("Last 15m")
706
- }, void 0, false), /* @__PURE__ */ jsxDEV("option", {
707
- value: "1h",
708
- children: t("Last hour")
709
- }, void 0, false)]
710
- }, void 0, true), /* @__PURE__ */ jsxDEV("button", {
711
- "aria-pressed": showSummary,
712
- className: cn("h-8 rounded-md border px-3 text-sm", showSummary ? "border-border bg-muted font-medium" : "border-input text-muted-foreground"),
713
- "data-testid": "logs-summary-toggle",
714
- onClick: toggleSummary,
715
- type: "button",
716
- children: showSummary ? t("List") : t("Summary")
717
- }, void 0, false)]
718
- }, void 0, true), view === "requests" && /* @__PURE__ */ jsxDEV("div", {
719
- className: "flex flex-wrap items-center gap-2",
720
- children: [/* @__PURE__ */ jsxDEV(Input, {
721
- "aria-label": t("Function path"),
722
- className: "h-8 w-44",
723
- "data-testid": "lg-req-path",
724
- onChange: onPathChange,
725
- placeholder: t("file:function"),
726
- value: pathPrefix
727
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
728
- "aria-label": t("User id"),
729
- className: "h-8 w-32",
730
- "data-testid": "lg-req-user",
731
- onChange: onUserChange,
732
- placeholder: t("userId"),
733
- value: userIdFilter
734
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
735
- "aria-label": t("Table touched"),
736
- className: "h-8 w-32",
737
- "data-testid": "lg-req-table",
738
- onChange: onTableChange,
739
- placeholder: t("table"),
740
- value: tableFilter
741
- }, void 0, false), /* @__PURE__ */ jsxDEV("select", {
742
- "aria-label": t("Outcome filter"),
743
- className: "h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none",
744
- "data-testid": "lg-req-outcome",
745
- onChange: onOutcomeChange,
746
- value: outcomeFilter,
747
- children: [/* @__PURE__ */ jsxDEV("option", {
748
- value: "all",
749
- children: t("all")
750
- }, void 0, false), /* @__PURE__ */ jsxDEV("option", {
751
- value: "ok",
752
- children: t("ok")
753
- }, void 0, false), /* @__PURE__ */ jsxDEV("option", {
754
- value: "error",
755
- children: t("error")
756
- }, void 0, false)]
757
- }, void 0, true)]
758
- }, void 0, true), readout === "error" && /* @__PURE__ */ jsxDEV("p", {
759
- className: "text-sm text-destructive",
760
- "data-testid": "lg-error",
761
- role: "alert",
762
- children: error
763
- }, void 0, false), readout === "empty" && /* @__PURE__ */ jsxDEV(EmptyState, {
764
- description: t("Function and request logs for this shard show up here as your app handles traffic."),
765
- icon: /* @__PURE__ */ jsxDEV("svg", {
766
- "aria-hidden": "true",
767
- fill: "none",
768
- stroke: "currentColor",
769
- strokeLinecap: "round",
770
- strokeLinejoin: "round",
771
- strokeWidth: 1.6,
772
- viewBox: "0 0 24 24",
773
- children: /* @__PURE__ */ jsxDEV("path", {
774
- d: "M4 5h16M4 12h16M4 19h10"
775
- }, void 0, false)
776
- }, void 0, false),
777
- testId: "lg-empty",
778
- title: t("No logs.")
779
- }, void 0, false), readout === "summary" && /* @__PURE__ */ jsxDEV("div", {
780
- className: "flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs",
781
- "data-testid": "logs-summary",
782
- children: [/* @__PURE__ */ jsxDEV("p", {
783
- className: "text-xs text-muted-foreground",
784
- "data-testid": "logs-summary-total",
785
- children: t("{count} entries", {
786
- count: summary.total
787
- })
788
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
789
- children: [/* @__PURE__ */ jsxDEV("h4", {
790
- className: "mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
791
- children: t("By level")
792
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
793
- className: "overflow-hidden rounded-lg border border-border",
794
- "data-testid": "logs-summary-levels",
795
- role: "grid",
796
- children: summary.byLevel.map((bucket) => /* @__PURE__ */ jsxDEV(SummaryBucketRow, {
797
- bucket
798
- }, bucket.key, false))
799
- }, void 0, false)]
800
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
801
- children: [/* @__PURE__ */ jsxDEV("h4", {
802
- className: "mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
803
- children: t("By function")
804
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
805
- className: "overflow-hidden rounded-lg border border-border",
806
- "data-testid": "logs-summary-paths",
807
- role: "grid",
808
- children: summary.byPath.map((bucket_0) => /* @__PURE__ */ jsxDEV(SummaryBucketRow, {
809
- bucket: bucket_0
810
- }, bucket_0.key, false))
811
- }, void 0, false)]
812
- }, void 0, true)]
813
- }, void 0, true), readout === "list" && /* @__PURE__ */ jsxDEV("div", {
814
- className: "rounded-xl border border-border shadow-xs",
815
- "data-testid": "lg-scroll",
816
- ref: scrollRef,
817
- style: SCROLL_STYLE,
818
- children: /* @__PURE__ */ jsxDEV("div", {
819
- "aria-label": t("Recent logs"),
820
- "data-testid": "lg-table",
821
- role: "grid",
822
- style: gridStyle,
823
- children: virtualRows.map((virtualRow) => view === "requests" ? /* @__PURE__ */ jsxDEV(RequestRow, {
824
- entry: requests[virtualRow.index],
825
- index: virtualRow.index,
826
- measureRef: virtualizer.measureElement,
827
- start: virtualRow.start
828
- }, virtualRow.key, false) : /* @__PURE__ */ jsxDEV(LogRow, {
829
- entry: filtered[virtualRow.index],
830
- index: virtualRow.index,
831
- measureRef: virtualizer.measureElement,
832
- start: virtualRow.start
833
- }, virtualRow.key, false))
834
- }, void 0, false)
835
- }, void 0, false)]
836
- }, void 0, true);
837
- };
838
-
839
- export { LogsPanel, filterLogs, summarizeLogs };