railwatch 0.6.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/AGENTS.md +42 -26
- data/CHANGELOG.md +41 -0
- data/README.md +40 -29
- data/app/frontend/components/app-content.tsx +26 -0
- data/app/frontend/components/app-logo-icon.tsx +23 -0
- data/app/frontend/components/app-logo.tsx +14 -0
- data/app/frontend/components/app-shell.tsx +38 -0
- data/app/frontend/components/app-sidebar-header.tsx +54 -0
- data/app/frontend/components/app-sidebar.tsx +94 -0
- data/app/frontend/components/app-wordmark.tsx +29 -0
- data/app/frontend/components/breadcrumbs.tsx +46 -0
- data/app/frontend/components/icon.tsx +16 -0
- data/app/frontend/components/input-error.tsx +18 -0
- data/app/frontend/components/nav-footer.tsx +46 -0
- data/app/frontend/components/nav-main.tsx +41 -0
- data/app/frontend/components/nav-user.tsx +50 -0
- data/app/frontend/components/railwatch/chart-hover.tsx +34 -0
- data/app/frontend/components/railwatch/chart-panel.tsx +170 -0
- data/app/frontend/components/railwatch/code.tsx +28 -0
- data/app/frontend/components/railwatch/command-palette.tsx +132 -0
- data/app/frontend/components/railwatch/copy-block.tsx +52 -0
- data/app/frontend/components/railwatch/copy-id.tsx +49 -0
- data/app/frontend/components/railwatch/cursor-load-more.tsx +39 -0
- data/app/frontend/components/railwatch/data-table.tsx +195 -0
- data/app/frontend/components/railwatch/digit-roll.tsx +312 -0
- data/app/frontend/components/railwatch/empty-state.tsx +159 -0
- data/app/frontend/components/railwatch/env-nav.tsx +130 -0
- data/app/frontend/components/railwatch/env-switcher.tsx +145 -0
- data/app/frontend/components/railwatch/filter-bar.tsx +153 -0
- data/app/frontend/components/railwatch/flamegraph.tsx +324 -0
- data/app/frontend/components/railwatch/frames.tsx +295 -0
- data/app/frontend/components/railwatch/json-viewer.tsx +159 -0
- data/app/frontend/components/railwatch/live-dot.tsx +78 -0
- data/app/frontend/components/railwatch/live-toggle.tsx +76 -0
- data/app/frontend/components/railwatch/metric-chart.tsx +112 -0
- data/app/frontend/components/railwatch/mobile-page-switcher.tsx +89 -0
- data/app/frontend/components/railwatch/onboarding.tsx +91 -0
- data/app/frontend/components/railwatch/origin-identity.tsx +84 -0
- data/app/frontend/components/railwatch/page-header.tsx +42 -0
- data/app/frontend/components/railwatch/percentile-picker.tsx +18 -0
- data/app/frontend/components/railwatch/relative-time.tsx +18 -0
- data/app/frontend/components/railwatch/saved-views.tsx +232 -0
- data/app/frontend/components/railwatch/segmented.tsx +64 -0
- data/app/frontend/components/railwatch/series-chart.tsx +400 -0
- data/app/frontend/components/railwatch/shortcuts-dialog.tsx +89 -0
- data/app/frontend/components/railwatch/signal-toast.tsx +121 -0
- data/app/frontend/components/railwatch/sort-header.tsx +37 -0
- data/app/frontend/components/railwatch/source-link.tsx +57 -0
- data/app/frontend/components/railwatch/sparkline-cell.tsx +14 -0
- data/app/frontend/components/railwatch/sql-block.tsx +116 -0
- data/app/frontend/components/railwatch/stat.tsx +173 -0
- data/app/frontend/components/railwatch/status-badge.tsx +79 -0
- data/app/frontend/components/railwatch/step-picker.tsx +57 -0
- data/app/frontend/components/railwatch/timeline.tsx +405 -0
- data/app/frontend/components/railwatch/utilisation-bar.tsx +44 -0
- data/app/frontend/components/railwatch/window-picker.tsx +147 -0
- data/app/frontend/components/ui/avatar.tsx +51 -0
- data/app/frontend/components/ui/badge.tsx +46 -0
- data/app/frontend/components/ui/breadcrumb.tsx +109 -0
- data/app/frontend/components/ui/button.tsx +60 -0
- data/app/frontend/components/ui/card.tsx +92 -0
- data/app/frontend/components/ui/chart.tsx +374 -0
- data/app/frontend/components/ui/checkbox.tsx +32 -0
- data/app/frontend/components/ui/collapsible.tsx +31 -0
- data/app/frontend/components/ui/command.tsx +182 -0
- data/app/frontend/components/ui/dialog.tsx +158 -0
- data/app/frontend/components/ui/dropdown-menu.tsx +255 -0
- data/app/frontend/components/ui/hover-card.tsx +42 -0
- data/app/frontend/components/ui/input.tsx +21 -0
- data/app/frontend/components/ui/label.tsx +24 -0
- data/app/frontend/components/ui/popover.tsx +87 -0
- data/app/frontend/components/ui/select.tsx +185 -0
- data/app/frontend/components/ui/separator.tsx +28 -0
- data/app/frontend/components/ui/sheet.tsx +137 -0
- data/app/frontend/components/ui/sidebar.tsx +726 -0
- data/app/frontend/components/ui/skeleton.tsx +13 -0
- data/app/frontend/components/ui/sonner.tsx +41 -0
- data/app/frontend/components/ui/table.tsx +114 -0
- data/app/frontend/components/ui/tabs.tsx +91 -0
- data/app/frontend/components/ui/textarea.tsx +18 -0
- data/app/frontend/components/ui/tooltip.tsx +61 -0
- data/app/frontend/components/user-info.tsx +32 -0
- data/app/frontend/components/user-menu-content.tsx +94 -0
- data/app/frontend/entrypoints/application.css +244 -0
- data/app/frontend/entrypoints/inertia.tsx +95 -0
- data/app/frontend/fonts/CommitMono-Bold.woff2 +0 -0
- data/app/frontend/fonts/CommitMono-Regular.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Black.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Bold.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Medium.woff2 +0 -0
- data/app/frontend/fonts/Roboto-Regular.woff2 +0 -0
- data/app/frontend/hooks/use-appearance.tsx +67 -0
- data/app/frontend/hooks/use-clipboard.ts +32 -0
- data/app/frontend/hooks/use-flash.tsx +23 -0
- data/app/frontend/hooks/use-hotkeys.ts +63 -0
- data/app/frontend/hooks/use-initials.tsx +15 -0
- data/app/frontend/hooks/use-live.ts +179 -0
- data/app/frontend/hooks/use-mobile-navigation.ts +8 -0
- data/app/frontend/hooks/use-mobile.ts +21 -0
- data/app/frontend/hooks/use-percentile.ts +24 -0
- data/app/frontend/hooks/use-reduced-motion.ts +25 -0
- data/app/frontend/hooks/use-row-nav.ts +106 -0
- data/app/frontend/hooks/use-step.ts +27 -0
- data/app/frontend/hooks/use-ticker.ts +12 -0
- data/app/frontend/hooks/use-window.ts +58 -0
- data/app/frontend/layouts/app/app-sidebar-layout.tsx +107 -0
- data/app/frontend/layouts/app-layout.tsx +21 -0
- data/app/frontend/layouts/env-layout.tsx +53 -0
- data/app/frontend/layouts/persistent-layout.tsx +18 -0
- data/app/frontend/lib/cable.ts +10 -0
- data/app/frontend/lib/env-pages.ts +236 -0
- data/app/frontend/lib/execution-path.ts +55 -0
- data/app/frontend/lib/explain.ts +50 -0
- data/app/frontend/lib/filter.ts +25 -0
- data/app/frontend/lib/flamegraph.ts +155 -0
- data/app/frontend/lib/format.ts +71 -0
- data/app/frontend/lib/keyboard.ts +18 -0
- data/app/frontend/lib/source-link.ts +217 -0
- data/app/frontend/lib/utils.ts +6 -0
- data/app/frontend/pages/alerts/index.tsx +171 -0
- data/app/frontend/pages/broadcasts/index.tsx +171 -0
- data/app/frontend/pages/cache_events/index.tsx +127 -0
- data/app/frontend/pages/commands/index.tsx +143 -0
- data/app/frontend/pages/deploys/index.tsx +94 -0
- data/app/frontend/pages/deploys/show.tsx +309 -0
- data/app/frontend/pages/deprecations/index.tsx +176 -0
- data/app/frontend/pages/exceptions/index.tsx +271 -0
- data/app/frontend/pages/executions/show.tsx +821 -0
- data/app/frontend/pages/issues/index.tsx +399 -0
- data/app/frontend/pages/issues/show.tsx +1367 -0
- data/app/frontend/pages/jobs/index.tsx +381 -0
- data/app/frontend/pages/jobs/klass.tsx +215 -0
- data/app/frontend/pages/llm_calls/index.tsx +664 -0
- data/app/frontend/pages/logs/index.tsx +303 -0
- data/app/frontend/pages/mails/index.tsx +218 -0
- data/app/frontend/pages/notifications/index.tsx +161 -0
- data/app/frontend/pages/outgoing_requests/index.tsx +309 -0
- data/app/frontend/pages/overview/show.tsx +333 -0
- data/app/frontend/pages/people/index.tsx +102 -0
- data/app/frontend/pages/people/show.tsx +149 -0
- data/app/frontend/pages/processes/index.tsx +335 -0
- data/app/frontend/pages/profiles/index.tsx +110 -0
- data/app/frontend/pages/profiles/show.tsx +105 -0
- data/app/frontend/pages/queries/index.tsx +492 -0
- data/app/frontend/pages/queries/show.tsx +276 -0
- data/app/frontend/pages/releases/index.tsx +190 -0
- data/app/frontend/pages/releases/release-health.tsx +68 -0
- data/app/frontend/pages/releases/release-path.ts +25 -0
- data/app/frontend/pages/releases/show.tsx +262 -0
- data/app/frontend/pages/requests/index.tsx +235 -0
- data/app/frontend/pages/requests/route.tsx +159 -0
- data/app/frontend/pages/scheduled_tasks/index.tsx +220 -0
- data/app/frontend/pages/spans/index.tsx +229 -0
- data/app/frontend/pages/spans/show.tsx +220 -0
- data/app/frontend/pages/storage_ops/index.tsx +150 -0
- data/app/frontend/pages/tenants/index.tsx +236 -0
- data/app/frontend/pages/tenants/show.tsx +477 -0
- data/app/frontend/pages/tenants/tenant-path.ts +26 -0
- data/app/frontend/pages/thresholds/index.tsx +414 -0
- data/app/frontend/pages/traces/show.tsx +208 -0
- data/app/frontend/pages/transactions/index.tsx +220 -0
- data/app/frontend/pages/view_renders/index.tsx +241 -0
- data/app/frontend/pages/visits/index.tsx +321 -0
- data/app/frontend/public/icon.png +0 -0
- data/app/frontend/public/icon.svg +5 -0
- data/app/frontend/routes/index.d.ts +2136 -0
- data/app/frontend/routes/index.js +2112 -0
- data/app/frontend/types/globals.d.ts +9 -0
- data/app/frontend/types/index.ts +288 -0
- data/app/frontend/types/vite-env.d.ts +9 -0
- data/app/jobs/railwatch/rollup_job.rb +3 -1
- data/app/models/railwatch/ingest/rollup_absorber.rb +1 -1
- data/docs/ai-and-mcp.md +9 -3
- data/docs/configuration.md +68 -27
- data/docs/embedded.md +76 -43
- data/docs/faq.md +22 -10
- data/docs/getting-started.md +116 -41
- data/docs/records.md +13 -10
- data/docs/replacing-nightwatch.md +16 -14
- data/docs/replacing-sentry.md +19 -10
- data/docs/security.md +24 -3
- data/docs/self-hosting.md +9 -1
- data/docs/testing.md +14 -4
- data/docs/troubleshooting.md +62 -23
- data/lib/generators/railwatch/install/install_generator.rb +5 -4
- data/lib/generators/railwatch/install/templates/initializer.rb.tt +2 -2
- data/lib/railwatch/version.rb +1 -1
- data/lib/railwatch.rb +8 -3
- data/llms.txt +21 -18
- data/public/railwatch/assets/app-layout-LvxN9xSS.js +41 -0
- data/public/railwatch/assets/application-Cc5v_Vk9.css +1 -0
- data/public/railwatch/assets/{arrow-up-EmePsTKP.js → arrow-up-DG01k9AL.js} +1 -1
- data/public/railwatch/assets/{braces-iZ7MEfYP.js → braces-C3w7pfxS.js} +1 -1
- data/public/railwatch/assets/{card-DqdEEKcJ.js → card-Dpwlr0uY.js} +1 -1
- data/public/railwatch/assets/{chart-C4k7Ub9W.js → chart-DJHv3R7W.js} +1 -1
- data/public/railwatch/assets/{chart-hover-2yZG3w2u.js → chart-hover-CEH-DtXO.js} +1 -1
- data/public/railwatch/assets/{chart-panel-CONkZcn9.js → chart-panel-CUdIzJvk.js} +1 -1
- data/public/railwatch/assets/code-BRZprwun.js +1 -0
- data/public/railwatch/assets/copy-id-CwhGGiwF.js +1 -0
- data/public/railwatch/assets/cursor-load-more-uF1_955Q.js +1 -0
- data/public/railwatch/assets/data-table-DYi-N0hm.js +1 -0
- data/public/railwatch/assets/env-layout-HdcOaPPX.js +1 -0
- data/public/railwatch/assets/{execution-path-DWovhgLi.js → execution-path-CElXXFO_.js} +1 -1
- data/public/railwatch/assets/filter-bar-DEv0G_34.js +1 -0
- data/public/railwatch/assets/{flamegraph-BNbNIuKT.js → flamegraph-SKD9yxW9.js} +2 -2
- data/public/railwatch/assets/frames-CUpyJQDy.js +1 -0
- data/public/railwatch/assets/index-2W-ppwap.js +1 -0
- data/public/railwatch/assets/index-74ocuU5d.js +1 -0
- data/public/railwatch/assets/{index-Zkt4W_CM.js → index-B8NA62Lz.js} +2 -2
- data/public/railwatch/assets/index-BBCEkLqp.js +1 -0
- data/public/railwatch/assets/index-BDcglJzX.js +1 -0
- data/public/railwatch/assets/index-B_KFb9LS.js +1 -0
- data/public/railwatch/assets/index-BqK_VKom.js +1 -0
- data/public/railwatch/assets/index-BxCXBHP2.js +1 -0
- data/public/railwatch/assets/index-C1jc1OoH.js +1 -0
- data/public/railwatch/assets/index-C7zREldp.js +1 -0
- data/public/railwatch/assets/index-CEetm4oC.js +1 -0
- data/public/railwatch/assets/index-CIaZkokF.js +1 -0
- data/public/railwatch/assets/index-CNH85TZp.js +1 -0
- data/public/railwatch/assets/index-Ce4SB5AB.js +1 -0
- data/public/railwatch/assets/index-CiRMSYMn.js +1 -0
- data/public/railwatch/assets/index-CjxXgOs-.js +1 -0
- data/public/railwatch/assets/index-ClL-PYEV.js +1 -0
- data/public/railwatch/assets/index-CteZ6fop.js +1 -0
- data/public/railwatch/assets/index-CvqfEExO.js +1 -0
- data/public/railwatch/assets/index-CxTLT-Qh.js +1 -0
- data/public/railwatch/assets/index-DJd3OUSd.js +1 -0
- data/public/railwatch/assets/index-DPD-rLp6.js +1 -0
- data/public/railwatch/assets/index-DYK_dps4.js +1 -0
- data/public/railwatch/assets/index-DrayARrI.js +1 -0
- data/public/railwatch/assets/index-HRXGir-0.js +1 -0
- data/public/railwatch/assets/index-UJOUALr_.js +1 -0
- data/public/railwatch/assets/index-d-3J7gQ5.js +1 -0
- data/public/railwatch/assets/index-oQrvBpOm.js +1 -0
- data/public/railwatch/assets/inertia-FoqYZAk8.js +97 -0
- data/public/railwatch/assets/json-viewer-CxqMojEm.js +1 -0
- data/public/railwatch/assets/klass-DEF-Vat5.js +1 -0
- data/public/railwatch/assets/origin-identity-Y6gvfQVR.js +1 -0
- data/public/railwatch/assets/{percentile-picker-BxIVblBw.js → percentile-picker-E2aUdLxx.js} +1 -1
- data/public/railwatch/assets/relative-time-DcJbkKlN.js +1 -0
- data/public/railwatch/assets/{release-health-Cb1tMOOO.js → release-health-C8WSCDKD.js} +1 -1
- data/public/railwatch/assets/route-qO5vX1p-.js +1 -0
- data/public/railwatch/assets/{segmented-C4oWE73o.js → segmented-BWee8uc9.js} +1 -1
- data/public/railwatch/assets/select-G7rNBzv0.js +1 -0
- data/public/railwatch/assets/series-chart-C5nXIUc5.js +1 -0
- data/public/railwatch/assets/show-BEWisLQw.js +1 -0
- data/public/railwatch/assets/show-BEa9PGu1.js +2 -0
- data/public/railwatch/assets/{show-gtwKsTsl.js → show-BiT_Aloc.js} +3 -3
- data/public/railwatch/assets/show-BpCO49d3.js +1 -0
- data/public/railwatch/assets/show-CH7yxt7R.js +1 -0
- data/public/railwatch/assets/show-CTO8Lvd2.js +1 -0
- data/public/railwatch/assets/show-DnYsDMUt.js +2 -0
- data/public/railwatch/assets/show-DyzHM527.js +1 -0
- data/public/railwatch/assets/show-Nfpxs8su.js +1 -0
- data/public/railwatch/assets/show-ddjUMo9G.js +1 -0
- data/public/railwatch/assets/show-ksjbSzDH.js +1 -0
- data/public/railwatch/assets/{sort-header-CPM6fhXv.js → sort-header-uOq5VlrB.js} +1 -1
- data/public/railwatch/assets/{sparkline-cell-CXCxXPWt.js → sparkline-cell-DgGij0cu.js} +1 -1
- data/public/railwatch/assets/stat-BTzNKTm2.js +1 -0
- data/public/railwatch/assets/status-badge-BDkOXa-C.js +1 -0
- data/public/railwatch/assets/{tenant-path-C4aM_cO0.js → tenant-path-DU0ezKSU.js} +1 -1
- data/public/railwatch/assets/{use-clipboard-C1ApSwzA.js → use-clipboard-DoENmlWY.js} +1 -1
- data/public/railwatch/assets/{use-live-DWwLg1Nj.js → use-live-CE_fN5_6.js} +1 -1
- data/public/railwatch/manifest.json +612 -1591
- metadata +242 -117
- data/public/railwatch/assets/app-layout-2xAKndVD.js +0 -1
- data/public/railwatch/assets/app-wordmark-Bt6XqURo.js +0 -1
- data/public/railwatch/assets/appearance-DyCfeh9o.js +0 -1
- data/public/railwatch/assets/application-B7h1MIhi.css +0 -1
- data/public/railwatch/assets/auth-layout-BuwogWMZ.js +0 -1
- data/public/railwatch/assets/badge-Dv7I-ebP.js +0 -1
- data/public/railwatch/assets/checkbox-DKbThbxr.js +0 -1
- data/public/railwatch/assets/code-CYahYQHZ.js +0 -1
- data/public/railwatch/assets/copy-DaQMJWoT.js +0 -1
- data/public/railwatch/assets/copy-block-CbJum9s8.js +0 -1
- data/public/railwatch/assets/copy-id-JmvLfkmx.js +0 -1
- data/public/railwatch/assets/cursor-load-more-C1ylbqqL.js +0 -1
- data/public/railwatch/assets/data-table-CVKR2wkq.js +0 -1
- data/public/railwatch/assets/edit-BXF5oNYA.js +0 -1
- data/public/railwatch/assets/edit-BwSEVrTG.js +0 -8
- data/public/railwatch/assets/edit-D5BRDwLT.js +0 -1
- data/public/railwatch/assets/empty-state-Bn48Gplm.js +0 -1
- data/public/railwatch/assets/env-layout-CKLL8Ds7.js +0 -1
- data/public/railwatch/assets/filter-bar-xcbJC93z.js +0 -1
- data/public/railwatch/assets/frames-Bk39xfJG.js +0 -1
- data/public/railwatch/assets/google-sign-in-button-B5as2ps1.js +0 -1
- data/public/railwatch/assets/index-Atp1FTgX.js +0 -1
- data/public/railwatch/assets/index-B-FXAo1w.js +0 -1
- data/public/railwatch/assets/index-B0xgzHuN.js +0 -1
- data/public/railwatch/assets/index-BDVShWMs.js +0 -1
- data/public/railwatch/assets/index-BRvRkfob.js +0 -1
- data/public/railwatch/assets/index-BVWapDeB.js +0 -1
- data/public/railwatch/assets/index-Bd4YpOIO.js +0 -1
- data/public/railwatch/assets/index-BeQw69GM.js +0 -1
- data/public/railwatch/assets/index-BfitxVBv.js +0 -1
- data/public/railwatch/assets/index-C-EwH4lO.js +0 -1
- data/public/railwatch/assets/index-C8JIdb3_.js +0 -1
- data/public/railwatch/assets/index-CBFCtJAR.js +0 -1
- data/public/railwatch/assets/index-CDXlITyG.js +0 -1
- data/public/railwatch/assets/index-COd9lT84.js +0 -1
- data/public/railwatch/assets/index-C_hQmVTP.js +0 -1
- data/public/railwatch/assets/index-CcennT28.js +0 -1
- data/public/railwatch/assets/index-CiaeS-n7.js +0 -1
- data/public/railwatch/assets/index-CrA7jBTK.js +0 -1
- data/public/railwatch/assets/index-D0mKj3Hg.js +0 -1
- data/public/railwatch/assets/index-DV5MdmpY.js +0 -1
- data/public/railwatch/assets/index-DaE-1xhx.js +0 -1
- data/public/railwatch/assets/index-DdVg9LKX.js +0 -1
- data/public/railwatch/assets/index-DeLtMWou.js +0 -1
- data/public/railwatch/assets/index-DiQ4mqT_.js +0 -1
- data/public/railwatch/assets/index-LKgpCzoR.js +0 -1
- data/public/railwatch/assets/index-S0NVaLj9.js +0 -1
- data/public/railwatch/assets/index-Vj93BTR5.js +0 -1
- data/public/railwatch/assets/index-XjXcV-EO.js +0 -1
- data/public/railwatch/assets/index-aPCZX-pW.js +0 -1
- data/public/railwatch/assets/index-cTzBycCg.js +0 -1
- data/public/railwatch/assets/index-dpG-19ZN.js +0 -1
- data/public/railwatch/assets/index-gCvuyG1l.js +0 -1
- data/public/railwatch/assets/index-o1xqGvLo.js +0 -1
- data/public/railwatch/assets/index-w_skgMmK.js +0 -1
- data/public/railwatch/assets/inertia-CqnzqPVD.js +0 -97
- data/public/railwatch/assets/input-error-ByT28UdP.js +0 -1
- data/public/railwatch/assets/json-viewer-Bnu9RsJL.js +0 -1
- data/public/railwatch/assets/klass-nLiBV-Az.js +0 -1
- data/public/railwatch/assets/label-1nSzpSB6.js +0 -1
- data/public/railwatch/assets/layout-D7lE1Doo.js +0 -1
- data/public/railwatch/assets/live-dot-UdzOfzJb.js +0 -41
- data/public/railwatch/assets/nav-BRCgp2w3.js +0 -1
- data/public/railwatch/assets/new-C60G72DR.js +0 -1
- data/public/railwatch/assets/new-COyDKOOb.js +0 -1
- data/public/railwatch/assets/new-Cd9zPNJ8.js +0 -1
- data/public/railwatch/assets/new-DMJGKjmH.js +0 -1
- data/public/railwatch/assets/new-Omvf-c9s.js +0 -1
- data/public/railwatch/assets/new-vjRzERL3.js +0 -1
- data/public/railwatch/assets/onboarding-gUjJQc-6.js +0 -1
- data/public/railwatch/assets/origin-identity-M1YUPYS0.js +0 -1
- data/public/railwatch/assets/relative-time-DQ4kjowZ.js +0 -1
- data/public/railwatch/assets/route-BJkoEm7r.js +0 -1
- data/public/railwatch/assets/select-ocdQJdQo.js +0 -1
- data/public/railwatch/assets/separator-Ct2UcZ2x.js +0 -1
- data/public/railwatch/assets/series-chart-D6upsrSn.js +0 -1
- data/public/railwatch/assets/show-B4bwI9x2.js +0 -2
- data/public/railwatch/assets/show-BAjfddEn.js +0 -6
- data/public/railwatch/assets/show-BLJOyLb_.js +0 -1
- data/public/railwatch/assets/show-BoVyMQS6.js +0 -1
- data/public/railwatch/assets/show-Bsu1rvnK.js +0 -1
- data/public/railwatch/assets/show-C6OiJ6Hr.js +0 -1
- data/public/railwatch/assets/show-C8TkpEgm.js +0 -1
- data/public/railwatch/assets/show-CBFBiBY2.js +0 -1
- data/public/railwatch/assets/show-CEhPVMMT.js +0 -1
- data/public/railwatch/assets/show-CV-lG2b6.js +0 -2
- data/public/railwatch/assets/show-CX_pab9S.js +0 -2
- data/public/railwatch/assets/show-D6lgzL6n.js +0 -1
- data/public/railwatch/assets/show-DDVsv-uS.js +0 -1
- data/public/railwatch/assets/show-Dwiq-8hA.js +0 -1
- data/public/railwatch/assets/show-eKazflRI.js +0 -1
- data/public/railwatch/assets/show-yEOrk6Pt.js +0 -1
- data/public/railwatch/assets/stat-BNEfE8X1.js +0 -1
- data/public/railwatch/assets/status-badge-D0aylrM5.js +0 -1
- data/public/railwatch/assets/text-link-CP4lqUi6.js +0 -1
- data/public/railwatch/assets/textarea-DzJo2ds4.js +0 -1
- data/public/railwatch/assets/timeline-BNcJ9PMc.js +0 -1
- data/public/railwatch/assets/transition-BX2M1iaq.js +0 -5
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { Link, router, usePage } from "@inertiajs/react"
|
|
2
|
+
import { FileText } from "lucide-react"
|
|
3
|
+
import { useState } from "react"
|
|
4
|
+
|
|
5
|
+
import { CursorLoadMore } from "@/components/railwatch/cursor-load-more"
|
|
6
|
+
import { DataTable } from "@/components/railwatch/data-table"
|
|
7
|
+
import { EmptyState } from "@/components/railwatch/empty-state"
|
|
8
|
+
import { FilterBar } from "@/components/railwatch/filter-bar"
|
|
9
|
+
import { PageHeader } from "@/components/railwatch/page-header"
|
|
10
|
+
import { SavedViewsMenu } from "@/components/railwatch/saved-views"
|
|
11
|
+
import { Segmented, SegmentedItem } from "@/components/railwatch/segmented"
|
|
12
|
+
import { LevelBadge } from "@/components/railwatch/status-badge"
|
|
13
|
+
import EnvLayout from "@/layouts/env-layout"
|
|
14
|
+
import { parseFilter, serializeFilter } from "@/lib/filter"
|
|
15
|
+
import { count, when } from "@/lib/format"
|
|
16
|
+
import { cn } from "@/lib/utils"
|
|
17
|
+
import * as R from "@/routes"
|
|
18
|
+
import type { CursorMeta, SharedProps } from "@/types"
|
|
19
|
+
|
|
20
|
+
interface LogRow {
|
|
21
|
+
id: number
|
|
22
|
+
level: string
|
|
23
|
+
message: string
|
|
24
|
+
tags: string[]
|
|
25
|
+
occurred_at: string
|
|
26
|
+
execution_id: string | null
|
|
27
|
+
execution_source: string | null
|
|
28
|
+
execution_preview: string | null
|
|
29
|
+
source: string | null
|
|
30
|
+
tenant: string | null
|
|
31
|
+
user_ref: string | null
|
|
32
|
+
context: string | null
|
|
33
|
+
}
|
|
34
|
+
interface Props {
|
|
35
|
+
logs: LogRow[]
|
|
36
|
+
counts: Record<string, number>
|
|
37
|
+
// id -> the matching part of the message, each hit wrapped in MARK. Only
|
|
38
|
+
// present for rows the full-text search actually matched.
|
|
39
|
+
highlights: Record<number, string>
|
|
40
|
+
pagination: CursorMeta
|
|
41
|
+
q: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Telemetry::Log::SNIPPET_MARK: one character opens and closes every hit, so
|
|
45
|
+
// the odd-numbered pieces of the split are the ones to mark.
|
|
46
|
+
const MARK = "\u001f"
|
|
47
|
+
|
|
48
|
+
// Long lines (structured events, stack dumps) are clamped to a few rows so
|
|
49
|
+
// the table stays scannable, especially on phones where the message column
|
|
50
|
+
// is narrow. Tapping the message toggles the full text. Short lines have
|
|
51
|
+
// nothing to expand, so they are plain.
|
|
52
|
+
const CLAMP_AT = 160
|
|
53
|
+
|
|
54
|
+
function LogMessage({
|
|
55
|
+
message,
|
|
56
|
+
highlight,
|
|
57
|
+
tags,
|
|
58
|
+
}: {
|
|
59
|
+
message: string
|
|
60
|
+
highlight?: string
|
|
61
|
+
tags: string[]
|
|
62
|
+
}) {
|
|
63
|
+
const [open, setOpen] = useState(false)
|
|
64
|
+
const long = message.length > CLAMP_AT || message.includes("\n")
|
|
65
|
+
const body = (
|
|
66
|
+
<span
|
|
67
|
+
className={cn(
|
|
68
|
+
"font-mono text-xs break-all whitespace-pre-wrap",
|
|
69
|
+
long && !open && "line-clamp-3",
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{highlight ? <Snippet text={highlight} /> : message}
|
|
73
|
+
{tags.length > 0 && (
|
|
74
|
+
<span className="text-muted-foreground"> [{tags.join(", ")}]</span>
|
|
75
|
+
)}
|
|
76
|
+
</span>
|
|
77
|
+
)
|
|
78
|
+
if (!long) return body
|
|
79
|
+
return (
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
onClick={() => setOpen((o) => !o)}
|
|
83
|
+
aria-expanded={open}
|
|
84
|
+
className="block w-full cursor-pointer text-left"
|
|
85
|
+
title={open ? "Collapse" : "Expand"}
|
|
86
|
+
>
|
|
87
|
+
{body}
|
|
88
|
+
</button>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function Snippet({ text }: { text: string }) {
|
|
93
|
+
return (
|
|
94
|
+
<>
|
|
95
|
+
{text.split(MARK).map((part, i) =>
|
|
96
|
+
i % 2 === 1 ? (
|
|
97
|
+
<mark key={i} className="fts-mark">
|
|
98
|
+
{part}
|
|
99
|
+
</mark>
|
|
100
|
+
) : (
|
|
101
|
+
<span key={i}>{part}</span>
|
|
102
|
+
),
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default function Logs(p: Props) {
|
|
109
|
+
const { environment, window, range } = usePage<SharedProps>().props
|
|
110
|
+
const a = environment!.application_id
|
|
111
|
+
const e = environment!.id
|
|
112
|
+
const timeParams =
|
|
113
|
+
window === "custom"
|
|
114
|
+
? { from: range?.from, to: range?.to }
|
|
115
|
+
: { window: window }
|
|
116
|
+
const cursorTimeParams = range
|
|
117
|
+
? { from: range.from, to: range.to }
|
|
118
|
+
: timeParams
|
|
119
|
+
const visit = (q: string) =>
|
|
120
|
+
router.visit(
|
|
121
|
+
R.applicationEnvironmentLogsPath(a, e, {
|
|
122
|
+
...timeParams,
|
|
123
|
+
q: q || undefined,
|
|
124
|
+
}),
|
|
125
|
+
{
|
|
126
|
+
only: ["logs", "pagination", "highlights", "counts", "q"],
|
|
127
|
+
preserveState: true,
|
|
128
|
+
preserveScroll: true,
|
|
129
|
+
reset: ["logs", "highlights"],
|
|
130
|
+
},
|
|
131
|
+
)
|
|
132
|
+
const logsPath = (cursor?: string) =>
|
|
133
|
+
R.applicationEnvironmentLogsPath(a, e, {
|
|
134
|
+
...cursorTimeParams,
|
|
135
|
+
q: p.q || undefined,
|
|
136
|
+
cursor,
|
|
137
|
+
limit: p.pagination.limit,
|
|
138
|
+
})
|
|
139
|
+
const currentLevel = parseFilter(p.q).fields.level
|
|
140
|
+
const setLevel = (level: string | undefined) => {
|
|
141
|
+
const parsed = parseFilter(p.q)
|
|
142
|
+
const fields = { ...parsed.fields }
|
|
143
|
+
if (level) fields.level = level
|
|
144
|
+
else delete fields.level
|
|
145
|
+
visit(serializeFilter({ text: parsed.text, fields }))
|
|
146
|
+
}
|
|
147
|
+
return (
|
|
148
|
+
<EnvLayout title="Logs">
|
|
149
|
+
<PageHeader
|
|
150
|
+
title="Logs"
|
|
151
|
+
description="Rails.logger lines and Rails.event structured events, linked to the request or job that wrote them."
|
|
152
|
+
actions={<SavedViewsMenu page="logs" />}
|
|
153
|
+
/>
|
|
154
|
+
<div className="-mx-3 [scrollbar-width:none] overflow-x-auto px-3 md:mx-0 md:px-0 [&::-webkit-scrollbar]:hidden">
|
|
155
|
+
<Segmented className="w-max">
|
|
156
|
+
<SegmentedItem
|
|
157
|
+
active={!currentLevel}
|
|
158
|
+
onClick={() => setLevel(undefined)}
|
|
159
|
+
>
|
|
160
|
+
All
|
|
161
|
+
</SegmentedItem>
|
|
162
|
+
{["debug", "info", "warn", "error", "fatal", "event"].map((l) => (
|
|
163
|
+
<SegmentedItem
|
|
164
|
+
key={l}
|
|
165
|
+
active={currentLevel === l}
|
|
166
|
+
onClick={() => setLevel(l)}
|
|
167
|
+
className="gap-1.5"
|
|
168
|
+
>
|
|
169
|
+
{l}
|
|
170
|
+
<span className="opacity-60">{count(p.counts[l] ?? 0)}</span>
|
|
171
|
+
</SegmentedItem>
|
|
172
|
+
))}
|
|
173
|
+
</Segmented>
|
|
174
|
+
</div>
|
|
175
|
+
<FilterBar
|
|
176
|
+
value={p.q}
|
|
177
|
+
fields={[
|
|
178
|
+
{ key: "after", label: "After" },
|
|
179
|
+
{ key: "before", label: "Before" },
|
|
180
|
+
{ key: "user", label: "User" },
|
|
181
|
+
{ key: "deploy", label: "Deploy" },
|
|
182
|
+
{
|
|
183
|
+
key: "level",
|
|
184
|
+
label: "Level",
|
|
185
|
+
options: [
|
|
186
|
+
"debug",
|
|
187
|
+
"info",
|
|
188
|
+
"warn",
|
|
189
|
+
"error",
|
|
190
|
+
"fatal",
|
|
191
|
+
"event",
|
|
192
|
+
"unknown",
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
key: "kind",
|
|
197
|
+
label: "Execution kind",
|
|
198
|
+
options: ["request", "job", "scheduled_task", "command"],
|
|
199
|
+
},
|
|
200
|
+
{ key: "source", label: "Source" },
|
|
201
|
+
{ key: "tenant", label: "Tenant" },
|
|
202
|
+
]}
|
|
203
|
+
onChange={visit}
|
|
204
|
+
placeholder="level:error kind:job source:app/jobs/sync_job.rb:12"
|
|
205
|
+
/>
|
|
206
|
+
<div className="text-muted-foreground flex flex-wrap items-baseline gap-x-3 gap-y-1 text-xs">
|
|
207
|
+
<span className="font-mono tabular-nums">
|
|
208
|
+
{count(p.logs.length)} {p.logs.length === 1 ? "line" : "lines"}
|
|
209
|
+
</span>
|
|
210
|
+
<span>
|
|
211
|
+
Full-text search: quotes for phrases, -word to exclude, prefixes match
|
|
212
|
+
</span>
|
|
213
|
+
</div>
|
|
214
|
+
<DataTable
|
|
215
|
+
rows={p.logs}
|
|
216
|
+
rowKey={(l) => l.id}
|
|
217
|
+
empty={
|
|
218
|
+
<EmptyState
|
|
219
|
+
icon={FileText}
|
|
220
|
+
title="No log lines match"
|
|
221
|
+
signal="caution"
|
|
222
|
+
description="Log lines are captured from your app's Rails logger."
|
|
223
|
+
/>
|
|
224
|
+
}
|
|
225
|
+
columns={[
|
|
226
|
+
{
|
|
227
|
+
key: "when",
|
|
228
|
+
header: "When",
|
|
229
|
+
className: "w-40",
|
|
230
|
+
cell: (l) => (
|
|
231
|
+
<span className="text-xs tabular-nums">
|
|
232
|
+
{when(l.occurred_at)}
|
|
233
|
+
</span>
|
|
234
|
+
),
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
key: "lvl",
|
|
238
|
+
header: "Level",
|
|
239
|
+
cell: (l) => <LevelBadge level={l.level} />,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
key: "msg",
|
|
243
|
+
header: "Message",
|
|
244
|
+
grow: true,
|
|
245
|
+
className: "whitespace-normal",
|
|
246
|
+
cell: (l) => (
|
|
247
|
+
<LogMessage
|
|
248
|
+
message={l.message}
|
|
249
|
+
highlight={p.highlights[l.id]}
|
|
250
|
+
tags={l.tags}
|
|
251
|
+
/>
|
|
252
|
+
),
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
key: "in",
|
|
256
|
+
hideOnMobile: true,
|
|
257
|
+
header: "In",
|
|
258
|
+
cell: (l) =>
|
|
259
|
+
l.execution_id ? (
|
|
260
|
+
<Link
|
|
261
|
+
className="font-mono text-xs hover:underline"
|
|
262
|
+
href={R.applicationEnvironmentRequestPath(
|
|
263
|
+
a,
|
|
264
|
+
e,
|
|
265
|
+
l.execution_id,
|
|
266
|
+
)}
|
|
267
|
+
>
|
|
268
|
+
{l.execution_preview}
|
|
269
|
+
</Link>
|
|
270
|
+
) : null,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
key: "t",
|
|
274
|
+
hideOnMobile: true,
|
|
275
|
+
header: "Tenant",
|
|
276
|
+
cell: (l) =>
|
|
277
|
+
l.tenant ? (
|
|
278
|
+
<button
|
|
279
|
+
className="font-mono text-xs hover:underline"
|
|
280
|
+
onClick={() => {
|
|
281
|
+
const parsed = parseFilter(p.q)
|
|
282
|
+
visit(
|
|
283
|
+
serializeFilter({
|
|
284
|
+
text: parsed.text,
|
|
285
|
+
fields: { ...parsed.fields, tenant: l.tenant! },
|
|
286
|
+
}),
|
|
287
|
+
)
|
|
288
|
+
}}
|
|
289
|
+
>
|
|
290
|
+
{l.tenant}
|
|
291
|
+
</button>
|
|
292
|
+
) : null,
|
|
293
|
+
},
|
|
294
|
+
]}
|
|
295
|
+
/>
|
|
296
|
+
<CursorLoadMore
|
|
297
|
+
meta={p.pagination}
|
|
298
|
+
href={logsPath}
|
|
299
|
+
only={["logs", "pagination", "highlights"]}
|
|
300
|
+
/>
|
|
301
|
+
</EnvLayout>
|
|
302
|
+
)
|
|
303
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Link, router, usePage } from "@inertiajs/react"
|
|
2
|
+
import { Mail } from "lucide-react"
|
|
3
|
+
|
|
4
|
+
import { VolumePanel } from "@/components/railwatch/chart-panel"
|
|
5
|
+
import { DataTable } from "@/components/railwatch/data-table"
|
|
6
|
+
import { EmptyState } from "@/components/railwatch/empty-state"
|
|
7
|
+
import { FilterBar } from "@/components/railwatch/filter-bar"
|
|
8
|
+
import { PageHeader } from "@/components/railwatch/page-header"
|
|
9
|
+
import { PercentilePicker } from "@/components/railwatch/percentile-picker"
|
|
10
|
+
import { SparklineCell } from "@/components/railwatch/sparkline-cell"
|
|
11
|
+
import { Badge } from "@/components/ui/badge"
|
|
12
|
+
import { usePercentile } from "@/hooks/use-percentile"
|
|
13
|
+
import EnvLayout from "@/layouts/env-layout"
|
|
14
|
+
import { count, ms, when } from "@/lib/format"
|
|
15
|
+
import * as R from "@/routes"
|
|
16
|
+
import type { GroupRow, SeriesPoint, SharedProps } from "@/types"
|
|
17
|
+
|
|
18
|
+
interface MailRow {
|
|
19
|
+
id: number
|
|
20
|
+
mailer: string
|
|
21
|
+
subject: string
|
|
22
|
+
to: number
|
|
23
|
+
cc: number
|
|
24
|
+
bcc: number
|
|
25
|
+
attachments: number
|
|
26
|
+
delivery_method: string | null
|
|
27
|
+
duration: number
|
|
28
|
+
failed: boolean
|
|
29
|
+
occurred_at: string
|
|
30
|
+
execution_id: string | null
|
|
31
|
+
execution_preview: string | null
|
|
32
|
+
}
|
|
33
|
+
interface Props {
|
|
34
|
+
mailers: GroupRow[]
|
|
35
|
+
series: SeriesPoint[]
|
|
36
|
+
recent: MailRow[]
|
|
37
|
+
q: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default function Mails(p: Props) {
|
|
41
|
+
const { environment, window } = usePage<SharedProps>().props
|
|
42
|
+
const { percentile } = usePercentile()
|
|
43
|
+
const a = environment!.application_id
|
|
44
|
+
const e = environment!.id
|
|
45
|
+
const mailHref = (m: MailRow) =>
|
|
46
|
+
m.execution_id
|
|
47
|
+
? R.applicationEnvironmentRequestPath(a, e, m.execution_id)
|
|
48
|
+
: null
|
|
49
|
+
return (
|
|
50
|
+
<EnvLayout title="Mail">
|
|
51
|
+
<PageHeader
|
|
52
|
+
title="Mail"
|
|
53
|
+
description="Action Mailer deliveries: recipients, delivery method, render and send time."
|
|
54
|
+
actions={<PercentilePicker />}
|
|
55
|
+
/>
|
|
56
|
+
<VolumePanel
|
|
57
|
+
legend="outcome"
|
|
58
|
+
label="Deliveries"
|
|
59
|
+
seriesLabel="Deliveries"
|
|
60
|
+
data={p.series}
|
|
61
|
+
/>
|
|
62
|
+
<DataTable
|
|
63
|
+
rows={p.mailers}
|
|
64
|
+
rowKey={(m) => m.group_hash}
|
|
65
|
+
empty={
|
|
66
|
+
<EmptyState
|
|
67
|
+
icon={Mail}
|
|
68
|
+
title="No mail sent in this window"
|
|
69
|
+
description="ActionMailer deliveries appear here as your app sends them."
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
columns={[
|
|
73
|
+
{
|
|
74
|
+
key: "m",
|
|
75
|
+
header: "Mailer",
|
|
76
|
+
cell: (m) => <span className="font-mono text-xs">{m.name}</span>,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "trend",
|
|
80
|
+
hideOnMobile: true,
|
|
81
|
+
header: "Trend",
|
|
82
|
+
cell: (m) => <SparklineCell data={m.sparkline} />,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "n",
|
|
86
|
+
header: "Sent",
|
|
87
|
+
align: "right",
|
|
88
|
+
cell: (m) => count(m.count),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: "f",
|
|
92
|
+
hideOnMobile: true,
|
|
93
|
+
header: "Failed",
|
|
94
|
+
align: "right",
|
|
95
|
+
cell: (m) => m.errors,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "avg",
|
|
99
|
+
hideOnMobile: true,
|
|
100
|
+
header: "Avg",
|
|
101
|
+
align: "right",
|
|
102
|
+
cell: (m) => ms(m.avg),
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: percentile,
|
|
106
|
+
header: percentile,
|
|
107
|
+
align: "right",
|
|
108
|
+
cell: (m) => (
|
|
109
|
+
<span className="font-semibold">{ms(m[percentile])}</span>
|
|
110
|
+
),
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
/>
|
|
114
|
+
<h2 className="text-sm font-semibold">Recent</h2>
|
|
115
|
+
<FilterBar
|
|
116
|
+
value={p.q}
|
|
117
|
+
fields={[
|
|
118
|
+
{ key: "mailer", label: "Mailer" },
|
|
119
|
+
{ key: "kind", label: "Kind" },
|
|
120
|
+
]}
|
|
121
|
+
onChange={(q) =>
|
|
122
|
+
router.visit(
|
|
123
|
+
R.applicationEnvironmentMailsPath(a, e, {
|
|
124
|
+
window,
|
|
125
|
+
q: q || undefined,
|
|
126
|
+
}),
|
|
127
|
+
{ preserveState: true },
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
placeholder="mailer:WidgetMailer kind:smtp"
|
|
131
|
+
/>
|
|
132
|
+
<DataTable
|
|
133
|
+
rows={p.recent}
|
|
134
|
+
rowKey={(m) => m.id}
|
|
135
|
+
empty={
|
|
136
|
+
<EmptyState
|
|
137
|
+
icon={Mail}
|
|
138
|
+
title="No mail sent in this window"
|
|
139
|
+
description="ActionMailer deliveries appear here as your app sends them."
|
|
140
|
+
/>
|
|
141
|
+
}
|
|
142
|
+
keyboardNav={{
|
|
143
|
+
onOpen: (m, opts) => {
|
|
144
|
+
const href = mailHref(m)
|
|
145
|
+
if (!href) return
|
|
146
|
+
if (opts?.newTab) globalThis.window.open(href, "_blank")
|
|
147
|
+
else router.visit(href)
|
|
148
|
+
},
|
|
149
|
+
}}
|
|
150
|
+
columns={[
|
|
151
|
+
{
|
|
152
|
+
key: "when",
|
|
153
|
+
header: "When",
|
|
154
|
+
cell: (m) => <span className="text-xs">{when(m.occurred_at)}</span>,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: "m",
|
|
158
|
+
header: "Mailer",
|
|
159
|
+
cell: (m) => <span className="font-mono text-xs">{m.mailer}</span>,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: "s",
|
|
163
|
+
header: "Subject",
|
|
164
|
+
cell: (m) => (
|
|
165
|
+
<span className="line-clamp-1 text-xs">{m.subject}</span>
|
|
166
|
+
),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: "to",
|
|
170
|
+
hideOnMobile: true,
|
|
171
|
+
header: "To/CC/BCC",
|
|
172
|
+
align: "right",
|
|
173
|
+
cell: (m) => `${m.to}/${m.cc}/${m.bcc}`,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: "att",
|
|
177
|
+
hideOnMobile: true,
|
|
178
|
+
header: "Att.",
|
|
179
|
+
align: "right",
|
|
180
|
+
cell: (m) => m.attachments,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
key: "dm",
|
|
184
|
+
hideOnMobile: true,
|
|
185
|
+
header: "Via",
|
|
186
|
+
cell: (m) => m.delivery_method,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: "st",
|
|
190
|
+
header: "",
|
|
191
|
+
cell: (m) =>
|
|
192
|
+
m.failed ? <Badge variant="destructive">failed</Badge> : null,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: "d",
|
|
196
|
+
hideOnMobile: true,
|
|
197
|
+
header: "Duration",
|
|
198
|
+
align: "right",
|
|
199
|
+
cell: (m) => ms(m.duration),
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
key: "in",
|
|
203
|
+
hideOnMobile: true,
|
|
204
|
+
header: "In",
|
|
205
|
+
cell: (m) => {
|
|
206
|
+
const href = mailHref(m)
|
|
207
|
+
return href ? (
|
|
208
|
+
<Link className="font-mono text-xs hover:underline" href={href}>
|
|
209
|
+
{m.execution_preview}
|
|
210
|
+
</Link>
|
|
211
|
+
) : null
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
]}
|
|
215
|
+
/>
|
|
216
|
+
</EnvLayout>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Link, router, usePage } from "@inertiajs/react"
|
|
2
|
+
import { BellRing } from "lucide-react"
|
|
3
|
+
|
|
4
|
+
import { DataTable } from "@/components/railwatch/data-table"
|
|
5
|
+
import { EmptyState } from "@/components/railwatch/empty-state"
|
|
6
|
+
import { PageHeader } from "@/components/railwatch/page-header"
|
|
7
|
+
import EnvLayout from "@/layouts/env-layout"
|
|
8
|
+
import { count, ms, when } from "@/lib/format"
|
|
9
|
+
import * as R from "@/routes"
|
|
10
|
+
import type { SharedProps } from "@/types"
|
|
11
|
+
|
|
12
|
+
interface Group {
|
|
13
|
+
group_hash: string
|
|
14
|
+
name: string
|
|
15
|
+
count: number
|
|
16
|
+
errors: number
|
|
17
|
+
avg: number
|
|
18
|
+
p95: number
|
|
19
|
+
}
|
|
20
|
+
interface Recent {
|
|
21
|
+
id: number
|
|
22
|
+
notifier: string | null
|
|
23
|
+
delivery_method: string | null
|
|
24
|
+
duration: number
|
|
25
|
+
failed: boolean
|
|
26
|
+
occurred_at: string
|
|
27
|
+
execution_id: string | null
|
|
28
|
+
execution_preview: string | null
|
|
29
|
+
}
|
|
30
|
+
interface Props {
|
|
31
|
+
groups: Group[]
|
|
32
|
+
recent: Recent[]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default function Notifications(p: Props) {
|
|
36
|
+
const { environment } = usePage<SharedProps>().props
|
|
37
|
+
const a = environment!.application_id
|
|
38
|
+
const e = environment!.id
|
|
39
|
+
const recentHref = (r: Recent) =>
|
|
40
|
+
r.execution_id
|
|
41
|
+
? R.applicationEnvironmentRequestPath(a, e, r.execution_id)
|
|
42
|
+
: null
|
|
43
|
+
return (
|
|
44
|
+
<EnvLayout title="Notifications">
|
|
45
|
+
<PageHeader
|
|
46
|
+
title="Notifications"
|
|
47
|
+
description="ActionMailer/Noticed deliveries, grouped by notifier and delivery method."
|
|
48
|
+
/>
|
|
49
|
+
<DataTable
|
|
50
|
+
rows={p.groups}
|
|
51
|
+
rowKey={(g) => g.group_hash}
|
|
52
|
+
empty={
|
|
53
|
+
<EmptyState
|
|
54
|
+
icon={BellRing}
|
|
55
|
+
title="No notifications in this window"
|
|
56
|
+
description="Notifications delivered by your app appear here as they're sent."
|
|
57
|
+
/>
|
|
58
|
+
}
|
|
59
|
+
columns={[
|
|
60
|
+
{
|
|
61
|
+
key: "n",
|
|
62
|
+
header: "Notifier",
|
|
63
|
+
cell: (g) => <span className="font-mono text-xs">{g.name}</span>,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "c",
|
|
67
|
+
hideOnMobile: true,
|
|
68
|
+
header: "Count",
|
|
69
|
+
align: "right",
|
|
70
|
+
cell: (g) => count(g.count),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "f",
|
|
74
|
+
hideOnMobile: true,
|
|
75
|
+
header: "Failed",
|
|
76
|
+
align: "right",
|
|
77
|
+
cell: (g) => count(g.errors),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "avg",
|
|
81
|
+
hideOnMobile: true,
|
|
82
|
+
header: "Avg",
|
|
83
|
+
align: "right",
|
|
84
|
+
cell: (g) => ms(g.avg, 3),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: "p95",
|
|
88
|
+
header: "p95",
|
|
89
|
+
align: "right",
|
|
90
|
+
cell: (g) => ms(g.p95, 3),
|
|
91
|
+
},
|
|
92
|
+
]}
|
|
93
|
+
/>
|
|
94
|
+
<h2 className="text-sm font-semibold">Recent</h2>
|
|
95
|
+
<DataTable
|
|
96
|
+
rows={p.recent}
|
|
97
|
+
rowKey={(r) => r.id}
|
|
98
|
+
empty={
|
|
99
|
+
<EmptyState
|
|
100
|
+
icon={BellRing}
|
|
101
|
+
title="No notifications in this window"
|
|
102
|
+
description="Notifications delivered by your app appear here as they're sent."
|
|
103
|
+
/>
|
|
104
|
+
}
|
|
105
|
+
keyboardNav={{
|
|
106
|
+
onOpen: (r, opts) => {
|
|
107
|
+
const href = recentHref(r)
|
|
108
|
+
if (!href) return
|
|
109
|
+
if (opts?.newTab) window.open(href, "_blank")
|
|
110
|
+
else router.visit(href)
|
|
111
|
+
},
|
|
112
|
+
}}
|
|
113
|
+
columns={[
|
|
114
|
+
{
|
|
115
|
+
key: "when",
|
|
116
|
+
header: "When",
|
|
117
|
+
cell: (r) => <span className="text-xs">{when(r.occurred_at)}</span>,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: "n",
|
|
121
|
+
header: "Notifier",
|
|
122
|
+
cell: (r) => (
|
|
123
|
+
<span className="font-mono text-xs">{r.notifier}</span>
|
|
124
|
+
),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: "dm",
|
|
128
|
+
hideOnMobile: true,
|
|
129
|
+
header: "Delivery method",
|
|
130
|
+
cell: (r) => r.delivery_method,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: "f",
|
|
134
|
+
hideOnMobile: true,
|
|
135
|
+
header: "Failed",
|
|
136
|
+
cell: (r) => (r.failed ? "yes" : ""),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
key: "d",
|
|
140
|
+
header: "Duration",
|
|
141
|
+
align: "right",
|
|
142
|
+
cell: (r) => ms(r.duration, 3),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: "in",
|
|
146
|
+
hideOnMobile: true,
|
|
147
|
+
header: "In",
|
|
148
|
+
cell: (r) => {
|
|
149
|
+
const href = recentHref(r)
|
|
150
|
+
return href ? (
|
|
151
|
+
<Link className="font-mono text-xs hover:underline" href={href}>
|
|
152
|
+
{r.execution_preview}
|
|
153
|
+
</Link>
|
|
154
|
+
) : null
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
]}
|
|
158
|
+
/>
|
|
159
|
+
</EnvLayout>
|
|
160
|
+
)
|
|
161
|
+
}
|