railwatch 0.5.0 → 0.6.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.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +6 -2
  3. data/CHANGELOG.md +133 -0
  4. data/README.md +21 -13
  5. data/app/controllers/railwatch/dashboard_controller.rb +1 -0
  6. data/app/controllers/railwatch/requests_controller.rb +1 -19
  7. data/app/models/railwatch/application_record.rb +2 -2
  8. data/app/models/railwatch/execution_presenter.rb +1 -1
  9. data/app/models/railwatch/filter_query.rb +20 -0
  10. data/app/models/railwatch/saved_view.rb +1 -1
  11. data/app/models/railwatch/telemetry_record.rb +2 -2
  12. data/docs/configuration.md +29 -13
  13. data/docs/embedded.md +32 -12
  14. data/docs/faq.md +6 -5
  15. data/docs/getting-started.md +9 -5
  16. data/docs/troubleshooting.md +10 -6
  17. data/lib/generators/railwatch/install/install_generator.rb +31 -16
  18. data/lib/generators/railwatch/install/templates/initializer.rb.tt +4 -4
  19. data/lib/puma/plugin/railwatch.rb +48 -3
  20. data/lib/railwatch/configuration.rb +16 -1
  21. data/lib/railwatch/engine.rb +14 -3
  22. data/lib/railwatch/reporter.rb +52 -16
  23. data/lib/railwatch/transport/http.rb +4 -9
  24. data/lib/railwatch/version.rb +1 -1
  25. data/lib/railwatch.rb +35 -1
  26. data/lib/tasks/railwatch_tasks.rake +11 -4
  27. data/llms.txt +8 -4
  28. data/public/railwatch/assets/{app-layout-DDyQa72H.js → app-layout-2xAKndVD.js} +1 -1
  29. data/public/railwatch/assets/{app-wordmark-o9CODKP0.js → app-wordmark-Bt6XqURo.js} +1 -1
  30. data/public/railwatch/assets/{appearance-BwuCXabr.js → appearance-DyCfeh9o.js} +1 -1
  31. data/public/railwatch/assets/{arrow-up-C6PxDiY3.js → arrow-up-EmePsTKP.js} +1 -1
  32. data/public/railwatch/assets/{auth-layout-BRt8MGFD.js → auth-layout-BuwogWMZ.js} +1 -1
  33. data/public/railwatch/assets/{badge-CAxXV8za.js → badge-Dv7I-ebP.js} +1 -1
  34. data/public/railwatch/assets/{braces-DgomTCNf.js → braces-iZ7MEfYP.js} +1 -1
  35. data/public/railwatch/assets/{card-cAtqCxWl.js → card-DqdEEKcJ.js} +1 -1
  36. data/public/railwatch/assets/{chart-BBeBkkNa.js → chart-C4k7Ub9W.js} +1 -1
  37. data/public/railwatch/assets/{chart-hover-B1M9jc0y.js → chart-hover-2yZG3w2u.js} +1 -1
  38. data/public/railwatch/assets/{chart-panel-DUQTz_C8.js → chart-panel-CONkZcn9.js} +1 -1
  39. data/public/railwatch/assets/{checkbox-CmhMHWZO.js → checkbox-DKbThbxr.js} +1 -1
  40. data/public/railwatch/assets/{code-DESvxyTj.js → code-CYahYQHZ.js} +1 -1
  41. data/public/railwatch/assets/{copy-block-BkSU5832.js → copy-block-CbJum9s8.js} +1 -1
  42. data/public/railwatch/assets/{copy-id-D03GhN9F.js → copy-id-JmvLfkmx.js} +1 -1
  43. data/public/railwatch/assets/{cursor-load-more-CRyuMeQb.js → cursor-load-more-C1ylbqqL.js} +1 -1
  44. data/public/railwatch/assets/{data-table-BIlt7Rtm.js → data-table-CVKR2wkq.js} +1 -1
  45. data/public/railwatch/assets/{edit-DJ0D0wHN.js → edit-BXF5oNYA.js} +1 -1
  46. data/public/railwatch/assets/{edit-O0NSBWxo.js → edit-BwSEVrTG.js} +1 -1
  47. data/public/railwatch/assets/{edit-Bb6MKoe4.js → edit-D5BRDwLT.js} +1 -1
  48. data/public/railwatch/assets/{empty-state-C38il627.js → empty-state-Bn48Gplm.js} +1 -1
  49. data/public/railwatch/assets/{env-layout-REF7OM4q.js → env-layout-CKLL8Ds7.js} +1 -1
  50. data/public/railwatch/assets/{execution-path-FYLq1TwC.js → execution-path-DWovhgLi.js} +1 -1
  51. data/public/railwatch/assets/{filter-bar-CYog9Alp.js → filter-bar-xcbJC93z.js} +1 -1
  52. data/public/railwatch/assets/{flamegraph-DSs69foN.js → flamegraph-BNbNIuKT.js} +1 -1
  53. data/public/railwatch/assets/{frames-BUi2J5Mk.js → frames-Bk39xfJG.js} +1 -1
  54. data/public/railwatch/assets/{google-sign-in-button-BQiIKFdd.js → google-sign-in-button-B5as2ps1.js} +1 -1
  55. data/public/railwatch/assets/{index-QpTtwFwu.js → index-Atp1FTgX.js} +1 -1
  56. data/public/railwatch/assets/{index-C-PmdhXA.js → index-B-FXAo1w.js} +1 -1
  57. data/public/railwatch/assets/{index-DqTFTP8p.js → index-B0xgzHuN.js} +1 -1
  58. data/public/railwatch/assets/{index-so4lRrRq.js → index-BDVShWMs.js} +1 -1
  59. data/public/railwatch/assets/{index-C_upSl_k.js → index-BRvRkfob.js} +1 -1
  60. data/public/railwatch/assets/{index-CsoN51vW.js → index-BVWapDeB.js} +1 -1
  61. data/public/railwatch/assets/{index-CrZ3vHDL.js → index-Bd4YpOIO.js} +1 -1
  62. data/public/railwatch/assets/{index-BaR1U9An.js → index-BeQw69GM.js} +1 -1
  63. data/public/railwatch/assets/{index-Dh4IRLFI.js → index-BfitxVBv.js} +1 -1
  64. data/public/railwatch/assets/{index-umIAl-pL.js → index-C-EwH4lO.js} +1 -1
  65. data/public/railwatch/assets/{index-CICUIFHL.js → index-C8JIdb3_.js} +1 -1
  66. data/public/railwatch/assets/{index-CFFpnzIS.js → index-CBFCtJAR.js} +1 -1
  67. data/public/railwatch/assets/{index-tpz-OGUP.js → index-CDXlITyG.js} +1 -1
  68. data/public/railwatch/assets/{index-DW2CBbxU.js → index-COd9lT84.js} +1 -1
  69. data/public/railwatch/assets/{index-FhUaPPab.js → index-C_hQmVTP.js} +1 -1
  70. data/public/railwatch/assets/{index-JdCVBrw8.js → index-CcennT28.js} +1 -1
  71. data/public/railwatch/assets/{index-DrcKVG2f.js → index-CiaeS-n7.js} +1 -1
  72. data/public/railwatch/assets/{index-BoUBioBP.js → index-CrA7jBTK.js} +1 -1
  73. data/public/railwatch/assets/{index-C3A_9imx.js → index-D0mKj3Hg.js} +1 -1
  74. data/public/railwatch/assets/{index-BiiyMcA0.js → index-DV5MdmpY.js} +1 -1
  75. data/public/railwatch/assets/{index-CiPo4Gob.js → index-DaE-1xhx.js} +1 -1
  76. data/public/railwatch/assets/{index-CpkI015n.js → index-DdVg9LKX.js} +1 -1
  77. data/public/railwatch/assets/{index-DvjY3dPD.js → index-DeLtMWou.js} +1 -1
  78. data/public/railwatch/assets/{index-CFRLPs4J.js → index-DiQ4mqT_.js} +1 -1
  79. data/public/railwatch/assets/{index-DtHmuB9Q.js → index-LKgpCzoR.js} +1 -1
  80. data/public/railwatch/assets/{index-BeOh2t_S.js → index-S0NVaLj9.js} +1 -1
  81. data/public/railwatch/assets/{index-C7OtLq_3.js → index-Vj93BTR5.js} +1 -1
  82. data/public/railwatch/assets/{index-ZOGOB8SA.js → index-XjXcV-EO.js} +1 -1
  83. data/public/railwatch/assets/{index-ZSZg9rtq.js → index-Zkt4W_CM.js} +1 -1
  84. data/public/railwatch/assets/{index-8-hnAhOD.js → index-aPCZX-pW.js} +1 -1
  85. data/public/railwatch/assets/{index-DDI_Zx5V.js → index-cTzBycCg.js} +1 -1
  86. data/public/railwatch/assets/{index-sTYvcbkh.js → index-dpG-19ZN.js} +1 -1
  87. data/public/railwatch/assets/{index-r0tSIplE.js → index-gCvuyG1l.js} +1 -1
  88. data/public/railwatch/assets/{index-DSvlZVWG.js → index-o1xqGvLo.js} +1 -1
  89. data/public/railwatch/assets/{index-CGs4m_fa.js → index-w_skgMmK.js} +1 -1
  90. data/public/railwatch/assets/{inertia-DLew8ZNx.js → inertia-CqnzqPVD.js} +2 -2
  91. data/public/railwatch/assets/{input-error-cvM6_Jht.js → input-error-ByT28UdP.js} +1 -1
  92. data/public/railwatch/assets/{json-viewer-D922McGi.js → json-viewer-Bnu9RsJL.js} +1 -1
  93. data/public/railwatch/assets/{klass-CrwICqN8.js → klass-nLiBV-Az.js} +1 -1
  94. data/public/railwatch/assets/{label-GWl7I6sf.js → label-1nSzpSB6.js} +1 -1
  95. data/public/railwatch/assets/{layout-0ZAnD3zl.js → layout-D7lE1Doo.js} +1 -1
  96. data/public/railwatch/assets/{live-dot-D1n_BreY.js → live-dot-UdzOfzJb.js} +1 -1
  97. data/public/railwatch/assets/{nav-DPxr1NNC.js → nav-BRCgp2w3.js} +1 -1
  98. data/public/railwatch/assets/{new-DHAHDrN7.js → new-C60G72DR.js} +1 -1
  99. data/public/railwatch/assets/{new-D-ZzUK9a.js → new-COyDKOOb.js} +1 -1
  100. data/public/railwatch/assets/{new-DEVkYv-z.js → new-Cd9zPNJ8.js} +1 -1
  101. data/public/railwatch/assets/{new-Dz4lZf1L.js → new-DMJGKjmH.js} +1 -1
  102. data/public/railwatch/assets/{new-GMrRFurX.js → new-Omvf-c9s.js} +1 -1
  103. data/public/railwatch/assets/{new-Cdl6pqST.js → new-vjRzERL3.js} +1 -1
  104. data/public/railwatch/assets/onboarding-gUjJQc-6.js +1 -0
  105. data/public/railwatch/assets/{origin-identity-Bk9yHWZ1.js → origin-identity-M1YUPYS0.js} +1 -1
  106. data/public/railwatch/assets/{percentile-picker-DfSx9yJO.js → percentile-picker-BxIVblBw.js} +1 -1
  107. data/public/railwatch/assets/{relative-time-CjIjb8Lg.js → relative-time-DQ4kjowZ.js} +1 -1
  108. data/public/railwatch/assets/{release-health-4b3tivEf.js → release-health-Cb1tMOOO.js} +1 -1
  109. data/public/railwatch/assets/{route-C_5BUtHK.js → route-BJkoEm7r.js} +1 -1
  110. data/public/railwatch/assets/{segmented-BgbT3wZa.js → segmented-C4oWE73o.js} +1 -1
  111. data/public/railwatch/assets/{select-DmunxCKE.js → select-ocdQJdQo.js} +1 -1
  112. data/public/railwatch/assets/{separator-BXzEdZ_8.js → separator-Ct2UcZ2x.js} +1 -1
  113. data/public/railwatch/assets/{series-chart-Xf49v9cv.js → series-chart-D6upsrSn.js} +1 -1
  114. data/public/railwatch/assets/{show-DlRVS18-.js → show-B4bwI9x2.js} +1 -1
  115. data/public/railwatch/assets/{show-DnR1Dnjd.js → show-BAjfddEn.js} +1 -1
  116. data/public/railwatch/assets/{show-mU38uGTg.js → show-BLJOyLb_.js} +1 -1
  117. data/public/railwatch/assets/{show-DYskfl3-.js → show-BoVyMQS6.js} +1 -1
  118. data/public/railwatch/assets/{show-DXs4deaC.js → show-Bsu1rvnK.js} +1 -1
  119. data/public/railwatch/assets/{show-Dn-GwFZL.js → show-C6OiJ6Hr.js} +1 -1
  120. data/public/railwatch/assets/{show-CAl7xcex.js → show-C8TkpEgm.js} +1 -1
  121. data/public/railwatch/assets/{show-BLpWUHWD.js → show-CBFBiBY2.js} +1 -1
  122. data/public/railwatch/assets/{show-Y74rM0VT.js → show-CEhPVMMT.js} +1 -1
  123. data/public/railwatch/assets/{show-SHwZjXb7.js → show-CV-lG2b6.js} +1 -1
  124. data/public/railwatch/assets/{show-Dily73Xk.js → show-CX_pab9S.js} +1 -1
  125. data/public/railwatch/assets/{show-DcpTFiLi.js → show-D6lgzL6n.js} +1 -1
  126. data/public/railwatch/assets/{show-vQ4bndYD.js → show-DDVsv-uS.js} +1 -1
  127. data/public/railwatch/assets/{show-SvLOcPrx.js → show-Dwiq-8hA.js} +1 -1
  128. data/public/railwatch/assets/{show-B2zLAW83.js → show-eKazflRI.js} +1 -1
  129. data/public/railwatch/assets/{show-DSP9Cq_C.js → show-gtwKsTsl.js} +1 -1
  130. data/public/railwatch/assets/{show-DI8IhNUH.js → show-yEOrk6Pt.js} +1 -1
  131. data/public/railwatch/assets/{sort-header-Dcq9bzmo.js → sort-header-CPM6fhXv.js} +1 -1
  132. data/public/railwatch/assets/{sparkline-cell-BON3qQUB.js → sparkline-cell-CXCxXPWt.js} +1 -1
  133. data/public/railwatch/assets/{stat-DFEyFxkO.js → stat-BNEfE8X1.js} +1 -1
  134. data/public/railwatch/assets/{status-badge-BaUKP7Yo.js → status-badge-D0aylrM5.js} +1 -1
  135. data/public/railwatch/assets/{tenant-path-DPZPc985.js → tenant-path-C4aM_cO0.js} +1 -1
  136. data/public/railwatch/assets/{text-link-BO77t9Xk.js → text-link-CP4lqUi6.js} +1 -1
  137. data/public/railwatch/assets/{textarea-DTqrCiV0.js → textarea-DzJo2ds4.js} +1 -1
  138. data/public/railwatch/assets/{timeline-D5rJ0es2.js → timeline-BNcJ9PMc.js} +1 -1
  139. data/public/railwatch/assets/{transition-DMIrZVth.js → transition-BX2M1iaq.js} +1 -1
  140. data/public/railwatch/assets/{use-clipboard-ByoUGQqA.js → use-clipboard-C1ApSwzA.js} +1 -1
  141. data/public/railwatch/assets/{use-live-D7xKz2ma.js → use-live-DWwLg1Nj.js} +1 -1
  142. data/public/railwatch/manifest.json +1283 -1283
  143. metadata +116 -116
  144. data/public/railwatch/assets/onboarding-D1vwaHYT.js +0 -1
  145. /data/db/railwatch_telemetry_migrate/{20260919000000_create_export_queue.rb → 20260919000100_create_export_queue.rb} +0 -0
@@ -1 +1 @@
1
- import{c as z,u as G,j as i,t as J,e as V,$ as Q,L as U}from"./inertia-DLew8ZNx.js";import{V as X}from"./chart-panel-DUQTz_C8.js";import{D as H}from"./data-table-BIlt7Rtm.js";import{E as W}from"./empty-state-C38il627.js";import{F as Y}from"./filter-bar-CYog9Alp.js";import{P as Z,E as ee}from"./env-layout-REF7OM4q.js";import{u as te,P as ie}from"./percentile-picker-DfSx9yJO.js";import{S as re}from"./sparkline-cell-BON3qQUB.js";import{B as le}from"./badge-CAxXV8za.js";import{m as F,c as ne,w as ae}from"./format-B9SDkrWj.js";import{M as I}from"./app-layout-DDyQa72H.js";import"./series-chart-Xf49v9cv.js";import"./chart-hover-B1M9jc0y.js";import"./chart-BBeBkkNa.js";import"./app-wordmark-o9CODKP0.js";import"./use-live-D7xKz2ma.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./segmented-BgbT3wZa.js";import"./label-GWl7I6sf.js";import"./checkbox-CmhMHWZO.js";function We(t){const e=z.c(51),{environment:K,window:L}=G().props,{percentile:l}=te(),n=K.application_id,a=K.id;let y;e[0]!==n||e[1]!==a?(y=r=>r.execution_id?J(n,a,r.execution_id):null,e[0]=n,e[1]=a,e[2]=y):y=e[2];const s=y;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Z,{title:"Mail",description:"Action Mailer deliveries: recipients, delivery method, render and send time.",actions:i.jsx(ie,{})}),e[3]=_):_=e[3];let o;e[4]!==t.series?(o=i.jsx(X,{legend:"outcome",label:"Deliveries",seriesLabel:"Deliveries",data:t.series}),e[4]=t.series,e[5]=o):o=e[5];let b,g,k,v,j,M;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(W,{icon:I,title:"No mail sent in this window",description:"ActionMailer deliveries appear here as your app sends them."}),g={key:"m",header:"Mailer",cell:ge},k={key:"trend",hideOnMobile:!0,header:"Trend",cell:be},v={key:"n",header:"Sent",align:"right",cell:_e},j={key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:ye},M={key:"avg",hideOnMobile:!0,header:"Avg",align:"right",cell:xe},e[6]=b,e[7]=g,e[8]=k,e[9]=v,e[10]=j,e[11]=M):(b=e[6],g=e[7],k=e[8],v=e[9],j=e[10],M=e[11]);let c;e[12]!==l?(c=r=>i.jsx("span",{className:"font-semibold",children:F(r[l])}),e[12]=l,e[13]=c):c=e[13];let m;e[14]!==l||e[15]!==c?(m=[g,k,v,j,M,{key:l,header:l,align:"right",cell:c}],e[14]=l,e[15]=c,e[16]=m):m=e[16];let d;e[17]!==t.mailers||e[18]!==m?(d=i.jsx(H,{rows:t.mailers,rowKey:ke,empty:b,columns:m}),e[17]=t.mailers,e[18]=m,e[19]=d):d=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[20]=w):w=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=[{key:"mailer",label:"Mailer"},{key:"kind",label:"Kind"}],e[21]=S):S=e[21];let u;e[22]!==n||e[23]!==a||e[24]!==L?(u=r=>V.visit(Q(n,a,{window:L,q:r||void 0}),{preserveState:!0}),e[22]=n,e[23]=a,e[24]=L,e[25]=u):u=e[25];let h;e[26]!==t.q||e[27]!==u?(h=i.jsx(Y,{value:t.q,fields:S,onChange:u,placeholder:"mailer:WidgetMailer kind:smtp"}),e[26]=t.q,e[27]=u,e[28]=h):h=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(W,{icon:I,title:"No mail sent in this window",description:"ActionMailer deliveries appear here as your app sends them."}),e[29]=N):N=e[29];let p;e[30]!==s?(p={onOpen:(r,B)=>{const R=s(r);R&&(B?.newTab?globalThis.window.open(R,"_blank"):V.visit(R))}},e[30]=s,e[31]=p):p=e[31];let P,O,E,C,q,A,D,T;e[32]===Symbol.for("react.memo_cache_sentinel")?(P={key:"when",header:"When",cell:pe},O={key:"m",header:"Mailer",cell:he},E={key:"s",header:"Subject",cell:ue},C={key:"to",hideOnMobile:!0,header:"To/CC/BCC",align:"right",cell:de},q={key:"att",hideOnMobile:!0,header:"Att.",align:"right",cell:me},A={key:"dm",hideOnMobile:!0,header:"Via",cell:ce},D={key:"st",header:"",cell:oe},T={key:"d",hideOnMobile:!0,header:"Duration",align:"right",cell:se},e[32]=P,e[33]=O,e[34]=E,e[35]=C,e[36]=q,e[37]=A,e[38]=D,e[39]=T):(P=e[32],O=e[33],E=e[34],C=e[35],q=e[36],A=e[37],D=e[38],T=e[39]);let f;e[40]!==s?(f=[P,O,E,C,q,A,D,T,{key:"in",hideOnMobile:!0,header:"In",cell:r=>{const B=s(r);return B?i.jsx(U,{className:"font-mono text-xs hover:underline",href:B,children:r.execution_preview}):null}}],e[40]=s,e[41]=f):f=e[41];let x;e[42]!==t.recent||e[43]!==p||e[44]!==f?(x=i.jsx(H,{rows:t.recent,rowKey:fe,empty:N,keyboardNav:p,columns:f}),e[42]=t.recent,e[43]=p,e[44]=f,e[45]=x):x=e[45];let $;return e[46]!==d||e[47]!==h||e[48]!==o||e[49]!==x?($=i.jsxs(ee,{title:"Mail",children:[_,o,d,w,h,x]}),e[46]=d,e[47]=h,e[48]=o,e[49]=x,e[50]=$):$=e[50],$}function se(t){return F(t.duration)}function oe(t){return t.failed?i.jsx(le,{variant:"destructive",children:"failed"}):null}function ce(t){return t.delivery_method}function me(t){return t.attachments}function de(t){return`${t.to}/${t.cc}/${t.bcc}`}function ue(t){return i.jsx("span",{className:"line-clamp-1 text-xs",children:t.subject})}function he(t){return i.jsx("span",{className:"font-mono text-xs",children:t.mailer})}function pe(t){return i.jsx("span",{className:"text-xs",children:ae(t.occurred_at)})}function fe(t){return t.id}function xe(t){return F(t.avg)}function ye(t){return t.errors}function _e(t){return ne(t.count)}function be(t){return i.jsx(re,{data:t.sparkline})}function ge(t){return i.jsx("span",{className:"font-mono text-xs",children:t.name})}function ke(t){return t.group_hash}export{We as default};
1
+ import{c as z,u as G,j as i,t as J,e as V,$ as Q,L as U}from"./inertia-CqnzqPVD.js";import{V as X}from"./chart-panel-CONkZcn9.js";import{D as H}from"./data-table-CVKR2wkq.js";import{E as W}from"./empty-state-Bn48Gplm.js";import{F as Y}from"./filter-bar-xcbJC93z.js";import{P as Z,E as ee}from"./env-layout-CKLL8Ds7.js";import{u as te,P as ie}from"./percentile-picker-BxIVblBw.js";import{S as re}from"./sparkline-cell-CXCxXPWt.js";import{B as le}from"./badge-Dv7I-ebP.js";import{m as F,c as ne,w as ae}from"./format-B9SDkrWj.js";import{M as I}from"./app-layout-2xAKndVD.js";import"./series-chart-D6upsrSn.js";import"./chart-hover-2yZG3w2u.js";import"./chart-C4k7Ub9W.js";import"./app-wordmark-Bt6XqURo.js";import"./use-live-DWwLg1Nj.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./segmented-C4oWE73o.js";import"./label-1nSzpSB6.js";import"./checkbox-DKbThbxr.js";function We(t){const e=z.c(51),{environment:K,window:L}=G().props,{percentile:l}=te(),n=K.application_id,a=K.id;let y;e[0]!==n||e[1]!==a?(y=r=>r.execution_id?J(n,a,r.execution_id):null,e[0]=n,e[1]=a,e[2]=y):y=e[2];const s=y;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Z,{title:"Mail",description:"Action Mailer deliveries: recipients, delivery method, render and send time.",actions:i.jsx(ie,{})}),e[3]=_):_=e[3];let o;e[4]!==t.series?(o=i.jsx(X,{legend:"outcome",label:"Deliveries",seriesLabel:"Deliveries",data:t.series}),e[4]=t.series,e[5]=o):o=e[5];let b,g,k,v,j,M;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(W,{icon:I,title:"No mail sent in this window",description:"ActionMailer deliveries appear here as your app sends them."}),g={key:"m",header:"Mailer",cell:ge},k={key:"trend",hideOnMobile:!0,header:"Trend",cell:be},v={key:"n",header:"Sent",align:"right",cell:_e},j={key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:ye},M={key:"avg",hideOnMobile:!0,header:"Avg",align:"right",cell:xe},e[6]=b,e[7]=g,e[8]=k,e[9]=v,e[10]=j,e[11]=M):(b=e[6],g=e[7],k=e[8],v=e[9],j=e[10],M=e[11]);let c;e[12]!==l?(c=r=>i.jsx("span",{className:"font-semibold",children:F(r[l])}),e[12]=l,e[13]=c):c=e[13];let m;e[14]!==l||e[15]!==c?(m=[g,k,v,j,M,{key:l,header:l,align:"right",cell:c}],e[14]=l,e[15]=c,e[16]=m):m=e[16];let d;e[17]!==t.mailers||e[18]!==m?(d=i.jsx(H,{rows:t.mailers,rowKey:ke,empty:b,columns:m}),e[17]=t.mailers,e[18]=m,e[19]=d):d=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[20]=w):w=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=[{key:"mailer",label:"Mailer"},{key:"kind",label:"Kind"}],e[21]=S):S=e[21];let u;e[22]!==n||e[23]!==a||e[24]!==L?(u=r=>V.visit(Q(n,a,{window:L,q:r||void 0}),{preserveState:!0}),e[22]=n,e[23]=a,e[24]=L,e[25]=u):u=e[25];let h;e[26]!==t.q||e[27]!==u?(h=i.jsx(Y,{value:t.q,fields:S,onChange:u,placeholder:"mailer:WidgetMailer kind:smtp"}),e[26]=t.q,e[27]=u,e[28]=h):h=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(W,{icon:I,title:"No mail sent in this window",description:"ActionMailer deliveries appear here as your app sends them."}),e[29]=N):N=e[29];let p;e[30]!==s?(p={onOpen:(r,B)=>{const R=s(r);R&&(B?.newTab?globalThis.window.open(R,"_blank"):V.visit(R))}},e[30]=s,e[31]=p):p=e[31];let P,O,E,C,q,A,D,T;e[32]===Symbol.for("react.memo_cache_sentinel")?(P={key:"when",header:"When",cell:pe},O={key:"m",header:"Mailer",cell:he},E={key:"s",header:"Subject",cell:ue},C={key:"to",hideOnMobile:!0,header:"To/CC/BCC",align:"right",cell:de},q={key:"att",hideOnMobile:!0,header:"Att.",align:"right",cell:me},A={key:"dm",hideOnMobile:!0,header:"Via",cell:ce},D={key:"st",header:"",cell:oe},T={key:"d",hideOnMobile:!0,header:"Duration",align:"right",cell:se},e[32]=P,e[33]=O,e[34]=E,e[35]=C,e[36]=q,e[37]=A,e[38]=D,e[39]=T):(P=e[32],O=e[33],E=e[34],C=e[35],q=e[36],A=e[37],D=e[38],T=e[39]);let f;e[40]!==s?(f=[P,O,E,C,q,A,D,T,{key:"in",hideOnMobile:!0,header:"In",cell:r=>{const B=s(r);return B?i.jsx(U,{className:"font-mono text-xs hover:underline",href:B,children:r.execution_preview}):null}}],e[40]=s,e[41]=f):f=e[41];let x;e[42]!==t.recent||e[43]!==p||e[44]!==f?(x=i.jsx(H,{rows:t.recent,rowKey:fe,empty:N,keyboardNav:p,columns:f}),e[42]=t.recent,e[43]=p,e[44]=f,e[45]=x):x=e[45];let $;return e[46]!==d||e[47]!==h||e[48]!==o||e[49]!==x?($=i.jsxs(ee,{title:"Mail",children:[_,o,d,w,h,x]}),e[46]=d,e[47]=h,e[48]=o,e[49]=x,e[50]=$):$=e[50],$}function se(t){return F(t.duration)}function oe(t){return t.failed?i.jsx(le,{variant:"destructive",children:"failed"}):null}function ce(t){return t.delivery_method}function me(t){return t.attachments}function de(t){return`${t.to}/${t.cc}/${t.bcc}`}function ue(t){return i.jsx("span",{className:"line-clamp-1 text-xs",children:t.subject})}function he(t){return i.jsx("span",{className:"font-mono text-xs",children:t.mailer})}function pe(t){return i.jsx("span",{className:"text-xs",children:ae(t.occurred_at)})}function fe(t){return t.id}function xe(t){return F(t.avg)}function ye(t){return t.errors}function _e(t){return ne(t.count)}function be(t){return i.jsx(re,{data:t.sparkline})}function ge(t){return i.jsx("span",{className:"font-mono text-xs",children:t.name})}function ke(t){return t.group_hash}export{We as default};
@@ -1 +1 @@
1
- import{c as ne,u as re,r as M,ar as ie,j as t,a_ as le,F as U,e as q,a$ as oe,b0 as G}from"./inertia-DLew8ZNx.js";import{I as v}from"./input-error-cvM6_Jht.js";import{D as J}from"./data-table-BIlt7Rtm.js";import{E as Q}from"./empty-state-C38il627.js";import{P as de,E as me}from"./env-layout-REF7OM4q.js";import{R as ce}from"./relative-time-CjIjb8Lg.js";import{B as N}from"./app-wordmark-o9CODKP0.js";import{b as X,c as Y,C as Z,a as ee}from"./card-cAtqCxWl.js";import{L as r,I as o}from"./label-GWl7I6sf.js";import{B as te}from"./live-dot-D1n_BreY.js";import"./chart-hover-B1M9jc0y.js";import"./badge-CAxXV8za.js";import"./app-layout-DDyQa72H.js";import"./index-umIAl-pL.js";import"./index-so4lRrRq.js";import"./checkbox-CmhMHWZO.js";import"./use-live-D7xKz2ma.js";import"./format-B9SDkrWj.js";import"./segmented-BgbT3wZa.js";function qe(s){const e=ne.c(56),{environment:z}=re().props,[k,se]=M.useState(s.kinds[0]),[y,H]=M.useState(s.metrics[0]),[w,ae]=M.useState(s.anomaly_target_kinds[0]),[F,O]=M.useState(s.anomaly_metrics[0]),B=s.anomaly_metrics_for_kind[w]??s.anomaly_metrics,D=s.metrics_for_kind[k]??s.metrics,I=s.units[y]??"ms",W=I==="$"?"Limit (US$)":I==="%"?"Limit (%)":I===""?"Limit (count)":"Limit (ms)",a=z.application_id,n=z.id;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(de,{withWindow:!1,title:"Thresholds",description:"Performance rules. When a route, job, or query crosses one, Railwatch opens a performance issue and alerts the rules subscribed to thresholds."}),e[0]=S):S=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(X,{children:t.jsx(Y,{children:"Add a threshold"})}),e[1]=C):C=e[1];let d;e[2]!==a||e[3]!==n?(d=ie(a,n),e[2]=a,e[3]=n,e[4]=d):d=e[4];let m;e[5]!==D||e[6]!==k||e[7]!==W||e[8]!==y||e[9]!==s.jobs||e[10]!==s.kinds||e[11]!==s.llm_models||e[12]!==s.metrics||e[13]!==s.metrics_for_kind||e[14]!==s.routes?(m=i=>{const{errors:_,processing:$}=i;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"target_kind",children:"Kind"}),t.jsx("select",{id:"target_kind",name:"target_kind",value:k,onChange:l=>{se(l.target.value);const b=s.metrics_for_kind[l.target.value]??s.metrics;b.includes(y)||H(b[0])},className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:s.kinds.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1 md:col-span-2",children:[t.jsx(r,{htmlFor:"target",children:"Target"}),t.jsx(o,{id:"target",name:"target",defaultValue:"*",list:"targets",placeholder:"* for all, or a route / job name"}),t.jsxs("datalist",{id:"targets",children:[t.jsx("option",{value:"*"}),t.jsx("option",{value:"unmatched"}),s.routes.map(ve),s.jobs.map(be),s.llm_models.map(ye)]}),t.jsx(v,{messages:_.target})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"metric",children:"Metric"}),t.jsx("select",{id:"metric",name:"metric",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:y,onChange:l=>H(l.target.value),children:D.map(_e)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"limit",children:W}),t.jsx(o,{id:"limit",name:"limit",type:"number",step:"any",defaultValue:2e3}),t.jsx(v,{messages:_.limit})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"window_minutes",children:"Window (min)"}),t.jsx(o,{id:"window_minutes",name:"window_minutes",type:"number",defaultValue:5})]}),t.jsx("div",{className:"md:col-span-6",children:t.jsx(N,{disabled:$,children:"Add threshold"})})]})},e[5]=D,e[6]=k,e[7]=W,e[8]=y,e[9]=s.jobs,e[10]=s.kinds,e[11]=s.llm_models,e[12]=s.metrics,e[13]=s.metrics_for_kind,e[14]=s.routes,e[15]=m):m=e[15];let c;e[16]!==d||e[17]!==m?(c=t.jsxs(Z,{children:[C,t.jsx(ee,{children:t.jsx(U,{method:"post",action:d,className:"grid gap-3 md:grid-cols-6",children:m})})]}),e[16]=d,e[17]=m,e[18]=c):c=e[18];let E,A;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Q,{icon:te,title:"No thresholds yet",description:"Start with requests * p95 2000ms to get alerted on regressions."}),A={key:"d",header:"Rule",cell:je},e[19]=E,e[20]=A):(E=e[19],A=e[20]);let h;e[21]!==a||e[22]!==n?(h=[A,{key:"x",header:"",align:"right",cell:i=>t.jsx(N,{size:"sm",variant:"ghost",onClick:()=>q.delete(oe(a,n,i.id)),children:"Remove"})}],e[21]=a,e[22]=n,e[23]=h):h=e[23];let u;e[24]!==s.thresholds||e[25]!==h?(u=t.jsx(J,{rows:s.thresholds,rowKey:fe,empty:E,columns:h}),e[24]=s.thresholds,e[25]=h,e[26]=u):u=e[26];let R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-semibold",children:"Anomaly rules"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"A threshold needs a number you already know. An anomaly rule learns one: it compares the last few minutes against the same clock window on each of the previous days and opens an issue when today sits more than the given number of standard deviations above that baseline."})]}),e[27]=R):R=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(X,{children:t.jsx(Y,{children:"Add an anomaly rule"})}),e[28]=T):T=e[28];let x;e[29]!==a||e[30]!==n?(x=le(a,n),e[29]=a,e[30]=n,e[31]=x):x=e[31];let p;e[32]!==B||e[33]!==w||e[34]!==F||e[35]!==s.anomaly_metrics||e[36]!==s.anomaly_metrics_for_kind||e[37]!==s.anomaly_target_kinds?(p=i=>{const{errors:_,processing:$}=i;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_target_kind",children:"Kind"}),t.jsx("select",{id:"anomaly_target_kind",name:"target_kind",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:w,onChange:l=>{ae(l.target.value);const b=s.anomaly_metrics_for_kind[l.target.value]??s.anomaly_metrics;b.includes(F)||O(b[0])},children:s.anomaly_target_kinds.map(ge)})]}),t.jsxs("div",{className:"grid gap-1 md:col-span-2",children:[t.jsx(r,{htmlFor:"anomaly_target",children:"Target"}),t.jsx(o,{id:"anomaly_target",name:"target",defaultValue:"*",list:"targets",placeholder:"* for all, or a route / job name"}),t.jsx(v,{messages:_.target})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_metric",children:"Metric"}),t.jsx("select",{id:"anomaly_metric",name:"metric",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:F,onChange:l=>O(l.target.value),children:B.map(pe)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"deviation",children:"Deviation (σ)"}),t.jsx(o,{id:"deviation",name:"deviation",type:"number",step:"0.5",min:"0.5",defaultValue:3}),t.jsx(v,{messages:_.deviation})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_window_minutes",children:"Window (min)"}),t.jsx(o,{id:"anomaly_window_minutes",name:"window_minutes",type:"number",defaultValue:15})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"baseline_days",children:"Baseline (days)"}),t.jsx(o,{id:"baseline_days",name:"baseline_days",type:"number",defaultValue:7}),t.jsx(v,{messages:_.baseline_days})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"enabled",children:"Status"}),t.jsxs("select",{id:"enabled",name:"enabled",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"true",children:"enabled"}),t.jsx("option",{value:"false",children:"disabled"})]})]}),t.jsx("div",{className:"md:col-span-6",children:t.jsx(N,{disabled:$,children:"Add anomaly rule"})})]})},e[32]=B,e[33]=w,e[34]=F,e[35]=s.anomaly_metrics,e[36]=s.anomaly_metrics_for_kind,e[37]=s.anomaly_target_kinds,e[38]=p):p=e[38];let g;e[39]!==x||e[40]!==p?(g=t.jsxs(Z,{children:[T,t.jsx(ee,{children:t.jsx(U,{method:"post",action:x,className:"grid gap-3 md:grid-cols-6",children:p})})]}),e[39]=x,e[40]=p,e[41]=g):g=e[41];let L,P,K;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Q,{icon:te,title:"No anomaly rules yet",description:"Start with requests * p95 at 3σ over a 7-day baseline."}),P={key:"d",header:"Rule",cell:ue},K={key:"f",header:"Last fired",hideOnMobile:!0,cell:he},e[42]=L,e[43]=P,e[44]=K):(L=e[42],P=e[43],K=e[44]);let j;e[45]!==a||e[46]!==n?(j=[P,K,{key:"x",header:"",align:"right",cell:i=>t.jsxs("span",{className:"flex justify-end gap-1",children:[t.jsx(N,{size:"sm",variant:"ghost",onClick:()=>q.patch(G(a,n,i.id),{enabled:!i.enabled}),children:i.enabled?"Disable":"Enable"}),t.jsx(N,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>q.delete(G(a,n,i.id)),children:"Remove"})]})}],e[45]=a,e[46]=n,e[47]=j):j=e[47];let f;e[48]!==s.anomaly_rules||e[49]!==j?(f=t.jsx(J,{rows:s.anomaly_rules,rowKey:xe,empty:L,columns:j}),e[48]=s.anomaly_rules,e[49]=j,e[50]=f):f=e[50];let V;return e[51]!==g||e[52]!==f||e[53]!==c||e[54]!==u?(V=t.jsxs(me,{title:"Thresholds",children:[S,c,u,R,g,f]}),e[51]=g,e[52]=f,e[53]=c,e[54]=u,e[55]=V):V=e[55],V}function he(s){return t.jsx(ce,{iso:s.last_fired_at,className:"text-muted-foreground font-mono text-xs"})}function ue(s){return t.jsxs("span",{className:"text-sm",children:[s.description,s.enabled?null:t.jsx("span",{className:"text-muted-foreground label-caps ml-2",children:"disabled"})]})}function xe(s){return s.id}function pe(s){return t.jsx("option",{value:s,children:s},s)}function ge(s){return t.jsx("option",{value:s,children:s},s)}function je(s){return t.jsx("span",{className:"text-sm",children:s.description})}function fe(s){return s.id}function _e(s){return t.jsx("option",{value:s,children:s},s)}function ye(s){return t.jsx("option",{value:s},s)}function be(s){return t.jsx("option",{value:s},s)}function ve(s){return t.jsx("option",{value:s},s)}function Ne(s){return t.jsx("option",{value:s,children:s},s)}export{qe as default};
1
+ import{c as ne,u as re,r as M,ar as ie,j as t,a_ as le,F as U,e as q,a$ as oe,b0 as G}from"./inertia-CqnzqPVD.js";import{I as v}from"./input-error-ByT28UdP.js";import{D as J}from"./data-table-CVKR2wkq.js";import{E as Q}from"./empty-state-Bn48Gplm.js";import{P as de,E as me}from"./env-layout-CKLL8Ds7.js";import{R as ce}from"./relative-time-DQ4kjowZ.js";import{B as N}from"./app-wordmark-Bt6XqURo.js";import{b as X,c as Y,C as Z,a as ee}from"./card-DqdEEKcJ.js";import{L as r,I as o}from"./label-1nSzpSB6.js";import{B as te}from"./live-dot-UdzOfzJb.js";import"./chart-hover-2yZG3w2u.js";import"./badge-Dv7I-ebP.js";import"./app-layout-2xAKndVD.js";import"./index-C-EwH4lO.js";import"./index-BDVShWMs.js";import"./checkbox-DKbThbxr.js";import"./use-live-DWwLg1Nj.js";import"./format-B9SDkrWj.js";import"./segmented-C4oWE73o.js";function qe(s){const e=ne.c(56),{environment:z}=re().props,[k,se]=M.useState(s.kinds[0]),[y,H]=M.useState(s.metrics[0]),[w,ae]=M.useState(s.anomaly_target_kinds[0]),[F,O]=M.useState(s.anomaly_metrics[0]),B=s.anomaly_metrics_for_kind[w]??s.anomaly_metrics,D=s.metrics_for_kind[k]??s.metrics,I=s.units[y]??"ms",W=I==="$"?"Limit (US$)":I==="%"?"Limit (%)":I===""?"Limit (count)":"Limit (ms)",a=z.application_id,n=z.id;let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(de,{withWindow:!1,title:"Thresholds",description:"Performance rules. When a route, job, or query crosses one, Railwatch opens a performance issue and alerts the rules subscribed to thresholds."}),e[0]=S):S=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(X,{children:t.jsx(Y,{children:"Add a threshold"})}),e[1]=C):C=e[1];let d;e[2]!==a||e[3]!==n?(d=ie(a,n),e[2]=a,e[3]=n,e[4]=d):d=e[4];let m;e[5]!==D||e[6]!==k||e[7]!==W||e[8]!==y||e[9]!==s.jobs||e[10]!==s.kinds||e[11]!==s.llm_models||e[12]!==s.metrics||e[13]!==s.metrics_for_kind||e[14]!==s.routes?(m=i=>{const{errors:_,processing:$}=i;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"target_kind",children:"Kind"}),t.jsx("select",{id:"target_kind",name:"target_kind",value:k,onChange:l=>{se(l.target.value);const b=s.metrics_for_kind[l.target.value]??s.metrics;b.includes(y)||H(b[0])},className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:s.kinds.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1 md:col-span-2",children:[t.jsx(r,{htmlFor:"target",children:"Target"}),t.jsx(o,{id:"target",name:"target",defaultValue:"*",list:"targets",placeholder:"* for all, or a route / job name"}),t.jsxs("datalist",{id:"targets",children:[t.jsx("option",{value:"*"}),t.jsx("option",{value:"unmatched"}),s.routes.map(ve),s.jobs.map(be),s.llm_models.map(ye)]}),t.jsx(v,{messages:_.target})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"metric",children:"Metric"}),t.jsx("select",{id:"metric",name:"metric",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:y,onChange:l=>H(l.target.value),children:D.map(_e)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"limit",children:W}),t.jsx(o,{id:"limit",name:"limit",type:"number",step:"any",defaultValue:2e3}),t.jsx(v,{messages:_.limit})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"window_minutes",children:"Window (min)"}),t.jsx(o,{id:"window_minutes",name:"window_minutes",type:"number",defaultValue:5})]}),t.jsx("div",{className:"md:col-span-6",children:t.jsx(N,{disabled:$,children:"Add threshold"})})]})},e[5]=D,e[6]=k,e[7]=W,e[8]=y,e[9]=s.jobs,e[10]=s.kinds,e[11]=s.llm_models,e[12]=s.metrics,e[13]=s.metrics_for_kind,e[14]=s.routes,e[15]=m):m=e[15];let c;e[16]!==d||e[17]!==m?(c=t.jsxs(Z,{children:[C,t.jsx(ee,{children:t.jsx(U,{method:"post",action:d,className:"grid gap-3 md:grid-cols-6",children:m})})]}),e[16]=d,e[17]=m,e[18]=c):c=e[18];let E,A;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Q,{icon:te,title:"No thresholds yet",description:"Start with requests * p95 2000ms to get alerted on regressions."}),A={key:"d",header:"Rule",cell:je},e[19]=E,e[20]=A):(E=e[19],A=e[20]);let h;e[21]!==a||e[22]!==n?(h=[A,{key:"x",header:"",align:"right",cell:i=>t.jsx(N,{size:"sm",variant:"ghost",onClick:()=>q.delete(oe(a,n,i.id)),children:"Remove"})}],e[21]=a,e[22]=n,e[23]=h):h=e[23];let u;e[24]!==s.thresholds||e[25]!==h?(u=t.jsx(J,{rows:s.thresholds,rowKey:fe,empty:E,columns:h}),e[24]=s.thresholds,e[25]=h,e[26]=u):u=e[26];let R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-semibold",children:"Anomaly rules"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"A threshold needs a number you already know. An anomaly rule learns one: it compares the last few minutes against the same clock window on each of the previous days and opens an issue when today sits more than the given number of standard deviations above that baseline."})]}),e[27]=R):R=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(X,{children:t.jsx(Y,{children:"Add an anomaly rule"})}),e[28]=T):T=e[28];let x;e[29]!==a||e[30]!==n?(x=le(a,n),e[29]=a,e[30]=n,e[31]=x):x=e[31];let p;e[32]!==B||e[33]!==w||e[34]!==F||e[35]!==s.anomaly_metrics||e[36]!==s.anomaly_metrics_for_kind||e[37]!==s.anomaly_target_kinds?(p=i=>{const{errors:_,processing:$}=i;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_target_kind",children:"Kind"}),t.jsx("select",{id:"anomaly_target_kind",name:"target_kind",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:w,onChange:l=>{ae(l.target.value);const b=s.anomaly_metrics_for_kind[l.target.value]??s.anomaly_metrics;b.includes(F)||O(b[0])},children:s.anomaly_target_kinds.map(ge)})]}),t.jsxs("div",{className:"grid gap-1 md:col-span-2",children:[t.jsx(r,{htmlFor:"anomaly_target",children:"Target"}),t.jsx(o,{id:"anomaly_target",name:"target",defaultValue:"*",list:"targets",placeholder:"* for all, or a route / job name"}),t.jsx(v,{messages:_.target})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_metric",children:"Metric"}),t.jsx("select",{id:"anomaly_metric",name:"metric",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",value:F,onChange:l=>O(l.target.value),children:B.map(pe)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"deviation",children:"Deviation (σ)"}),t.jsx(o,{id:"deviation",name:"deviation",type:"number",step:"0.5",min:"0.5",defaultValue:3}),t.jsx(v,{messages:_.deviation})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"anomaly_window_minutes",children:"Window (min)"}),t.jsx(o,{id:"anomaly_window_minutes",name:"window_minutes",type:"number",defaultValue:15})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"baseline_days",children:"Baseline (days)"}),t.jsx(o,{id:"baseline_days",name:"baseline_days",type:"number",defaultValue:7}),t.jsx(v,{messages:_.baseline_days})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"enabled",children:"Status"}),t.jsxs("select",{id:"enabled",name:"enabled",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"true",children:"enabled"}),t.jsx("option",{value:"false",children:"disabled"})]})]}),t.jsx("div",{className:"md:col-span-6",children:t.jsx(N,{disabled:$,children:"Add anomaly rule"})})]})},e[32]=B,e[33]=w,e[34]=F,e[35]=s.anomaly_metrics,e[36]=s.anomaly_metrics_for_kind,e[37]=s.anomaly_target_kinds,e[38]=p):p=e[38];let g;e[39]!==x||e[40]!==p?(g=t.jsxs(Z,{children:[T,t.jsx(ee,{children:t.jsx(U,{method:"post",action:x,className:"grid gap-3 md:grid-cols-6",children:p})})]}),e[39]=x,e[40]=p,e[41]=g):g=e[41];let L,P,K;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Q,{icon:te,title:"No anomaly rules yet",description:"Start with requests * p95 at 3σ over a 7-day baseline."}),P={key:"d",header:"Rule",cell:ue},K={key:"f",header:"Last fired",hideOnMobile:!0,cell:he},e[42]=L,e[43]=P,e[44]=K):(L=e[42],P=e[43],K=e[44]);let j;e[45]!==a||e[46]!==n?(j=[P,K,{key:"x",header:"",align:"right",cell:i=>t.jsxs("span",{className:"flex justify-end gap-1",children:[t.jsx(N,{size:"sm",variant:"ghost",onClick:()=>q.patch(G(a,n,i.id),{enabled:!i.enabled}),children:i.enabled?"Disable":"Enable"}),t.jsx(N,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>q.delete(G(a,n,i.id)),children:"Remove"})]})}],e[45]=a,e[46]=n,e[47]=j):j=e[47];let f;e[48]!==s.anomaly_rules||e[49]!==j?(f=t.jsx(J,{rows:s.anomaly_rules,rowKey:xe,empty:L,columns:j}),e[48]=s.anomaly_rules,e[49]=j,e[50]=f):f=e[50];let V;return e[51]!==g||e[52]!==f||e[53]!==c||e[54]!==u?(V=t.jsxs(me,{title:"Thresholds",children:[S,c,u,R,g,f]}),e[51]=g,e[52]=f,e[53]=c,e[54]=u,e[55]=V):V=e[55],V}function he(s){return t.jsx(ce,{iso:s.last_fired_at,className:"text-muted-foreground font-mono text-xs"})}function ue(s){return t.jsxs("span",{className:"text-sm",children:[s.description,s.enabled?null:t.jsx("span",{className:"text-muted-foreground label-caps ml-2",children:"disabled"})]})}function xe(s){return s.id}function pe(s){return t.jsx("option",{value:s,children:s},s)}function ge(s){return t.jsx("option",{value:s,children:s},s)}function je(s){return t.jsx("span",{className:"text-sm",children:s.description})}function fe(s){return s.id}function _e(s){return t.jsx("option",{value:s,children:s},s)}function ye(s){return t.jsx("option",{value:s},s)}function be(s){return t.jsx("option",{value:s},s)}function ve(s){return t.jsx("option",{value:s},s)}function Ne(s){return t.jsx("option",{value:s,children:s},s)}export{qe as default};
@@ -1 +1 @@
1
- import{c as M,u as N,j as l,L as T,G as O}from"./inertia-DLew8ZNx.js";import{D as $}from"./data-table-BIlt7Rtm.js";import{E as D}from"./empty-state-C38il627.js";import{P as F,E as H}from"./env-layout-REF7OM4q.js";import{R as I}from"./relative-time-CjIjb8Lg.js";import{S as R,a as C}from"./stat-DFEyFxkO.js";import{c as d,p as G,m as K}from"./format-B9SDkrWj.js";import{N as W}from"./app-layout-DDyQa72H.js";import"./chart-hover-B1M9jc0y.js";import"./badge-CAxXV8za.js";import"./app-wordmark-o9CODKP0.js";import"./use-live-D7xKz2ma.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./segmented-BgbT3wZa.js";import"./label-GWl7I6sf.js";import"./arrow-up-C6PxDiY3.js";import"./checkbox-CmhMHWZO.js";function de(i){const e=M.c(40),{environment:A,window:b}=N().props,S=A.application_id,k=A.id,t=i.summary;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(F,{title:"Profiles",description:"Sampled stack profiles, grouped by the execution they profiled."}),e[0]=h):h=e[0];let o;e[1]!==t.profiles?(o=d(t.profiles),e[1]=t.profiles,e[2]=o):o=e[2];let s;e[3]!==o?(s=l.jsx(R,{label:"Profiles",value:o}),e[3]=o,e[4]=s):s=e[4];let r;e[5]!==t.executions||e[6]!==t.profiled?(r=G(t.profiled,t.executions),e[5]=t.executions,e[6]=t.profiled,e[7]=r):r=e[7];let x;e[8]!==t.profiled?(x=d(t.profiled),e[8]=t.profiled,e[9]=x):x=e[9];let _;e[10]!==t.executions?(_=d(t.executions),e[10]=t.executions,e[11]=_):_=e[11];const w=`${x} of ${_}`;let a;e[12]!==r||e[13]!==w?(a=l.jsx(R,{label:"Executions profiled",value:r,hint:w}),e[12]=r,e[13]=w,e[14]=a):a=e[14];let n;e[15]!==t.avg_samples?(n=d(t.avg_samples),e[15]=t.avg_samples,e[16]=n):n=e[16];let m;e[17]!==n?(m=l.jsx(R,{label:"Avg samples",value:n}),e[17]=n,e[18]=m):m=e[18];let p;e[19]!==s||e[20]!==a||e[21]!==m?(p=l.jsxs(C,{children:[s,a,m]}),e[19]=s,e[20]=a,e[21]=m,e[22]=p):p=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(D,{icon:W,title:"No profiles in this window",description:"Set RAILWATCH_PROFILE_SAMPLE_RATE in the app to profile slow executions."}),e[23]=g):g=e[23];let f;e[24]!==S||e[25]!==k||e[26]!==b?(f={key:"name",header:"Execution",className:"max-w-0",cell:L=>l.jsx(T,{href:O(S,k,L.profile_id,{window:b}),className:"block truncate font-mono text-xs hover:underline",children:L.name??L.group_hash})},e[24]=S,e[25]=k,e[26]=b,e[27]=f):f=e[27];let v,y,j,E;e[28]===Symbol.for("react.memo_cache_sentinel")?(v={key:"n",header:"Profiles",align:"right",cell:J},y={key:"avg",header:"Avg duration",align:"right",cell:B},j={key:"samples",hideOnMobile:!0,header:"Max samples",align:"right",cell:z},E={key:"last",hideOnMobile:!0,header:"Last seen",align:"right",cell:q},e[28]=v,e[29]=y,e[30]=j,e[31]=E):(v=e[28],y=e[29],j=e[30],E=e[31]);let c;e[32]!==f?(c=[f,v,y,j,E],e[32]=f,e[33]=c):c=e[33];let u;e[34]!==i.profiles||e[35]!==c?(u=l.jsx($,{rows:i.profiles,rowKey:Q,empty:g,columns:c}),e[34]=i.profiles,e[35]=c,e[36]=u):u=e[36];let P;return e[37]!==p||e[38]!==u?(P=l.jsxs(H,{title:"Profiles",children:[h,p,u]}),e[37]=p,e[38]=u,e[39]=P):P=e[39],P}function q(i){return l.jsx(I,{iso:i.last_seen_at})}function z(i){return d(i.max_samples)}function B(i){return K(i.avg_duration)}function J(i){return d(i.count)}function Q(i){return i.group_hash}export{de as default};
1
+ import{c as M,u as N,j as l,L as T,G as O}from"./inertia-CqnzqPVD.js";import{D as $}from"./data-table-CVKR2wkq.js";import{E as D}from"./empty-state-Bn48Gplm.js";import{P as F,E as H}from"./env-layout-CKLL8Ds7.js";import{R as I}from"./relative-time-DQ4kjowZ.js";import{S as R,a as C}from"./stat-BNEfE8X1.js";import{c as d,p as G,m as K}from"./format-B9SDkrWj.js";import{N as W}from"./app-layout-2xAKndVD.js";import"./chart-hover-2yZG3w2u.js";import"./badge-Dv7I-ebP.js";import"./app-wordmark-Bt6XqURo.js";import"./use-live-DWwLg1Nj.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./segmented-C4oWE73o.js";import"./label-1nSzpSB6.js";import"./arrow-up-EmePsTKP.js";import"./checkbox-DKbThbxr.js";function de(i){const e=M.c(40),{environment:A,window:b}=N().props,S=A.application_id,k=A.id,t=i.summary;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(F,{title:"Profiles",description:"Sampled stack profiles, grouped by the execution they profiled."}),e[0]=h):h=e[0];let o;e[1]!==t.profiles?(o=d(t.profiles),e[1]=t.profiles,e[2]=o):o=e[2];let s;e[3]!==o?(s=l.jsx(R,{label:"Profiles",value:o}),e[3]=o,e[4]=s):s=e[4];let r;e[5]!==t.executions||e[6]!==t.profiled?(r=G(t.profiled,t.executions),e[5]=t.executions,e[6]=t.profiled,e[7]=r):r=e[7];let x;e[8]!==t.profiled?(x=d(t.profiled),e[8]=t.profiled,e[9]=x):x=e[9];let _;e[10]!==t.executions?(_=d(t.executions),e[10]=t.executions,e[11]=_):_=e[11];const w=`${x} of ${_}`;let a;e[12]!==r||e[13]!==w?(a=l.jsx(R,{label:"Executions profiled",value:r,hint:w}),e[12]=r,e[13]=w,e[14]=a):a=e[14];let n;e[15]!==t.avg_samples?(n=d(t.avg_samples),e[15]=t.avg_samples,e[16]=n):n=e[16];let m;e[17]!==n?(m=l.jsx(R,{label:"Avg samples",value:n}),e[17]=n,e[18]=m):m=e[18];let p;e[19]!==s||e[20]!==a||e[21]!==m?(p=l.jsxs(C,{children:[s,a,m]}),e[19]=s,e[20]=a,e[21]=m,e[22]=p):p=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(D,{icon:W,title:"No profiles in this window",description:"Set RAILWATCH_PROFILE_SAMPLE_RATE in the app to profile slow executions."}),e[23]=g):g=e[23];let f;e[24]!==S||e[25]!==k||e[26]!==b?(f={key:"name",header:"Execution",className:"max-w-0",cell:L=>l.jsx(T,{href:O(S,k,L.profile_id,{window:b}),className:"block truncate font-mono text-xs hover:underline",children:L.name??L.group_hash})},e[24]=S,e[25]=k,e[26]=b,e[27]=f):f=e[27];let v,y,j,E;e[28]===Symbol.for("react.memo_cache_sentinel")?(v={key:"n",header:"Profiles",align:"right",cell:J},y={key:"avg",header:"Avg duration",align:"right",cell:B},j={key:"samples",hideOnMobile:!0,header:"Max samples",align:"right",cell:z},E={key:"last",hideOnMobile:!0,header:"Last seen",align:"right",cell:q},e[28]=v,e[29]=y,e[30]=j,e[31]=E):(v=e[28],y=e[29],j=e[30],E=e[31]);let c;e[32]!==f?(c=[f,v,y,j,E],e[32]=f,e[33]=c):c=e[33];let u;e[34]!==i.profiles||e[35]!==c?(u=l.jsx($,{rows:i.profiles,rowKey:Q,empty:g,columns:c}),e[34]=i.profiles,e[35]=c,e[36]=u):u=e[36];let P;return e[37]!==p||e[38]!==u?(P=l.jsxs(H,{title:"Profiles",children:[h,p,u]}),e[37]=p,e[38]=u,e[39]=P):P=e[39],P}function q(i){return l.jsx(I,{iso:i.last_seen_at})}function z(i){return d(i.max_samples)}function B(i){return K(i.avg_duration)}function J(i){return d(i.count)}function Q(i){return i.group_hash}export{de as default};