@perses-dev/alert-manager-plugin 0.1.0-rc.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 (384) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/430.85c2cbf6.css +1 -0
  4. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  5. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  6. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  8. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  10. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  11. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  12. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  13. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  14. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  17. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  18. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  26. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  27. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  28. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  29. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  30. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  31. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  32. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  33. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  34. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  35. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  36. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  37. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  38. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  39. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  40. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  42. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  43. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  44. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  45. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  47. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  49. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  50. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  51. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  52. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  53. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  54. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  55. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  56. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  57. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  58. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  59. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  60. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  61. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  62. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  63. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  64. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  66. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  67. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  68. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  69. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  70. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  71. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  72. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  73. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  74. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  75. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  77. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  79. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  80. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  82. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  83. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  84. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  85. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  86. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  87. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  88. package/__mf/js/AlertManager.3d597fc0.js +7 -0
  89. package/__mf/js/async/1616.24f00c9d.js +1 -0
  90. package/__mf/js/async/1728.a509c63a.js +1 -0
  91. package/__mf/js/async/1871.23ff54b3.js +1 -0
  92. package/__mf/js/async/1969.a83b1b48.js +1 -0
  93. package/__mf/js/async/2218.7829c9d9.js +2 -0
  94. package/__mf/js/async/2218.7829c9d9.js.LICENSE.txt +9 -0
  95. package/__mf/js/async/2377.f8875a4e.js +1 -0
  96. package/__mf/js/async/2657.fe8dd44f.js +1 -0
  97. package/__mf/js/async/2842.7f15ae1d.js +1 -0
  98. package/__mf/js/async/3468.1679f87f.js +1 -0
  99. package/__mf/js/async/3540.96681482.js +2 -0
  100. package/__mf/js/async/3540.96681482.js.LICENSE.txt +37 -0
  101. package/__mf/js/async/392.7e11dd69.js +2 -0
  102. package/__mf/js/async/392.7e11dd69.js.LICENSE.txt +8 -0
  103. package/__mf/js/async/3963.fb6246d2.js +1 -0
  104. package/__mf/js/async/4121.ec666be2.js +2 -0
  105. package/__mf/js/async/4121.ec666be2.js.LICENSE.txt +9 -0
  106. package/__mf/js/async/4133.e94df4f8.js +28 -0
  107. package/__mf/js/async/4213.a0c4f2eb.js +1 -0
  108. package/__mf/js/async/430.74d85c4b.js +7 -0
  109. package/__mf/js/async/430.74d85c4b.js.LICENSE.txt +64 -0
  110. package/__mf/js/async/4466.a8145edd.js +74 -0
  111. package/__mf/js/async/4788.49ffeac3.js +1 -0
  112. package/__mf/js/async/5038.269393e3.js +2 -0
  113. package/__mf/js/async/5038.269393e3.js.LICENSE.txt +9 -0
  114. package/__mf/js/async/5481.cf6703fd.js +2 -0
  115. package/__mf/js/async/5481.cf6703fd.js.LICENSE.txt +9 -0
  116. package/__mf/js/async/5570.d4dd47e0.js +1 -0
  117. package/__mf/js/async/573.ce8ce2ef.js +2 -0
  118. package/__mf/js/async/6274.8c77cb1a.js +2 -0
  119. package/__mf/js/async/6274.8c77cb1a.js.LICENSE.txt +8 -0
  120. package/__mf/js/async/6390.3f6f279d.js +2 -0
  121. package/__mf/js/async/6390.3f6f279d.js.LICENSE.txt +9 -0
  122. package/__mf/js/async/6401.1a59dbad.js +1 -0
  123. package/__mf/js/async/6594.b02adfd9.js +2 -0
  124. package/__mf/js/async/6594.b02adfd9.js.LICENSE.txt +9 -0
  125. package/__mf/js/async/663.5445c7e0.js +1 -0
  126. package/__mf/js/async/6854.1d628838.js +1 -0
  127. package/__mf/js/async/7177.27c86137.js +1 -0
  128. package/__mf/js/async/7192.ede9860b.js +1 -0
  129. package/__mf/js/async/7283.8c1cb6ee.js +2 -0
  130. package/__mf/js/async/7283.8c1cb6ee.js.LICENSE.txt +9 -0
  131. package/__mf/js/async/7984.1f786d95.js +22 -0
  132. package/__mf/js/async/7984.1f786d95.js.LICENSE.txt +19 -0
  133. package/__mf/js/async/804.23da0d30.js +37 -0
  134. package/__mf/js/async/8470.2df0db71.js +2 -0
  135. package/__mf/js/async/8470.2df0db71.js.LICENSE.txt +19 -0
  136. package/__mf/js/async/8697.c13c6603.js +1 -0
  137. package/__mf/js/async/8711.c7dc09b8.js +2 -0
  138. package/__mf/js/async/8711.c7dc09b8.js.LICENSE.txt +9 -0
  139. package/__mf/js/async/8907.9e3edf43.js +1 -0
  140. package/__mf/js/async/9040.94717f28.js +10 -0
  141. package/__mf/js/async/9040.94717f28.js.LICENSE.txt +17 -0
  142. package/__mf/js/async/9184.27a439a4.js +1 -0
  143. package/__mf/js/async/9235.00f9412f.js +1 -0
  144. package/__mf/js/async/941.d3bc6208.js +2 -0
  145. package/__mf/js/async/941.d3bc6208.js.LICENSE.txt +9 -0
  146. package/__mf/js/async/9537.36ff6f15.js +1 -0
  147. package/__mf/js/async/9634.3a366799.js +1 -0
  148. package/__mf/js/async/9741.199e8033.js +4 -0
  149. package/__mf/js/async/9741.199e8033.js.LICENSE.txt +24 -0
  150. package/__mf/js/async/983.77219d7b.js +1 -0
  151. package/__mf/js/async/9836.cc839227.js +1 -0
  152. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.a0623742.js +2 -0
  153. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.a0623742.js.LICENSE.txt +9 -0
  154. package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.aa08447d.js +1 -0
  155. package/__mf/js/async/__federation_expose_AlertManagerDatasource.fe5b34fb.js +2 -0
  156. package/__mf/js/async/__federation_expose_AlertManagerDatasource.fe5b34fb.js.LICENSE.txt +9 -0
  157. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.ff9617f8.js +2 -0
  158. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.ff9617f8.js.LICENSE.txt +9 -0
  159. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.c9a49171.js +2 -0
  160. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.c9a49171.js.LICENSE.txt +9 -0
  161. package/__mf/js/async/__federation_expose_AlertTable.cac7598a.js +1 -0
  162. package/__mf/js/async/__federation_expose_SilenceTable.50ee1f33.js +2 -0
  163. package/__mf/js/async/__federation_expose_SilenceTable.50ee1f33.js.LICENSE.txt +9 -0
  164. package/__mf/js/async/lib-router.19f64904.js +2 -0
  165. package/__mf/js/async/lib-router.19f64904.js.LICENSE.txt +32 -0
  166. package/__mf/js/main.1ce74432.js +7 -0
  167. package/lib/bootstrap.d.ts +2 -0
  168. package/lib/bootstrap.d.ts.map +1 -0
  169. package/lib/bootstrap.js +19 -0
  170. package/lib/bootstrap.js.map +1 -0
  171. package/lib/cjs/bootstrap.js +26 -0
  172. package/lib/cjs/components/ColumnsEditor.js +271 -0
  173. package/lib/cjs/components/LazyTextField.js +50 -0
  174. package/lib/cjs/components/MatcherEditor.js +153 -0
  175. package/lib/cjs/components/MatchersList.js +46 -0
  176. package/lib/cjs/components/SilenceForm.js +205 -0
  177. package/lib/cjs/components/StatusBadge.js +71 -0
  178. package/lib/cjs/components/index.js +44 -0
  179. package/lib/cjs/explore/AlertManagerAlertsExplorer.js +79 -0
  180. package/lib/cjs/explore/AlertManagerSilencesExplorer.js +153 -0
  181. package/lib/cjs/getPluginModule.js +39 -0
  182. package/lib/cjs/index-federation.js +55 -0
  183. package/lib/cjs/index.js +39 -0
  184. package/lib/cjs/model/alertmanager-client.js +128 -0
  185. package/lib/cjs/model/alertmanager-selectors.js +66 -0
  186. package/lib/cjs/model/api-types.js +22 -0
  187. package/lib/cjs/model/index.js +32 -0
  188. package/lib/cjs/plugins/AlertManagerDatasourceEditor.js +71 -0
  189. package/lib/cjs/plugins/alert-table/AlertTable.js +56 -0
  190. package/lib/cjs/plugins/alert-table/AlertTableColumnsEditor.js +110 -0
  191. package/lib/cjs/plugins/alert-table/AlertTableDeduplicationEditor.js +138 -0
  192. package/lib/cjs/plugins/alert-table/AlertTableLabelsEditor.js +277 -0
  193. package/lib/cjs/plugins/alert-table/AlertTableOptionsEditor.js +128 -0
  194. package/lib/cjs/plugins/alert-table/AlertTablePanel.js +773 -0
  195. package/lib/cjs/plugins/alert-table/alert-table-model.js +142 -0
  196. package/lib/cjs/plugins/alert-table/alert-table-sorting.js +205 -0
  197. package/lib/cjs/plugins/alert-table/label-colors.js +170 -0
  198. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +51 -0
  199. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +138 -0
  200. package/lib/cjs/plugins/alertmanager-alerts-query/get-alerts-data.js +124 -0
  201. package/lib/cjs/plugins/alertmanager-datasource.js +69 -0
  202. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +45 -0
  203. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +78 -0
  204. package/lib/cjs/plugins/alertmanager-silences-query/get-silences-data.js +64 -0
  205. package/lib/cjs/plugins/index.js +74 -0
  206. package/lib/cjs/plugins/silence-table/SilenceTable.js +42 -0
  207. package/lib/cjs/plugins/silence-table/SilenceTableColumnsEditor.js +137 -0
  208. package/lib/cjs/plugins/silence-table/SilenceTableOptionsEditor.js +63 -0
  209. package/lib/cjs/plugins/silence-table/SilenceTablePanel.js +345 -0
  210. package/lib/cjs/plugins/silence-table/silence-table-model.js +116 -0
  211. package/lib/cjs/plugins/silence-table/silence-table-sorting.js +68 -0
  212. package/lib/cjs/plugins/types.js +16 -0
  213. package/lib/cjs/setup-tests.js +18 -0
  214. package/lib/components/ColumnsEditor.d.ts +25 -0
  215. package/lib/components/ColumnsEditor.d.ts.map +1 -0
  216. package/lib/components/ColumnsEditor.js +258 -0
  217. package/lib/components/ColumnsEditor.js.map +1 -0
  218. package/lib/components/LazyTextField.d.ts +12 -0
  219. package/lib/components/LazyTextField.d.ts.map +1 -0
  220. package/lib/components/LazyTextField.js +42 -0
  221. package/lib/components/LazyTextField.js.map +1 -0
  222. package/lib/components/MatcherEditor.d.ts +17 -0
  223. package/lib/components/MatcherEditor.d.ts.map +1 -0
  224. package/lib/components/MatcherEditor.js +142 -0
  225. package/lib/components/MatcherEditor.js.map +1 -0
  226. package/lib/components/MatchersList.d.ts +10 -0
  227. package/lib/components/MatchersList.d.ts.map +1 -0
  228. package/lib/components/MatchersList.js +40 -0
  229. package/lib/components/MatchersList.js.map +1 -0
  230. package/lib/components/SilenceForm.d.ts +13 -0
  231. package/lib/components/SilenceForm.d.ts.map +1 -0
  232. package/lib/components/SilenceForm.js +194 -0
  233. package/lib/components/SilenceForm.js.map +1 -0
  234. package/lib/components/StatusBadge.d.ts +10 -0
  235. package/lib/components/StatusBadge.d.ts.map +1 -0
  236. package/lib/components/StatusBadge.js +65 -0
  237. package/lib/components/StatusBadge.js.map +1 -0
  238. package/lib/components/index.d.ts +11 -0
  239. package/lib/components/index.d.ts.map +1 -0
  240. package/lib/components/index.js +19 -0
  241. package/lib/components/index.js.map +1 -0
  242. package/lib/explore/AlertManagerAlertsExplorer.d.ts +3 -0
  243. package/lib/explore/AlertManagerAlertsExplorer.d.ts.map +1 -0
  244. package/lib/explore/AlertManagerAlertsExplorer.js +71 -0
  245. package/lib/explore/AlertManagerAlertsExplorer.js.map +1 -0
  246. package/lib/explore/AlertManagerSilencesExplorer.d.ts +3 -0
  247. package/lib/explore/AlertManagerSilencesExplorer.d.ts.map +1 -0
  248. package/lib/explore/AlertManagerSilencesExplorer.js +140 -0
  249. package/lib/explore/AlertManagerSilencesExplorer.js.map +1 -0
  250. package/lib/getPluginModule.d.ts +3 -0
  251. package/lib/getPluginModule.d.ts.map +1 -0
  252. package/lib/getPluginModule.js +26 -0
  253. package/lib/getPluginModule.js.map +1 -0
  254. package/lib/index-federation.d.ts +1 -0
  255. package/lib/index-federation.d.ts.map +1 -0
  256. package/lib/index-federation.js +15 -0
  257. package/lib/index-federation.js.map +1 -0
  258. package/lib/index.d.ts +5 -0
  259. package/lib/index.d.ts.map +1 -0
  260. package/lib/index.js +18 -0
  261. package/lib/index.js.map +1 -0
  262. package/lib/model/alertmanager-client.d.ts +27 -0
  263. package/lib/model/alertmanager-client.d.ts.map +1 -0
  264. package/lib/model/alertmanager-client.js +100 -0
  265. package/lib/model/alertmanager-client.js.map +1 -0
  266. package/lib/model/alertmanager-selectors.d.ts +13 -0
  267. package/lib/model/alertmanager-selectors.d.ts.map +1 -0
  268. package/lib/model/alertmanager-selectors.js +41 -0
  269. package/lib/model/alertmanager-selectors.js.map +1 -0
  270. package/lib/model/api-types.d.ts +120 -0
  271. package/lib/model/api-types.d.ts.map +1 -0
  272. package/lib/model/api-types.js +23 -0
  273. package/lib/model/api-types.js.map +1 -0
  274. package/lib/model/index.d.ts +4 -0
  275. package/lib/model/index.d.ts.map +1 -0
  276. package/lib/model/index.js +17 -0
  277. package/lib/model/index.js.map +1 -0
  278. package/lib/plugins/AlertManagerDatasourceEditor.d.ts +9 -0
  279. package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -0
  280. package/lib/plugins/AlertManagerDatasourceEditor.js +63 -0
  281. package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -0
  282. package/lib/plugins/alert-table/AlertTable.d.ts +8 -0
  283. package/lib/plugins/alert-table/AlertTable.d.ts.map +1 -0
  284. package/lib/plugins/alert-table/AlertTable.js +50 -0
  285. package/lib/plugins/alert-table/AlertTable.js.map +1 -0
  286. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts +5 -0
  287. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts.map +1 -0
  288. package/lib/plugins/alert-table/AlertTableColumnsEditor.js +102 -0
  289. package/lib/plugins/alert-table/AlertTableColumnsEditor.js.map +1 -0
  290. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts +5 -0
  291. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts.map +1 -0
  292. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js +130 -0
  293. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js.map +1 -0
  294. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts +5 -0
  295. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts.map +1 -0
  296. package/lib/plugins/alert-table/AlertTableLabelsEditor.js +264 -0
  297. package/lib/plugins/alert-table/AlertTableLabelsEditor.js.map +1 -0
  298. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts +5 -0
  299. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts.map +1 -0
  300. package/lib/plugins/alert-table/AlertTableOptionsEditor.js +120 -0
  301. package/lib/plugins/alert-table/AlertTableOptionsEditor.js.map +1 -0
  302. package/lib/plugins/alert-table/AlertTablePanel.d.ts +11 -0
  303. package/lib/plugins/alert-table/AlertTablePanel.d.ts.map +1 -0
  304. package/lib/plugins/alert-table/AlertTablePanel.js +763 -0
  305. package/lib/plugins/alert-table/AlertTablePanel.js.map +1 -0
  306. package/lib/plugins/alert-table/alert-table-model.d.ts +73 -0
  307. package/lib/plugins/alert-table/alert-table-model.d.ts.map +1 -0
  308. package/lib/plugins/alert-table/alert-table-model.js +127 -0
  309. package/lib/plugins/alert-table/alert-table-model.js.map +1 -0
  310. package/lib/plugins/alert-table/alert-table-sorting.d.ts +13 -0
  311. package/lib/plugins/alert-table/alert-table-sorting.d.ts.map +1 -0
  312. package/lib/plugins/alert-table/alert-table-sorting.js +180 -0
  313. package/lib/plugins/alert-table/alert-table-sorting.js.map +1 -0
  314. package/lib/plugins/alert-table/label-colors.d.ts +6 -0
  315. package/lib/plugins/alert-table/label-colors.d.ts.map +1 -0
  316. package/lib/plugins/alert-table/label-colors.js +148 -0
  317. package/lib/plugins/alert-table/label-colors.js.map +1 -0
  318. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts +4 -0
  319. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts.map +1 -0
  320. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +43 -0
  321. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js.map +1 -0
  322. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts +9 -0
  323. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts.map +1 -0
  324. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +130 -0
  325. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js.map +1 -0
  326. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts +8 -0
  327. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts.map +1 -0
  328. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js +118 -0
  329. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js.map +1 -0
  330. package/lib/plugins/alertmanager-datasource.d.ts +5 -0
  331. package/lib/plugins/alertmanager-datasource.d.ts.map +1 -0
  332. package/lib/plugins/alertmanager-datasource.js +61 -0
  333. package/lib/plugins/alertmanager-datasource.js.map +1 -0
  334. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts +4 -0
  335. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts.map +1 -0
  336. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +37 -0
  337. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js.map +1 -0
  338. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts +9 -0
  339. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts.map +1 -0
  340. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +70 -0
  341. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js.map +1 -0
  342. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts +8 -0
  343. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts.map +1 -0
  344. package/lib/plugins/alertmanager-silences-query/get-silences-data.js +58 -0
  345. package/lib/plugins/alertmanager-silences-query/get-silences-data.js.map +1 -0
  346. package/lib/plugins/index.d.ts +19 -0
  347. package/lib/plugins/index.d.ts.map +1 -0
  348. package/lib/plugins/index.js +30 -0
  349. package/lib/plugins/index.js.map +1 -0
  350. package/lib/plugins/silence-table/SilenceTable.d.ts +7 -0
  351. package/lib/plugins/silence-table/SilenceTable.d.ts.map +1 -0
  352. package/lib/plugins/silence-table/SilenceTable.js +36 -0
  353. package/lib/plugins/silence-table/SilenceTable.js.map +1 -0
  354. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts +5 -0
  355. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts.map +1 -0
  356. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js +129 -0
  357. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js.map +1 -0
  358. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts +5 -0
  359. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts.map +1 -0
  360. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js +55 -0
  361. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js.map +1 -0
  362. package/lib/plugins/silence-table/SilenceTablePanel.d.ts +11 -0
  363. package/lib/plugins/silence-table/SilenceTablePanel.d.ts.map +1 -0
  364. package/lib/plugins/silence-table/SilenceTablePanel.js +335 -0
  365. package/lib/plugins/silence-table/SilenceTablePanel.js.map +1 -0
  366. package/lib/plugins/silence-table/silence-table-model.d.ts +29 -0
  367. package/lib/plugins/silence-table/silence-table-model.d.ts.map +1 -0
  368. package/lib/plugins/silence-table/silence-table-model.js +90 -0
  369. package/lib/plugins/silence-table/silence-table-model.js.map +1 -0
  370. package/lib/plugins/silence-table/silence-table-sorting.d.ts +9 -0
  371. package/lib/plugins/silence-table/silence-table-sorting.d.ts.map +1 -0
  372. package/lib/plugins/silence-table/silence-table-sorting.js +60 -0
  373. package/lib/plugins/silence-table/silence-table-sorting.js.map +1 -0
  374. package/lib/plugins/types.d.ts +30 -0
  375. package/lib/plugins/types.d.ts.map +1 -0
  376. package/lib/plugins/types.js +17 -0
  377. package/lib/plugins/types.js.map +1 -0
  378. package/lib/setup-tests.d.ts +2 -0
  379. package/lib/setup-tests.d.ts.map +1 -0
  380. package/lib/setup-tests.js +16 -0
  381. package/lib/setup-tests.js.map +1 -0
  382. package/mf-manifest.json +663 -0
  383. package/mf-stats.json +784 -0
  384. package/package.json +116 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MatcherEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useId } from 'react';\nimport {\n IconButton,\n MenuItem,\n Stack,\n TextField,\n Select,\n FormControl,\n InputLabel,\n SelectChangeEvent,\n} from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/Delete';\n\nexport interface MatcherValue {\n name: string;\n value: string;\n isEqual: boolean;\n isRegex: boolean;\n}\n\nexport interface MatcherEditorProps {\n matcher: MatcherValue;\n onChange: (matcher: MatcherValue) => void;\n onRemove: () => void;\n}\n\ntype MatchType = '=' | '!=' | '=~' | '!~';\n\nfunction getMatchType(matcher: MatcherValue): MatchType {\n if (matcher.isRegex) {\n return matcher.isEqual ? '=~' : '!~';\n }\n return matcher.isEqual ? '=' : '!=';\n}\n\nfunction parseMatchType(matchType: MatchType): { isEqual: boolean; isRegex: boolean } {\n switch (matchType) {\n case '=':\n return { isEqual: true, isRegex: false };\n case '!=':\n return { isEqual: false, isRegex: false };\n case '=~':\n return { isEqual: true, isRegex: true };\n case '!~':\n return { isEqual: false, isRegex: true };\n }\n}\n\n/**\n * A form for editing a single matcher with fields for name, value, and match type.\n */\nexport function MatcherEditor({ matcher, onChange, onRemove }: MatcherEditorProps): ReactElement {\n const matchTypeLabelId = useId();\n\n const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n onChange({ ...matcher, name: e.target.value });\n };\n\n const handleValueChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n onChange({ ...matcher, value: e.target.value });\n };\n\n const handleMatchTypeChange = (e: SelectChangeEvent): void => {\n const { isEqual, isRegex } = parseMatchType(e.target.value as MatchType);\n onChange({ ...matcher, isEqual, isRegex });\n };\n\n return (\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n label=\"Label name\"\n value={matcher.name}\n onChange={handleNameChange}\n size=\"small\"\n sx={{ minWidth: 150 }}\n />\n <FormControl size=\"small\" sx={{ minWidth: 80 }}>\n <InputLabel id={matchTypeLabelId}>Match</InputLabel>\n <Select labelId={matchTypeLabelId} value={getMatchType(matcher)} onChange={handleMatchTypeChange} label=\"Match\">\n <MenuItem value=\"=\">=</MenuItem>\n <MenuItem value=\"!=\">!=</MenuItem>\n <MenuItem value=\"=~\">=~</MenuItem>\n <MenuItem value=\"!~\">!~</MenuItem>\n </Select>\n </FormControl>\n <TextField label=\"Value\" value={matcher.value} onChange={handleValueChange} size=\"small\" sx={{ minWidth: 200 }} />\n <IconButton onClick={onRemove} size=\"small\" aria-label=\"Remove matcher\">\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Stack>\n );\n}\n"],"names":["useId","IconButton","MenuItem","Stack","TextField","Select","FormControl","InputLabel","DeleteIcon","getMatchType","matcher","isRegex","isEqual","parseMatchType","matchType","MatcherEditor","onChange","onRemove","matchTypeLabelId","handleNameChange","e","name","target","value","handleValueChange","handleMatchTypeChange","direction","spacing","alignItems","label","size","sx","minWidth","id","labelId","onClick","aria-label","fontSize"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAuBA,KAAK,QAAQ,QAAQ;AAC5C,SACEC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,MAAM,EACNC,WAAW,EACXC,UAAU,QAEL,gBAAgB;AACvB,OAAOC,gBAAgB,yBAAyB;AAiBhD,SAASC,aAAaC,OAAqB;IACzC,IAAIA,QAAQC,OAAO,EAAE;QACnB,OAAOD,QAAQE,OAAO,GAAG,OAAO;IAClC;IACA,OAAOF,QAAQE,OAAO,GAAG,MAAM;AACjC;AAEA,SAASC,eAAeC,SAAoB;IAC1C,OAAQA;QACN,KAAK;YACH,OAAO;gBAAEF,SAAS;gBAAMD,SAAS;YAAM;QACzC,KAAK;YACH,OAAO;gBAAEC,SAAS;gBAAOD,SAAS;YAAM;QAC1C,KAAK;YACH,OAAO;gBAAEC,SAAS;gBAAMD,SAAS;YAAK;QACxC,KAAK;YACH,OAAO;gBAAEC,SAAS;gBAAOD,SAAS;YAAK;IAC3C;AACF;AAEA;;CAEC,GACD,OAAO,SAASI,cAAc,EAAEL,OAAO,EAAEM,QAAQ,EAAEC,QAAQ,EAAsB;IAC/E,MAAMC,mBAAmBlB;IAEzB,MAAMmB,mBAAmB,CAACC;QACxBJ,SAAS;YAAE,GAAGN,OAAO;YAAEW,MAAMD,EAAEE,MAAM,CAACC,KAAK;QAAC;IAC9C;IAEA,MAAMC,oBAAoB,CAACJ;QACzBJ,SAAS;YAAE,GAAGN,OAAO;YAAEa,OAAOH,EAAEE,MAAM,CAACC,KAAK;QAAC;IAC/C;IAEA,MAAME,wBAAwB,CAACL;QAC7B,MAAM,EAAER,OAAO,EAAED,OAAO,EAAE,GAAGE,eAAeO,EAAEE,MAAM,CAACC,KAAK;QAC1DP,SAAS;YAAE,GAAGN,OAAO;YAAEE;YAASD;QAAQ;IAC1C;IAEA,qBACE,MAACR;QAAMuB,WAAU;QAAMC,SAAS;QAAGC,YAAW;;0BAC5C,KAACxB;gBACCyB,OAAM;gBACNN,OAAOb,QAAQW,IAAI;gBACnBL,UAAUG;gBACVW,MAAK;gBACLC,IAAI;oBAAEC,UAAU;gBAAI;;0BAEtB,MAAC1B;gBAAYwB,MAAK;gBAAQC,IAAI;oBAAEC,UAAU;gBAAG;;kCAC3C,KAACzB;wBAAW0B,IAAIf;kCAAkB;;kCAClC,MAACb;wBAAO6B,SAAShB;wBAAkBK,OAAOd,aAAaC;wBAAUM,UAAUS;wBAAuBI,OAAM;;0CACtG,KAAC3B;gCAASqB,OAAM;0CAAI;;0CACpB,KAACrB;gCAASqB,OAAM;0CAAK;;0CACrB,KAACrB;gCAASqB,OAAM;0CAAK;;0CACrB,KAACrB;gCAASqB,OAAM;0CAAK;;;;;;0BAGzB,KAACnB;gBAAUyB,OAAM;gBAAQN,OAAOb,QAAQa,KAAK;gBAAEP,UAAUQ;gBAAmBM,MAAK;gBAAQC,IAAI;oBAAEC,UAAU;gBAAI;;0BAC7G,KAAC/B;gBAAWkC,SAASlB;gBAAUa,MAAK;gBAAQM,cAAW;0BACrD,cAAA,KAAC5B;oBAAW6B,UAAS;;;;;AAI7B"}
@@ -0,0 +1,10 @@
1
+ import { SilenceMatcher } from '@perses-dev/spec';
2
+ import { ReactElement } from 'react';
3
+ export interface MatchersListProps {
4
+ matchers: SilenceMatcher[];
5
+ }
6
+ /**
7
+ * Renders a list of matchers as MUI Chips.
8
+ */
9
+ export declare function MatchersList({ matchers }: MatchersListProps): ReactElement;
10
+ //# sourceMappingURL=MatchersList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MatchersList.d.ts","sourceRoot":"","sources":["../../../src/components/MatchersList.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAYD;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAQ1E"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { Chip, Stack } from '@mui/material';
15
+ function formatMatcher(matcher) {
16
+ let operator;
17
+ if (matcher.isRegex) {
18
+ operator = matcher.isEqual ?? true ? '=~' : '!~';
19
+ } else {
20
+ operator = matcher.isEqual ?? true ? '=' : '!=';
21
+ }
22
+ return `${matcher.name}${operator}"${matcher.value}"`;
23
+ }
24
+ /**
25
+ * Renders a list of matchers as MUI Chips.
26
+ */ export function MatchersList({ matchers }) {
27
+ return /*#__PURE__*/ _jsx(Stack, {
28
+ direction: "row",
29
+ spacing: 0.5,
30
+ flexWrap: "wrap",
31
+ useFlexGap: true,
32
+ children: matchers.map((matcher, index)=>/*#__PURE__*/ _jsx(Chip, {
33
+ label: formatMatcher(matcher),
34
+ size: "small",
35
+ variant: "outlined"
36
+ }, index))
37
+ });
38
+ }
39
+
40
+ //# sourceMappingURL=MatchersList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/MatchersList.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Chip, Stack } from '@mui/material';\nimport { SilenceMatcher } from '@perses-dev/spec';\nimport { ReactElement } from 'react';\n\nexport interface MatchersListProps {\n matchers: SilenceMatcher[];\n}\n\nfunction formatMatcher(matcher: SilenceMatcher): string {\n let operator: string;\n if (matcher.isRegex) {\n operator = (matcher.isEqual ?? true) ? '=~' : '!~';\n } else {\n operator = (matcher.isEqual ?? true) ? '=' : '!=';\n }\n return `${matcher.name}${operator}\"${matcher.value}\"`;\n}\n\n/**\n * Renders a list of matchers as MUI Chips.\n */\nexport function MatchersList({ matchers }: MatchersListProps): ReactElement {\n return (\n <Stack direction=\"row\" spacing={0.5} flexWrap=\"wrap\" useFlexGap>\n {matchers.map((matcher, index) => (\n <Chip key={index} label={formatMatcher(matcher)} size=\"small\" variant=\"outlined\" />\n ))}\n </Stack>\n );\n}\n"],"names":["Chip","Stack","formatMatcher","matcher","operator","isRegex","isEqual","name","value","MatchersList","matchers","direction","spacing","flexWrap","useFlexGap","map","index","label","size","variant"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAQ5C,SAASC,cAAcC,OAAuB;IAC5C,IAAIC;IACJ,IAAID,QAAQE,OAAO,EAAE;QACnBD,WAAW,AAACD,QAAQG,OAAO,IAAI,OAAQ,OAAO;IAChD,OAAO;QACLF,WAAW,AAACD,QAAQG,OAAO,IAAI,OAAQ,MAAM;IAC/C;IACA,OAAO,GAAGH,QAAQI,IAAI,GAAGH,SAAS,CAAC,EAAED,QAAQK,KAAK,CAAC,CAAC,CAAC;AACvD;AAEA;;CAEC,GACD,OAAO,SAASC,aAAa,EAAEC,QAAQ,EAAqB;IAC1D,qBACE,KAACT;QAAMU,WAAU;QAAMC,SAAS;QAAKC,UAAS;QAAOC,UAAU;kBAC5DJ,SAASK,GAAG,CAAC,CAACZ,SAASa,sBACtB,KAAChB;gBAAiBiB,OAAOf,cAAcC;gBAAUe,MAAK;gBAAQC,SAAQ;eAA3DH;;AAInB"}
@@ -0,0 +1,13 @@
1
+ import { ReactElement } from 'react';
2
+ import { PostableSilence } from '../model/api-types';
3
+ export interface SilenceFormProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ onSubmit: (silence: PostableSilence) => void;
7
+ initialSilence?: Partial<PostableSilence>;
8
+ }
9
+ /**
10
+ * Form dialog for creating or editing silences.
11
+ */
12
+ export declare function SilenceForm({ open, onClose, onSubmit, initialSilence }: SilenceFormProps): ReactElement;
13
+ //# sourceMappingURL=SilenceForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SilenceForm.d.ts","sourceRoot":"","sources":["../../../src/components/SilenceForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC3C;AAwBD;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,gBAAgB,GAAG,YAAY,CA0HvG"}
@@ -0,0 +1,194 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, TextField, Typography } from '@mui/material';
15
+ import AddIcon from 'mdi-material-ui/Plus';
16
+ import { useState } from 'react';
17
+ import { MatcherEditor } from './MatcherEditor';
18
+ const DEFAULT_MATCHER = {
19
+ name: '',
20
+ value: '',
21
+ isEqual: true,
22
+ isRegex: false
23
+ };
24
+ function toLocalDatetimeString(date) {
25
+ const pad = (n)=>String(n).padStart(2, '0');
26
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
27
+ }
28
+ function getDefaultEndTime() {
29
+ const end = new Date();
30
+ end.setMinutes(end.getMinutes() + 30);
31
+ return toLocalDatetimeString(end);
32
+ }
33
+ function getNowLocalISO() {
34
+ return toLocalDatetimeString(new Date());
35
+ }
36
+ /**
37
+ * Form dialog for creating or editing silences.
38
+ */ export function SilenceForm({ open, onClose, onSubmit, initialSilence }) {
39
+ const [matchers, setMatchers] = useState(initialSilence?.matchers?.length ? initialSilence.matchers.map((m)=>({
40
+ name: m.name,
41
+ value: m.value,
42
+ isEqual: m.isEqual,
43
+ isRegex: m.isRegex
44
+ })) : [
45
+ {
46
+ ...DEFAULT_MATCHER
47
+ }
48
+ ]);
49
+ const [startsAt, setStartsAt] = useState(initialSilence?.startsAt?.slice(0, 16) ?? getNowLocalISO());
50
+ const [endsAt, setEndsAt] = useState(initialSilence?.endsAt?.slice(0, 16) ?? getDefaultEndTime());
51
+ const [createdBy, setCreatedBy] = useState(initialSilence?.createdBy ?? '');
52
+ const [comment, setComment] = useState(initialSilence?.comment ?? '');
53
+ const handleAddMatcher = ()=>{
54
+ setMatchers([
55
+ ...matchers,
56
+ {
57
+ ...DEFAULT_MATCHER
58
+ }
59
+ ]);
60
+ };
61
+ const handleMatcherChange = (index, updated)=>{
62
+ const next = [
63
+ ...matchers
64
+ ];
65
+ next[index] = updated;
66
+ setMatchers(next);
67
+ };
68
+ const handleRemoveMatcher = (index)=>{
69
+ setMatchers(matchers.filter((_, i)=>i !== index));
70
+ };
71
+ const handleSubmit = ()=>{
72
+ const startsAtDate = new Date(startsAt);
73
+ const endsAtDate = new Date(endsAt);
74
+ if (isNaN(startsAtDate.getTime()) || isNaN(endsAtDate.getTime())) return;
75
+ const silence = {
76
+ id: initialSilence?.id,
77
+ matchers: matchers.map((m)=>({
78
+ name: m.name,
79
+ value: m.value,
80
+ isEqual: m.isEqual,
81
+ isRegex: m.isRegex
82
+ })),
83
+ startsAt: startsAtDate.toISOString(),
84
+ endsAt: endsAtDate.toISOString(),
85
+ createdBy,
86
+ comment
87
+ };
88
+ onSubmit(silence);
89
+ };
90
+ const startsAtDate = new Date(startsAt);
91
+ const endsAtDate = new Date(endsAt);
92
+ const isValidDates = !isNaN(startsAtDate.getTime()) && !isNaN(endsAtDate.getTime()) && endsAtDate.getTime() > startsAtDate.getTime();
93
+ const isValid = matchers.length > 0 && matchers.every((m)=>m.name.length > 0) && createdBy.length > 0 && isValidDates;
94
+ return /*#__PURE__*/ _jsxs(Dialog, {
95
+ open: open,
96
+ onClose: onClose,
97
+ maxWidth: "md",
98
+ fullWidth: true,
99
+ children: [
100
+ /*#__PURE__*/ _jsx(DialogTitle, {
101
+ children: initialSilence?.id ? 'Edit Silence' : 'Create Silence'
102
+ }),
103
+ /*#__PURE__*/ _jsx(DialogContent, {
104
+ children: /*#__PURE__*/ _jsxs(Stack, {
105
+ spacing: 2,
106
+ sx: {
107
+ mt: 1
108
+ },
109
+ children: [
110
+ /*#__PURE__*/ _jsx(Typography, {
111
+ variant: "subtitle2",
112
+ children: "Matchers"
113
+ }),
114
+ matchers.map((matcher, index)=>/*#__PURE__*/ _jsx(MatcherEditor, {
115
+ matcher: matcher,
116
+ onChange: (updated)=>handleMatcherChange(index, updated),
117
+ onRemove: ()=>handleRemoveMatcher(index)
118
+ }, index)),
119
+ /*#__PURE__*/ _jsx(Button, {
120
+ startIcon: /*#__PURE__*/ _jsx(AddIcon, {}),
121
+ onClick: handleAddMatcher,
122
+ variant: "outlined",
123
+ size: "small",
124
+ children: "Add Matcher"
125
+ }),
126
+ /*#__PURE__*/ _jsxs(Stack, {
127
+ direction: "row",
128
+ spacing: 2,
129
+ children: [
130
+ /*#__PURE__*/ _jsx(TextField, {
131
+ label: "Start",
132
+ type: "datetime-local",
133
+ value: startsAt,
134
+ onChange: (e)=>setStartsAt(e.target.value),
135
+ size: "small",
136
+ InputLabelProps: {
137
+ shrink: true
138
+ },
139
+ sx: {
140
+ flex: 1
141
+ }
142
+ }),
143
+ /*#__PURE__*/ _jsx(TextField, {
144
+ label: "End",
145
+ type: "datetime-local",
146
+ value: endsAt,
147
+ onChange: (e)=>setEndsAt(e.target.value),
148
+ size: "small",
149
+ InputLabelProps: {
150
+ shrink: true
151
+ },
152
+ sx: {
153
+ flex: 1
154
+ }
155
+ })
156
+ ]
157
+ }),
158
+ /*#__PURE__*/ _jsx(TextField, {
159
+ label: "Creator",
160
+ value: createdBy,
161
+ onChange: (e)=>setCreatedBy(e.target.value),
162
+ size: "small",
163
+ required: true
164
+ }),
165
+ /*#__PURE__*/ _jsx(TextField, {
166
+ label: "Comment",
167
+ value: comment,
168
+ onChange: (e)=>setComment(e.target.value),
169
+ size: "small",
170
+ multiline: true,
171
+ rows: 2
172
+ })
173
+ ]
174
+ })
175
+ }),
176
+ /*#__PURE__*/ _jsxs(DialogActions, {
177
+ children: [
178
+ /*#__PURE__*/ _jsx(Button, {
179
+ onClick: onClose,
180
+ children: "Cancel"
181
+ }),
182
+ /*#__PURE__*/ _jsx(Button, {
183
+ onClick: handleSubmit,
184
+ variant: "contained",
185
+ disabled: !isValid,
186
+ children: initialSilence?.id ? 'Update' : 'Create'
187
+ })
188
+ ]
189
+ })
190
+ ]
191
+ });
192
+ }
193
+
194
+ //# sourceMappingURL=SilenceForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/SilenceForm.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, TextField, Typography } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { ReactElement, useState } from 'react';\nimport { PostableSilence } from '../model/api-types';\nimport { MatcherEditor, MatcherValue } from './MatcherEditor';\n\nexport interface SilenceFormProps {\n open: boolean;\n onClose: () => void;\n onSubmit: (silence: PostableSilence) => void;\n initialSilence?: Partial<PostableSilence>;\n}\n\nconst DEFAULT_MATCHER: MatcherValue = {\n name: '',\n value: '',\n isEqual: true,\n isRegex: false,\n};\n\nfunction toLocalDatetimeString(date: Date): string {\n const pad = (n: number): string => String(n).padStart(2, '0');\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\n}\n\nfunction getDefaultEndTime(): string {\n const end = new Date();\n end.setMinutes(end.getMinutes() + 30);\n return toLocalDatetimeString(end);\n}\n\nfunction getNowLocalISO(): string {\n return toLocalDatetimeString(new Date());\n}\n\n/**\n * Form dialog for creating or editing silences.\n */\nexport function SilenceForm({ open, onClose, onSubmit, initialSilence }: SilenceFormProps): ReactElement {\n const [matchers, setMatchers] = useState<MatcherValue[]>(\n initialSilence?.matchers?.length\n ? initialSilence.matchers.map((m) => ({\n name: m.name,\n value: m.value,\n isEqual: m.isEqual,\n isRegex: m.isRegex,\n }))\n : [{ ...DEFAULT_MATCHER }]\n );\n const [startsAt, setStartsAt] = useState(initialSilence?.startsAt?.slice(0, 16) ?? getNowLocalISO());\n const [endsAt, setEndsAt] = useState(initialSilence?.endsAt?.slice(0, 16) ?? getDefaultEndTime());\n const [createdBy, setCreatedBy] = useState(initialSilence?.createdBy ?? '');\n const [comment, setComment] = useState(initialSilence?.comment ?? '');\n\n const handleAddMatcher = (): void => {\n setMatchers([...matchers, { ...DEFAULT_MATCHER }]);\n };\n\n const handleMatcherChange = (index: number, updated: MatcherValue): void => {\n const next = [...matchers];\n next[index] = updated;\n setMatchers(next);\n };\n\n const handleRemoveMatcher = (index: number): void => {\n setMatchers(matchers.filter((_, i) => i !== index));\n };\n\n const handleSubmit = (): void => {\n const startsAtDate = new Date(startsAt);\n const endsAtDate = new Date(endsAt);\n if (isNaN(startsAtDate.getTime()) || isNaN(endsAtDate.getTime())) return;\n\n const silence: PostableSilence = {\n id: initialSilence?.id,\n matchers: matchers.map((m) => ({\n name: m.name,\n value: m.value,\n isEqual: m.isEqual,\n isRegex: m.isRegex,\n })),\n startsAt: startsAtDate.toISOString(),\n endsAt: endsAtDate.toISOString(),\n createdBy,\n comment,\n };\n onSubmit(silence);\n };\n\n const startsAtDate = new Date(startsAt);\n const endsAtDate = new Date(endsAt);\n const isValidDates =\n !isNaN(startsAtDate.getTime()) && !isNaN(endsAtDate.getTime()) && endsAtDate.getTime() > startsAtDate.getTime();\n const isValid =\n matchers.length > 0 && matchers.every((m) => m.name.length > 0) && createdBy.length > 0 && isValidDates;\n\n return (\n <Dialog open={open} onClose={onClose} maxWidth=\"md\" fullWidth>\n <DialogTitle>{initialSilence?.id ? 'Edit Silence' : 'Create Silence'}</DialogTitle>\n <DialogContent>\n <Stack spacing={2} sx={{ mt: 1 }}>\n <Typography variant=\"subtitle2\">Matchers</Typography>\n {matchers.map((matcher, index) => (\n <MatcherEditor\n key={index}\n matcher={matcher}\n onChange={(updated) => handleMatcherChange(index, updated)}\n onRemove={() => handleRemoveMatcher(index)}\n />\n ))}\n <Button startIcon={<AddIcon />} onClick={handleAddMatcher} variant=\"outlined\" size=\"small\">\n Add Matcher\n </Button>\n\n <Stack direction=\"row\" spacing={2}>\n <TextField\n label=\"Start\"\n type=\"datetime-local\"\n value={startsAt}\n onChange={(e) => setStartsAt(e.target.value)}\n size=\"small\"\n InputLabelProps={{ shrink: true }}\n sx={{ flex: 1 }}\n />\n <TextField\n label=\"End\"\n type=\"datetime-local\"\n value={endsAt}\n onChange={(e) => setEndsAt(e.target.value)}\n size=\"small\"\n InputLabelProps={{ shrink: true }}\n sx={{ flex: 1 }}\n />\n </Stack>\n\n <TextField\n label=\"Creator\"\n value={createdBy}\n onChange={(e) => setCreatedBy(e.target.value)}\n size=\"small\"\n required\n />\n <TextField\n label=\"Comment\"\n value={comment}\n onChange={(e) => setComment(e.target.value)}\n size=\"small\"\n multiline\n rows={2}\n />\n </Stack>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>Cancel</Button>\n <Button onClick={handleSubmit} variant=\"contained\" disabled={!isValid}>\n {initialSilence?.id ? 'Update' : 'Create'}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":["Button","Dialog","DialogActions","DialogContent","DialogTitle","Stack","TextField","Typography","AddIcon","useState","MatcherEditor","DEFAULT_MATCHER","name","value","isEqual","isRegex","toLocalDatetimeString","date","pad","n","String","padStart","getFullYear","getMonth","getDate","getHours","getMinutes","getDefaultEndTime","end","Date","setMinutes","getNowLocalISO","SilenceForm","open","onClose","onSubmit","initialSilence","matchers","setMatchers","length","map","m","startsAt","setStartsAt","slice","endsAt","setEndsAt","createdBy","setCreatedBy","comment","setComment","handleAddMatcher","handleMatcherChange","index","updated","next","handleRemoveMatcher","filter","_","i","handleSubmit","startsAtDate","endsAtDate","isNaN","getTime","silence","id","toISOString","isValidDates","isValid","every","maxWidth","fullWidth","spacing","sx","mt","variant","matcher","onChange","onRemove","startIcon","onClick","size","direction","label","type","e","target","InputLabelProps","shrink","flex","required","multiline","rows","disabled"],"mappings":"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"}
@@ -0,0 +1,10 @@
1
+ import { ReactElement } from 'react';
2
+ export interface StatusBadgeProps {
3
+ status: string;
4
+ variant?: 'alert' | 'silence';
5
+ }
6
+ /**
7
+ * Renders a colored badge/chip based on alert or silence status.
8
+ */
9
+ export declare function StatusBadge({ status, variant }: StatusBadgeProps): ReactElement;
10
+ //# sourceMappingURL=StatusBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAqBD;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,OAAiB,EAAE,EAAE,gBAAgB,GAAG,YAAY,CAQzF"}
@@ -0,0 +1,65 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Chip } from '@mui/material';
15
+ const ALERT_STATUS_MAP = {
16
+ firing: {
17
+ label: 'Firing',
18
+ color: 'error'
19
+ },
20
+ suppressed: {
21
+ label: 'Silenced',
22
+ color: 'warning'
23
+ },
24
+ pending: {
25
+ label: 'Pending',
26
+ color: 'default'
27
+ },
28
+ resolved: {
29
+ label: 'Resolved',
30
+ color: 'success'
31
+ },
32
+ inactive: {
33
+ label: 'Inactive',
34
+ color: 'default'
35
+ }
36
+ };
37
+ const SILENCE_STATUS_MAP = {
38
+ active: {
39
+ label: 'Active',
40
+ color: 'success'
41
+ },
42
+ expired: {
43
+ label: 'Expired',
44
+ color: 'default'
45
+ },
46
+ pending: {
47
+ label: 'Pending',
48
+ color: 'warning'
49
+ }
50
+ };
51
+ /**
52
+ * Renders a colored badge/chip based on alert or silence status.
53
+ */ export function StatusBadge({ status, variant = 'alert' }) {
54
+ const statusMap = variant === 'silence' ? SILENCE_STATUS_MAP : ALERT_STATUS_MAP;
55
+ const config = statusMap[status];
56
+ const label = config?.label ?? status;
57
+ const color = config?.color ?? 'default';
58
+ return /*#__PURE__*/ _jsx(Chip, {
59
+ label: label,
60
+ color: color,
61
+ size: "small"
62
+ });
63
+ }
64
+
65
+ //# sourceMappingURL=StatusBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/StatusBadge.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\nimport { Chip, ChipProps } from '@mui/material';\n\nexport interface StatusBadgeProps {\n status: string;\n variant?: 'alert' | 'silence';\n}\n\ninterface StatusConfig {\n label: string;\n color: ChipProps['color'];\n}\n\nconst ALERT_STATUS_MAP: Record<string, StatusConfig> = {\n firing: { label: 'Firing', color: 'error' },\n suppressed: { label: 'Silenced', color: 'warning' },\n pending: { label: 'Pending', color: 'default' },\n resolved: { label: 'Resolved', color: 'success' },\n inactive: { label: 'Inactive', color: 'default' },\n};\n\nconst SILENCE_STATUS_MAP: Record<string, StatusConfig> = {\n active: { label: 'Active', color: 'success' },\n expired: { label: 'Expired', color: 'default' },\n pending: { label: 'Pending', color: 'warning' },\n};\n\n/**\n * Renders a colored badge/chip based on alert or silence status.\n */\nexport function StatusBadge({ status, variant = 'alert' }: StatusBadgeProps): ReactElement {\n const statusMap = variant === 'silence' ? SILENCE_STATUS_MAP : ALERT_STATUS_MAP;\n const config = statusMap[status];\n\n const label = config?.label ?? status;\n const color = config?.color ?? 'default';\n\n return <Chip label={label} color={color} size=\"small\" />;\n}\n"],"names":["Chip","ALERT_STATUS_MAP","firing","label","color","suppressed","pending","resolved","inactive","SILENCE_STATUS_MAP","active","expired","StatusBadge","status","variant","statusMap","config","size"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,IAAI,QAAmB,gBAAgB;AAYhD,MAAMC,mBAAiD;IACrDC,QAAQ;QAAEC,OAAO;QAAUC,OAAO;IAAQ;IAC1CC,YAAY;QAAEF,OAAO;QAAYC,OAAO;IAAU;IAClDE,SAAS;QAAEH,OAAO;QAAWC,OAAO;IAAU;IAC9CG,UAAU;QAAEJ,OAAO;QAAYC,OAAO;IAAU;IAChDI,UAAU;QAAEL,OAAO;QAAYC,OAAO;IAAU;AAClD;AAEA,MAAMK,qBAAmD;IACvDC,QAAQ;QAAEP,OAAO;QAAUC,OAAO;IAAU;IAC5CO,SAAS;QAAER,OAAO;QAAWC,OAAO;IAAU;IAC9CE,SAAS;QAAEH,OAAO;QAAWC,OAAO;IAAU;AAChD;AAEA;;CAEC,GACD,OAAO,SAASQ,YAAY,EAAEC,MAAM,EAAEC,UAAU,OAAO,EAAoB;IACzE,MAAMC,YAAYD,YAAY,YAAYL,qBAAqBR;IAC/D,MAAMe,SAASD,SAAS,CAACF,OAAO;IAEhC,MAAMV,QAAQa,QAAQb,SAASU;IAC/B,MAAMT,QAAQY,QAAQZ,SAAS;IAE/B,qBAAO,KAACJ;QAAKG,OAAOA;QAAOC,OAAOA;QAAOa,MAAK;;AAChD"}
@@ -0,0 +1,11 @@
1
+ export { StatusBadge } from './StatusBadge';
2
+ export type { StatusBadgeProps } from './StatusBadge';
3
+ export { MatchersList } from './MatchersList';
4
+ export type { MatchersListProps } from './MatchersList';
5
+ export { MatcherEditor } from './MatcherEditor';
6
+ export type { MatcherEditorProps, MatcherValue } from './MatcherEditor';
7
+ export { SilenceForm } from './SilenceForm';
8
+ export type { SilenceFormProps } from './SilenceForm';
9
+ export { LazyTextField } from './LazyTextField';
10
+ export type { LazyTextFieldProps } from './LazyTextField';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { StatusBadge } from './StatusBadge';
14
+ export { MatchersList } from './MatchersList';
15
+ export { MatcherEditor } from './MatcherEditor';
16
+ export { SilenceForm } from './SilenceForm';
17
+ export { LazyTextField } from './LazyTextField';
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport { StatusBadge } from './StatusBadge';\nexport type { StatusBadgeProps } from './StatusBadge';\n\nexport { MatchersList } from './MatchersList';\nexport type { MatchersListProps } from './MatchersList';\n\nexport { MatcherEditor } from './MatcherEditor';\nexport type { MatcherEditorProps, MatcherValue } from './MatcherEditor';\n\nexport { SilenceForm } from './SilenceForm';\nexport type { SilenceFormProps } from './SilenceForm';\n\nexport { LazyTextField } from './LazyTextField';\nexport type { LazyTextFieldProps } from './LazyTextField';\n"],"names":["StatusBadge","MatchersList","MatcherEditor","SilenceForm","LazyTextField"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,gBAAgB;AAG5C,SAASC,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,SAASC,WAAW,QAAQ,gBAAgB;AAG5C,SAASC,aAAa,QAAQ,kBAAkB"}
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ export declare function AlertManagerAlertsExplorer(): ReactElement;
3
+ //# sourceMappingURL=AlertManagerAlertsExplorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertManagerAlertsExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/AlertManagerAlertsExplorer.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAa/C,wBAAgB,0BAA0B,IAAI,YAAY,CAiCzD"}
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { useState } from 'react';
15
+ import { Box, Stack } from '@mui/material';
16
+ import { DataQueriesProvider, MultiQueryEditor } from '@perses-dev/plugin-system';
17
+ import { Panel } from '@perses-dev/dashboards';
18
+ import { useExplorerManagerContext } from '@perses-dev/explore';
19
+ const PANEL_PREVIEW_HEIGHT = 600;
20
+ export function AlertManagerAlertsExplorer() {
21
+ const { data: { queries = [] }, setData } = useExplorerManagerContext();
22
+ const [queryDefinitions, setQueryDefinitions] = useState(queries);
23
+ return /*#__PURE__*/ _jsxs(Stack, {
24
+ gap: 2,
25
+ sx: {
26
+ width: '100%'
27
+ },
28
+ children: [
29
+ /*#__PURE__*/ _jsx(MultiQueryEditor, {
30
+ queryTypes: [
31
+ 'AlertsQuery'
32
+ ],
33
+ onChange: (state)=>setQueryDefinitions(state),
34
+ queries: queryDefinitions,
35
+ onQueryRun: ()=>setData({
36
+ queries: queryDefinitions
37
+ })
38
+ }),
39
+ /*#__PURE__*/ _jsx(DataQueriesProvider, {
40
+ definitions: queries,
41
+ children: /*#__PURE__*/ _jsx(Box, {
42
+ height: PANEL_PREVIEW_HEIGHT,
43
+ children: /*#__PURE__*/ _jsx(Panel, {
44
+ panelOptions: {
45
+ hideHeader: true
46
+ },
47
+ definition: {
48
+ kind: 'Panel',
49
+ spec: {
50
+ queries,
51
+ display: {
52
+ name: ''
53
+ },
54
+ plugin: {
55
+ kind: 'AlertTable',
56
+ spec: {
57
+ defaultGroupBy: [
58
+ 'alertname'
59
+ ]
60
+ }
61
+ }
62
+ }
63
+ }
64
+ })
65
+ })
66
+ })
67
+ ]
68
+ });
69
+ }
70
+
71
+ //# sourceMappingURL=AlertManagerAlertsExplorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/explore/AlertManagerAlertsExplorer.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useState } from 'react';\nimport { Box, Stack } from '@mui/material';\nimport { DataQueriesProvider, MultiQueryEditor } from '@perses-dev/plugin-system';\nimport { Panel } from '@perses-dev/dashboards';\nimport { useExplorerManagerContext } from '@perses-dev/explore';\nimport { QueryDefinition } from '@perses-dev/spec';\n\ninterface AlertsExplorerQueryParams {\n queries?: QueryDefinition[];\n}\n\nconst PANEL_PREVIEW_HEIGHT = 600;\n\nexport function AlertManagerAlertsExplorer(): ReactElement {\n const {\n data: { queries = [] },\n setData,\n } = useExplorerManagerContext<AlertsExplorerQueryParams>();\n\n const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <MultiQueryEditor\n queryTypes={['AlertsQuery']}\n onChange={(state) => setQueryDefinitions(state)}\n queries={queryDefinitions}\n onQueryRun={() => setData({ queries: queryDefinitions })}\n />\n <DataQueriesProvider definitions={queries}>\n <Box height={PANEL_PREVIEW_HEIGHT}>\n <Panel\n panelOptions={{ hideHeader: true }}\n definition={{\n kind: 'Panel',\n spec: {\n queries,\n display: { name: '' },\n plugin: { kind: 'AlertTable', spec: { defaultGroupBy: ['alertname'] } },\n },\n }}\n />\n </Box>\n </DataQueriesProvider>\n </Stack>\n );\n}\n"],"names":["useState","Box","Stack","DataQueriesProvider","MultiQueryEditor","Panel","useExplorerManagerContext","PANEL_PREVIEW_HEIGHT","AlertManagerAlertsExplorer","data","queries","setData","queryDefinitions","setQueryDefinitions","gap","sx","width","queryTypes","onChange","state","onQueryRun","definitions","height","panelOptions","hideHeader","definition","kind","spec","display","name","plugin","defaultGroupBy"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,GAAG,EAAEC,KAAK,QAAQ,gBAAgB;AAC3C,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAClF,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,yBAAyB,QAAQ,sBAAsB;AAOhE,MAAMC,uBAAuB;AAE7B,OAAO,SAASC;IACd,MAAM,EACJC,MAAM,EAAEC,UAAU,EAAE,EAAE,EACtBC,OAAO,EACR,GAAGL;IAEJ,MAAM,CAACM,kBAAkBC,oBAAoB,GAAGb,SAA4BU;IAE5E,qBACE,MAACR;QAAMY,KAAK;QAAGC,IAAI;YAAEC,OAAO;QAAO;;0BACjC,KAACZ;gBACCa,YAAY;oBAAC;iBAAc;gBAC3BC,UAAU,CAACC,QAAUN,oBAAoBM;gBACzCT,SAASE;gBACTQ,YAAY,IAAMT,QAAQ;wBAAED,SAASE;oBAAiB;;0BAExD,KAACT;gBAAoBkB,aAAaX;0BAChC,cAAA,KAACT;oBAAIqB,QAAQf;8BACX,cAAA,KAACF;wBACCkB,cAAc;4BAAEC,YAAY;wBAAK;wBACjCC,YAAY;4BACVC,MAAM;4BACNC,MAAM;gCACJjB;gCACAkB,SAAS;oCAAEC,MAAM;gCAAG;gCACpBC,QAAQ;oCAAEJ,MAAM;oCAAcC,MAAM;wCAAEI,gBAAgB;4CAAC;yCAAY;oCAAC;gCAAE;4BACxE;wBACF;;;;;;AAMZ"}
@@ -0,0 +1,3 @@
1
+ import { ReactElement } from 'react';
2
+ export declare function AlertManagerSilencesExplorer(): ReactElement;
3
+ //# sourceMappingURL=AlertManagerSilencesExplorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertManagerSilencesExplorer.d.ts","sourceRoot":"","sources":["../../../src/explore/AlertManagerSilencesExplorer.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAA0C,MAAM,OAAO,CAAC;AAoE7E,wBAAgB,4BAA4B,IAAI,YAAY,CAoC3D"}