@perses-dev/alert-manager-plugin 0.1.1 → 0.2.0-beta.2

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 (334) hide show
  1. package/__mf/js/AlertManager.42d95b33.js +7 -0
  2. package/__mf/js/async/1299.d5af4767.js +1 -0
  3. package/__mf/js/async/1522.04dc197d.js +22 -0
  4. package/__mf/js/async/1616.0c9baa4c.js +1 -0
  5. package/__mf/js/async/1871.5e21fb62.js +1 -0
  6. package/__mf/js/async/1969.e54f3991.js +1 -0
  7. package/__mf/js/async/2043.4e8f2371.js +2 -0
  8. package/__mf/js/async/{430.74d85c4b.js.LICENSE.txt → 2043.4e8f2371.js.LICENSE.txt} +1 -41
  9. package/__mf/js/async/2197.53bcb69e.js +1 -0
  10. package/__mf/js/async/2218.8b7e30c2.js +2 -0
  11. package/__mf/js/async/2317.e656eab3.js +2 -0
  12. package/__mf/js/async/2377.5295b064.js +1 -0
  13. package/__mf/js/async/2650.0b5955b5.js +3 -0
  14. package/__mf/js/async/2657.e6a11726.js +1 -0
  15. package/__mf/js/async/3222.6ad1b128.js +1 -0
  16. package/__mf/js/async/3514.e71d5cb9.js +2 -0
  17. package/__mf/js/async/3910.1bd28e15.js +1 -0
  18. package/__mf/js/async/392.26ae5cc4.js +2 -0
  19. package/__mf/js/async/3963.181d3782.js +1 -0
  20. package/__mf/js/async/4077.91abd1da.js +1 -0
  21. package/__mf/js/async/4121.f9595b70.js +2 -0
  22. package/__mf/js/async/4133.cc678ae9.js +28 -0
  23. package/__mf/js/async/4213.005a1a65.js +1 -0
  24. package/__mf/js/async/{4466.a8145edd.js → 4466.7cca717d.js} +3 -3
  25. package/__mf/js/async/4481.5bc5aa13.js +2 -0
  26. package/__mf/js/async/4496.3760da2f.js +1 -0
  27. package/__mf/js/async/4978.f1550309.js +1 -0
  28. package/__mf/js/async/5038.b1e9133a.js +2 -0
  29. package/__mf/js/async/5071.eeb1c9b1.js +1 -0
  30. package/__mf/js/async/5428.6922d4df.js +1 -0
  31. package/__mf/js/async/5759.84fc4d0b.js +7 -0
  32. package/__mf/js/async/{3540.96681482.js.LICENSE.txt → 5759.84fc4d0b.js.LICENSE.txt} +41 -1
  33. package/__mf/js/async/6274.9f68ee7d.js +2 -0
  34. package/__mf/js/async/6390.0fd40bd8.js +2 -0
  35. package/__mf/js/async/6401.7bf2c4c2.js +1 -0
  36. package/__mf/js/async/6594.b3a19fc1.js +2 -0
  37. package/__mf/js/async/6854.f05f8da0.js +1 -0
  38. package/__mf/js/async/6911.bc380f0c.js +37 -0
  39. package/__mf/js/async/7177.83345474.js +1 -0
  40. package/__mf/js/async/7192.715c4cb3.js +1 -0
  41. package/__mf/js/async/733.8bc3bc96.js +1 -0
  42. package/__mf/js/async/7862.10a19eef.js +2 -0
  43. package/__mf/js/async/7978.4ca49c3a.js +1 -0
  44. package/__mf/js/async/8470.7ebe8e66.js +2 -0
  45. package/__mf/js/async/8697.7b6d10e1.js +1 -0
  46. package/__mf/js/async/873.fcc6e5b7.js +1 -0
  47. package/__mf/js/async/8907.5d1f9505.js +1 -0
  48. package/__mf/js/async/{9040.94717f28.js → 9040.8de751d6.js} +4 -4
  49. package/__mf/js/async/9184.307e83da.js +1 -0
  50. package/__mf/js/async/9235.1b0d1de0.js +1 -0
  51. package/__mf/js/async/941.36858244.js +2 -0
  52. package/__mf/js/async/9588.31544c69.js +1 -0
  53. package/__mf/js/async/9836.e4cf02db.js +1 -0
  54. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js +2 -0
  55. package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.27d99dac.js +1 -0
  56. package/__mf/js/async/__federation_expose_AlertManagerDatasource.c2b36e70.js +2 -0
  57. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.65e1901a.js +2 -0
  58. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.f619a448.js +2 -0
  59. package/__mf/js/async/__federation_expose_AlertTable.6c37126b.js +1 -0
  60. package/__mf/js/async/__federation_expose_SilenceTable.3a614a2f.js +1 -0
  61. package/__mf/js/async/lib-router.20ba053c.js +2 -0
  62. package/__mf/js/{main.259f5b24.js → main.babca431.js} +2 -2
  63. package/lib/bootstrap.js +2 -2
  64. package/lib/components/ColumnsEditor.d.ts +1 -1
  65. package/lib/components/ColumnsEditor.d.ts.map +1 -1
  66. package/lib/components/ColumnsEditor.js +7 -7
  67. package/lib/components/ColumnsEditor.js.map +1 -1
  68. package/lib/components/LazyTextField.d.ts +1 -1
  69. package/lib/components/LazyTextField.d.ts.map +1 -1
  70. package/lib/components/LazyTextField.js +2 -2
  71. package/lib/components/LazyTextField.js.map +1 -1
  72. package/lib/components/MatcherEditor.d.ts +1 -1
  73. package/lib/components/MatcherEditor.d.ts.map +1 -1
  74. package/lib/components/MatcherEditor.js +4 -4
  75. package/lib/components/MatcherEditor.js.map +1 -1
  76. package/lib/components/MatchersList.d.ts +2 -2
  77. package/lib/components/MatchersList.d.ts.map +1 -1
  78. package/lib/components/MatchersList.js +1 -1
  79. package/lib/components/MatchersList.js.map +1 -1
  80. package/lib/components/SilenceForm.d.ts +2 -2
  81. package/lib/components/SilenceForm.d.ts.map +1 -1
  82. package/lib/components/SilenceForm.js +4 -4
  83. package/lib/components/SilenceForm.js.map +1 -1
  84. package/lib/components/StatusBadge.d.ts +1 -1
  85. package/lib/components/StatusBadge.d.ts.map +1 -1
  86. package/lib/components/StatusBadge.js +1 -1
  87. package/lib/components/StatusBadge.js.map +1 -1
  88. package/lib/components/index.js +5 -5
  89. package/lib/components/index.js.map +1 -1
  90. package/lib/explore/AlertManagerAlertsExplorer.d.ts +1 -1
  91. package/lib/explore/AlertManagerAlertsExplorer.d.ts.map +1 -1
  92. package/lib/explore/AlertManagerAlertsExplorer.js +5 -5
  93. package/lib/explore/AlertManagerAlertsExplorer.js.map +1 -1
  94. package/lib/explore/AlertManagerSilencesExplorer.d.ts +1 -1
  95. package/lib/explore/AlertManagerSilencesExplorer.d.ts.map +1 -1
  96. package/lib/explore/AlertManagerSilencesExplorer.js +10 -10
  97. package/lib/explore/AlertManagerSilencesExplorer.js.map +1 -1
  98. package/lib/getPluginModule.d.ts +1 -1
  99. package/lib/getPluginModule.d.ts.map +1 -1
  100. package/lib/getPluginModule.js +3 -1
  101. package/lib/getPluginModule.js.map +1 -1
  102. package/lib/index-federation.js +1 -1
  103. package/lib/index.js +4 -4
  104. package/lib/index.js.map +1 -1
  105. package/lib/model/alertmanager-client.d.ts +3 -3
  106. package/lib/model/alertmanager-client.d.ts.map +1 -1
  107. package/lib/model/alertmanager-client.js +4 -2
  108. package/lib/model/alertmanager-client.js.map +1 -1
  109. package/lib/model/alertmanager-selectors.d.ts +2 -2
  110. package/lib/model/alertmanager-selectors.d.ts.map +1 -1
  111. package/lib/model/alertmanager-selectors.js +1 -1
  112. package/lib/model/alertmanager-selectors.js.map +1 -1
  113. package/lib/model/index.js +3 -3
  114. package/lib/model/index.js.map +1 -1
  115. package/lib/plugins/AlertManagerDatasourceEditor.d.ts +2 -2
  116. package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -1
  117. package/lib/plugins/AlertManagerDatasourceEditor.js +1 -1
  118. package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -1
  119. package/lib/plugins/alert-table/AlertTable.d.ts +3 -3
  120. package/lib/plugins/alert-table/AlertTable.d.ts.map +1 -1
  121. package/lib/plugins/alert-table/AlertTable.js +5 -5
  122. package/lib/plugins/alert-table/AlertTable.js.map +1 -1
  123. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts +3 -3
  124. package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts.map +1 -1
  125. package/lib/plugins/alert-table/AlertTableColumnsEditor.js +4 -4
  126. package/lib/plugins/alert-table/AlertTableColumnsEditor.js.map +1 -1
  127. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts +3 -3
  128. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts.map +1 -1
  129. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js +4 -4
  130. package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js.map +1 -1
  131. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts +3 -3
  132. package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts.map +1 -1
  133. package/lib/plugins/alert-table/AlertTableLabelsEditor.js +6 -6
  134. package/lib/plugins/alert-table/AlertTableLabelsEditor.js.map +1 -1
  135. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts +3 -3
  136. package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts.map +1 -1
  137. package/lib/plugins/alert-table/AlertTableOptionsEditor.js +5 -5
  138. package/lib/plugins/alert-table/AlertTableOptionsEditor.js.map +1 -1
  139. package/lib/plugins/alert-table/AlertTablePanel.d.ts +4 -4
  140. package/lib/plugins/alert-table/AlertTablePanel.d.ts.map +1 -1
  141. package/lib/plugins/alert-table/AlertTablePanel.js +21 -21
  142. package/lib/plugins/alert-table/AlertTablePanel.js.map +1 -1
  143. package/lib/plugins/alert-table/alert-table-model.d.ts +1 -1
  144. package/lib/plugins/alert-table/alert-table-model.d.ts.map +1 -1
  145. package/lib/plugins/alert-table/alert-table-model.js +2 -2
  146. package/lib/plugins/alert-table/alert-table-model.js.map +1 -1
  147. package/lib/plugins/alert-table/alert-table-sorting.d.ts +2 -2
  148. package/lib/plugins/alert-table/alert-table-sorting.d.ts.map +1 -1
  149. package/lib/plugins/alert-table/alert-table-sorting.js +1 -1
  150. package/lib/plugins/alert-table/alert-table-sorting.js.map +1 -1
  151. package/lib/plugins/alert-table/label-colors.d.ts +1 -1
  152. package/lib/plugins/alert-table/label-colors.d.ts.map +1 -1
  153. package/lib/plugins/alert-table/label-colors.js.map +1 -1
  154. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts +2 -2
  155. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts.map +1 -1
  156. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +3 -3
  157. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js.map +1 -1
  158. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts +2 -2
  159. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts.map +1 -1
  160. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +7 -7
  161. package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js.map +1 -1
  162. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts +3 -3
  163. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts.map +1 -1
  164. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js +2 -2
  165. package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js.map +1 -1
  166. package/lib/plugins/alertmanager-datasource.d.ts +3 -3
  167. package/lib/plugins/alertmanager-datasource.d.ts.map +1 -1
  168. package/lib/plugins/alertmanager-datasource.js +2 -2
  169. package/lib/plugins/alertmanager-datasource.js.map +1 -1
  170. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts +2 -2
  171. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts.map +1 -1
  172. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +3 -3
  173. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js.map +1 -1
  174. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts +2 -2
  175. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts.map +1 -1
  176. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +7 -7
  177. package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js.map +1 -1
  178. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts +3 -3
  179. package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts.map +1 -1
  180. package/lib/plugins/alertmanager-silences-query/get-silences-data.js +2 -2
  181. package/lib/plugins/alertmanager-silences-query/get-silences-data.js.map +1 -1
  182. package/lib/plugins/index.js +16 -16
  183. package/lib/plugins/index.js.map +1 -1
  184. package/lib/plugins/silence-table/SilenceTable.d.ts +2 -2
  185. package/lib/plugins/silence-table/SilenceTable.d.ts.map +1 -1
  186. package/lib/plugins/silence-table/SilenceTable.js +3 -3
  187. package/lib/plugins/silence-table/SilenceTable.js.map +1 -1
  188. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts +3 -3
  189. package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts.map +1 -1
  190. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js +5 -5
  191. package/lib/plugins/silence-table/SilenceTableColumnsEditor.js.map +1 -1
  192. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts +3 -3
  193. package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts.map +1 -1
  194. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js +5 -5
  195. package/lib/plugins/silence-table/SilenceTableOptionsEditor.js.map +1 -1
  196. package/lib/plugins/silence-table/SilenceTablePanel.d.ts +4 -4
  197. package/lib/plugins/silence-table/SilenceTablePanel.d.ts.map +1 -1
  198. package/lib/plugins/silence-table/SilenceTablePanel.js +13 -13
  199. package/lib/plugins/silence-table/SilenceTablePanel.js.map +1 -1
  200. package/lib/plugins/silence-table/silence-table-model.d.ts +1 -1
  201. package/lib/plugins/silence-table/silence-table-model.d.ts.map +1 -1
  202. package/lib/plugins/silence-table/silence-table-model.js.map +1 -1
  203. package/lib/plugins/silence-table/silence-table-sorting.d.ts +2 -2
  204. package/lib/plugins/silence-table/silence-table-sorting.d.ts.map +1 -1
  205. package/lib/plugins/silence-table/silence-table-sorting.js +1 -1
  206. package/lib/plugins/silence-table/silence-table-sorting.js.map +1 -1
  207. package/lib/plugins/types.d.ts +3 -3
  208. package/lib/plugins/types.d.ts.map +1 -1
  209. package/lib/plugins/types.js.map +1 -1
  210. package/lib/setup-tests.d.ts +1 -1
  211. package/lib/setup-tests.d.ts.map +1 -1
  212. package/lib/setup-tests.js +2 -2
  213. package/lib/setup-tests.js.map +1 -1
  214. package/mf-manifest.json +302 -308
  215. package/mf-stats.json +308 -314
  216. package/package.json +12 -12
  217. package/__mf/js/AlertManager.377d377b.js +0 -7
  218. package/__mf/js/async/1616.24f00c9d.js +0 -1
  219. package/__mf/js/async/1728.8a326412.js +0 -1
  220. package/__mf/js/async/1871.23ff54b3.js +0 -1
  221. package/__mf/js/async/1969.a83b1b48.js +0 -1
  222. package/__mf/js/async/2218.7829c9d9.js +0 -2
  223. package/__mf/js/async/2377.f8875a4e.js +0 -1
  224. package/__mf/js/async/2657.fe8dd44f.js +0 -1
  225. package/__mf/js/async/2842.993baf22.js +0 -1
  226. package/__mf/js/async/3468.1679f87f.js +0 -1
  227. package/__mf/js/async/3540.96681482.js +0 -2
  228. package/__mf/js/async/392.7e11dd69.js +0 -2
  229. package/__mf/js/async/3963.fb6246d2.js +0 -1
  230. package/__mf/js/async/3981.84d12fdc.js +0 -4
  231. package/__mf/js/async/3981.84d12fdc.js.LICENSE.txt +0 -24
  232. package/__mf/js/async/4121.ec666be2.js +0 -2
  233. package/__mf/js/async/4133.e94df4f8.js +0 -28
  234. package/__mf/js/async/4213.a0c4f2eb.js +0 -1
  235. package/__mf/js/async/430.74d85c4b.js +0 -7
  236. package/__mf/js/async/4788.49ffeac3.js +0 -1
  237. package/__mf/js/async/5038.269393e3.js +0 -2
  238. package/__mf/js/async/5481.cf6703fd.js +0 -2
  239. package/__mf/js/async/5570.d4dd47e0.js +0 -1
  240. package/__mf/js/async/573.ce8ce2ef.js +0 -2
  241. package/__mf/js/async/6274.8c77cb1a.js +0 -2
  242. package/__mf/js/async/6390.3f6f279d.js +0 -2
  243. package/__mf/js/async/6401.1a59dbad.js +0 -1
  244. package/__mf/js/async/6594.b02adfd9.js +0 -2
  245. package/__mf/js/async/663.5445c7e0.js +0 -1
  246. package/__mf/js/async/6854.1d628838.js +0 -1
  247. package/__mf/js/async/7177.27c86137.js +0 -1
  248. package/__mf/js/async/7192.ede9860b.js +0 -1
  249. package/__mf/js/async/7283.8c1cb6ee.js +0 -2
  250. package/__mf/js/async/7984.163a6ddb.js +0 -22
  251. package/__mf/js/async/804.23da0d30.js +0 -37
  252. package/__mf/js/async/8470.2df0db71.js +0 -2
  253. package/__mf/js/async/8697.c13c6603.js +0 -1
  254. package/__mf/js/async/8711.c7dc09b8.js +0 -2
  255. package/__mf/js/async/8907.9e3edf43.js +0 -1
  256. package/__mf/js/async/9184.27a439a4.js +0 -1
  257. package/__mf/js/async/9235.00f9412f.js +0 -1
  258. package/__mf/js/async/941.d3bc6208.js +0 -2
  259. package/__mf/js/async/9537.36ff6f15.js +0 -1
  260. package/__mf/js/async/9634.3a366799.js +0 -1
  261. package/__mf/js/async/983.36857235.js +0 -1
  262. package/__mf/js/async/9836.cc839227.js +0 -1
  263. package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.47ee46dc.js +0 -2
  264. package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.22b0e5bc.js +0 -1
  265. package/__mf/js/async/__federation_expose_AlertManagerDatasource.7ee7440a.js +0 -2
  266. package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.35860f1b.js +0 -2
  267. package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.52a24c9e.js +0 -2
  268. package/__mf/js/async/__federation_expose_AlertTable.5d005bae.js +0 -1
  269. package/__mf/js/async/__federation_expose_SilenceTable.3fc487a4.js +0 -2
  270. package/__mf/js/async/__federation_expose_SilenceTable.3fc487a4.js.LICENSE.txt +0 -9
  271. package/__mf/js/async/lib-router.19f64904.js +0 -2
  272. package/lib/cjs/bootstrap.js +0 -26
  273. package/lib/cjs/components/ColumnsEditor.js +0 -271
  274. package/lib/cjs/components/LazyTextField.js +0 -50
  275. package/lib/cjs/components/MatcherEditor.js +0 -153
  276. package/lib/cjs/components/MatchersList.js +0 -46
  277. package/lib/cjs/components/SilenceForm.js +0 -205
  278. package/lib/cjs/components/StatusBadge.js +0 -71
  279. package/lib/cjs/components/index.js +0 -44
  280. package/lib/cjs/explore/AlertManagerAlertsExplorer.js +0 -79
  281. package/lib/cjs/explore/AlertManagerSilencesExplorer.js +0 -153
  282. package/lib/cjs/getPluginModule.js +0 -39
  283. package/lib/cjs/index-federation.js +0 -55
  284. package/lib/cjs/index.js +0 -39
  285. package/lib/cjs/model/alertmanager-client.js +0 -128
  286. package/lib/cjs/model/alertmanager-selectors.js +0 -66
  287. package/lib/cjs/model/api-types.js +0 -22
  288. package/lib/cjs/model/index.js +0 -32
  289. package/lib/cjs/plugins/AlertManagerDatasourceEditor.js +0 -71
  290. package/lib/cjs/plugins/alert-table/AlertTable.js +0 -56
  291. package/lib/cjs/plugins/alert-table/AlertTableColumnsEditor.js +0 -110
  292. package/lib/cjs/plugins/alert-table/AlertTableDeduplicationEditor.js +0 -138
  293. package/lib/cjs/plugins/alert-table/AlertTableLabelsEditor.js +0 -277
  294. package/lib/cjs/plugins/alert-table/AlertTableOptionsEditor.js +0 -128
  295. package/lib/cjs/plugins/alert-table/AlertTablePanel.js +0 -773
  296. package/lib/cjs/plugins/alert-table/alert-table-model.js +0 -142
  297. package/lib/cjs/plugins/alert-table/alert-table-sorting.js +0 -205
  298. package/lib/cjs/plugins/alert-table/label-colors.js +0 -170
  299. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +0 -51
  300. package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +0 -138
  301. package/lib/cjs/plugins/alertmanager-alerts-query/get-alerts-data.js +0 -124
  302. package/lib/cjs/plugins/alertmanager-datasource.js +0 -69
  303. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +0 -45
  304. package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +0 -78
  305. package/lib/cjs/plugins/alertmanager-silences-query/get-silences-data.js +0 -64
  306. package/lib/cjs/plugins/index.js +0 -74
  307. package/lib/cjs/plugins/silence-table/SilenceTable.js +0 -42
  308. package/lib/cjs/plugins/silence-table/SilenceTableColumnsEditor.js +0 -137
  309. package/lib/cjs/plugins/silence-table/SilenceTableOptionsEditor.js +0 -63
  310. package/lib/cjs/plugins/silence-table/SilenceTablePanel.js +0 -345
  311. package/lib/cjs/plugins/silence-table/silence-table-model.js +0 -116
  312. package/lib/cjs/plugins/silence-table/silence-table-sorting.js +0 -68
  313. package/lib/cjs/plugins/types.js +0 -16
  314. package/lib/cjs/setup-tests.js +0 -18
  315. /package/__mf/css/async/{430.85c2cbf6.css → 5759.85c2cbf6.css} +0 -0
  316. /package/__mf/js/async/{7984.163a6ddb.js.LICENSE.txt → 1522.04dc197d.js.LICENSE.txt} +0 -0
  317. /package/__mf/js/async/{2218.7829c9d9.js.LICENSE.txt → 2218.8b7e30c2.js.LICENSE.txt} +0 -0
  318. /package/__mf/js/async/{5038.269393e3.js.LICENSE.txt → 2317.e656eab3.js.LICENSE.txt} +0 -0
  319. /package/__mf/js/async/{6390.3f6f279d.js.LICENSE.txt → 3514.e71d5cb9.js.LICENSE.txt} +0 -0
  320. /package/__mf/js/async/{392.7e11dd69.js.LICENSE.txt → 392.26ae5cc4.js.LICENSE.txt} +0 -0
  321. /package/__mf/js/async/{4121.ec666be2.js.LICENSE.txt → 4121.f9595b70.js.LICENSE.txt} +0 -0
  322. /package/__mf/js/async/{6594.b02adfd9.js.LICENSE.txt → 5038.b1e9133a.js.LICENSE.txt} +0 -0
  323. /package/__mf/js/async/{6274.8c77cb1a.js.LICENSE.txt → 6274.9f68ee7d.js.LICENSE.txt} +0 -0
  324. /package/__mf/js/async/{7283.8c1cb6ee.js.LICENSE.txt → 6390.0fd40bd8.js.LICENSE.txt} +0 -0
  325. /package/__mf/js/async/{8711.c7dc09b8.js.LICENSE.txt → 6594.b3a19fc1.js.LICENSE.txt} +0 -0
  326. /package/__mf/js/async/{5481.cf6703fd.js.LICENSE.txt → 7862.10a19eef.js.LICENSE.txt} +0 -0
  327. /package/__mf/js/async/{8470.2df0db71.js.LICENSE.txt → 8470.7ebe8e66.js.LICENSE.txt} +0 -0
  328. /package/__mf/js/async/{9040.94717f28.js.LICENSE.txt → 9040.8de751d6.js.LICENSE.txt} +0 -0
  329. /package/__mf/js/async/{941.d3bc6208.js.LICENSE.txt → 941.36858244.js.LICENSE.txt} +0 -0
  330. /package/__mf/js/async/{__federation_expose_AlertManagerAlertsExplorer.47ee46dc.js.LICENSE.txt → __federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js.LICENSE.txt} +0 -0
  331. /package/__mf/js/async/{__federation_expose_AlertManagerDatasource.7ee7440a.js.LICENSE.txt → __federation_expose_AlertManagerDatasource.c2b36e70.js.LICENSE.txt} +0 -0
  332. /package/__mf/js/async/{__federation_expose_AlertManagerSilencesExplorer.35860f1b.js.LICENSE.txt → __federation_expose_AlertManagerSilencesExplorer.65e1901a.js.LICENSE.txt} +0 -0
  333. /package/__mf/js/async/{__federation_expose_AlertManagerSilencesQuery.52a24c9e.js.LICENSE.txt → __federation_expose_AlertManagerSilencesQuery.f619a448.js.LICENSE.txt} +0 -0
  334. /package/__mf/js/async/{lib-router.19f64904.js.LICENSE.txt → lib-router.20ba053c.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/explore/AlertManagerSilencesExplorer.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, useCallback, useMemo, useRef, useState } from 'react';\nimport { Box, Button, Stack } from '@mui/material';\nimport BellOffIcon from 'mdi-material-ui/BellOff';\nimport { DataQueriesProvider, MultiQueryEditor, useDatasourceClient } from '@perses-dev/plugin-system';\nimport { Panel } from '@perses-dev/dashboards';\nimport { useExplorerManagerContext } from '@perses-dev/explore';\nimport { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';\nimport { useSnackbar } from '@perses-dev/components';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { SilenceForm } from '../components/SilenceForm';\nimport { AlertManagerClient, DEFAULT_ALERTMANAGER, PostableSilence } from '../model';\n\ninterface SilencesExplorerQueryParams {\n queries?: QueryDefinition[];\n}\n\nconst PANEL_PREVIEW_HEIGHT = 600;\n\nfunction extractSelectorFromQueries(queries: QueryDefinition[]): DatasourceSelector {\n const spec: unknown = queries[0]?.spec?.plugin?.spec;\n if (spec && typeof spec === 'object' && 'datasource' in spec) {\n const ds = (spec as Record<string, unknown>).datasource;\n if (ds && typeof ds === 'object' && 'kind' in ds) {\n return ds as DatasourceSelector;\n }\n }\n return DEFAULT_ALERTMANAGER;\n}\n\nfunction CreateSilenceButton({ queries }: { queries: QueryDefinition[] }): ReactElement {\n const datasourceSelector = useMemo(() => extractSelectorFromQueries(queries), [queries]);\n const { data: amClient } = useDatasourceClient<AlertManagerClient>(datasourceSelector);\n const queryClient = useQueryClient();\n const { successSnackbar, exceptionSnackbar } = useSnackbar();\n\n const [open, setOpen] = useState(false);\n const formKeyRef = useRef(0);\n\n const handleOpen = useCallback(() => {\n formKeyRef.current++;\n setOpen(true);\n }, []);\n\n const handleSubmit = useCallback(\n async (silence: PostableSilence) => {\n if (!amClient) return;\n try {\n await amClient.createSilence(silence);\n setOpen(false);\n successSnackbar('Silence created successfully');\n queryClient.invalidateQueries({ queryKey: ['query', 'SilencesQuery'] });\n } catch (err) {\n exceptionSnackbar(err);\n }\n },\n [amClient, queryClient, successSnackbar, exceptionSnackbar]\n );\n\n return (\n <>\n <Button variant=\"contained\" startIcon={<BellOffIcon />} onClick={handleOpen} size=\"small\">\n Create Silence\n </Button>\n <SilenceForm key={formKeyRef.current} open={open} onClose={() => setOpen(false)} onSubmit={handleSubmit} />\n </>\n );\n}\n\nexport function AlertManagerSilencesExplorer(): ReactElement {\n const {\n data: { queries = [] },\n setData,\n } = useExplorerManagerContext<SilencesExplorerQueryParams>();\n\n const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <Stack direction=\"row\" justifyContent=\"flex-end\">\n <CreateSilenceButton queries={queries} />\n </Stack>\n <MultiQueryEditor\n queryTypes={['SilencesQuery']}\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: 'SilenceTable', spec: {} },\n },\n }}\n />\n </Box>\n </DataQueriesProvider>\n </Stack>\n );\n}\n"],"names":["useCallback","useMemo","useRef","useState","Box","Button","Stack","BellOffIcon","DataQueriesProvider","MultiQueryEditor","useDatasourceClient","Panel","useExplorerManagerContext","useSnackbar","useQueryClient","SilenceForm","DEFAULT_ALERTMANAGER","PANEL_PREVIEW_HEIGHT","extractSelectorFromQueries","queries","spec","plugin","ds","datasource","CreateSilenceButton","datasourceSelector","data","amClient","queryClient","successSnackbar","exceptionSnackbar","open","setOpen","formKeyRef","handleOpen","current","handleSubmit","silence","createSilence","invalidateQueries","queryKey","err","variant","startIcon","onClick","size","onClose","onSubmit","AlertManagerSilencesExplorer","setData","queryDefinitions","setQueryDefinitions","gap","sx","width","direction","justifyContent","queryTypes","onChange","state","onQueryRun","definitions","height","panelOptions","hideHeader","definition","kind","display","name"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE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/C,QAAQ;oCAAE6C,MAAM;oCAAgB9C,MAAM,CAAC;gCAAE;4BAC3C;wBACF;;;;;;AAMZ"}
1
+ {"version":3,"sources":["../../../src/explore/AlertManagerSilencesExplorer.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 { Box, Button, Stack } from '@mui/material';\nimport { useSnackbar } from '@perses-dev/components';\nimport { Panel } from '@perses-dev/dashboards';\nimport { useExplorerManagerContext } from '@perses-dev/explore';\nimport { DataQueriesProvider, MultiQueryEditor, useDatasourceClient } from '@perses-dev/plugin-system';\nimport type { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';\nimport { useQueryClient } from '@tanstack/react-query';\nimport BellOffIcon from 'mdi-material-ui/BellOff';\nimport type { ReactElement } from 'react';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { SilenceForm } from '../components/SilenceForm';\nimport type { AlertManagerClient, PostableSilence } from '../model';\nimport { DEFAULT_ALERTMANAGER } from '../model';\n\ninterface SilencesExplorerQueryParams {\n queries?: QueryDefinition[];\n}\n\nconst PANEL_PREVIEW_HEIGHT = 600;\n\nfunction extractSelectorFromQueries(queries: QueryDefinition[]): DatasourceSelector {\n const spec: unknown = queries[0]?.spec?.plugin?.spec;\n if (spec && typeof spec === 'object' && 'datasource' in spec) {\n const ds = (spec as Record<string, unknown>).datasource;\n if (ds && typeof ds === 'object' && 'kind' in ds) {\n return ds as DatasourceSelector;\n }\n }\n return DEFAULT_ALERTMANAGER;\n}\n\nfunction CreateSilenceButton({ queries }: { queries: QueryDefinition[] }): ReactElement {\n const datasourceSelector = useMemo(() => extractSelectorFromQueries(queries), [queries]);\n const { data: amClient } = useDatasourceClient<AlertManagerClient>(datasourceSelector);\n const queryClient = useQueryClient();\n const { successSnackbar, exceptionSnackbar } = useSnackbar();\n\n const [open, setOpen] = useState(false);\n const formKeyRef = useRef(0);\n\n const handleOpen = useCallback(() => {\n formKeyRef.current++;\n setOpen(true);\n }, []);\n\n const handleSubmit = useCallback(\n async (silence: PostableSilence) => {\n if (!amClient) return;\n try {\n await amClient.createSilence(silence);\n setOpen(false);\n successSnackbar('Silence created successfully');\n queryClient.invalidateQueries({ queryKey: ['query', 'SilencesQuery'] });\n } catch (err) {\n exceptionSnackbar(err);\n }\n },\n [amClient, queryClient, successSnackbar, exceptionSnackbar],\n );\n\n return (\n <>\n <Button variant=\"contained\" startIcon={<BellOffIcon />} onClick={handleOpen} size=\"small\">\n Create Silence\n </Button>\n <SilenceForm key={formKeyRef.current} open={open} onClose={() => setOpen(false)} onSubmit={handleSubmit} />\n </>\n );\n}\n\nexport function AlertManagerSilencesExplorer(): ReactElement {\n const {\n data: { queries = [] },\n setData,\n } = useExplorerManagerContext<SilencesExplorerQueryParams>();\n\n const [queryDefinitions, setQueryDefinitions] = useState<QueryDefinition[]>(queries);\n\n return (\n <Stack gap={2} sx={{ width: '100%' }}>\n <Stack direction=\"row\" justifyContent=\"flex-end\">\n <CreateSilenceButton queries={queries} />\n </Stack>\n <MultiQueryEditor\n queryTypes={['SilencesQuery']}\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: 'SilenceTable', spec: {} },\n },\n }}\n />\n </Box>\n </DataQueriesProvider>\n </Stack>\n );\n}\n"],"names":["Box","Button","Stack","useSnackbar","Panel","useExplorerManagerContext","DataQueriesProvider","MultiQueryEditor","useDatasourceClient","useQueryClient","BellOffIcon","useCallback","useMemo","useRef","useState","SilenceForm","DEFAULT_ALERTMANAGER","PANEL_PREVIEW_HEIGHT","extractSelectorFromQueries","queries","spec","plugin","ds","datasource","CreateSilenceButton","datasourceSelector","data","amClient","queryClient","successSnackbar","exceptionSnackbar","open","setOpen","formKeyRef","handleOpen","current","handleSubmit","silence","createSilence","invalidateQueries","queryKey","err","variant","startIcon","onClick","size","onClose","onSubmit","AlertManagerSilencesExplorer","setData","queryDefinitions","setQueryDefinitions","gap","sx","width","direction","justifyContent","queryTypes","onChange","state","onQueryRun","definitions","height","panelOptions","hideHeader","definition","kind","display","name"],"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,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gBAAgB;AACnD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,yBAAyB,QAAQ,sBAAsB;AAChE,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,4BAA4B;AAEvG,SAASC,cAAc,QAAQ,wBAAwB;AACvD,OAAOC,iBAAiB,0BAA0B;AAElD,SAASC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAE/D,SAASC,WAAW,QAAQ,+BAA4B;AAExD,SAASC,oBAAoB,QAAQ,oBAAW;AAMhD,MAAMC,uBAAuB;AAE7B,SAASC,2BAA2BC,OAA0B;IAC5D,MAAMC,OAAgBD,OAAO,CAAC,EAAE,EAAEC,MAAMC,QAAQD;IAChD,IAAIA,QAAQ,OAAOA,SAAS,YAAY,gBAAgBA,MAAM;QAC5D,MAAME,K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I;YAAEC,OAAO;QAAO;;0BACjC,KAACpD;gBAAMqD,WAAU;gBAAMC,gBAAe;0BACpC,cAAA,KAAChC;oBAAoBL,SAASA;;;0BAEhC,KAACZ;gBACCkD,YAAY;oBAAC;iBAAgB;gBAC7BC,UAAU,CAACC,QAAUR,oBAAoBQ;gBACzCxC,SAAS+B;gBACTU,YAAY,IAAMX,QAAQ;wBAAE9B,SAAS+B;oBAAiB;;0BAExD,KAAC5C;gBAAoBuD,aAAa1C;0BAChC,cAAA,KAACnB;oBAAI8D,QAAQ7C;8BACX,cAAA,KAACb;wBACC2D,cAAc;4BAAEC,YAAY;wBAAK;wBACjCC,YAAY;4BACVC,MAAM;4BACN9C,MAAM;gCACJD;gCACAgD,SAAS;oCAAEC,MAAM;gCAAG;gCACpB/C,QAAQ;oCAAE6C,MAAM;oCAAgB9C,MAAM,CAAC;gCAAE;4BAC3C;wBACF;;;;;;AAMZ"}
@@ -1,3 +1,3 @@
1
- import { PluginModuleResource } from '@perses-dev/plugin-system';
1
+ import type { PluginModuleResource } from '@perses-dev/plugin-system';
2
2
  export declare function getPluginModule(): PluginModuleResource;
3
3
  //# sourceMappingURL=getPluginModule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
1
+ {"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAIxF,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
@@ -10,7 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import packageJson from '../package.json';
13
+ import packageJson from "../package.json" with {
14
+ type: 'json'
15
+ };
14
16
  export function getPluginModule() {
15
17
  const { name, version, perses } = packageJson;
16
18
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getPluginModule.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\nimport { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"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,OAAOA,iBAAiB,kBAAkB;AAE1C,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
1
+ {"version":3,"sources":["../../src/getPluginModule.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\nimport type { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\n\nimport packageJson from '../package.json' with { type: 'json' };\n\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","type","getPluginModule","name","version","perses","kind","metadata","spec"],"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;AAIjC,OAAOA,iBAAiB,uBAAuB;IAAEC,MAAM;AAAO,EAAE;AAEhE,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGL;IAClC,OAAO;QACLM,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
@@ -10,6 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import('./bootstrap');
13
+ import("./bootstrap.js");
14
14
 
15
15
  //# sourceMappingURL=index-federation.js.map
package/lib/index.js CHANGED
@@ -10,9 +10,9 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { getPluginModule } from './getPluginModule';
14
- export * from './model';
15
- export * from './plugins';
16
- export * from './components';
13
+ export { getPluginModule } from "./getPluginModule.js";
14
+ export * from "./model/index.js";
15
+ export * from "./plugins/index.js";
16
+ export * from "./components/index.js";
17
17
 
18
18
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/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 { getPluginModule } from './getPluginModule';\nexport * from './model';\nexport * from './plugins';\nexport * from './components';\n"],"names":["getPluginModule"],"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,eAAe,QAAQ,oBAAoB;AACpD,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,eAAe"}
1
+ {"version":3,"sources":["../../src/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 { getPluginModule } from './getPluginModule';\nexport * from './model';\nexport * from './plugins';\nexport * from './components';\n"],"names":["getPluginModule"],"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,eAAe,QAAQ,uBAAoB;AACpD,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,wBAAe"}
@@ -1,6 +1,6 @@
1
- import { RequestHeaders } from '@perses-dev/client';
2
- import { DatasourceClient } from '@perses-dev/plugin-system';
3
- import { AlertManagerStatus, AlertsQueryParams, GettableAlert, GettableSilence, PostableSilence, SilencesQueryParams } from './api-types';
1
+ import type { RequestHeaders } from '@perses-dev/client';
2
+ import type { DatasourceClient } from '@perses-dev/plugin-system';
3
+ import type { AlertManagerStatus, AlertsQueryParams, GettableAlert, GettableSilence, PostableSilence, SilencesQueryParams } from './api-types';
4
4
  export interface AlertManagerQueryOptions {
5
5
  datasourceUrl: string;
6
6
  headers?: RequestHeaders;
@@ -1 +1 @@
1
- {"version":3,"file":"alertmanager-client.d.ts","sourceRoot":"","sources":["../../../src/model/alertmanager-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAS,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,OAAO,EAAE,wBAAwB,CAAC;IAClC,SAAS,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1F,WAAW,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,O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B,MAAM,CAAC,EAAE,mBAAmB,EAC5B,YAAY,CAAC,EAAE,wBAAwB,GACtC,OAAO,CAAC,eAAe,EAAE,CAAC,CAG5B;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC,CAEvG;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,wBAAwB,GACrC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAQhC;AAED,wBAAsB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CASrG;AAED,wBAAgB,SAAS,CAAC,YAAY,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE7F"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { fetch } from '@perses-dev/client';
13
+ import { fetch } from "@perses-dev/client";
14
14
  async function throwOnError(response) {
15
15
  if (!response.ok) {
16
16
  let message = response.statusText;
@@ -30,7 +30,9 @@ const executeRequest = async (...args)=>{
30
30
  return await response.json();
31
31
  } catch (e) {
32
32
  console.error('Invalid response from server', e);
33
- throw new Error('Invalid response from server');
33
+ throw new Error('Invalid response from server', {
34
+ cause: e
35
+ });
34
36
  }
35
37
  };
36
38
  function buildSearchParams(params) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/alertmanager-client.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\nimport { fetch, RequestHeaders } from '@perses-dev/client';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\nimport {\n AlertManagerStatus,\n AlertsQueryParams,\n GettableAlert,\n GettableSilence,\n PostableSilence,\n SilencesQueryParams,\n} from './api-types';\n\nexport interface AlertManagerQueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface AlertManagerClient extends DatasourceClient {\n options: AlertManagerQueryOptions;\n getAlerts(params?: AlertsQueryParams, headers?: RequestHeaders): Promise<GettableAlert[]>;\n getSilences(params?: SilencesQueryParams, headers?: RequestHeaders): Promise<GettableSilence[]>;\n getSilence(id: string, headers?: RequestHeaders): Promise<GettableSilence>;\n createSilence(silence: PostableSilence, headers?: RequestHeaders): Promise<{ silenceID: string }>;\n deleteSilence(id: string, headers?: RequestHeaders): Promise<void>;\n getStatus(headers?: RequestHeaders): Promise<AlertManagerStatus>;\n}\n\nasync function throwOnError(response: Response): Promise<void> {\n if (!response.ok) {\n let message = response.statusText;\n try {\n const body = await response.json();\n if (body?.message) message = body.message;\n } catch {\n // no JSON body\n }\n throw new Error(message);\n }\n}\n\nconst executeRequest = async <T>(...args: Parameters<typeof fetch>): Promise<T> => {\n const response = await fetch(...args);\n await throwOnError(response);\n try {\n return await response.json();\n } catch (e) {\n console.error('Invalid response from server', e);\n throw new Error('Invalid response from server');\n }\n};\n\nfunction buildSearchParams(params: Record<string, unknown> | object): URLSearchParams {\n const urlSearchParams = new URLSearchParams();\n Object.entries(params).forEach(([key, value]) => {\n if (value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => urlSearchParams.append(key, String(entry)));\n return;\n }\n urlSearchParams.append(key, String(value));\n });\n return urlSearchParams;\n}\n\nfunction fetchWithGet<TResponse>(\n apiURI: string,\n params: Record<string, unknown> | object,\n queryOptions: AlertManagerQueryOptions\n): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n const urlParams = buildSearchParams(params).toString();\n if (urlParams !== '') {\n url += `?${urlParams}`;\n }\n\n return executeRequest<TResponse>(url, {\n method: 'GET',\n headers,\n });\n}\n\nexport function getAlerts(\n params?: AlertsQueryParams,\n queryOptions?: AlertManagerQueryOptions\n): Promise<GettableAlert[]> {\n const opts = queryOptions ?? { datasourceUrl: '' };\n return fetchWithGet<GettableAlert[]>('/api/v2/alerts', params ?? {}, opts);\n}\n\nexport function getSilences(\n params?: SilencesQueryParams,\n queryOptions?: AlertManagerQueryOptions\n): Promise<GettableSilence[]> {\n const opts = queryOptions ?? { datasourceUrl: '' };\n return fetchWithGet<GettableSilence[]>('/api/v2/silences', params ?? {}, opts);\n}\n\nexport function getSilence(id: string, queryOptions: AlertManagerQueryOptions): Promise<GettableSilence> {\n return fetchWithGet<GettableSilence>(`/api/v2/silence/${encodeURIComponent(id)}`, {}, queryOptions);\n}\n\nexport function createSilence(\n silence: PostableSilence,\n queryOptions: AlertManagerQueryOptions\n): Promise<{ silenceID: string }> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n return executeRequest<{ silenceID: string }>(`${datasourceUrl}/api/v2/silences`, {\n method: 'POST',\n headers: { ...headers, 'Content-Type': 'application/json' },\n body: JSON.stringify(silence),\n });\n}\n\nexport async function deleteSilence(id: string, queryOptions: AlertManagerQueryOptions): Promise<void> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n const response = await fetch(`${datasourceUrl}/api/v2/silence/${encodeURIComponent(id)}`, {\n method: 'DELETE',\n headers,\n });\n\n await throwOnError(response);\n}\n\nexport function getStatus(queryOptions: AlertManagerQueryOptions): Promise<AlertManagerStatus> {\n return fetchWithGet<AlertManagerStatus>('/api/v2/status', {}, queryOptions);\n}\n"],"names":["fetch","throwOnError","response","ok","message","statusText","body","json","Error","executeRequest","args","e","console","error","buildSearchParams","params","urlSearchParams","URLSearchParams","Object","entries","forEach","key","value","undefined","Array","isArray","entry","append","String","fetchWithGet","apiURI","queryOptions","datasourceUrl","headers","url","urlParams","toString","method","getAlerts","opts","getSilences","getSilence","id","encodeURIComponent","createSilence","silence","JSON","stringify","deleteSilence","getStatus"],"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,KAAK,QAAwB,qBAAqB;AA0B3D,eAAeC,aAAaC,QAAkB;IAC5C,IAAI,CAACA,SAASC,EAAE,EAAE;QAChB,IAAIC,UAAUF,SAASG,UAAU;QACjC,IAAI;YACF,MAAMC,OAAO,MAAMJ,SAASK,IAAI;YAChC,IAAID,MAAMF,SAASA,UAAUE,KAAKF,OAAO;QAC3C,EAAE,OAAM;QACN,eAAe;QACjB;QACA,MAAM,IAAII,MAAMJ;IAClB;AACF;AAEA,MAAMK,iBAAiB,OAAU,GAAGC;IAClC,MAAMR,WAAW,MAAMF,SAASU;IAChC,MAAMT,aAAaC;IACnB,IAAI;QACF,OAAO,MAAMA,SAASK,IAAI;IAC5B,EAAE,OAAOI,GAAG;QACVC,QAAQC,KAAK,CAAC,gCAAgCF;QAC9C,MAAM,IAAIH,MAAM;IAClB;AACF;AAEA,SAASM,kBAAkBC,MAAwC;IACjE,MAAMC,kBAAkB,IAAIC;IAC5BC,OAAOC,OAAO,CAACJ,QAAQK,OAAO,CAAC,CAAC,CAACC,KAAKC,MAAM;QAC1C,IAAIA,UAAUC,WAAW;YACvB;QACF;QACA,IAAIC,MAAMC,OAAO,CAACH,QAAQ;YACxBA,MAAMF,OAAO,CAAC,CAACM,QAAUV,gBAAgBW,MAAM,CAACN,KAAKO,OAAOF;YAC5D;QACF;QACAV,gBAAgBW,MAAM,CAACN,KAAKO,OAAON;IACrC;IACA,OAAON;AACT;AAEA,SAASa,aACPC,MAAc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K,EAAE;QACxFL,QAAQ;QACRJ;IACF;IAEA,MAAMhC,aAAaC;AACrB;AAEA,OAAO,SAAS+C,UAAUlB,YAAsC;IAC9D,OAAOF,aAAiC,kBAAkB,CAAC,GAAGE;AAChE"}
1
+ {"version":3,"sources":["../../../src/model/alertmanager-client.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\nimport type { RequestHeaders } from '@perses-dev/client';\nimport { fetch } from '@perses-dev/client';\nimport type { DatasourceClient } from '@perses-dev/plugin-system';\n\nimport type {\n AlertManagerStatus,\n AlertsQueryParams,\n GettableAlert,\n GettableSilence,\n PostableSilence,\n SilencesQueryParams,\n} from './api-types';\n\nexport interface AlertManagerQueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface AlertManagerClient extends DatasourceClient {\n options: AlertManagerQueryOptions;\n getAlerts(params?: AlertsQueryParams, headers?: RequestHeaders): Promise<GettableAlert[]>;\n getSilences(params?: SilencesQueryParams, headers?: RequestHeaders): Promise<GettableSilence[]>;\n getSilence(id: string, headers?: RequestHeaders): Promise<GettableSilence>;\n createSilence(silence: PostableSilence, headers?: RequestHeaders): Promise<{ silenceID: string }>;\n deleteSilence(id: string, headers?: RequestHeaders): Promise<void>;\n getStatus(headers?: RequestHeaders): Promise<AlertManagerStatus>;\n}\n\nasync function throwOnError(response: Response): Promise<void> {\n if (!response.ok) {\n let message = response.statusText;\n try {\n const body = await response.json();\n if (body?.message) message = body.message;\n } catch {\n // no JSON body\n }\n throw new Error(message);\n }\n}\n\nconst executeRequest = async <T>(...args: Parameters<typeof fetch>): Promise<T> => {\n const response = await fetch(...args);\n await throwOnError(response);\n try {\n return await response.json();\n } catch (e) {\n console.error('Invalid response from server', e);\n throw new Error('Invalid response from server', { cause: e });\n }\n};\n\nfunction buildSearchParams(params: Record<string, unknown> | object): URLSearchParams {\n const urlSearchParams = new URLSearchParams();\n Object.entries(params).forEach(([key, value]) => {\n if (value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n value.forEach((entry) => urlSearchParams.append(key, String(entry)));\n return;\n }\n urlSearchParams.append(key, String(value));\n });\n return urlSearchParams;\n}\n\nfunction fetchWithGet<TResponse>(\n apiURI: string,\n params: Record<string, unknown> | object,\n queryOptions: AlertManagerQueryOptions,\n): Promise<TResponse> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n let url = `${datasourceUrl}${apiURI}`;\n const urlParams = buildSearchParams(params).toString();\n if (urlParams !== '') {\n url += `?${urlParams}`;\n }\n\n return executeRequest<TResponse>(url, {\n method: 'GET',\n headers,\n });\n}\n\nexport function getAlerts(\n params?: AlertsQueryParams,\n queryOptions?: AlertManagerQueryOptions,\n): Promise<GettableAlert[]> {\n const opts = queryOptions ?? { datasourceUrl: '' };\n return fetchWithGet<GettableAlert[]>('/api/v2/alerts', params ?? {}, opts);\n}\n\nexport function getSilences(\n params?: SilencesQueryParams,\n queryOptions?: AlertManagerQueryOptions,\n): Promise<GettableSilence[]> {\n const opts = queryOptions ?? { datasourceUrl: '' };\n return fetchWithGet<GettableSilence[]>('/api/v2/silences', params ?? {}, opts);\n}\n\nexport function getSilence(id: string, queryOptions: AlertManagerQueryOptions): Promise<GettableSilence> {\n return fetchWithGet<GettableSilence>(`/api/v2/silence/${encodeURIComponent(id)}`, {}, queryOptions);\n}\n\nexport function createSilence(\n silence: PostableSilence,\n queryOptions: AlertManagerQueryOptions,\n): Promise<{ silenceID: string }> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n return executeRequest<{ silenceID: string }>(`${datasourceUrl}/api/v2/silences`, {\n method: 'POST',\n headers: { ...headers, 'Content-Type': 'application/json' },\n body: JSON.stringify(silence),\n });\n}\n\nexport async function deleteSilence(id: string, queryOptions: AlertManagerQueryOptions): Promise<void> {\n const { datasourceUrl, headers = {} } = queryOptions;\n\n const response = await fetch(`${datasourceUrl}/api/v2/silence/${encodeURIComponent(id)}`, {\n method: 'DELETE',\n headers,\n });\n\n await throwOnError(response);\n}\n\nexport function getStatus(queryOptions: AlertManagerQueryOptions): Promise<AlertManagerStatus> {\n return fetchWithGet<AlertManagerStatus>('/api/v2/status', {}, queryOptions);\n}\n"],"names":["fetch","throwOnError","response","ok","message","statusText","body","json","Error","executeRequest","args","e","console","error","cause","buildSearchParams","params","urlSearchParams","URLSearchParams","Object","entries","forEach","key","value","undefined","Array","isArray","entry","append","String","fetchWithGet","apiURI","queryOptions","datasourceUrl","headers","url","urlParams","toString","method","getAlerts","opts","getSilences","getSilence","id","encodeURIComponent","createSilence","silence","JSON","stringify","deleteSilence","getStatus"],"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,KAAK,QAAQ,qBAAqB;AA2B3C,eAAeC,aAAaC,QAAkB;IAC5C,IAAI,CAACA,SAASC,EAAE,EAAE;QAChB,IAAIC,UAAUF,SAASG,UAAU;QACjC,IAAI;YACF,MAAMC,OAAO,MAAMJ,SAASK,IAAI;YAChC,IAAID,MAAMF,SAASA,UAAUE,KAAKF,OAAO;QAC3C,EAAE,OAAM;QACN,eAAe;QACjB;QACA,MAAM,IAAII,MAAMJ;IAClB;AACF;AAEA,MAAMK,iBAAiB,OAAU,GAAGC;IAClC,MAAMR,WAAW,MAAMF,SAASU;IAChC,MAAMT,aAAaC;IACnB,IAAI;QACF,OAAO,MAAMA,SAASK,IAAI;IAC5B,EAAE,OAAOI,GAAG;QACVC,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ACxF;AAEA,OAAO,SAASa,cACdC,OAAwB,EACxBd,YAAsC;IAEtC,MAAM,EAAEC,aAAa,EAAEC,UAAU,CAAC,CAAC,EAAE,GAAGF;IAExC,OAAOvB,eAAsC,GAAGwB,cAAc,gBAAgB,CAAC,EAAE;QAC/EK,QAAQ;QACRJ,SAAS;YAAE,GAAGA,OAAO;YAAE,gBAAgB;QAAmB;QAC1D5B,MAAMyC,KAAKC,SAAS,CAACF;IACvB;AACF;AAEA,OAAO,eAAeG,cAAcN,EAAU,EAAEX,YAAsC;IACpF,MAAM,EAAEC,aAAa,EAAEC,UAAU,CAAC,CAAC,EAAE,GAAGF;IAExC,MAAM9B,WAAW,MAAMF,MAAM,GAAGiC,cAAc,gBAAgB,EAAEW,mBAAmBD,KAAK,EAAE;QACxFL,QAAQ;QACRJ;IACF;IAEA,MAAMjC,aAAaC;AACrB;AAEA,OAAO,SAASgD,UAAUlB,YAAsC;IAC9D,OAAOF,aAAiC,kBAAkB,CAAC,GAAGE;AAChE"}
@@ -1,5 +1,5 @@
1
- import { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';
2
- import { DatasourceSelectValue } from '@perses-dev/plugin-system';
1
+ import type { DatasourceSelectValue } from '@perses-dev/plugin-system';
2
+ import type { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';
3
3
  export declare const ALERTMANAGER_DATASOURCE_KIND: "AlertManagerDatasource";
4
4
  export interface AlertManagerDatasourceSelector extends DatasourceSelector {
5
5
  kind: typeof ALERTMANAGER_DATASOURCE_KIND;
@@ -1 +1 @@
1
- {"version":3,"file":"alertmanager-selectors.d.ts","sourceRoot":"","sources":["../../../src/model/alertmanager-selectors.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAwB,MAAM,2BAA2B,CAAC;AAExF,eAAO,MAAM,4BAA4B,EAAG,wBAAiC,CAAC;AAE9E,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;IACxE,IAAI,EAAE,OAAO,4BAA4B,CAAC;CAC3C;AAED,eAAO,MAAM,oBAAoB,EAAE,8BAAuE,CAAC;AAE3G,wBAAgB,6BAA6B,CAAC,qBAAqB,EAAE,qBAAqB,GAAG,OAAO,CAEnG;AAED,wBAAgB,gCAAgC,CAC9C,qBAAqB,EAAE,qBAAqB,GAC3C,qBAAqB,IAAI,8BAA8B,CAEzD;AAED,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,eAAe,CAAA;CAAE,CAAC,GAAG,kBAAkB,CAelH"}
1
+ {"version":3,"file":"alertmanager-selectors.d.ts","sourceRoot":"","sources":["../../../src/model/alertmanager-selectors.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE5E,eAAO,MAAM,4BAA4B,EAAG,wBAAiC,CAAC;AAE9E,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;IACxE,IAAI,EAAE,OAAO,4BAA4B,CAAC;CAC3C;AAED,eAAO,MAAM,oBAAoB,EAAE,8BAAuE,CAAC;AAE3G,wBAAgB,6BAA6B,CAAC,qBAAqB,EAAE,qBAAqB,GAAG,OAAO,CAEnG;AAED,wBAAgB,gCAAgC,CAC9C,qBAAqB,EAAE,qBAAqB,GAC3C,qBAAqB,IAAI,8BAA8B,CAEzD;AAED,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,eAAe,CAAA;CAAE,CAAC,GAAG,kBAAkB,CAelH"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { isVariableDatasource } from '@perses-dev/plugin-system';
13
+ import { isVariableDatasource } from "@perses-dev/plugin-system";
14
14
  export const ALERTMANAGER_DATASOURCE_KIND = 'AlertManagerDatasource';
15
15
  export const DEFAULT_ALERTMANAGER = {
16
16
  kind: ALERTMANAGER_DATASOURCE_KIND
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/alertmanager-selectors.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\nimport { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';\nimport { DatasourceSelectValue, isVariableDatasource } from '@perses-dev/plugin-system';\n\nexport const ALERTMANAGER_DATASOURCE_KIND = 'AlertManagerDatasource' as const;\n\nexport interface AlertManagerDatasourceSelector extends DatasourceSelector {\n kind: typeof ALERTMANAGER_DATASOURCE_KIND;\n}\n\nexport const DEFAULT_ALERTMANAGER: AlertManagerDatasourceSelector = { kind: ALERTMANAGER_DATASOURCE_KIND };\n\nexport function isDefaultAlertManagerSelector(datasourceSelectValue: DatasourceSelectValue): boolean {\n return !isVariableDatasource(datasourceSelectValue) && datasourceSelectValue.name === undefined;\n}\n\nexport function isAlertManagerDatasourceSelector(\n datasourceSelectValue: DatasourceSelectValue\n): datasourceSelectValue is AlertManagerDatasourceSelector {\n return isVariableDatasource(datasourceSelectValue) || datasourceSelectValue.kind === ALERTMANAGER_DATASOURCE_KIND;\n}\n\nexport function extractDatasourceSelector(queryResults: Array<{ definition: QueryDefinition }>): DatasourceSelector {\n const defSpec: unknown = queryResults[0]?.definition?.spec;\n if (defSpec && typeof defSpec === 'object' && 'plugin' in defSpec) {\n const plugin = (defSpec as Record<string, unknown>).plugin;\n if (plugin && typeof plugin === 'object' && 'spec' in plugin) {\n const spec = (plugin as Record<string, unknown>).spec;\n if (spec && typeof spec === 'object' && 'datasource' in spec) {\n const ds = (spec as Record<string, unknown>).datasource;\n if (ds && typeof ds === 'object' && 'kind' in ds) {\n return ds as DatasourceSelector;\n }\n }\n }\n }\n return DEFAULT_ALERTMANAGER;\n}\n"],"names":["isVariableDatasource","ALERTMANAGER_DATASOURCE_KIND","DEFAULT_ALERTMANAGER","kind","isDefaultAlertManagerSelector","datasourceSelectValue","name","undefined","isAlertManagerDatasourceSelector","extractDatasourceSelector","queryResults","defSpec","definition","spec","plugin","ds","datasource"],"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,SAAgCA,oBAAoB,QAAQ,4BAA4B;AAExF,OAAO,MAAMC,+BAA+B,yBAAkC;AAM9E,OAAO,MAAMC,uBAAuD;IAAEC,MAAMF;AAA6B,EAAE;AAE3G,OAAO,SAASG,8BAA8BC,qBAA4C;IACxF,OAAO,CAACL,qBAAqBK,0BAA0BA,sBAAsBC,IAAI,KAAKC;AACxF;AAEA,OAAO,SAASC,iCACdH,qBAA4C;IAE5C,OAAOL,qBAAqBK,0BAA0BA,sBAAsBF,IAAI,KAAKF;AACvF;AAEA,OAAO,SAASQ,0BAA0BC,YAAoD;IAC5F,MAAMC,UAAmBD,YAAY,CAAC,EAAE,EAAEE,YAAYC;IACtD,IAAIF,WAAW,OAAOA,YAAY,YAAY,YAAYA,SAAS;QACjE,MAAMG,SAAS,AAACH,QAAoCG,MAAM;QAC1D,IAAIA,UAAU,OAAOA,WAAW,YAAY,UAAUA,QAAQ;YAC5D,MAAMD,OAAO,AAACC,OAAmCD,IAAI;YACrD,IAAIA,QAAQ,OAAOA,SAAS,YAAY,gBAAgBA,MAAM;gBAC5D,MAAME,KAAK,AAACF,KAAiCG,UAAU;gBACvD,IAAID,MAAM,OAAOA,OAAO,YAAY,UAAUA,IAAI;oBAChD,OAAOA;gBACT;YACF;QACF;IACF;IACA,OAAOb;AACT"}
1
+ {"version":3,"sources":["../../../src/model/alertmanager-selectors.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\nimport type { DatasourceSelectValue } from '@perses-dev/plugin-system';\nimport { isVariableDatasource } from '@perses-dev/plugin-system';\nimport type { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';\n\nexport const ALERTMANAGER_DATASOURCE_KIND = 'AlertManagerDatasource' as const;\n\nexport interface AlertManagerDatasourceSelector extends DatasourceSelector {\n kind: typeof ALERTMANAGER_DATASOURCE_KIND;\n}\n\nexport const DEFAULT_ALERTMANAGER: AlertManagerDatasourceSelector = { kind: ALERTMANAGER_DATASOURCE_KIND };\n\nexport function isDefaultAlertManagerSelector(datasourceSelectValue: DatasourceSelectValue): boolean {\n return !isVariableDatasource(datasourceSelectValue) && datasourceSelectValue.name === undefined;\n}\n\nexport function isAlertManagerDatasourceSelector(\n datasourceSelectValue: DatasourceSelectValue,\n): datasourceSelectValue is AlertManagerDatasourceSelector {\n return isVariableDatasource(datasourceSelectValue) || datasourceSelectValue.kind === ALERTMANAGER_DATASOURCE_KIND;\n}\n\nexport function extractDatasourceSelector(queryResults: Array<{ definition: QueryDefinition }>): DatasourceSelector {\n const defSpec: unknown = queryResults[0]?.definition?.spec;\n if (defSpec && typeof defSpec === 'object' && 'plugin' in defSpec) {\n const plugin = (defSpec as Record<string, unknown>).plugin;\n if (plugin && typeof plugin === 'object' && 'spec' in plugin) {\n const spec = (plugin as Record<string, unknown>).spec;\n if (spec && typeof spec === 'object' && 'datasource' in spec) {\n const ds = (spec as Record<string, unknown>).datasource;\n if (ds && typeof ds === 'object' && 'kind' in ds) {\n return ds as DatasourceSelector;\n }\n }\n }\n }\n return DEFAULT_ALERTMANAGER;\n}\n"],"names":["isVariableDatasource","ALERTMANAGER_DATASOURCE_KIND","DEFAULT_ALERTMANAGER","kind","isDefaultAlertManagerSelector","datasourceSelectValue","name","undefined","isAlertManagerDatasourceSelector","extractDatasourceSelector","queryResults","defSpec","definition","spec","plugin","ds","datasource"],"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,oBAAoB,QAAQ,4BAA4B;AAGjE,OAAO,MAAMC,+BAA+B,yBAAkC;AAM9E,OAAO,MAAMC,uBAAuD;IAAEC,MAAMF;AAA6B,EAAE;AAE3G,OAAO,SAASG,8BAA8BC,qBAA4C;IACxF,OAAO,CAACL,qBAAqBK,0BAA0BA,sBAAsBC,IAAI,KAAKC;AACxF;AAEA,OAAO,SAASC,iCACdH,qBAA4C;IAE5C,OAAOL,qBAAqBK,0BAA0BA,sBAAsBF,IAAI,KAAKF;AACvF;AAEA,OAAO,SAASQ,0BAA0BC,YAAoD;IAC5F,MAAMC,UAAmBD,YAAY,CAAC,EAAE,EAAEE,YAAYC;IACtD,IAAIF,WAAW,OAAOA,YAAY,YAAY,YAAYA,SAAS;QACjE,MAAMG,SAAS,AAACH,QAAoCG,MAAM;QAC1D,IAAIA,UAAU,OAAOA,WAAW,YAAY,UAAUA,QAAQ;YAC5D,MAAMD,OAAO,AAACC,OAAmCD,IAAI;YACrD,IAAIA,QAAQ,OAAOA,SAAS,YAAY,gBAAgBA,MAAM;gBAC5D,MAAME,KAAK,AAACF,KAAiCG,UAAU;gBACvD,IAAID,MAAM,OAAOA,OAAO,YAAY,UAAUA,IAAI;oBAChD,OAAOA;gBACT;YACF;QACF;IACF;IACA,OAAOb;AACT"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './api-types';
14
- export * from './alertmanager-client';
15
- export * from './alertmanager-selectors';
13
+ export * from "./api-types.js";
14
+ export * from "./alertmanager-client.js";
15
+ export * from "./alertmanager-selectors.js";
16
16
 
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/model/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 * from './api-types';\nexport * from './alertmanager-client';\nexport * from './alertmanager-selectors';\n"],"names":[],"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,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,2BAA2B"}
1
+ {"version":3,"sources":["../../../src/model/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 * from './api-types';\nexport * from './alertmanager-client';\nexport * from './alertmanager-selectors';\n"],"names":[],"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,cAAc,iBAAc;AAC5B,cAAc,2BAAwB;AACtC,cAAc,8BAA2B"}
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { AlertManagerDatasourceSpec } from './types';
1
+ import type { ReactElement } from 'react';
2
+ import type { AlertManagerDatasourceSpec } from './types';
3
3
  export interface AlertManagerDatasourceEditorProps {
4
4
  value: AlertManagerDatasourceSpec;
5
5
  onChange: (next: AlertManagerDatasourceSpec) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"AlertManagerDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/AlertManagerDatasourceEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,0BAA0B,CAAC;IAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,GAAG,YAAY,CAmDnG"}
1
+ {"version":3,"file":"AlertManagerDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/AlertManagerDatasourceEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,0BAA0B,CAAC;IAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,GAAG,YAAY,CAmDnG"}
@@ -11,7 +11,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
14
+ import { HTTPSettingsEditor } from "@perses-dev/plugin-system";
15
15
  export function AlertManagerDatasourceEditor(props) {
16
16
  const { value, onChange, isReadonly } = props;
17
17
  const initialSpecDirect = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/AlertManagerDatasourceEditor.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 { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { AlertManagerDatasourceSpec } from './types';\n\nexport interface AlertManagerDatasourceEditorProps {\n value: AlertManagerDatasourceSpec;\n onChange: (next: AlertManagerDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function AlertManagerDatasourceEditor(props: AlertManagerDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: AlertManagerDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: AlertManagerDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/api/v2/alerts',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silences',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silences',\n method: 'POST',\n },\n {\n endpointPattern: '/api/v2/silence/.*',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silence/.*',\n method: 'DELETE',\n },\n {\n endpointPattern: '/api/v2/status',\n method: 'GET',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","AlertManagerDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"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,kBAAkB,QAAQ,4BAA4B;AAU/D,OAAO,SAASC,6BAA6BC,KAAwC;IACnF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAAgD;QACpDC,WAAW;IACb;IAEA,MAAMC,mBAA+C;QACnDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
1
+ {"version":3,"sources":["../../../src/plugins/AlertManagerDatasourceEditor.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 { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\n\nimport type { AlertManagerDatasourceSpec } from './types';\n\nexport interface AlertManagerDatasourceEditorProps {\n value: AlertManagerDatasourceSpec;\n onChange: (next: AlertManagerDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function AlertManagerDatasourceEditor(props: AlertManagerDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: AlertManagerDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: AlertManagerDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/api/v2/alerts',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silences',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silences',\n method: 'POST',\n },\n {\n endpointPattern: '/api/v2/silence/.*',\n method: 'GET',\n },\n {\n endpointPattern: '/api/v2/silence/.*',\n method: 'DELETE',\n },\n {\n endpointPattern: '/api/v2/status',\n method: 'GET',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","AlertManagerDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"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,kBAAkB,QAAQ,4BAA4B;AAW/D,OAAO,SAASC,6BAA6BC,KAAwC;IACnF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAAgD;QACpDC,WAAW;IACb;IAEA,MAAMC,mBAA+C;QACnDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;oBACA;wBACED,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
@@ -1,6 +1,6 @@
1
- import { PanelPlugin } from '@perses-dev/plugin-system';
2
- import { AlertTablePanelProps } from './AlertTablePanel';
3
- import { AlertTableOptions } from './alert-table-model';
1
+ import type { PanelPlugin } from '@perses-dev/plugin-system';
2
+ import type { AlertTableOptions } from './alert-table-model';
3
+ import type { AlertTablePanelProps } from './AlertTablePanel';
4
4
  /**
5
5
  * Panel plugin for displaying Alert Manager alerts in a hierarchical table.
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AlertTable.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTable.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAKxD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,iBAAiB,EAAE,oBAAoB,CAY3E,CAAC"}
1
+ {"version":3,"file":"AlertTable.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTable.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,iBAAiB,EAAE,oBAAoB,CAY3E,CAAC"}
@@ -10,11 +10,11 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { AlertTableColumnsEditor } from './AlertTableColumnsEditor';
14
- import { AlertTableDeduplicationEditor } from './AlertTableDeduplicationEditor';
15
- import { AlertTableLabelsEditor } from './AlertTableLabelsEditor';
16
- import { AlertTableOptionsEditor } from './AlertTableOptionsEditor';
17
- import { AlertTablePanel } from './AlertTablePanel';
13
+ import { AlertTableColumnsEditor } from "./AlertTableColumnsEditor.js";
14
+ import { AlertTableDeduplicationEditor } from "./AlertTableDeduplicationEditor.js";
15
+ import { AlertTableLabelsEditor } from "./AlertTableLabelsEditor.js";
16
+ import { AlertTableOptionsEditor } from "./AlertTableOptionsEditor.js";
17
+ import { AlertTablePanel } from "./AlertTablePanel.js";
18
18
  /**
19
19
  * Panel plugin for displaying Alert Manager alerts in a hierarchical table.
20
20
  */ export const AlertTable = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/alert-table/AlertTable.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\nimport { PanelPlugin } from '@perses-dev/plugin-system';\nimport { AlertTableColumnsEditor } from './AlertTableColumnsEditor';\nimport { AlertTableDeduplicationEditor } from './AlertTableDeduplicationEditor';\nimport { AlertTableLabelsEditor } from './AlertTableLabelsEditor';\nimport { AlertTableOptionsEditor } from './AlertTableOptionsEditor';\nimport { AlertTablePanel, AlertTablePanelProps } from './AlertTablePanel';\nimport { AlertTableOptions } from './alert-table-model';\n\n/**\n * Panel plugin for displaying Alert Manager alerts in a hierarchical table.\n */\nexport const AlertTable: PanelPlugin<AlertTableOptions, AlertTablePanelProps> = {\n PanelComponent: AlertTablePanel,\n supportedQueryTypes: ['AlertsQuery'],\n panelOptionsEditorComponents: [\n { label: 'General', content: AlertTableOptionsEditor },\n { label: 'Columns', content: AlertTableColumnsEditor },\n { label: 'Labels', content: AlertTableLabelsEditor },\n { label: 'Deduplication', content: AlertTableDeduplicationEditor },\n ],\n createInitialOptions: () => ({\n defaultGroupBy: ['alertname'],\n }),\n};\n"],"names":["AlertTableColumnsEditor","AlertTableDeduplicationEditor","AlertTableLabelsEditor","AlertTableOptionsEditor","AlertTablePanel","AlertTable","PanelComponent","supportedQueryTypes","panelOptionsEditorComponents","label","content","createInitialOptions","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;AAGjC,SAASA,uBAAuB,QAAQ,4BAA4B;AACpE,SAASC,6BAA6B,QAAQ,kCAAkC;AAChF,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,uBAAuB,QAAQ,4BAA4B;AACpE,SAASC,eAAe,QAA8B,oBAAoB;AAG1E;;CAEC,GACD,OAAO,MAAMC,aAAmE;IAC9EC,gBAAgBF;IAChBG,qBAAqB;QAAC;KAAc;IACpCC,8BAA8B;QAC5B;YAAEC,OAAO;YAAWC,SAASP;QAAwB;QACrD;YAAEM,OAAO;YAAWC,SAASV;QAAwB;QACrD;YAAES,OAAO;YAAUC,SAASR;QAAuB;QACnD;YAAEO,OAAO;YAAiBC,SAAST;QAA8B;KAClE;IACDU,sBAAsB,IAAO,CAAA;YAC3BC,gBAAgB;gBAAC;aAAY;QAC/B,CAAA;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../src/plugins/alert-table/AlertTable.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\nimport type { PanelPlugin } from '@perses-dev/plugin-system';\n\nimport type { AlertTableOptions } from './alert-table-model';\nimport { AlertTableColumnsEditor } from './AlertTableColumnsEditor';\nimport { AlertTableDeduplicationEditor } from './AlertTableDeduplicationEditor';\nimport { AlertTableLabelsEditor } from './AlertTableLabelsEditor';\nimport { AlertTableOptionsEditor } from './AlertTableOptionsEditor';\nimport type { AlertTablePanelProps } from './AlertTablePanel';\nimport { AlertTablePanel } from './AlertTablePanel';\n\n/**\n * Panel plugin for displaying Alert Manager alerts in a hierarchical table.\n */\nexport const AlertTable: PanelPlugin<AlertTableOptions, AlertTablePanelProps> = {\n PanelComponent: AlertTablePanel,\n supportedQueryTypes: ['AlertsQuery'],\n panelOptionsEditorComponents: [\n { label: 'General', content: AlertTableOptionsEditor },\n { label: 'Columns', content: AlertTableColumnsEditor },\n { label: 'Labels', content: AlertTableLabelsEditor },\n { label: 'Deduplication', content: AlertTableDeduplicationEditor },\n ],\n createInitialOptions: () => ({\n defaultGroupBy: ['alertname'],\n }),\n};\n"],"names":["AlertTableColumnsEditor","AlertTableDeduplicationEditor","AlertTableLabelsEditor","AlertTableOptionsEditor","AlertTablePanel","AlertTable","PanelComponent","supportedQueryTypes","panelOptionsEditorComponents","label","content","createInitialOptions","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;AAKjC,SAASA,uBAAuB,QAAQ,+BAA4B;AACpE,SAASC,6BAA6B,QAAQ,qCAAkC;AAChF,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,uBAAuB,QAAQ,+BAA4B;AAEpE,SAASC,eAAe,QAAQ,uBAAoB;AAEpD;;CAEC,GACD,OAAO,MAAMC,aAAmE;IAC9EC,gBAAgBF;IAChBG,qBAAqB;QAAC;KAAc;IACpCC,8BAA8B;QAC5B;YAAEC,OAAO;YAAWC,SAASP;QAAwB;QACrD;YAAEM,OAAO;YAAWC,SAASV;QAAwB;QACrD;YAAES,OAAO;YAAUC,SAASR;QAAuB;QACnD;YAAEO,OAAO;YAAiBC,SAAST;QAA8B;KAClE;IACDU,sBAAsB,IAAO,CAAA;YAC3BC,gBAAgB;gBAAC;aAAY;QAC/B,CAAA;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { AlertTableOptions } from './alert-table-model';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { AlertTableOptions } from './alert-table-model';
4
4
  export declare function AlertTableColumnsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
5
5
  //# sourceMappingURL=AlertTableColumnsEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlertTableColumnsEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableColumnsEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAS1F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA6FlG"}
1
+ {"version":3,"file":"AlertTableColumnsEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableColumnsEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAS/F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA6FlG"}
@@ -11,10 +11,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { TextField } from '@mui/material';
15
- import { produce } from 'immer';
16
- import { useCallback } from 'react';
17
- import { ColumnsEditor } from '../../components/ColumnsEditor';
14
+ import { TextField } from "@mui/material";
15
+ import { produce } from "immer";
16
+ import { useCallback } from "react";
17
+ import { ColumnsEditor } from "../../components/ColumnsEditor.js";
18
18
  const SORT_MODE_LABELS = {
19
19
  alphabetical: 'Alphabetical',
20
20
  numeric: 'Numeric',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/alert-table/AlertTableColumnsEditor.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 { TextField } from '@mui/material';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { ReactElement, useCallback } from 'react';\nimport { ColumnsEditor } from '../../components/ColumnsEditor';\nimport { AlertTableOptions, ColumnDefinition, ColumnSortMode } from './alert-table-model';\n\nconst SORT_MODE_LABELS: Record<ColumnSortMode, string> = {\n alphabetical: 'Alphabetical',\n numeric: 'Numeric',\n severity: 'Severity (critical → other)',\n status: 'Status (firing → resolved)',\n};\n\nexport function AlertTableColumnsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement {\n const { value, onChange } = props;\n const columns = value.columns ?? [];\n\n const handleAddColumn = useCallback((): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.columns) draft.columns = [];\n draft.columns.push({ name: '' });\n })\n );\n }, [value, onChange]);\n\n const handleRemoveColumn = useCallback(\n (index: number): void => {\n onChange(\n produce(value, (draft) => {\n draft.columns?.splice(index, 1);\n })\n );\n },\n [value, onChange]\n );\n\n const handleUpdateColumn = useCallback(\n (index: number, updater: (draft: ColumnDefinition) => void): void => {\n onChange(\n produce(value, (draft) => {\n const column = draft.columns?.[index];\n if (column) {\n updater(column);\n }\n })\n );\n },\n [value, onChange]\n );\n\n const handleMoveUp = useCallback(\n (index: number): void => {\n if (index <= 0) return;\n onChange(\n produce(value, (draft) => {\n if (!draft.columns) return;\n const item = draft.columns.splice(index, 1)[0]!;\n draft.columns.splice(index - 1, 0, item);\n })\n );\n },\n [value, onChange]\n );\n\n const handleMoveDown = useCallback(\n (index: number): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.columns || index >= draft.columns.length - 1) return;\n const item = draft.columns.splice(index, 1)[0]!;\n draft.columns.splice(index + 1, 0, item);\n })\n );\n },\n [value, onChange]\n );\n\n return (\n <ColumnsEditor<ColumnDefinition>\n columns={columns}\n description=\"Status and Alert Name are always shown. Add extra columns below.\"\n sortModeLabels={SORT_MODE_LABELS}\n defaultSortMode=\"alphabetical\"\n getDisplayName={(col) => col.header || col.name || 'New column'}\n getHeaderPlaceholder={(col) => col.name || 'Column header'}\n onAdd={handleAddColumn}\n onRemove={handleRemoveColumn}\n onUpdate={handleUpdateColumn}\n onMoveUp={handleMoveUp}\n onMoveDown={handleMoveDown}\n renderNameField={(col, index, onUpdate) => (\n <TextField\n label=\"Label key\"\n value={col.name}\n onChange={(e) =>\n onUpdate(index, (draft) => {\n draft.name = e.target.value;\n })\n }\n size=\"small\"\n fullWidth\n />\n )}\n />\n );\n}\n"],"names":["TextField","produce","useCallback","ColumnsEditor","SORT_MODE_LABELS","alphabetical","numeric","severity","status","AlertTableColumnsEditor","props","value","onChange","columns","handleAddColumn","draft","push","name","handleRemoveColumn","index","splice","handleUpdateColumn","updater","column","handleMoveUp","item","handleMoveDown","length","description","sortModeLabels","defaultSortMode","getDisplayName","col","header","getHeaderPlaceholder","onAdd","onRemove","onUpdate","onMoveUp","onMoveDown","renderNameField","label","e","target","size","fullWidth"],"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,SAAS,QAAQ,gBAAgB;AAE1C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAAuBC,WAAW,QAAQ,QAAQ;AAClD,SAASC,aAAa,QAAQ,iCAAiC;AAG/D,MAAMC,mBAAmD;IACvDC,cAAc;IACdC,SAAS;IACTC,UAAU;IACVC,QAAQ;AACV;AAEA,OAAO,SAASC,wBAAwBC,KAA4C;IAClF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAC5B,MAAMG,UAAUF,MAAME,OAAO,IAAI,EAAE;IAEnC,MAAMC,kBAAkBZ,YAAY;QAClCU,SACEX,QAAQU,OAAO,CAACI;YACd,IAAI,CAACA,MAAMF,OAAO,EAAEE,MAAMF,OAAO,GAAG,EAAE;YACtCE,MAAMF,OAAO,CAACG,IAAI,CAAC;gBAAEC,MAAM;YAAG;QAChC;IAEJ,GAAG;QAACN;QAAOC;KAAS;IAEpB,MAAMM,qBAAqBhB,YACzB,CAACiB;QACCP,SACEX,QAAQU,OAAO,CAACI;YACdA,MAAMF,OAAO,EAAEO,OAAOD,OAAO;QAC/B;IAEJ,GACA;QAACR;QAAOC;KAAS;IAGnB,MAAMS,qBAAqBnB,YACzB,CAACiB,OAAeG;QACdV,SACEX,QAAQU,OAAO,CAACI;YACd,MAAMQ,SAASR,MAAMF,OAAO,EAAE,CAACM,MAAM;YACrC,IAAII,QAAQ;gBACVD,QAAQC;YACV;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or.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 { TextField } from '@mui/material';\nimport type { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\n\nimport { ColumnsEditor } from '../../components/ColumnsEditor';\nimport type { AlertTableOptions, ColumnDefinition, ColumnSortMode } from './alert-table-model';\n\nconst SORT_MODE_LABELS: Record<ColumnSortMode, string> = {\n alphabetical: 'Alphabetical',\n numeric: 'Numeric',\n severity: 'Severity (critical → other)',\n status: 'Status (firing → resolved)',\n};\n\nexport function AlertTableColumnsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement {\n const { value, onChange } = props;\n const columns = value.columns ?? [];\n\n const handleAddColumn = useCallback((): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.columns) draft.columns = [];\n draft.columns.push({ name: '' });\n }),\n );\n }, [value, onChange]);\n\n const handleRemoveColumn = useCallback(\n (index: number): void => {\n onChange(\n produce(value, (draft) => {\n draft.columns?.splice(index, 1);\n }),\n );\n },\n [value, onChange],\n );\n\n const handleUpdateColumn = useCallback(\n (index: number, updater: (draft: ColumnDefinition) => void): void => {\n onChange(\n produce(value, (draft) => {\n const column = draft.columns?.[index];\n if (column) {\n updater(column);\n }\n }),\n );\n },\n [value, onChange],\n );\n\n const handleMoveUp = useCallback(\n (index: number): void => {\n if (index <= 0) return;\n onChange(\n produce(value, (draft) => {\n if (!draft.columns) return;\n const item = draft.columns.splice(index, 1)[0]!;\n draft.columns.splice(index - 1, 0, item);\n }),\n );\n },\n [value, onChange],\n );\n\n const handleMoveDown = useCallback(\n (index: number): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.columns || index >= draft.columns.length - 1) return;\n const item = draft.columns.splice(index, 1)[0]!;\n draft.columns.splice(index + 1, 0, item);\n }),\n );\n },\n [value, onChange],\n );\n\n return (\n <ColumnsEditor<ColumnDefinition>\n columns={columns}\n description=\"Status and Alert Name are always shown. Add extra columns below.\"\n sortModeLabels={SORT_MODE_LABELS}\n defaultSortMode=\"alphabetical\"\n getDisplayName={(col) => col.header || col.name || 'New column'}\n getHeaderPlaceholder={(col) => col.name || 'Column header'}\n onAdd={handleAddColumn}\n onRemove={handleRemoveColumn}\n onUpdate={handleUpdateColumn}\n onMoveUp={handleMoveUp}\n onMoveDown={handleMoveDown}\n renderNameField={(col, index, onUpdate) => (\n <TextField\n label=\"Label key\"\n value={col.name}\n onChange={(e) =>\n onUpdate(index, (draft) => {\n draft.name = e.target.value;\n })\n }\n size=\"small\"\n fullWidth\n />\n )}\n />\n );\n}\n"],"names":["TextField","produce","useCallback","ColumnsEditor","SORT_MODE_LABELS","alphabetical","numeric","severity","status","AlertTableColumnsEditor","props","value","onChange","columns","handleAddColumn","draft","push","name","handleRemoveColumn","index","splice","handleUpdateColumn","updater","column","handleMoveUp","item","handleMoveDown","length","description","sortModeLabels","defaultSortMode","getDisplayName","col","header","getHeaderPlaceholder","onAdd","onRemove","onUpdate","onMoveUp","onMoveDown","renderNameField","label","e","target","size","fullWidth"],"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,SAAS,QAAQ,gBAAgB;AAE1C,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,WAAW,QAAQ,QAAQ;AAEpC,SAASC,aAAa,QAAQ,oCAAiC;AAG/D,MAA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zD,MAAMF,OAAOV,MAAMF,OAAO,CAACO,MAAM,CAACD,OAAO,EAAE,CAAC,EAAE;YAC9CJ,MAAMF,OAAO,CAACO,MAAM,CAACD,QAAQ,GAAG,GAAGM;QACrC;IAEJ,GACA;QAACd;QAAOC;KAAS;IAGnB,qBACE,KAACT;QACCU,SAASA;QACTe,aAAY;QACZC,gBAAgBzB;QAChB0B,iBAAgB;QAChBC,gBAAgB,CAACC,MAAQA,IAAIC,MAAM,IAAID,IAAIf,IAAI,IAAI;QACnDiB,sBAAsB,CAACF,MAAQA,IAAIf,IAAI,IAAI;QAC3CkB,OAAOrB;QACPsB,UAAUlB;QACVmB,UAAUhB;QACViB,UAAUd;QACVe,YAAYb;QACZc,iBAAiB,CAACR,KAAKb,OAAOkB,yBAC5B,KAACrC;gBACCyC,OAAM;gBACN9B,OAAOqB,IAAIf,IAAI;gBACfL,UAAU,CAAC8B,IACTL,SAASlB,OAAO,CAACJ;wBACfA,MAAME,IAAI,GAAGyB,EAAEC,MAAM,CAAChC,KAAK;oBAC7B;gBAEFiC,MAAK;gBACLC,SAAS;;;AAKnB"}
@@ -1,5 +1,5 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { AlertTableOptions } from './alert-table-model';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { AlertTableOptions } from './alert-table-model';
4
4
  export declare function AlertTableDeduplicationEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
5
5
  //# sourceMappingURL=AlertTableDeduplicationEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlertTableDeduplicationEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableDeduplicationEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAA+B,MAAM,OAAO,CAAC;AAClE,OAAO,EAA4B,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQlF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA+ExG"}
1
+ {"version":3,"file":"AlertTableDeduplicationEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableDeduplicationEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,OAAO,CAAC;AAG1D,OAAO,KAAK,EAA4B,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQvF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA+ExG"}
@@ -11,10 +11,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Autocomplete, Chip, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';
15
- import { OptionsEditorGroup } from '@perses-dev/components';
16
- import { produce } from 'immer';
17
- import { useCallback } from 'react';
14
+ import { Autocomplete, Chip, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from "@mui/material";
15
+ import { OptionsEditorGroup } from "@perses-dev/components";
16
+ import { produce } from "immer";
17
+ import { useCallback } from "react";
18
18
  const MODE_DESCRIPTIONS = {
19
19
  none: 'No deduplication. All alerts from all datasources are shown as-is.',
20
20
  fingerprint: 'Alerts with the same fingerprint from different datasources are merged. This is the default.',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/plugins/alert-table/AlertTableDeduplicationEditor.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 { Autocomplete, Chip, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';\nimport { OptionsEditorGroup } from '@perses-dev/components';\nimport { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { ReactElement, SyntheticEvent, useCallback } from 'react';\nimport { AlertDeduplicationConfig, AlertTableOptions } from './alert-table-model';\n\nconst MODE_DESCRIPTIONS: Record<AlertDeduplicationConfig['mode'], string> = {\n none: 'No deduplication. All alerts from all datasources are shown as-is.',\n fingerprint: 'Alerts with the same fingerprint from different datasources are merged. This is the default.',\n labels: 'Alerts are considered duplicates when all specified label values match.',\n};\n\nexport function AlertTableDeduplicationEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement {\n const { value, onChange } = props;\n const dedup = value.deduplication ?? { mode: 'fingerprint' as const };\n\n const handleModeChange = useCallback(\n (mode: AlertDeduplicationConfig['mode']): void => {\n onChange(\n produce(value, (draft) => {\n draft.deduplication = { mode };\n if (mode === 'labels') {\n draft.deduplication.labels = draft.deduplication.labels ?? [];\n }\n })\n );\n },\n [value, onChange]\n );\n\n const handleLabelsChange = useCallback(\n (_event: SyntheticEvent, newLabels: string[]): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.deduplication) {\n draft.deduplication = { mode: 'labels' };\n }\n draft.deduplication.labels = newLabels.length > 0 ? newLabels : undefined;\n })\n );\n },\n [value, onChange]\n );\n\n return (\n <>\n <OptionsEditorGroup title=\"Mode\">\n <FormControl size=\"small\" fullWidth>\n <InputLabel id=\"dedup-mode-label\">Deduplication Mode</InputLabel>\n <Select\n labelId=\"dedup-mode-label\"\n value={dedup.mode}\n label=\"Deduplication Mode\"\n onChange={(e) => handleModeChange(e.target.value as AlertDeduplicationConfig['mode'])}\n >\n <MenuItem value=\"none\">None</MenuItem>\n <MenuItem value=\"fingerprint\">Fingerprint</MenuItem>\n <MenuItem value=\"labels\">Labels</MenuItem>\n </Select>\n </FormControl>\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mt: 1 }}>\n {MODE_DESCRIPTIONS[dedup.mode]}\n </Typography>\n </OptionsEditorGroup>\n {dedup.mode === 'labels' && (\n <OptionsEditorGroup title=\"Deduplication Labels\">\n <Autocomplete<string, true, false, true>\n multiple\n freeSolo\n options={[] as string[]}\n value={dedup.labels ?? []}\n onChange={handleLabelsChange}\n renderTags={(tagValues, getTagProps): ReactElement[] =>\n tagValues.map((option, index) => {\n const { key, ...rest } = getTagProps({ index });\n return <Chip key={key} label={option} size=\"small\" variant=\"outlined\" {...rest} />;\n })\n }\n renderInput={(params) => (\n <TextField\n {...params}\n size=\"small\"\n placeholder=\"Type a label key and press Enter\"\n helperText=\"Alerts with identical values for all listed labels are considered duplicates.\"\n />\n )}\n />\n </OptionsEditorGroup>\n )}\n </>\n );\n}\n"],"names":["Autocomplete","Chip","FormControl","InputLabel","MenuItem","Select","TextField","Typography","OptionsEditorGroup","produce","useCallback","MODE_DESCRIPTIONS","none","fingerprint","labels","AlertTableDeduplicationEditor","props","value","onChange","dedup","deduplication","mode","handleModeChange","draft","handleLabelsChange","_event","newLabels","length","undefined","title","size","fullWidth","id","labelId","label","e","target","variant","color","sx","mt","multiple","freeSolo","options","renderTags","tagValues","getTagProps","map","option","index","key","rest","renderInput","params","placeholder","helperText"],"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,YAAY,EAAEC,IAAI,EAAEC,WAAW,EAAEC,UAAU,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kDACvB,KAACb;wCAASa,OAAM;kDAAc;;kDAC9B,KAACb;wCAASa,OAAM;kDAAS;;;;;;kCAG7B,KAACV;wBAAW8B,SAAQ;wBAAQC,OAAM;wBAAiBC,IAAI;4BAAEC,IAAI;wBAAE;kCAC5D7B,iBAAiB,CAACQ,MAAME,IAAI,CAAC;;;;YAGjCF,MAAME,IAAI,KAAK,0BACd,KAACb;gBAAmBqB,OAAM;0BACxB,cAAA,KAAC7B;oBACCyC,QAAQ;oBACRC,QAAQ;oBACRC,SAAS,EAAE;oBACX1B,OAAOE,MAAML,MAAM,IAAI,EAAE;oBACzBI,UAAUM;oBACVoB,YAAY,CAACC,WAAWC,cACtBD,UAAUE,GAAG,CAAC,CAACC,QAAQC;4BACrB,MAAM,EAAEC,GAAG,EAAE,GAAGC,MAAM,GAAGL,YAAY;gCAAEG;4BAAM;4BAC7C,qBAAO,KAAChD;gCAAeiC,OAAOc;gCAAQlB,MAAK;gCAAQO,SAAQ;gCAAY,GAAGc,IAAI;+BAA5DD;wBACpB;oBAEFE,aAAa,CAACC,uBACZ,KAAC/C;4BACE,GAAG+C,MAAM;4BACVvB,MAAK;4BACLwB,aAAY;4BACZC,YAAW;;;;;;AAQ3B"}
1
+ {"version":3,"sources":["../../../../src/plugins/alert-table/AlertTableDeduplicationEditor.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 { Autocomplete, Chip, FormControl, InputLabel, MenuItem, Select, TextField, Typography } from '@mui/material';\nimport { OptionsEditorGroup } from '@perses-dev/components';\nimport type { OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport type { ReactElement, SyntheticEvent } from 'react';\nimport { useCallback } from 'react';\n\nimport type { AlertDeduplicationConfig, AlertTableOptions } from './alert-table-model';\n\nconst MODE_DESCRIPTIONS: Record<AlertDeduplicationConfig['mode'], string> = {\n none: 'No deduplication. All alerts from all datasources are shown as-is.',\n fingerprint: 'Alerts with the same fingerprint from different datasources are merged. This is the default.',\n labels: 'Alerts are considered duplicates when all specified label values match.',\n};\n\nexport function AlertTableDeduplicationEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement {\n const { value, onChange } = props;\n const dedup = value.deduplication ?? { mode: 'fingerprint' as const };\n\n const handleModeChange = useCallback(\n (mode: AlertDeduplicationConfig['mode']): void => {\n onChange(\n produce(value, (draft) => {\n draft.deduplication = { mode };\n if (mode === 'labels') {\n draft.deduplication.labels = draft.deduplication.labels ?? [];\n }\n }),\n );\n },\n [value, onChange],\n );\n\n const handleLabelsChange = useCallback(\n (_event: SyntheticEvent, newLabels: string[]): void => {\n onChange(\n produce(value, (draft) => {\n if (!draft.deduplication) {\n draft.deduplication = { mode: 'labels' };\n }\n draft.deduplication.labels = newLabels.length > 0 ? newLabels : undefined;\n }),\n );\n },\n [value, onChange],\n );\n\n return (\n <>\n <OptionsEditorGroup title=\"Mode\">\n <FormControl size=\"small\" fullWidth>\n <InputLabel id=\"dedup-mode-label\">Deduplication Mode</InputLabel>\n <Select\n labelId=\"dedup-mode-label\"\n value={dedup.mode}\n label=\"Deduplication Mode\"\n onChange={(e) => handleModeChange(e.target.value as AlertDeduplicationConfig['mode'])}\n >\n <MenuItem value=\"none\">None</MenuItem>\n <MenuItem value=\"fingerprint\">Fingerprint</MenuItem>\n <MenuItem value=\"labels\">Labels</MenuItem>\n </Select>\n </FormControl>\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mt: 1 }}>\n {MODE_DESCRIPTIONS[dedup.mode]}\n </Typography>\n </OptionsEditorGroup>\n {dedup.mode === 'labels' && (\n <OptionsEditorGroup title=\"Deduplication Labels\">\n <Autocomplete<string, true, false, true>\n multiple\n freeSolo\n options={[] as string[]}\n value={dedup.labels ?? []}\n onChange={handleLabelsChange}\n renderTags={(tagValues, getTagProps): ReactElement[] =>\n tagValues.map((option, index) => {\n const { key, ...rest } = getTagProps({ index });\n return <Chip key={key} label={option} size=\"small\" variant=\"outlined\" {...rest} />;\n })\n }\n renderInput={(params) => (\n <TextField\n {...params}\n size=\"small\"\n placeholder=\"Type a label key and press Enter\"\n helperText=\"Alerts with identical values for all listed labels are considered duplicates.\"\n />\n )}\n />\n </OptionsEditorGroup>\n )}\n </>\n );\n}\n"],"names":["Autocomplete","Chip","FormControl","InputLabel","MenuItem","Select","TextField","Typography","OptionsEditorGroup","produce","useCallback","MODE_DESCRIPTIONS","none","fingerprint","labels","AlertTableDeduplicationEditor","props","value","onChange","dedup","deduplication","mode","handleModeChange","draft","handleLabelsChange","_event","newLabels","length","undefined","title","size","fullWidth","id","labelId","label","e","target","variant","color","sx","mt","multiple","freeSolo","options","renderTags","tagValues","getTagProps","map","option","index","key","rest","renderInput","params","placeholder","helperText"],"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,YAAY,EAAEC,IAAI,EAAEC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACrH,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,WAAW,QAAQ,QAAQ;AAIpC,MAAMC,oBAAsE;IAC1EC,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA,OAAO,SAASC,8BAA8BC,KAA4C;IACxF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAA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,SAAS,EAAE;oBACX1B,OAAOE,MAAML,MAAM,IAAI,EAAE;oBACzBI,UAAUM;oBACVoB,YAAY,CAACC,WAAWC,cACtBD,UAAUE,GAAG,CAAC,CAACC,QAAQC;4BACrB,MAAM,EAAEC,GAAG,EAAE,GAAGC,MAAM,GAAGL,YAAY;gCAAEG;4BAAM;4BAC7C,qBAAO,KAAChD;gCAAeiC,OAAOc;gCAAQlB,MAAK;gCAAQO,SAAQ;gCAAY,GAAGc,IAAI;+BAA5DD;wBACpB;oBAEFE,aAAa,CAACC,uBACZ,KAAC/C;4BACE,GAAG+C,MAAM;4BACVvB,MAAK;4BACLwB,aAAY;4BACZC,YAAW;;;;;;AAQ3B"}
@@ -1,5 +1,5 @@
1
- import { OptionsEditorProps } from '@perses-dev/plugin-system';
2
- import { ReactElement } from 'react';
3
- import { AlertTableOptions } from './alert-table-model';
1
+ import type { OptionsEditorProps } from '@perses-dev/plugin-system';
2
+ import type { ReactElement } from 'react';
3
+ import type { AlertTableOptions } from './alert-table-model';
4
4
  export declare function AlertTableLabelsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
5
5
  //# sourceMappingURL=AlertTableLabelsEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlertTableLabelsEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableLabelsEditor.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAyC,MAAM,qBAAqB,CAAC;AA2I/F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA+DjG"}
1
+ {"version":3,"file":"AlertTableLabelsEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/alert-table/AlertTableLabelsEditor.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,iBAAiB,EAAyC,MAAM,qBAAqB,CAAC;AA2IpG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CA+DjG"}
@@ -11,12 +11,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { Box, Button, Checkbox, Divider, FormControl, FormControlLabel, IconButton, InputLabel, MenuItem, Select, Stack, TextField, Typography } from '@mui/material';
15
- import { OptionsEditorGroup } from '@perses-dev/components';
16
- import { produce } from 'immer';
17
- import DeleteIcon from 'mdi-material-ui/Delete';
18
- import PlusIcon from 'mdi-material-ui/Plus';
19
- import { useCallback } from 'react';
14
+ import { Box, Button, Checkbox, Divider, FormControl, FormControlLabel, IconButton, InputLabel, MenuItem, Select, Stack, TextField, Typography } from "@mui/material";
15
+ import { OptionsEditorGroup } from "@perses-dev/components";
16
+ import { produce } from "immer";
17
+ import DeleteIcon from "mdi-material-ui/Delete";
18
+ import PlusIcon from "mdi-material-ui/Plus";
19
+ import { useCallback } from "react";
20
20
  const MODE_LABELS = {
21
21
  auto: 'Auto (hash-derived colors)',
22
22
  severity: 'Severity (built-in defaults)',