@perses-dev/alert-manager-plugin 0.1.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 (380) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/7790.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.f762e62c.js +7 -0
  89. package/__mf/js/async/1616.24f00c9d.js +1 -0
  90. package/__mf/js/async/1728.83bb9a7c.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/2954.3ac1f636.js +2 -0
  98. package/__mf/js/async/392.7e11dd69.js +2 -0
  99. package/__mf/js/async/392.7e11dd69.js.LICENSE.txt +8 -0
  100. package/__mf/js/async/3963.fb6246d2.js +1 -0
  101. package/__mf/js/async/4121.ec666be2.js +2 -0
  102. package/__mf/js/async/4121.ec666be2.js.LICENSE.txt +9 -0
  103. package/__mf/js/async/4133.e94df4f8.js +28 -0
  104. package/__mf/js/async/4213.a0c4f2eb.js +1 -0
  105. package/__mf/js/async/4397.d399eecb.js +2 -0
  106. package/__mf/js/async/4397.d399eecb.js.LICENSE.txt +37 -0
  107. package/__mf/js/async/4466.a8145edd.js +74 -0
  108. package/__mf/js/async/4732.e866a740.js +1 -0
  109. package/__mf/js/async/4788.49ffeac3.js +1 -0
  110. package/__mf/js/async/5038.269393e3.js +2 -0
  111. package/__mf/js/async/5038.269393e3.js.LICENSE.txt +9 -0
  112. package/__mf/js/async/573.214f2003.js +2 -0
  113. package/__mf/js/async/573.214f2003.js.LICENSE.txt +9 -0
  114. package/__mf/js/async/6274.8c77cb1a.js +2 -0
  115. package/__mf/js/async/6274.8c77cb1a.js.LICENSE.txt +8 -0
  116. package/__mf/js/async/6390.3f6f279d.js +2 -0
  117. package/__mf/js/async/6390.3f6f279d.js.LICENSE.txt +9 -0
  118. package/__mf/js/async/6401.1a59dbad.js +1 -0
  119. package/__mf/js/async/6593.acc8b704.js +4 -0
  120. package/__mf/js/async/6593.acc8b704.js.LICENSE.txt +24 -0
  121. package/__mf/js/async/6594.b02adfd9.js +2 -0
  122. package/__mf/js/async/6594.b02adfd9.js.LICENSE.txt +9 -0
  123. package/__mf/js/async/663.5445c7e0.js +1 -0
  124. package/__mf/js/async/6854.1d628838.js +1 -0
  125. package/__mf/js/async/7177.27c86137.js +1 -0
  126. package/__mf/js/async/7192.ede9860b.js +1 -0
  127. package/__mf/js/async/733.22ab2a8a.js +1 -0
  128. package/__mf/js/async/7422.33d76364.js +2 -0
  129. package/__mf/js/async/7422.33d76364.js.LICENSE.txt +9 -0
  130. package/__mf/js/async/7790.a75199e6.js +7 -0
  131. package/__mf/js/async/7790.a75199e6.js.LICENSE.txt +64 -0
  132. package/__mf/js/async/7862.556c038f.js +2 -0
  133. package/__mf/js/async/7862.556c038f.js.LICENSE.txt +9 -0
  134. package/__mf/js/async/7984.49fa1156.js +22 -0
  135. package/__mf/js/async/7984.49fa1156.js.LICENSE.txt +19 -0
  136. package/__mf/js/async/804.23da0d30.js +37 -0
  137. package/__mf/js/async/8470.2df0db71.js +2 -0
  138. package/__mf/js/async/8470.2df0db71.js.LICENSE.txt +19 -0
  139. package/__mf/js/async/8697.c13c6603.js +1 -0
  140. package/__mf/js/async/8907.9e3edf43.js +1 -0
  141. package/__mf/js/async/9040.94717f28.js +10 -0
  142. package/__mf/js/async/9040.94717f28.js.LICENSE.txt +17 -0
  143. package/__mf/js/async/9184.27a439a4.js +1 -0
  144. package/__mf/js/async/9235.00f9412f.js +1 -0
  145. package/__mf/js/async/941.d3bc6208.js +2 -0
  146. package/__mf/js/async/941.d3bc6208.js.LICENSE.txt +9 -0
  147. package/__mf/js/async/9634.3a366799.js +1 -0
  148. package/__mf/js/async/9836.cc839227.js +1 -0
  149. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js +2 -0
  150. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js.LICENSE.txt +9 -0
  151. package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.9ea3093c.js +1 -0
  152. package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js +2 -0
  153. package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js.LICENSE.txt +9 -0
  154. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js +2 -0
  155. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js.LICENSE.txt +9 -0
  156. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js +2 -0
  157. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js.LICENSE.txt +9 -0
  158. package/__mf/js/async/__federation_expose_AlertTable.4a636b80.js +1 -0
  159. package/__mf/js/async/__federation_expose_SilenceTable.11259028.js +1 -0
  160. package/__mf/js/async/lib-router.19f64904.js +2 -0
  161. package/__mf/js/async/lib-router.19f64904.js.LICENSE.txt +32 -0
  162. package/__mf/js/main.a1362788.js +7 -0
  163. package/lib/bootstrap.d.ts +2 -0
  164. package/lib/bootstrap.d.ts.map +1 -0
  165. package/lib/bootstrap.js +19 -0
  166. package/lib/bootstrap.js.map +1 -0
  167. package/lib/cjs/bootstrap.js +26 -0
  168. package/lib/cjs/components/ColumnsEditor.js +271 -0
  169. package/lib/cjs/components/LazyTextField.js +50 -0
  170. package/lib/cjs/components/MatcherEditor.js +153 -0
  171. package/lib/cjs/components/MatchersList.js +46 -0
  172. package/lib/cjs/components/SilenceForm.js +205 -0
  173. package/lib/cjs/components/StatusBadge.js +71 -0
  174. package/lib/cjs/components/index.js +44 -0
  175. package/lib/cjs/explore/AlertManagerAlertsExplorer.js +79 -0
  176. package/lib/cjs/explore/AlertManagerSilencesExplorer.js +153 -0
  177. package/lib/cjs/getPluginModule.js +39 -0
  178. package/lib/cjs/index-federation.js +55 -0
  179. package/lib/cjs/index.js +39 -0
  180. package/lib/cjs/model/alertmanager-client.js +128 -0
  181. package/lib/cjs/model/alertmanager-selectors.js +66 -0
  182. package/lib/cjs/model/api-types.js +22 -0
  183. package/lib/cjs/model/index.js +32 -0
  184. package/lib/cjs/plugins/AlertManagerDatasourceEditor.js +71 -0
  185. package/lib/cjs/plugins/alert-table/AlertTable.js +56 -0
  186. package/lib/cjs/plugins/alert-table/AlertTableColumnsEditor.js +110 -0
  187. package/lib/cjs/plugins/alert-table/AlertTableDeduplicationEditor.js +138 -0
  188. package/lib/cjs/plugins/alert-table/AlertTableLabelsEditor.js +277 -0
  189. package/lib/cjs/plugins/alert-table/AlertTableOptionsEditor.js +128 -0
  190. package/lib/cjs/plugins/alert-table/AlertTablePanel.js +773 -0
  191. package/lib/cjs/plugins/alert-table/alert-table-model.js +142 -0
  192. package/lib/cjs/plugins/alert-table/alert-table-sorting.js +205 -0
  193. package/lib/cjs/plugins/alert-table/label-colors.js +170 -0
  194. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +51 -0
  195. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +138 -0
  196. package/lib/cjs/plugins/alertmanager-alerts-query/get-alerts-data.js +124 -0
  197. package/lib/cjs/plugins/alertmanager-datasource.js +69 -0
  198. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +45 -0
  199. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +78 -0
  200. package/lib/cjs/plugins/alertmanager-silences-query/get-silences-data.js +64 -0
  201. package/lib/cjs/plugins/index.js +74 -0
  202. package/lib/cjs/plugins/silence-table/SilenceTable.js +42 -0
  203. package/lib/cjs/plugins/silence-table/SilenceTableColumnsEditor.js +137 -0
  204. package/lib/cjs/plugins/silence-table/SilenceTableOptionsEditor.js +63 -0
  205. package/lib/cjs/plugins/silence-table/SilenceTablePanel.js +345 -0
  206. package/lib/cjs/plugins/silence-table/silence-table-model.js +116 -0
  207. package/lib/cjs/plugins/silence-table/silence-table-sorting.js +68 -0
  208. package/lib/cjs/plugins/types.js +16 -0
  209. package/lib/cjs/setup-tests.js +18 -0
  210. package/lib/components/ColumnsEditor.d.ts +25 -0
  211. package/lib/components/ColumnsEditor.d.ts.map +1 -0
  212. package/lib/components/ColumnsEditor.js +258 -0
  213. package/lib/components/ColumnsEditor.js.map +1 -0
  214. package/lib/components/LazyTextField.d.ts +12 -0
  215. package/lib/components/LazyTextField.d.ts.map +1 -0
  216. package/lib/components/LazyTextField.js +42 -0
  217. package/lib/components/LazyTextField.js.map +1 -0
  218. package/lib/components/MatcherEditor.d.ts +17 -0
  219. package/lib/components/MatcherEditor.d.ts.map +1 -0
  220. package/lib/components/MatcherEditor.js +142 -0
  221. package/lib/components/MatcherEditor.js.map +1 -0
  222. package/lib/components/MatchersList.d.ts +10 -0
  223. package/lib/components/MatchersList.d.ts.map +1 -0
  224. package/lib/components/MatchersList.js +40 -0
  225. package/lib/components/MatchersList.js.map +1 -0
  226. package/lib/components/SilenceForm.d.ts +13 -0
  227. package/lib/components/SilenceForm.d.ts.map +1 -0
  228. package/lib/components/SilenceForm.js +194 -0
  229. package/lib/components/SilenceForm.js.map +1 -0
  230. package/lib/components/StatusBadge.d.ts +10 -0
  231. package/lib/components/StatusBadge.d.ts.map +1 -0
  232. package/lib/components/StatusBadge.js +65 -0
  233. package/lib/components/StatusBadge.js.map +1 -0
  234. package/lib/components/index.d.ts +11 -0
  235. package/lib/components/index.d.ts.map +1 -0
  236. package/lib/components/index.js +19 -0
  237. package/lib/components/index.js.map +1 -0
  238. package/lib/explore/AlertManagerAlertsExplorer.d.ts +3 -0
  239. package/lib/explore/AlertManagerAlertsExplorer.d.ts.map +1 -0
  240. package/lib/explore/AlertManagerAlertsExplorer.js +71 -0
  241. package/lib/explore/AlertManagerAlertsExplorer.js.map +1 -0
  242. package/lib/explore/AlertManagerSilencesExplorer.d.ts +3 -0
  243. package/lib/explore/AlertManagerSilencesExplorer.d.ts.map +1 -0
  244. package/lib/explore/AlertManagerSilencesExplorer.js +140 -0
  245. package/lib/explore/AlertManagerSilencesExplorer.js.map +1 -0
  246. package/lib/getPluginModule.d.ts +3 -0
  247. package/lib/getPluginModule.d.ts.map +1 -0
  248. package/lib/getPluginModule.js +26 -0
  249. package/lib/getPluginModule.js.map +1 -0
  250. package/lib/index-federation.d.ts +1 -0
  251. package/lib/index-federation.d.ts.map +1 -0
  252. package/lib/index-federation.js +15 -0
  253. package/lib/index-federation.js.map +1 -0
  254. package/lib/index.d.ts +5 -0
  255. package/lib/index.d.ts.map +1 -0
  256. package/lib/index.js +18 -0
  257. package/lib/index.js.map +1 -0
  258. package/lib/model/alertmanager-client.d.ts +27 -0
  259. package/lib/model/alertmanager-client.d.ts.map +1 -0
  260. package/lib/model/alertmanager-client.js +100 -0
  261. package/lib/model/alertmanager-client.js.map +1 -0
  262. package/lib/model/alertmanager-selectors.d.ts +13 -0
  263. package/lib/model/alertmanager-selectors.d.ts.map +1 -0
  264. package/lib/model/alertmanager-selectors.js +41 -0
  265. package/lib/model/alertmanager-selectors.js.map +1 -0
  266. package/lib/model/api-types.d.ts +120 -0
  267. package/lib/model/api-types.d.ts.map +1 -0
  268. package/lib/model/api-types.js +23 -0
  269. package/lib/model/api-types.js.map +1 -0
  270. package/lib/model/index.d.ts +4 -0
  271. package/lib/model/index.d.ts.map +1 -0
  272. package/lib/model/index.js +17 -0
  273. package/lib/model/index.js.map +1 -0
  274. package/lib/plugins/AlertManagerDatasourceEditor.d.ts +9 -0
  275. package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -0
  276. package/lib/plugins/AlertManagerDatasourceEditor.js +63 -0
  277. package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -0
  278. package/lib/plugins/alert-table/AlertTable.d.ts +8 -0
  279. package/lib/plugins/alert-table/AlertTable.d.ts.map +1 -0
  280. package/lib/plugins/alert-table/AlertTable.js +50 -0
  281. package/lib/plugins/alert-table/AlertTable.js.map +1 -0
  282. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts +5 -0
  283. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts.map +1 -0
  284. package/lib/plugins/alert-table/AlertTableColumnsEditor.js +102 -0
  285. package/lib/plugins/alert-table/AlertTableColumnsEditor.js.map +1 -0
  286. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts +5 -0
  287. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts.map +1 -0
  288. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js +130 -0
  289. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js.map +1 -0
  290. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts +5 -0
  291. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts.map +1 -0
  292. package/lib/plugins/alert-table/AlertTableLabelsEditor.js +264 -0
  293. package/lib/plugins/alert-table/AlertTableLabelsEditor.js.map +1 -0
  294. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts +5 -0
  295. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts.map +1 -0
  296. package/lib/plugins/alert-table/AlertTableOptionsEditor.js +120 -0
  297. package/lib/plugins/alert-table/AlertTableOptionsEditor.js.map +1 -0
  298. package/lib/plugins/alert-table/AlertTablePanel.d.ts +11 -0
  299. package/lib/plugins/alert-table/AlertTablePanel.d.ts.map +1 -0
  300. package/lib/plugins/alert-table/AlertTablePanel.js +763 -0
  301. package/lib/plugins/alert-table/AlertTablePanel.js.map +1 -0
  302. package/lib/plugins/alert-table/alert-table-model.d.ts +73 -0
  303. package/lib/plugins/alert-table/alert-table-model.d.ts.map +1 -0
  304. package/lib/plugins/alert-table/alert-table-model.js +127 -0
  305. package/lib/plugins/alert-table/alert-table-model.js.map +1 -0
  306. package/lib/plugins/alert-table/alert-table-sorting.d.ts +13 -0
  307. package/lib/plugins/alert-table/alert-table-sorting.d.ts.map +1 -0
  308. package/lib/plugins/alert-table/alert-table-sorting.js +180 -0
  309. package/lib/plugins/alert-table/alert-table-sorting.js.map +1 -0
  310. package/lib/plugins/alert-table/label-colors.d.ts +6 -0
  311. package/lib/plugins/alert-table/label-colors.d.ts.map +1 -0
  312. package/lib/plugins/alert-table/label-colors.js +148 -0
  313. package/lib/plugins/alert-table/label-colors.js.map +1 -0
  314. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts +4 -0
  315. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts.map +1 -0
  316. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +43 -0
  317. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js.map +1 -0
  318. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts +9 -0
  319. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts.map +1 -0
  320. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +130 -0
  321. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js.map +1 -0
  322. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts +8 -0
  323. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts.map +1 -0
  324. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js +118 -0
  325. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js.map +1 -0
  326. package/lib/plugins/alertmanager-datasource.d.ts +5 -0
  327. package/lib/plugins/alertmanager-datasource.d.ts.map +1 -0
  328. package/lib/plugins/alertmanager-datasource.js +61 -0
  329. package/lib/plugins/alertmanager-datasource.js.map +1 -0
  330. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts +4 -0
  331. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts.map +1 -0
  332. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +37 -0
  333. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js.map +1 -0
  334. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts +9 -0
  335. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts.map +1 -0
  336. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +70 -0
  337. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js.map +1 -0
  338. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts +8 -0
  339. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts.map +1 -0
  340. package/lib/plugins/alertmanager-silences-query/get-silences-data.js +58 -0
  341. package/lib/plugins/alertmanager-silences-query/get-silences-data.js.map +1 -0
  342. package/lib/plugins/index.d.ts +19 -0
  343. package/lib/plugins/index.d.ts.map +1 -0
  344. package/lib/plugins/index.js +30 -0
  345. package/lib/plugins/index.js.map +1 -0
  346. package/lib/plugins/silence-table/SilenceTable.d.ts +7 -0
  347. package/lib/plugins/silence-table/SilenceTable.d.ts.map +1 -0
  348. package/lib/plugins/silence-table/SilenceTable.js +36 -0
  349. package/lib/plugins/silence-table/SilenceTable.js.map +1 -0
  350. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts +5 -0
  351. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts.map +1 -0
  352. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js +129 -0
  353. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js.map +1 -0
  354. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts +5 -0
  355. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts.map +1 -0
  356. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js +55 -0
  357. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js.map +1 -0
  358. package/lib/plugins/silence-table/SilenceTablePanel.d.ts +11 -0
  359. package/lib/plugins/silence-table/SilenceTablePanel.d.ts.map +1 -0
  360. package/lib/plugins/silence-table/SilenceTablePanel.js +335 -0
  361. package/lib/plugins/silence-table/SilenceTablePanel.js.map +1 -0
  362. package/lib/plugins/silence-table/silence-table-model.d.ts +29 -0
  363. package/lib/plugins/silence-table/silence-table-model.d.ts.map +1 -0
  364. package/lib/plugins/silence-table/silence-table-model.js +90 -0
  365. package/lib/plugins/silence-table/silence-table-model.js.map +1 -0
  366. package/lib/plugins/silence-table/silence-table-sorting.d.ts +9 -0
  367. package/lib/plugins/silence-table/silence-table-sorting.d.ts.map +1 -0
  368. package/lib/plugins/silence-table/silence-table-sorting.js +60 -0
  369. package/lib/plugins/silence-table/silence-table-sorting.js.map +1 -0
  370. package/lib/plugins/types.d.ts +30 -0
  371. package/lib/plugins/types.d.ts.map +1 -0
  372. package/lib/plugins/types.js +17 -0
  373. package/lib/plugins/types.js.map +1 -0
  374. package/lib/setup-tests.d.ts +2 -0
  375. package/lib/setup-tests.d.ts.map +1 -0
  376. package/lib/setup-tests.js +16 -0
  377. package/lib/setup-tests.js.map +1 -0
  378. package/mf-manifest.json +631 -0
  379. package/mf-stats.json +752 -0
  380. package/package.json +115 -0
@@ -0,0 +1,205 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "SilenceForm", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return SilenceForm;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
26
+ const _react = require("react");
27
+ const _MatcherEditor = require("./MatcherEditor");
28
+ function _interop_require_default(obj) {
29
+ return obj && obj.__esModule ? obj : {
30
+ default: obj
31
+ };
32
+ }
33
+ const DEFAULT_MATCHER = {
34
+ name: '',
35
+ value: '',
36
+ isEqual: true,
37
+ isRegex: false
38
+ };
39
+ function toLocalDatetimeString(date) {
40
+ const pad = (n)=>String(n).padStart(2, '0');
41
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
42
+ }
43
+ function getDefaultEndTime() {
44
+ const end = new Date();
45
+ end.setMinutes(end.getMinutes() + 30);
46
+ return toLocalDatetimeString(end);
47
+ }
48
+ function getNowLocalISO() {
49
+ return toLocalDatetimeString(new Date());
50
+ }
51
+ function SilenceForm({ open, onClose, onSubmit, initialSilence }) {
52
+ const [matchers, setMatchers] = (0, _react.useState)(initialSilence?.matchers?.length ? initialSilence.matchers.map((m)=>({
53
+ name: m.name,
54
+ value: m.value,
55
+ isEqual: m.isEqual,
56
+ isRegex: m.isRegex
57
+ })) : [
58
+ {
59
+ ...DEFAULT_MATCHER
60
+ }
61
+ ]);
62
+ const [startsAt, setStartsAt] = (0, _react.useState)(initialSilence?.startsAt?.slice(0, 16) ?? getNowLocalISO());
63
+ const [endsAt, setEndsAt] = (0, _react.useState)(initialSilence?.endsAt?.slice(0, 16) ?? getDefaultEndTime());
64
+ const [createdBy, setCreatedBy] = (0, _react.useState)(initialSilence?.createdBy ?? '');
65
+ const [comment, setComment] = (0, _react.useState)(initialSilence?.comment ?? '');
66
+ const handleAddMatcher = ()=>{
67
+ setMatchers([
68
+ ...matchers,
69
+ {
70
+ ...DEFAULT_MATCHER
71
+ }
72
+ ]);
73
+ };
74
+ const handleMatcherChange = (index, updated)=>{
75
+ const next = [
76
+ ...matchers
77
+ ];
78
+ next[index] = updated;
79
+ setMatchers(next);
80
+ };
81
+ const handleRemoveMatcher = (index)=>{
82
+ setMatchers(matchers.filter((_, i)=>i !== index));
83
+ };
84
+ const handleSubmit = ()=>{
85
+ const startsAtDate = new Date(startsAt);
86
+ const endsAtDate = new Date(endsAt);
87
+ if (isNaN(startsAtDate.getTime()) || isNaN(endsAtDate.getTime())) return;
88
+ const silence = {
89
+ id: initialSilence?.id,
90
+ matchers: matchers.map((m)=>({
91
+ name: m.name,
92
+ value: m.value,
93
+ isEqual: m.isEqual,
94
+ isRegex: m.isRegex
95
+ })),
96
+ startsAt: startsAtDate.toISOString(),
97
+ endsAt: endsAtDate.toISOString(),
98
+ createdBy,
99
+ comment
100
+ };
101
+ onSubmit(silence);
102
+ };
103
+ const startsAtDate = new Date(startsAt);
104
+ const endsAtDate = new Date(endsAt);
105
+ const isValidDates = !isNaN(startsAtDate.getTime()) && !isNaN(endsAtDate.getTime()) && endsAtDate.getTime() > startsAtDate.getTime();
106
+ const isValid = matchers.length > 0 && matchers.every((m)=>m.name.length > 0) && createdBy.length > 0 && isValidDates;
107
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Dialog, {
108
+ open: open,
109
+ onClose: onClose,
110
+ maxWidth: "md",
111
+ fullWidth: true,
112
+ children: [
113
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogTitle, {
114
+ children: initialSilence?.id ? 'Edit Silence' : 'Create Silence'
115
+ }),
116
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.DialogContent, {
117
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
118
+ spacing: 2,
119
+ sx: {
120
+ mt: 1
121
+ },
122
+ children: [
123
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
124
+ variant: "subtitle2",
125
+ children: "Matchers"
126
+ }),
127
+ matchers.map((matcher, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_MatcherEditor.MatcherEditor, {
128
+ matcher: matcher,
129
+ onChange: (updated)=>handleMatcherChange(index, updated),
130
+ onRemove: ()=>handleRemoveMatcher(index)
131
+ }, index)),
132
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
133
+ startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
134
+ onClick: handleAddMatcher,
135
+ variant: "outlined",
136
+ size: "small",
137
+ children: "Add Matcher"
138
+ }),
139
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
140
+ direction: "row",
141
+ spacing: 2,
142
+ children: [
143
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
144
+ label: "Start",
145
+ type: "datetime-local",
146
+ value: startsAt,
147
+ onChange: (e)=>setStartsAt(e.target.value),
148
+ size: "small",
149
+ InputLabelProps: {
150
+ shrink: true
151
+ },
152
+ sx: {
153
+ flex: 1
154
+ }
155
+ }),
156
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
157
+ label: "End",
158
+ type: "datetime-local",
159
+ value: endsAt,
160
+ onChange: (e)=>setEndsAt(e.target.value),
161
+ size: "small",
162
+ InputLabelProps: {
163
+ shrink: true
164
+ },
165
+ sx: {
166
+ flex: 1
167
+ }
168
+ })
169
+ ]
170
+ }),
171
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
172
+ label: "Creator",
173
+ value: createdBy,
174
+ onChange: (e)=>setCreatedBy(e.target.value),
175
+ size: "small",
176
+ required: true
177
+ }),
178
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
179
+ label: "Comment",
180
+ value: comment,
181
+ onChange: (e)=>setComment(e.target.value),
182
+ size: "small",
183
+ multiline: true,
184
+ rows: 2
185
+ })
186
+ ]
187
+ })
188
+ }),
189
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.DialogActions, {
190
+ children: [
191
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
192
+ onClick: onClose,
193
+ children: "Cancel"
194
+ }),
195
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
196
+ onClick: handleSubmit,
197
+ variant: "contained",
198
+ disabled: !isValid,
199
+ children: initialSilence?.id ? 'Update' : 'Create'
200
+ })
201
+ ]
202
+ })
203
+ ]
204
+ });
205
+ }
@@ -0,0 +1,71 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "StatusBadge", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return StatusBadge;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const ALERT_STATUS_MAP = {
26
+ firing: {
27
+ label: 'Firing',
28
+ color: 'error'
29
+ },
30
+ suppressed: {
31
+ label: 'Silenced',
32
+ color: 'warning'
33
+ },
34
+ pending: {
35
+ label: 'Pending',
36
+ color: 'default'
37
+ },
38
+ resolved: {
39
+ label: 'Resolved',
40
+ color: 'success'
41
+ },
42
+ inactive: {
43
+ label: 'Inactive',
44
+ color: 'default'
45
+ }
46
+ };
47
+ const SILENCE_STATUS_MAP = {
48
+ active: {
49
+ label: 'Active',
50
+ color: 'success'
51
+ },
52
+ expired: {
53
+ label: 'Expired',
54
+ color: 'default'
55
+ },
56
+ pending: {
57
+ label: 'Pending',
58
+ color: 'warning'
59
+ }
60
+ };
61
+ function StatusBadge({ status, variant = 'alert' }) {
62
+ const statusMap = variant === 'silence' ? SILENCE_STATUS_MAP : ALERT_STATUS_MAP;
63
+ const config = statusMap[status];
64
+ const label = config?.label ?? status;
65
+ const color = config?.color ?? 'default';
66
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
67
+ label: label,
68
+ color: color,
69
+ size: "small"
70
+ });
71
+ }
@@ -0,0 +1,44 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
+ });
22
+ }
23
+ _export(exports, {
24
+ get LazyTextField () {
25
+ return _LazyTextField.LazyTextField;
26
+ },
27
+ get MatcherEditor () {
28
+ return _MatcherEditor.MatcherEditor;
29
+ },
30
+ get MatchersList () {
31
+ return _MatchersList.MatchersList;
32
+ },
33
+ get SilenceForm () {
34
+ return _SilenceForm.SilenceForm;
35
+ },
36
+ get StatusBadge () {
37
+ return _StatusBadge.StatusBadge;
38
+ }
39
+ });
40
+ const _StatusBadge = require("./StatusBadge");
41
+ const _MatchersList = require("./MatchersList");
42
+ const _MatcherEditor = require("./MatcherEditor");
43
+ const _SilenceForm = require("./SilenceForm");
44
+ const _LazyTextField = require("./LazyTextField");
@@ -0,0 +1,79 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "AlertManagerAlertsExplorer", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return AlertManagerAlertsExplorer;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = require("react");
25
+ const _material = require("@mui/material");
26
+ const _pluginsystem = require("@perses-dev/plugin-system");
27
+ const _dashboards = require("@perses-dev/dashboards");
28
+ const _explore = require("@perses-dev/explore");
29
+ const PANEL_PREVIEW_HEIGHT = 600;
30
+ function AlertManagerAlertsExplorer() {
31
+ const { data: { queries = [] }, setData } = (0, _explore.useExplorerManagerContext)();
32
+ const [queryDefinitions, setQueryDefinitions] = (0, _react.useState)(queries);
33
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
34
+ gap: 2,
35
+ sx: {
36
+ width: '100%'
37
+ },
38
+ children: [
39
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.MultiQueryEditor, {
40
+ queryTypes: [
41
+ 'AlertsQuery'
42
+ ],
43
+ onChange: (state)=>setQueryDefinitions(state),
44
+ queries: queryDefinitions,
45
+ onQueryRun: ()=>setData({
46
+ queries: queryDefinitions
47
+ })
48
+ }),
49
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
50
+ definitions: queries,
51
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
52
+ height: PANEL_PREVIEW_HEIGHT,
53
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.Panel, {
54
+ panelOptions: {
55
+ hideHeader: true
56
+ },
57
+ definition: {
58
+ kind: 'Panel',
59
+ spec: {
60
+ queries,
61
+ display: {
62
+ name: ''
63
+ },
64
+ plugin: {
65
+ kind: 'AlertTable',
66
+ spec: {
67
+ defaultGroupBy: [
68
+ 'alertname'
69
+ ]
70
+ }
71
+ }
72
+ }
73
+ }
74
+ })
75
+ })
76
+ })
77
+ ]
78
+ });
79
+ }
@@ -0,0 +1,153 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "AlertManagerSilencesExplorer", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return AlertManagerSilencesExplorer;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = require("react");
25
+ const _material = require("@mui/material");
26
+ const _BellOff = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/BellOff"));
27
+ const _pluginsystem = require("@perses-dev/plugin-system");
28
+ const _dashboards = require("@perses-dev/dashboards");
29
+ const _explore = require("@perses-dev/explore");
30
+ const _components = require("@perses-dev/components");
31
+ const _reactquery = require("@tanstack/react-query");
32
+ const _SilenceForm = require("../components/SilenceForm");
33
+ const _model = require("../model");
34
+ function _interop_require_default(obj) {
35
+ return obj && obj.__esModule ? obj : {
36
+ default: obj
37
+ };
38
+ }
39
+ const PANEL_PREVIEW_HEIGHT = 600;
40
+ function extractSelectorFromQueries(queries) {
41
+ const spec = queries[0]?.spec?.plugin?.spec;
42
+ if (spec && typeof spec === 'object' && 'datasource' in spec) {
43
+ const ds = spec.datasource;
44
+ if (ds && typeof ds === 'object' && 'kind' in ds) {
45
+ return ds;
46
+ }
47
+ }
48
+ return _model.DEFAULT_ALERTMANAGER;
49
+ }
50
+ function CreateSilenceButton({ queries }) {
51
+ const datasourceSelector = (0, _react.useMemo)(()=>extractSelectorFromQueries(queries), [
52
+ queries
53
+ ]);
54
+ const { data: amClient } = (0, _pluginsystem.useDatasourceClient)(datasourceSelector);
55
+ const queryClient = (0, _reactquery.useQueryClient)();
56
+ const { successSnackbar, exceptionSnackbar } = (0, _components.useSnackbar)();
57
+ const [open, setOpen] = (0, _react.useState)(false);
58
+ const formKeyRef = (0, _react.useRef)(0);
59
+ const handleOpen = (0, _react.useCallback)(()=>{
60
+ formKeyRef.current++;
61
+ setOpen(true);
62
+ }, []);
63
+ const handleSubmit = (0, _react.useCallback)(async (silence)=>{
64
+ if (!amClient) return;
65
+ try {
66
+ await amClient.createSilence(silence);
67
+ setOpen(false);
68
+ successSnackbar('Silence created successfully');
69
+ queryClient.invalidateQueries({
70
+ queryKey: [
71
+ 'query',
72
+ 'SilencesQuery'
73
+ ]
74
+ });
75
+ } catch (err) {
76
+ exceptionSnackbar(err);
77
+ }
78
+ }, [
79
+ amClient,
80
+ queryClient,
81
+ successSnackbar,
82
+ exceptionSnackbar
83
+ ]);
84
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
85
+ children: [
86
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
87
+ variant: "contained",
88
+ startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_BellOff.default, {}),
89
+ onClick: handleOpen,
90
+ size: "small",
91
+ children: "Create Silence"
92
+ }),
93
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_SilenceForm.SilenceForm, {
94
+ open: open,
95
+ onClose: ()=>setOpen(false),
96
+ onSubmit: handleSubmit
97
+ }, formKeyRef.current)
98
+ ]
99
+ });
100
+ }
101
+ function AlertManagerSilencesExplorer() {
102
+ const { data: { queries = [] }, setData } = (0, _explore.useExplorerManagerContext)();
103
+ const [queryDefinitions, setQueryDefinitions] = (0, _react.useState)(queries);
104
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
105
+ gap: 2,
106
+ sx: {
107
+ width: '100%'
108
+ },
109
+ children: [
110
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
111
+ direction: "row",
112
+ justifyContent: "flex-end",
113
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(CreateSilenceButton, {
114
+ queries: queries
115
+ })
116
+ }),
117
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.MultiQueryEditor, {
118
+ queryTypes: [
119
+ 'SilencesQuery'
120
+ ],
121
+ onChange: (state)=>setQueryDefinitions(state),
122
+ queries: queryDefinitions,
123
+ onQueryRun: ()=>setData({
124
+ queries: queryDefinitions
125
+ })
126
+ }),
127
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
128
+ definitions: queries,
129
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
130
+ height: PANEL_PREVIEW_HEIGHT,
131
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.Panel, {
132
+ panelOptions: {
133
+ hideHeader: true
134
+ },
135
+ definition: {
136
+ kind: 'Panel',
137
+ spec: {
138
+ queries,
139
+ display: {
140
+ name: ''
141
+ },
142
+ plugin: {
143
+ kind: 'SilenceTable',
144
+ spec: {}
145
+ }
146
+ }
147
+ }
148
+ })
149
+ })
150
+ })
151
+ ]
152
+ });
153
+ }
@@ -0,0 +1,39 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "getPluginModule", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return getPluginModule;
21
+ }
22
+ });
23
+ const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
24
+ function _interop_require_default(obj) {
25
+ return obj && obj.__esModule ? obj : {
26
+ default: obj
27
+ };
28
+ }
29
+ function getPluginModule() {
30
+ const { name, version, perses } = _packagejson.default;
31
+ return {
32
+ kind: 'PluginModule',
33
+ metadata: {
34
+ name,
35
+ version
36
+ },
37
+ spec: perses
38
+ };
39
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ function _getRequireWildcardCache(nodeInterop) {
3
+ if (typeof WeakMap !== "function") return null;
4
+ var cacheBabelInterop = new WeakMap();
5
+ var cacheNodeInterop = new WeakMap();
6
+ return (_getRequireWildcardCache = function(nodeInterop) {
7
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
8
+ })(nodeInterop);
9
+ }
10
+ function _interop_require_wildcard(obj, nodeInterop) {
11
+ if (!nodeInterop && obj && obj.__esModule) {
12
+ return obj;
13
+ }
14
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
15
+ return {
16
+ default: obj
17
+ };
18
+ }
19
+ var cache = _getRequireWildcardCache(nodeInterop);
20
+ if (cache && cache.has(obj)) {
21
+ return cache.get(obj);
22
+ }
23
+ var newObj = {
24
+ __proto__: null
25
+ };
26
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
27
+ for(var key in obj){
28
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
29
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
30
+ if (desc && (desc.get || desc.set)) {
31
+ Object.defineProperty(newObj, key, desc);
32
+ } else {
33
+ newObj[key] = obj[key];
34
+ }
35
+ }
36
+ }
37
+ newObj.default = obj;
38
+ if (cache) {
39
+ cache.set(obj, newObj);
40
+ }
41
+ return newObj;
42
+ }
43
+ // Copyright The Perses Authors
44
+ // Licensed under the Apache License, Version 2.0 (the "License");
45
+ // you may not use this file except in compliance with the License.
46
+ // You may obtain a copy of the License at
47
+ //
48
+ // http://www.apache.org/licenses/LICENSE-2.0
49
+ //
50
+ // Unless required by applicable law or agreed to in writing, software
51
+ // distributed under the License is distributed on an "AS IS" BASIS,
52
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+ // See the License for the specific language governing permissions and
54
+ // limitations under the License.
55
+ Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
@@ -0,0 +1,39 @@
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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "getPluginModule", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return _getPluginModule.getPluginModule;
21
+ }
22
+ });
23
+ const _getPluginModule = require("./getPluginModule");
24
+ _export_star(require("./model"), exports);
25
+ _export_star(require("./plugins"), exports);
26
+ _export_star(require("./components"), exports);
27
+ function _export_star(from, to) {
28
+ Object.keys(from).forEach(function(k) {
29
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
30
+ Object.defineProperty(to, k, {
31
+ enumerable: true,
32
+ get: function() {
33
+ return from[k];
34
+ }
35
+ });
36
+ }
37
+ });
38
+ return from;
39
+ }