@perses-dev/alert-manager-plugin 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +41 -0
- package/__mf/css/async/430.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/AlertManager.3d597fc0.js +7 -0
- package/__mf/js/async/1616.24f00c9d.js +1 -0
- package/__mf/js/async/1728.a509c63a.js +1 -0
- package/__mf/js/async/1871.23ff54b3.js +1 -0
- package/__mf/js/async/1969.a83b1b48.js +1 -0
- package/__mf/js/async/2218.7829c9d9.js +2 -0
- package/__mf/js/async/2218.7829c9d9.js.LICENSE.txt +9 -0
- package/__mf/js/async/2377.f8875a4e.js +1 -0
- package/__mf/js/async/2657.fe8dd44f.js +1 -0
- package/__mf/js/async/2842.7f15ae1d.js +1 -0
- package/__mf/js/async/3468.1679f87f.js +1 -0
- package/__mf/js/async/3540.96681482.js +2 -0
- package/__mf/js/async/3540.96681482.js.LICENSE.txt +37 -0
- package/__mf/js/async/392.7e11dd69.js +2 -0
- package/__mf/js/async/392.7e11dd69.js.LICENSE.txt +8 -0
- package/__mf/js/async/3963.fb6246d2.js +1 -0
- package/__mf/js/async/4121.ec666be2.js +2 -0
- package/__mf/js/async/4121.ec666be2.js.LICENSE.txt +9 -0
- package/__mf/js/async/4133.e94df4f8.js +28 -0
- package/__mf/js/async/4213.a0c4f2eb.js +1 -0
- package/__mf/js/async/430.74d85c4b.js +7 -0
- package/__mf/js/async/430.74d85c4b.js.LICENSE.txt +64 -0
- package/__mf/js/async/4466.a8145edd.js +74 -0
- package/__mf/js/async/4788.49ffeac3.js +1 -0
- package/__mf/js/async/5038.269393e3.js +2 -0
- package/__mf/js/async/5038.269393e3.js.LICENSE.txt +9 -0
- package/__mf/js/async/5481.cf6703fd.js +2 -0
- package/__mf/js/async/5481.cf6703fd.js.LICENSE.txt +9 -0
- package/__mf/js/async/5570.d4dd47e0.js +1 -0
- package/__mf/js/async/573.ce8ce2ef.js +2 -0
- package/__mf/js/async/6274.8c77cb1a.js +2 -0
- package/__mf/js/async/6274.8c77cb1a.js.LICENSE.txt +8 -0
- package/__mf/js/async/6390.3f6f279d.js +2 -0
- package/__mf/js/async/6390.3f6f279d.js.LICENSE.txt +9 -0
- package/__mf/js/async/6401.1a59dbad.js +1 -0
- package/__mf/js/async/6594.b02adfd9.js +2 -0
- package/__mf/js/async/6594.b02adfd9.js.LICENSE.txt +9 -0
- package/__mf/js/async/663.5445c7e0.js +1 -0
- package/__mf/js/async/6854.1d628838.js +1 -0
- package/__mf/js/async/7177.27c86137.js +1 -0
- package/__mf/js/async/7192.ede9860b.js +1 -0
- package/__mf/js/async/7283.8c1cb6ee.js +2 -0
- package/__mf/js/async/7283.8c1cb6ee.js.LICENSE.txt +9 -0
- package/__mf/js/async/7984.1f786d95.js +22 -0
- package/__mf/js/async/7984.1f786d95.js.LICENSE.txt +19 -0
- package/__mf/js/async/804.23da0d30.js +37 -0
- package/__mf/js/async/8470.2df0db71.js +2 -0
- package/__mf/js/async/8470.2df0db71.js.LICENSE.txt +19 -0
- package/__mf/js/async/8697.c13c6603.js +1 -0
- package/__mf/js/async/8711.c7dc09b8.js +2 -0
- package/__mf/js/async/8711.c7dc09b8.js.LICENSE.txt +9 -0
- package/__mf/js/async/8907.9e3edf43.js +1 -0
- package/__mf/js/async/9040.94717f28.js +10 -0
- package/__mf/js/async/9040.94717f28.js.LICENSE.txt +17 -0
- package/__mf/js/async/9184.27a439a4.js +1 -0
- package/__mf/js/async/9235.00f9412f.js +1 -0
- package/__mf/js/async/941.d3bc6208.js +2 -0
- package/__mf/js/async/941.d3bc6208.js.LICENSE.txt +9 -0
- package/__mf/js/async/9537.36ff6f15.js +1 -0
- package/__mf/js/async/9634.3a366799.js +1 -0
- package/__mf/js/async/9741.199e8033.js +4 -0
- package/__mf/js/async/9741.199e8033.js.LICENSE.txt +24 -0
- package/__mf/js/async/983.77219d7b.js +1 -0
- package/__mf/js/async/9836.cc839227.js +1 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.a0623742.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.a0623742.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.aa08447d.js +1 -0
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.fe5b34fb.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.fe5b34fb.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.ff9617f8.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.ff9617f8.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.c9a49171.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.c9a49171.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertTable.cac7598a.js +1 -0
- package/__mf/js/async/__federation_expose_SilenceTable.50ee1f33.js +2 -0
- package/__mf/js/async/__federation_expose_SilenceTable.50ee1f33.js.LICENSE.txt +9 -0
- package/__mf/js/async/lib-router.19f64904.js +2 -0
- package/__mf/js/async/lib-router.19f64904.js.LICENSE.txt +32 -0
- package/__mf/js/main.1ce74432.js +7 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/ColumnsEditor.js +271 -0
- package/lib/cjs/components/LazyTextField.js +50 -0
- package/lib/cjs/components/MatcherEditor.js +153 -0
- package/lib/cjs/components/MatchersList.js +46 -0
- package/lib/cjs/components/SilenceForm.js +205 -0
- package/lib/cjs/components/StatusBadge.js +71 -0
- package/lib/cjs/components/index.js +44 -0
- package/lib/cjs/explore/AlertManagerAlertsExplorer.js +79 -0
- package/lib/cjs/explore/AlertManagerSilencesExplorer.js +153 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +39 -0
- package/lib/cjs/model/alertmanager-client.js +128 -0
- package/lib/cjs/model/alertmanager-selectors.js +66 -0
- package/lib/cjs/model/api-types.js +22 -0
- package/lib/cjs/model/index.js +32 -0
- package/lib/cjs/plugins/AlertManagerDatasourceEditor.js +71 -0
- package/lib/cjs/plugins/alert-table/AlertTable.js +56 -0
- package/lib/cjs/plugins/alert-table/AlertTableColumnsEditor.js +110 -0
- package/lib/cjs/plugins/alert-table/AlertTableDeduplicationEditor.js +138 -0
- package/lib/cjs/plugins/alert-table/AlertTableLabelsEditor.js +277 -0
- package/lib/cjs/plugins/alert-table/AlertTableOptionsEditor.js +128 -0
- package/lib/cjs/plugins/alert-table/AlertTablePanel.js +773 -0
- package/lib/cjs/plugins/alert-table/alert-table-model.js +142 -0
- package/lib/cjs/plugins/alert-table/alert-table-sorting.js +205 -0
- package/lib/cjs/plugins/alert-table/label-colors.js +170 -0
- package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +51 -0
- package/lib/cjs/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +138 -0
- package/lib/cjs/plugins/alertmanager-alerts-query/get-alerts-data.js +124 -0
- package/lib/cjs/plugins/alertmanager-datasource.js +69 -0
- package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +45 -0
- package/lib/cjs/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +78 -0
- package/lib/cjs/plugins/alertmanager-silences-query/get-silences-data.js +64 -0
- package/lib/cjs/plugins/index.js +74 -0
- package/lib/cjs/plugins/silence-table/SilenceTable.js +42 -0
- package/lib/cjs/plugins/silence-table/SilenceTableColumnsEditor.js +137 -0
- package/lib/cjs/plugins/silence-table/SilenceTableOptionsEditor.js +63 -0
- package/lib/cjs/plugins/silence-table/SilenceTablePanel.js +345 -0
- package/lib/cjs/plugins/silence-table/silence-table-model.js +116 -0
- package/lib/cjs/plugins/silence-table/silence-table-sorting.js +68 -0
- package/lib/cjs/plugins/types.js +16 -0
- package/lib/cjs/setup-tests.js +18 -0
- package/lib/components/ColumnsEditor.d.ts +25 -0
- package/lib/components/ColumnsEditor.d.ts.map +1 -0
- package/lib/components/ColumnsEditor.js +258 -0
- package/lib/components/ColumnsEditor.js.map +1 -0
- package/lib/components/LazyTextField.d.ts +12 -0
- package/lib/components/LazyTextField.d.ts.map +1 -0
- package/lib/components/LazyTextField.js +42 -0
- package/lib/components/LazyTextField.js.map +1 -0
- package/lib/components/MatcherEditor.d.ts +17 -0
- package/lib/components/MatcherEditor.d.ts.map +1 -0
- package/lib/components/MatcherEditor.js +142 -0
- package/lib/components/MatcherEditor.js.map +1 -0
- package/lib/components/MatchersList.d.ts +10 -0
- package/lib/components/MatchersList.d.ts.map +1 -0
- package/lib/components/MatchersList.js +40 -0
- package/lib/components/MatchersList.js.map +1 -0
- package/lib/components/SilenceForm.d.ts +13 -0
- package/lib/components/SilenceForm.d.ts.map +1 -0
- package/lib/components/SilenceForm.js +194 -0
- package/lib/components/SilenceForm.js.map +1 -0
- package/lib/components/StatusBadge.d.ts +10 -0
- package/lib/components/StatusBadge.d.ts.map +1 -0
- package/lib/components/StatusBadge.js +65 -0
- package/lib/components/StatusBadge.js.map +1 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +19 -0
- package/lib/components/index.js.map +1 -0
- package/lib/explore/AlertManagerAlertsExplorer.d.ts +3 -0
- package/lib/explore/AlertManagerAlertsExplorer.d.ts.map +1 -0
- package/lib/explore/AlertManagerAlertsExplorer.js +71 -0
- package/lib/explore/AlertManagerAlertsExplorer.js.map +1 -0
- package/lib/explore/AlertManagerSilencesExplorer.d.ts +3 -0
- package/lib/explore/AlertManagerSilencesExplorer.d.ts.map +1 -0
- package/lib/explore/AlertManagerSilencesExplorer.js +140 -0
- package/lib/explore/AlertManagerSilencesExplorer.js.map +1 -0
- package/lib/getPluginModule.d.ts +3 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +26 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/alertmanager-client.d.ts +27 -0
- package/lib/model/alertmanager-client.d.ts.map +1 -0
- package/lib/model/alertmanager-client.js +100 -0
- package/lib/model/alertmanager-client.js.map +1 -0
- package/lib/model/alertmanager-selectors.d.ts +13 -0
- package/lib/model/alertmanager-selectors.d.ts.map +1 -0
- package/lib/model/alertmanager-selectors.js +41 -0
- package/lib/model/alertmanager-selectors.js.map +1 -0
- package/lib/model/api-types.d.ts +120 -0
- package/lib/model/api-types.d.ts.map +1 -0
- package/lib/model/api-types.js +23 -0
- package/lib/model/api-types.js.map +1 -0
- package/lib/model/index.d.ts +4 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +17 -0
- package/lib/model/index.js.map +1 -0
- package/lib/plugins/AlertManagerDatasourceEditor.d.ts +9 -0
- package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -0
- package/lib/plugins/AlertManagerDatasourceEditor.js +63 -0
- package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -0
- package/lib/plugins/alert-table/AlertTable.d.ts +8 -0
- package/lib/plugins/alert-table/AlertTable.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTable.js +50 -0
- package/lib/plugins/alert-table/AlertTable.js.map +1 -0
- package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts +5 -0
- package/lib/plugins/alert-table/AlertTableColumnsEditor.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTableColumnsEditor.js +102 -0
- package/lib/plugins/alert-table/AlertTableColumnsEditor.js.map +1 -0
- package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts +5 -0
- package/lib/plugins/alert-table/AlertTableDeduplicationEditor.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js +130 -0
- package/lib/plugins/alert-table/AlertTableDeduplicationEditor.js.map +1 -0
- package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts +5 -0
- package/lib/plugins/alert-table/AlertTableLabelsEditor.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTableLabelsEditor.js +264 -0
- package/lib/plugins/alert-table/AlertTableLabelsEditor.js.map +1 -0
- package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts +5 -0
- package/lib/plugins/alert-table/AlertTableOptionsEditor.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTableOptionsEditor.js +120 -0
- package/lib/plugins/alert-table/AlertTableOptionsEditor.js.map +1 -0
- package/lib/plugins/alert-table/AlertTablePanel.d.ts +11 -0
- package/lib/plugins/alert-table/AlertTablePanel.d.ts.map +1 -0
- package/lib/plugins/alert-table/AlertTablePanel.js +763 -0
- package/lib/plugins/alert-table/AlertTablePanel.js.map +1 -0
- package/lib/plugins/alert-table/alert-table-model.d.ts +73 -0
- package/lib/plugins/alert-table/alert-table-model.d.ts.map +1 -0
- package/lib/plugins/alert-table/alert-table-model.js +127 -0
- package/lib/plugins/alert-table/alert-table-model.js.map +1 -0
- package/lib/plugins/alert-table/alert-table-sorting.d.ts +13 -0
- package/lib/plugins/alert-table/alert-table-sorting.d.ts.map +1 -0
- package/lib/plugins/alert-table/alert-table-sorting.js +180 -0
- package/lib/plugins/alert-table/alert-table-sorting.js.map +1 -0
- package/lib/plugins/alert-table/label-colors.d.ts +6 -0
- package/lib/plugins/alert-table/label-colors.d.ts.map +1 -0
- package/lib/plugins/alert-table/label-colors.js +148 -0
- package/lib/plugins/alert-table/label-colors.js.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts +4 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.d.ts.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js +43 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQuery.js.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts +9 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.d.ts.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js +130 -0
- package/lib/plugins/alertmanager-alerts-query/AlertManagerAlertsQueryEditor.js.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts +8 -0
- package/lib/plugins/alertmanager-alerts-query/get-alerts-data.d.ts.map +1 -0
- package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js +118 -0
- package/lib/plugins/alertmanager-alerts-query/get-alerts-data.js.map +1 -0
- package/lib/plugins/alertmanager-datasource.d.ts +5 -0
- package/lib/plugins/alertmanager-datasource.d.ts.map +1 -0
- package/lib/plugins/alertmanager-datasource.js +61 -0
- package/lib/plugins/alertmanager-datasource.js.map +1 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts +4 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.d.ts.map +1 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js +37 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQuery.js.map +1 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts +9 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.d.ts.map +1 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js +70 -0
- package/lib/plugins/alertmanager-silences-query/AlertManagerSilencesQueryEditor.js.map +1 -0
- package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts +8 -0
- package/lib/plugins/alertmanager-silences-query/get-silences-data.d.ts.map +1 -0
- package/lib/plugins/alertmanager-silences-query/get-silences-data.js +58 -0
- package/lib/plugins/alertmanager-silences-query/get-silences-data.js.map +1 -0
- package/lib/plugins/index.d.ts +19 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +30 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/silence-table/SilenceTable.d.ts +7 -0
- package/lib/plugins/silence-table/SilenceTable.d.ts.map +1 -0
- package/lib/plugins/silence-table/SilenceTable.js +36 -0
- package/lib/plugins/silence-table/SilenceTable.js.map +1 -0
- package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts +5 -0
- package/lib/plugins/silence-table/SilenceTableColumnsEditor.d.ts.map +1 -0
- package/lib/plugins/silence-table/SilenceTableColumnsEditor.js +129 -0
- package/lib/plugins/silence-table/SilenceTableColumnsEditor.js.map +1 -0
- package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts +5 -0
- package/lib/plugins/silence-table/SilenceTableOptionsEditor.d.ts.map +1 -0
- package/lib/plugins/silence-table/SilenceTableOptionsEditor.js +55 -0
- package/lib/plugins/silence-table/SilenceTableOptionsEditor.js.map +1 -0
- package/lib/plugins/silence-table/SilenceTablePanel.d.ts +11 -0
- package/lib/plugins/silence-table/SilenceTablePanel.d.ts.map +1 -0
- package/lib/plugins/silence-table/SilenceTablePanel.js +335 -0
- package/lib/plugins/silence-table/SilenceTablePanel.js.map +1 -0
- package/lib/plugins/silence-table/silence-table-model.d.ts +29 -0
- package/lib/plugins/silence-table/silence-table-model.d.ts.map +1 -0
- package/lib/plugins/silence-table/silence-table-model.js +90 -0
- package/lib/plugins/silence-table/silence-table-model.js.map +1 -0
- package/lib/plugins/silence-table/silence-table-sorting.d.ts +9 -0
- package/lib/plugins/silence-table/silence-table-sorting.d.ts.map +1 -0
- package/lib/plugins/silence-table/silence-table-sorting.js +60 -0
- package/lib/plugins/silence-table/silence-table-sorting.js.map +1 -0
- package/lib/plugins/types.d.ts +30 -0
- package/lib/plugins/types.d.ts.map +1 -0
- package/lib/plugins/types.js +17 -0
- package/lib/plugins/types.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +16 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +663 -0
- package/mf-stats.json +784 -0
- package/package.json +116 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { Box, Chip, FormControl, IconButton, InputAdornment, InputLabel, MenuItem, Select, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TableSortLabel, TextField, Tooltip, Typography } from '@mui/material';
|
|
15
|
+
import { useSnackbar } from '@perses-dev/components';
|
|
16
|
+
import { parseVariables, replaceVariablesInString, useAllVariableValues, useDatasourceClient } from '@perses-dev/plugin-system';
|
|
17
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
18
|
+
import BellOffIcon from 'mdi-material-ui/BellOff';
|
|
19
|
+
import BookOpenIcon from 'mdi-material-ui/BookOpen';
|
|
20
|
+
import ChevronDownIcon from 'mdi-material-ui/ChevronDown';
|
|
21
|
+
import ChevronRightIcon from 'mdi-material-ui/ChevronRight';
|
|
22
|
+
import MagnifyIcon from 'mdi-material-ui/Magnify';
|
|
23
|
+
import UnfoldLessHorizontalIcon from 'mdi-material-ui/UnfoldLessHorizontal';
|
|
24
|
+
import UnfoldMoreHorizontalIcon from 'mdi-material-ui/UnfoldMoreHorizontal';
|
|
25
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
26
|
+
import { SilenceForm } from '../../components/SilenceForm';
|
|
27
|
+
import { StatusBadge } from '../../components/StatusBadge';
|
|
28
|
+
import { extractDatasourceSelector } from '../../model';
|
|
29
|
+
import { ALL_ALERT_ACTIONS, deduplicateAlerts, extractLabelKeys, getGroupKey, getGroupSummary } from './alert-table-model';
|
|
30
|
+
import { compareAlertsByColumn, compareGroupsByColumn, SORT_COL_ALERTNAME, SORT_COL_STATUS } from './alert-table-sorting';
|
|
31
|
+
import { getLabelColor } from './label-colors';
|
|
32
|
+
function GroupSummaryChips({ summary }) {
|
|
33
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
34
|
+
direction: "row",
|
|
35
|
+
spacing: 0.5,
|
|
36
|
+
children: [
|
|
37
|
+
summary.firing > 0 && /*#__PURE__*/ _jsx(Chip, {
|
|
38
|
+
label: `${summary.firing} firing`,
|
|
39
|
+
color: "error",
|
|
40
|
+
size: "small"
|
|
41
|
+
}),
|
|
42
|
+
summary.suppressed > 0 && /*#__PURE__*/ _jsx(Chip, {
|
|
43
|
+
label: `${summary.suppressed} silenced`,
|
|
44
|
+
color: "warning",
|
|
45
|
+
size: "small"
|
|
46
|
+
}),
|
|
47
|
+
summary.pending > 0 && /*#__PURE__*/ _jsx(Chip, {
|
|
48
|
+
label: `${summary.pending} pending`,
|
|
49
|
+
color: "default",
|
|
50
|
+
size: "small"
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function LabelValueSummaryChips({ summary, mapping }) {
|
|
56
|
+
const counts = summary.labelCounts?.[mapping.labelKey];
|
|
57
|
+
if (!counts || Object.keys(counts).length === 0) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return /*#__PURE__*/ _jsx(Stack, {
|
|
61
|
+
direction: "row",
|
|
62
|
+
spacing: 0.5,
|
|
63
|
+
children: Object.entries(counts).sort(([, a], [, b])=>b - a).map(([value, count])=>{
|
|
64
|
+
const bgColor = getLabelColor(value, mapping);
|
|
65
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
66
|
+
label: `${count} ${value}`,
|
|
67
|
+
size: "small",
|
|
68
|
+
sx: {
|
|
69
|
+
backgroundColor: bgColor,
|
|
70
|
+
color: '#fff',
|
|
71
|
+
fontWeight: 500
|
|
72
|
+
}
|
|
73
|
+
}, value);
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function AlertRow({ alert, allowedActions, columnDefs, columnKeySet, mappingsByKey, runbookAnnotationKey, onSilence, duplicateCount, showDuplicates }) {
|
|
78
|
+
const runbookUrl = alert.annotations?.[runbookAnnotationKey];
|
|
79
|
+
const showActions = allowedActions.length > 0;
|
|
80
|
+
return /*#__PURE__*/ _jsxs(TableRow, {
|
|
81
|
+
hover: true,
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
84
|
+
children: /*#__PURE__*/ _jsx(StatusBadge, {
|
|
85
|
+
status: alert.suppressed ? 'suppressed' : alert.state,
|
|
86
|
+
variant: "alert"
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
90
|
+
children: alert.name
|
|
91
|
+
}),
|
|
92
|
+
columnDefs.map((col, colIdx)=>{
|
|
93
|
+
const value = alert.labels[col.name];
|
|
94
|
+
const mapping = mappingsByKey.get(col.name);
|
|
95
|
+
if (value !== undefined && mapping) {
|
|
96
|
+
const bgColor = getLabelColor(value, mapping);
|
|
97
|
+
return /*#__PURE__*/ _jsx(TableCell, {
|
|
98
|
+
children: /*#__PURE__*/ _jsx(Chip, {
|
|
99
|
+
label: value,
|
|
100
|
+
size: "small",
|
|
101
|
+
sx: {
|
|
102
|
+
backgroundColor: bgColor,
|
|
103
|
+
color: '#fff',
|
|
104
|
+
fontWeight: 500
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
}, colIdx);
|
|
108
|
+
}
|
|
109
|
+
return /*#__PURE__*/ _jsx(TableCell, {
|
|
110
|
+
children: value ?? ''
|
|
111
|
+
}, colIdx);
|
|
112
|
+
}),
|
|
113
|
+
showDuplicates && /*#__PURE__*/ _jsx(TableCell, {
|
|
114
|
+
children: duplicateCount !== undefined && /*#__PURE__*/ _jsx(Chip, {
|
|
115
|
+
label: `${duplicateCount}`,
|
|
116
|
+
size: "small",
|
|
117
|
+
variant: "outlined",
|
|
118
|
+
color: "info"
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
122
|
+
children: /*#__PURE__*/ _jsx(Stack, {
|
|
123
|
+
direction: "row",
|
|
124
|
+
spacing: 0.5,
|
|
125
|
+
flexWrap: "wrap",
|
|
126
|
+
useFlexGap: true,
|
|
127
|
+
children: Object.entries(alert.labels).filter(([key])=>key !== 'alertname' && !columnKeySet.has(key)).map(([key, value])=>{
|
|
128
|
+
const mapping = mappingsByKey.get(key);
|
|
129
|
+
if (mapping) {
|
|
130
|
+
const bgColor = getLabelColor(value, mapping);
|
|
131
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
132
|
+
label: `${key}=${value}`,
|
|
133
|
+
size: "small",
|
|
134
|
+
sx: {
|
|
135
|
+
backgroundColor: bgColor,
|
|
136
|
+
color: '#fff',
|
|
137
|
+
fontWeight: 500
|
|
138
|
+
}
|
|
139
|
+
}, key);
|
|
140
|
+
}
|
|
141
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
142
|
+
label: `${key}=${value}`,
|
|
143
|
+
size: "small",
|
|
144
|
+
variant: "outlined"
|
|
145
|
+
}, key);
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
}),
|
|
149
|
+
showActions && /*#__PURE__*/ _jsx(TableCell, {
|
|
150
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
151
|
+
direction: "row",
|
|
152
|
+
spacing: 0.5,
|
|
153
|
+
children: [
|
|
154
|
+
allowedActions.includes('silence') && !alert.suppressed && /*#__PURE__*/ _jsx(Tooltip, {
|
|
155
|
+
title: "Silence this alert",
|
|
156
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
157
|
+
size: "small",
|
|
158
|
+
"aria-label": "Silence alert",
|
|
159
|
+
onClick: ()=>onSilence(alert),
|
|
160
|
+
children: /*#__PURE__*/ _jsx(BellOffIcon, {
|
|
161
|
+
fontSize: "small"
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
}),
|
|
165
|
+
allowedActions.includes('runbook') && runbookUrl && /*#__PURE__*/ _jsx(Tooltip, {
|
|
166
|
+
title: "View runbook",
|
|
167
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
168
|
+
size: "small",
|
|
169
|
+
"aria-label": "View runbook",
|
|
170
|
+
component: "a",
|
|
171
|
+
href: runbookUrl,
|
|
172
|
+
target: "_blank",
|
|
173
|
+
rel: "noopener noreferrer",
|
|
174
|
+
children: /*#__PURE__*/ _jsx(BookOpenIcon, {
|
|
175
|
+
fontSize: "small"
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function AlertGroupRow({ group, expanded, allowedActions, columnDefs, columnKeySet, labelColorMappings, mappingsByKey, runbookAnnotationKey, onToggle, onSilence, duplicateCounts, showDuplicates }) {
|
|
186
|
+
const showActions = allowedActions.length > 0;
|
|
187
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
188
|
+
children: [
|
|
189
|
+
/*#__PURE__*/ _jsxs(TableRow, {
|
|
190
|
+
sx: {
|
|
191
|
+
cursor: 'pointer',
|
|
192
|
+
'& > td': {
|
|
193
|
+
fontWeight: 'bold'
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
onClick: onToggle,
|
|
197
|
+
children: [
|
|
198
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
199
|
+
colSpan: 2,
|
|
200
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
201
|
+
direction: "row",
|
|
202
|
+
spacing: 1,
|
|
203
|
+
alignItems: "center",
|
|
204
|
+
children: [
|
|
205
|
+
expanded ? /*#__PURE__*/ _jsx(ChevronDownIcon, {}) : /*#__PURE__*/ _jsx(ChevronRightIcon, {}),
|
|
206
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
207
|
+
variant: "body2",
|
|
208
|
+
fontWeight: "bold",
|
|
209
|
+
children: group.key || 'Ungrouped'
|
|
210
|
+
}),
|
|
211
|
+
/*#__PURE__*/ _jsx(Chip, {
|
|
212
|
+
label: `${group.summary.total}`,
|
|
213
|
+
size: "small",
|
|
214
|
+
variant: "outlined"
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
columnDefs.map((col, colIdx)=>{
|
|
220
|
+
const counts = group.summary.labelCounts?.[col.name];
|
|
221
|
+
const mapping = mappingsByKey.get(col.name);
|
|
222
|
+
if (counts && mapping) {
|
|
223
|
+
return /*#__PURE__*/ _jsx(TableCell, {
|
|
224
|
+
children: /*#__PURE__*/ _jsx(LabelValueSummaryChips, {
|
|
225
|
+
summary: group.summary,
|
|
226
|
+
mapping: mapping
|
|
227
|
+
})
|
|
228
|
+
}, colIdx);
|
|
229
|
+
}
|
|
230
|
+
if (counts) {
|
|
231
|
+
return /*#__PURE__*/ _jsx(TableCell, {
|
|
232
|
+
children: /*#__PURE__*/ _jsx(Stack, {
|
|
233
|
+
direction: "row",
|
|
234
|
+
spacing: 0.5,
|
|
235
|
+
children: Object.entries(counts).sort(([, a], [, b])=>b - a).map(([value, count])=>/*#__PURE__*/ _jsx(Chip, {
|
|
236
|
+
label: `${count} ${value}`,
|
|
237
|
+
size: "small",
|
|
238
|
+
variant: "outlined"
|
|
239
|
+
}, value))
|
|
240
|
+
})
|
|
241
|
+
}, colIdx);
|
|
242
|
+
}
|
|
243
|
+
return /*#__PURE__*/ _jsx(TableCell, {}, colIdx);
|
|
244
|
+
}),
|
|
245
|
+
showDuplicates && /*#__PURE__*/ _jsx(TableCell, {}),
|
|
246
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
247
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
248
|
+
direction: "row",
|
|
249
|
+
spacing: 1,
|
|
250
|
+
alignItems: "center",
|
|
251
|
+
flexWrap: "wrap",
|
|
252
|
+
useFlexGap: true,
|
|
253
|
+
children: [
|
|
254
|
+
/*#__PURE__*/ _jsx(GroupSummaryChips, {
|
|
255
|
+
summary: group.summary
|
|
256
|
+
}),
|
|
257
|
+
labelColorMappings.filter((mapping)=>!columnKeySet.has(mapping.labelKey)).map((mapping)=>/*#__PURE__*/ _jsx(LabelValueSummaryChips, {
|
|
258
|
+
summary: group.summary,
|
|
259
|
+
mapping: mapping
|
|
260
|
+
}, mapping.labelKey))
|
|
261
|
+
]
|
|
262
|
+
})
|
|
263
|
+
}),
|
|
264
|
+
showActions && /*#__PURE__*/ _jsx(TableCell, {})
|
|
265
|
+
]
|
|
266
|
+
}),
|
|
267
|
+
expanded && group.alerts.map((alert, idx)=>/*#__PURE__*/ _jsx(AlertRow, {
|
|
268
|
+
alert: alert,
|
|
269
|
+
allowedActions: allowedActions,
|
|
270
|
+
columnDefs: columnDefs,
|
|
271
|
+
columnKeySet: columnKeySet,
|
|
272
|
+
mappingsByKey: mappingsByKey,
|
|
273
|
+
runbookAnnotationKey: runbookAnnotationKey,
|
|
274
|
+
onSilence: onSilence,
|
|
275
|
+
duplicateCount: duplicateCounts.get(alert),
|
|
276
|
+
showDuplicates: showDuplicates
|
|
277
|
+
}, alert.id ?? String(idx)))
|
|
278
|
+
]
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Alert hierarchical table panel component.
|
|
283
|
+
* Displays alerts grouped by configurable labels with deduplication.
|
|
284
|
+
*/ export function AlertTablePanel({ spec, queryResults, contentDimensions }) {
|
|
285
|
+
const datasourceSelector = useMemo(()=>extractDatasourceSelector(queryResults), [
|
|
286
|
+
queryResults
|
|
287
|
+
]);
|
|
288
|
+
const { data: amClient } = useDatasourceClient(datasourceSelector);
|
|
289
|
+
const queryClient = useQueryClient();
|
|
290
|
+
const [silenceTarget, setSilenceTarget] = useState(null);
|
|
291
|
+
const silenceKeyRef = useRef(0);
|
|
292
|
+
const handleSetSilenceTarget = useCallback((alert)=>{
|
|
293
|
+
silenceKeyRef.current++;
|
|
294
|
+
setSilenceTarget(alert);
|
|
295
|
+
}, []);
|
|
296
|
+
const [search, setSearch] = useState('');
|
|
297
|
+
const [expandedGroups, setExpandedGroups] = useState(new Set());
|
|
298
|
+
const { successSnackbar, exceptionSnackbar } = useSnackbar();
|
|
299
|
+
const handleSilenceSubmit = useCallback(async (silence)=>{
|
|
300
|
+
if (!amClient) return;
|
|
301
|
+
try {
|
|
302
|
+
await amClient.createSilence(silence);
|
|
303
|
+
setSilenceTarget(null);
|
|
304
|
+
successSnackbar('Silence created successfully');
|
|
305
|
+
queryClient.invalidateQueries({
|
|
306
|
+
queryKey: [
|
|
307
|
+
'query',
|
|
308
|
+
'AlertsQuery'
|
|
309
|
+
]
|
|
310
|
+
});
|
|
311
|
+
queryClient.invalidateQueries({
|
|
312
|
+
queryKey: [
|
|
313
|
+
'query',
|
|
314
|
+
'SilencesQuery'
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
} catch (err) {
|
|
318
|
+
exceptionSnackbar(err);
|
|
319
|
+
}
|
|
320
|
+
}, [
|
|
321
|
+
amClient,
|
|
322
|
+
queryClient,
|
|
323
|
+
successSnackbar,
|
|
324
|
+
exceptionSnackbar
|
|
325
|
+
]);
|
|
326
|
+
const silenceInitial = useMemo(()=>{
|
|
327
|
+
if (!silenceTarget) return undefined;
|
|
328
|
+
return {
|
|
329
|
+
matchers: Object.entries(silenceTarget.labels).map(([name, value])=>({
|
|
330
|
+
name,
|
|
331
|
+
value,
|
|
332
|
+
isEqual: true,
|
|
333
|
+
isRegex: false
|
|
334
|
+
}))
|
|
335
|
+
};
|
|
336
|
+
}, [
|
|
337
|
+
silenceTarget
|
|
338
|
+
]);
|
|
339
|
+
const defaultGroupBy = useMemo(()=>spec.defaultGroupBy ?? [
|
|
340
|
+
'alertname'
|
|
341
|
+
], [
|
|
342
|
+
spec.defaultGroupBy
|
|
343
|
+
]);
|
|
344
|
+
const variableNames = useMemo(()=>[
|
|
345
|
+
...new Set(defaultGroupBy.flatMap((entry)=>parseVariables(entry)))
|
|
346
|
+
], [
|
|
347
|
+
defaultGroupBy
|
|
348
|
+
]);
|
|
349
|
+
const variableState = useAllVariableValues(variableNames);
|
|
350
|
+
const resolvedDefaultGroupBy = useMemo(()=>{
|
|
351
|
+
const result = [];
|
|
352
|
+
for (const entry of defaultGroupBy){
|
|
353
|
+
const vars = parseVariables(entry);
|
|
354
|
+
if (vars.length === 0) {
|
|
355
|
+
result.push(entry);
|
|
356
|
+
} else if (vars.length === 1 && (entry === `$${vars[0]}` || entry === `\${${vars[0]}}`)) {
|
|
357
|
+
const varState = variableState[vars[0] ?? ''];
|
|
358
|
+
if (varState?.value) {
|
|
359
|
+
if (Array.isArray(varState.value)) {
|
|
360
|
+
result.push(...varState.value);
|
|
361
|
+
} else {
|
|
362
|
+
result.push(varState.value);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
const resolved = replaceVariablesInString(entry, variableState);
|
|
367
|
+
if (resolved) result.push(resolved);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return result;
|
|
371
|
+
}, [
|
|
372
|
+
defaultGroupBy,
|
|
373
|
+
variableState
|
|
374
|
+
]);
|
|
375
|
+
const [groupBy, setGroupBy] = useState(resolvedDefaultGroupBy);
|
|
376
|
+
useEffect(()=>{
|
|
377
|
+
setGroupBy(resolvedDefaultGroupBy);
|
|
378
|
+
}, [
|
|
379
|
+
resolvedDefaultGroupBy
|
|
380
|
+
]);
|
|
381
|
+
const effectiveActions = useMemo(()=>spec.allowedActions ?? ALL_ALERT_ACTIONS, [
|
|
382
|
+
spec.allowedActions
|
|
383
|
+
]);
|
|
384
|
+
const showActionsColumn = effectiveActions.length > 0;
|
|
385
|
+
const runbookAnnotationKey = spec.runbookAnnotationKey || 'runbook_url';
|
|
386
|
+
const columnDefs = useMemo(()=>spec.columns ?? [], [
|
|
387
|
+
spec.columns
|
|
388
|
+
]);
|
|
389
|
+
const columnKeySet = useMemo(()=>new Set(columnDefs.map((c)=>c.name)), [
|
|
390
|
+
columnDefs
|
|
391
|
+
]);
|
|
392
|
+
const labelColorMappings = useMemo(()=>spec.labelColorMappings ?? [], [
|
|
393
|
+
spec.labelColorMappings
|
|
394
|
+
]);
|
|
395
|
+
const labelKeys = useMemo(()=>labelColorMappings.map((m)=>m.labelKey), [
|
|
396
|
+
labelColorMappings
|
|
397
|
+
]);
|
|
398
|
+
const mappingsByKey = useMemo(()=>new Map(labelColorMappings.map((m)=>[
|
|
399
|
+
m.labelKey,
|
|
400
|
+
m
|
|
401
|
+
])), [
|
|
402
|
+
labelColorMappings
|
|
403
|
+
]);
|
|
404
|
+
const allTrackedKeys = useMemo(()=>[
|
|
405
|
+
...new Set([
|
|
406
|
+
...labelKeys,
|
|
407
|
+
...columnDefs.map((c)=>c.name)
|
|
408
|
+
])
|
|
409
|
+
], [
|
|
410
|
+
labelKeys,
|
|
411
|
+
columnDefs
|
|
412
|
+
]);
|
|
413
|
+
const initialSort = useMemo(()=>{
|
|
414
|
+
const col = columnDefs.find((c)=>c.sort && c.enableSorting !== false);
|
|
415
|
+
if (!col?.sort) return null;
|
|
416
|
+
return {
|
|
417
|
+
columnName: col.name,
|
|
418
|
+
direction: col.sort,
|
|
419
|
+
mode: col.sortMode ?? 'alphabetical'
|
|
420
|
+
};
|
|
421
|
+
}, [
|
|
422
|
+
columnDefs
|
|
423
|
+
]);
|
|
424
|
+
const [sortState, setSortState] = useState(initialSort);
|
|
425
|
+
const handleSortClick = useCallback((columnName, sortMode = 'alphabetical')=>{
|
|
426
|
+
setSortState((prev)=>{
|
|
427
|
+
if (prev?.columnName === columnName) {
|
|
428
|
+
return prev.direction === 'asc' ? {
|
|
429
|
+
...prev,
|
|
430
|
+
direction: 'desc'
|
|
431
|
+
} : null;
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
columnName,
|
|
435
|
+
direction: 'asc',
|
|
436
|
+
mode: sortMode
|
|
437
|
+
};
|
|
438
|
+
});
|
|
439
|
+
}, []);
|
|
440
|
+
// Flatten all alerts from all query results
|
|
441
|
+
const allAlerts = useMemo(()=>{
|
|
442
|
+
return queryResults.flatMap((result)=>result.data?.alerts ?? []);
|
|
443
|
+
}, [
|
|
444
|
+
queryResults
|
|
445
|
+
]);
|
|
446
|
+
// Deduplicate
|
|
447
|
+
const dedupConfig = useMemo(()=>spec.deduplication ?? {
|
|
448
|
+
mode: 'fingerprint'
|
|
449
|
+
}, [
|
|
450
|
+
spec.deduplication
|
|
451
|
+
]);
|
|
452
|
+
const dedupResult = useMemo(()=>deduplicateAlerts(allAlerts, dedupConfig), [
|
|
453
|
+
allAlerts,
|
|
454
|
+
dedupConfig
|
|
455
|
+
]);
|
|
456
|
+
const dedupAlerts = dedupResult.alerts;
|
|
457
|
+
const duplicateCounts = dedupResult.duplicateCounts;
|
|
458
|
+
const hasDuplicates = duplicateCounts.size > 0;
|
|
459
|
+
// Filter by search term
|
|
460
|
+
const alerts = useMemo(()=>{
|
|
461
|
+
const term = search.trim().toLowerCase();
|
|
462
|
+
if (!term) return dedupAlerts;
|
|
463
|
+
return dedupAlerts.filter((a)=>{
|
|
464
|
+
if (a.state.toLowerCase().includes(term)) return true;
|
|
465
|
+
if (a.suppressed && ('suppressed'.includes(term) || 'silenced'.includes(term))) return true;
|
|
466
|
+
if (Object.values(a.labels).some((v)=>v.toLowerCase().includes(term))) return true;
|
|
467
|
+
if (a.annotations && Object.values(a.annotations).some((v)=>v.toLowerCase().includes(term))) return true;
|
|
468
|
+
return false;
|
|
469
|
+
});
|
|
470
|
+
}, [
|
|
471
|
+
dedupAlerts,
|
|
472
|
+
search
|
|
473
|
+
]);
|
|
474
|
+
// Extract available label keys for group-by selector
|
|
475
|
+
const availableLabelKeys = useMemo(()=>extractLabelKeys(alerts), [
|
|
476
|
+
alerts
|
|
477
|
+
]);
|
|
478
|
+
// Group alerts
|
|
479
|
+
const groups = useMemo(()=>{
|
|
480
|
+
let result;
|
|
481
|
+
if (groupBy.length === 0) {
|
|
482
|
+
result = [
|
|
483
|
+
{
|
|
484
|
+
key: '',
|
|
485
|
+
alerts: [
|
|
486
|
+
...alerts
|
|
487
|
+
],
|
|
488
|
+
summary: getGroupSummary(alerts, allTrackedKeys)
|
|
489
|
+
}
|
|
490
|
+
];
|
|
491
|
+
} else {
|
|
492
|
+
const groupMap = new Map();
|
|
493
|
+
for (const alert of alerts){
|
|
494
|
+
const key = getGroupKey(alert, groupBy);
|
|
495
|
+
const existing = groupMap.get(key) ?? [];
|
|
496
|
+
existing.push(alert);
|
|
497
|
+
groupMap.set(key, existing);
|
|
498
|
+
}
|
|
499
|
+
result = Array.from(groupMap.entries()).map(([key, groupAlerts])=>({
|
|
500
|
+
key,
|
|
501
|
+
alerts: groupAlerts,
|
|
502
|
+
summary: getGroupSummary(groupAlerts, allTrackedKeys)
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
if (sortState) {
|
|
506
|
+
for (const group of result){
|
|
507
|
+
group.alerts.sort((a, b)=>compareAlertsByColumn(a, b, sortState));
|
|
508
|
+
}
|
|
509
|
+
result.sort((a, b)=>compareGroupsByColumn(a.summary.labelCounts?.[sortState.columnName], b.summary.labelCounts?.[sortState.columnName], sortState));
|
|
510
|
+
}
|
|
511
|
+
return result;
|
|
512
|
+
}, [
|
|
513
|
+
alerts,
|
|
514
|
+
groupBy,
|
|
515
|
+
allTrackedKeys,
|
|
516
|
+
sortState
|
|
517
|
+
]);
|
|
518
|
+
const prevGroupKeysRef = useRef('');
|
|
519
|
+
useEffect(()=>{
|
|
520
|
+
const currentKeys = groups.map((g)=>g.key).join('\0');
|
|
521
|
+
if (currentKeys === prevGroupKeysRef.current) return;
|
|
522
|
+
prevGroupKeysRef.current = currentKeys;
|
|
523
|
+
if (groups.length === 1) {
|
|
524
|
+
setExpandedGroups(new Set(groups.map((g)=>g.key)));
|
|
525
|
+
} else {
|
|
526
|
+
setExpandedGroups(new Set());
|
|
527
|
+
}
|
|
528
|
+
}, [
|
|
529
|
+
groups
|
|
530
|
+
]);
|
|
531
|
+
const handleToggleGroup = useCallback((key)=>{
|
|
532
|
+
setExpandedGroups((prev)=>{
|
|
533
|
+
const next = new Set(prev);
|
|
534
|
+
if (next.has(key)) {
|
|
535
|
+
next.delete(key);
|
|
536
|
+
} else {
|
|
537
|
+
next.add(key);
|
|
538
|
+
}
|
|
539
|
+
return next;
|
|
540
|
+
});
|
|
541
|
+
}, []);
|
|
542
|
+
const handleExpandAll = useCallback(()=>{
|
|
543
|
+
setExpandedGroups(new Set(groups.map((g)=>g.key)));
|
|
544
|
+
}, [
|
|
545
|
+
groups
|
|
546
|
+
]);
|
|
547
|
+
const handleCollapseAll = useCallback(()=>{
|
|
548
|
+
setExpandedGroups(new Set());
|
|
549
|
+
}, []);
|
|
550
|
+
const handleGroupByChange = (event)=>{
|
|
551
|
+
const value = event.target.value;
|
|
552
|
+
setGroupBy(typeof value === 'string' ? value.split(',') : value);
|
|
553
|
+
};
|
|
554
|
+
if (allAlerts.length === 0) {
|
|
555
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
556
|
+
sx: {
|
|
557
|
+
display: 'flex',
|
|
558
|
+
justifyContent: 'center',
|
|
559
|
+
alignItems: 'center',
|
|
560
|
+
height: contentDimensions?.height ?? '100%'
|
|
561
|
+
},
|
|
562
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
563
|
+
children: "No alerts to display"
|
|
564
|
+
})
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
568
|
+
spacing: 1,
|
|
569
|
+
sx: {
|
|
570
|
+
height: contentDimensions?.height,
|
|
571
|
+
overflow: 'auto'
|
|
572
|
+
},
|
|
573
|
+
children: [
|
|
574
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
575
|
+
direction: "row",
|
|
576
|
+
spacing: 2,
|
|
577
|
+
alignItems: "center",
|
|
578
|
+
sx: {
|
|
579
|
+
px: 1,
|
|
580
|
+
pt: 1
|
|
581
|
+
},
|
|
582
|
+
children: [
|
|
583
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
584
|
+
size: "small",
|
|
585
|
+
placeholder: "Search alerts...",
|
|
586
|
+
value: search,
|
|
587
|
+
onChange: (e)=>setSearch(e.target.value),
|
|
588
|
+
sx: {
|
|
589
|
+
minWidth: 200
|
|
590
|
+
},
|
|
591
|
+
slotProps: {
|
|
592
|
+
htmlInput: {
|
|
593
|
+
'aria-label': 'Search alerts'
|
|
594
|
+
},
|
|
595
|
+
input: {
|
|
596
|
+
startAdornment: /*#__PURE__*/ _jsx(InputAdornment, {
|
|
597
|
+
position: "start",
|
|
598
|
+
children: /*#__PURE__*/ _jsx(MagnifyIcon, {
|
|
599
|
+
fontSize: "small"
|
|
600
|
+
})
|
|
601
|
+
})
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}),
|
|
605
|
+
/*#__PURE__*/ _jsxs(FormControl, {
|
|
606
|
+
size: "small",
|
|
607
|
+
sx: {
|
|
608
|
+
minWidth: 200
|
|
609
|
+
},
|
|
610
|
+
children: [
|
|
611
|
+
/*#__PURE__*/ _jsx(InputLabel, {
|
|
612
|
+
id: "group-by-label",
|
|
613
|
+
children: "Group by"
|
|
614
|
+
}),
|
|
615
|
+
/*#__PURE__*/ _jsx(Select, {
|
|
616
|
+
labelId: "group-by-label",
|
|
617
|
+
multiple: true,
|
|
618
|
+
value: groupBy,
|
|
619
|
+
onChange: handleGroupByChange,
|
|
620
|
+
label: "Group by",
|
|
621
|
+
renderValue: (selected)=>selected.join(', '),
|
|
622
|
+
children: availableLabelKeys.map((key)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
623
|
+
value: key,
|
|
624
|
+
children: key
|
|
625
|
+
}, key))
|
|
626
|
+
})
|
|
627
|
+
]
|
|
628
|
+
}),
|
|
629
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
630
|
+
variant: "body2",
|
|
631
|
+
color: "text.secondary",
|
|
632
|
+
sx: {
|
|
633
|
+
flexGrow: 1
|
|
634
|
+
},
|
|
635
|
+
children: [
|
|
636
|
+
alerts.length,
|
|
637
|
+
" alert",
|
|
638
|
+
alerts.length !== 1 ? 's' : '',
|
|
639
|
+
" in ",
|
|
640
|
+
groups.length,
|
|
641
|
+
" group",
|
|
642
|
+
groups.length !== 1 ? 's' : ''
|
|
643
|
+
]
|
|
644
|
+
}),
|
|
645
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
646
|
+
direction: "row",
|
|
647
|
+
spacing: 0.5,
|
|
648
|
+
children: [
|
|
649
|
+
/*#__PURE__*/ _jsx(Tooltip, {
|
|
650
|
+
title: "Expand all groups",
|
|
651
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
652
|
+
size: "small",
|
|
653
|
+
"aria-label": "Expand all groups",
|
|
654
|
+
onClick: handleExpandAll,
|
|
655
|
+
children: /*#__PURE__*/ _jsx(UnfoldMoreHorizontalIcon, {
|
|
656
|
+
fontSize: "small"
|
|
657
|
+
})
|
|
658
|
+
})
|
|
659
|
+
}),
|
|
660
|
+
/*#__PURE__*/ _jsx(Tooltip, {
|
|
661
|
+
title: "Collapse all groups",
|
|
662
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
663
|
+
size: "small",
|
|
664
|
+
"aria-label": "Collapse all groups",
|
|
665
|
+
onClick: handleCollapseAll,
|
|
666
|
+
children: /*#__PURE__*/ _jsx(UnfoldLessHorizontalIcon, {
|
|
667
|
+
fontSize: "small"
|
|
668
|
+
})
|
|
669
|
+
})
|
|
670
|
+
})
|
|
671
|
+
]
|
|
672
|
+
})
|
|
673
|
+
]
|
|
674
|
+
}),
|
|
675
|
+
/*#__PURE__*/ _jsx(TableContainer, {
|
|
676
|
+
children: /*#__PURE__*/ _jsxs(Table, {
|
|
677
|
+
size: "small",
|
|
678
|
+
stickyHeader: true,
|
|
679
|
+
children: [
|
|
680
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
681
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
682
|
+
children: [
|
|
683
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
684
|
+
sortDirection: sortState?.columnName === SORT_COL_STATUS ? sortState.direction : false,
|
|
685
|
+
children: /*#__PURE__*/ _jsx(TableSortLabel, {
|
|
686
|
+
active: sortState?.columnName === SORT_COL_STATUS,
|
|
687
|
+
direction: sortState?.columnName === SORT_COL_STATUS ? sortState.direction : 'asc',
|
|
688
|
+
onClick: ()=>handleSortClick(SORT_COL_STATUS, 'status'),
|
|
689
|
+
children: "Status"
|
|
690
|
+
})
|
|
691
|
+
}),
|
|
692
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
693
|
+
sortDirection: sortState?.columnName === SORT_COL_ALERTNAME ? sortState.direction : false,
|
|
694
|
+
children: /*#__PURE__*/ _jsx(TableSortLabel, {
|
|
695
|
+
active: sortState?.columnName === SORT_COL_ALERTNAME,
|
|
696
|
+
direction: sortState?.columnName === SORT_COL_ALERTNAME ? sortState.direction : 'asc',
|
|
697
|
+
onClick: ()=>handleSortClick(SORT_COL_ALERTNAME, 'alphabetical'),
|
|
698
|
+
children: "Alert Name"
|
|
699
|
+
})
|
|
700
|
+
}),
|
|
701
|
+
columnDefs.map((col, colIdx)=>/*#__PURE__*/ _jsx(TableCell, {
|
|
702
|
+
sortDirection: sortState?.columnName === col.name ? sortState.direction : false,
|
|
703
|
+
children: col.enableSorting !== false ? /*#__PURE__*/ _jsx(TableSortLabel, {
|
|
704
|
+
active: sortState?.columnName === col.name,
|
|
705
|
+
direction: sortState?.columnName === col.name ? sortState.direction : 'asc',
|
|
706
|
+
onClick: ()=>handleSortClick(col.name, col.sortMode),
|
|
707
|
+
children: col.header ?? col.name
|
|
708
|
+
}) : col.header ?? col.name
|
|
709
|
+
}, colIdx)),
|
|
710
|
+
hasDuplicates && /*#__PURE__*/ _jsx(TableCell, {
|
|
711
|
+
children: "Duplicates"
|
|
712
|
+
}),
|
|
713
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
714
|
+
children: "Labels"
|
|
715
|
+
}),
|
|
716
|
+
showActionsColumn && /*#__PURE__*/ _jsx(TableCell, {
|
|
717
|
+
children: "Actions"
|
|
718
|
+
})
|
|
719
|
+
]
|
|
720
|
+
})
|
|
721
|
+
}),
|
|
722
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
723
|
+
children: alerts.length === 0 ? /*#__PURE__*/ _jsx(TableRow, {
|
|
724
|
+
children: /*#__PURE__*/ _jsx(TableCell, {
|
|
725
|
+
colSpan: 99,
|
|
726
|
+
align: "center",
|
|
727
|
+
sx: {
|
|
728
|
+
py: 4
|
|
729
|
+
},
|
|
730
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
731
|
+
color: "text.secondary",
|
|
732
|
+
children: "No matching alerts"
|
|
733
|
+
})
|
|
734
|
+
})
|
|
735
|
+
}) : groups.map((group)=>/*#__PURE__*/ _jsx(AlertGroupRow, {
|
|
736
|
+
group: group,
|
|
737
|
+
expanded: expandedGroups.has(group.key),
|
|
738
|
+
allowedActions: effectiveActions,
|
|
739
|
+
columnDefs: columnDefs,
|
|
740
|
+
columnKeySet: columnKeySet,
|
|
741
|
+
labelColorMappings: labelColorMappings,
|
|
742
|
+
mappingsByKey: mappingsByKey,
|
|
743
|
+
runbookAnnotationKey: runbookAnnotationKey,
|
|
744
|
+
onToggle: ()=>handleToggleGroup(group.key),
|
|
745
|
+
onSilence: handleSetSilenceTarget,
|
|
746
|
+
duplicateCounts: duplicateCounts,
|
|
747
|
+
showDuplicates: hasDuplicates
|
|
748
|
+
}, group.key))
|
|
749
|
+
})
|
|
750
|
+
]
|
|
751
|
+
})
|
|
752
|
+
}),
|
|
753
|
+
/*#__PURE__*/ _jsx(SilenceForm, {
|
|
754
|
+
open: !!silenceTarget,
|
|
755
|
+
onClose: ()=>setSilenceTarget(null),
|
|
756
|
+
onSubmit: handleSilenceSubmit,
|
|
757
|
+
initialSilence: silenceInitial
|
|
758
|
+
}, silenceKeyRef.current)
|
|
759
|
+
]
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
//# sourceMappingURL=AlertTablePanel.js.map
|