@perses-dev/alert-manager-plugin 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +41 -0
- package/__mf/css/async/7790.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.f762e62c.js +7 -0
- package/__mf/js/async/1616.24f00c9d.js +1 -0
- package/__mf/js/async/1728.83bb9a7c.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/2954.3ac1f636.js +2 -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/4397.d399eecb.js +2 -0
- package/__mf/js/async/4397.d399eecb.js.LICENSE.txt +37 -0
- package/__mf/js/async/4466.a8145edd.js +74 -0
- package/__mf/js/async/4732.e866a740.js +1 -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/573.214f2003.js +2 -0
- package/__mf/js/async/573.214f2003.js.LICENSE.txt +9 -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/6593.acc8b704.js +4 -0
- package/__mf/js/async/6593.acc8b704.js.LICENSE.txt +24 -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/733.22ab2a8a.js +1 -0
- package/__mf/js/async/7422.33d76364.js +2 -0
- package/__mf/js/async/7422.33d76364.js.LICENSE.txt +9 -0
- package/__mf/js/async/7790.a75199e6.js +7 -0
- package/__mf/js/async/7790.a75199e6.js.LICENSE.txt +64 -0
- package/__mf/js/async/7862.556c038f.js +2 -0
- package/__mf/js/async/7862.556c038f.js.LICENSE.txt +9 -0
- package/__mf/js/async/7984.49fa1156.js +22 -0
- package/__mf/js/async/7984.49fa1156.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/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/9634.3a366799.js +1 -0
- package/__mf/js/async/9836.cc839227.js +1 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsExplorer.d4fb76c0.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerAlertsQuery.9ea3093c.js +1 -0
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.2fbf067c.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesExplorer.d2527c12.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js +2 -0
- package/__mf/js/async/__federation_expose_AlertManagerSilencesQuery.7aca31d3.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_AlertTable.4a636b80.js +1 -0
- package/__mf/js/async/__federation_expose_SilenceTable.11259028.js +1 -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.a1362788.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 +631 -0
- package/mf-stats.json +752 -0
- package/package.json +115 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/api-types.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\n/**\n * Alert Manager v2 API response types.\n * Based on the Alertmanager OpenAPI v2 spec.\n * @see https://github.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml\n */\n\n/**\n * A matcher used by silences and alerts.\n */\nexport interface Matcher {\n name: string;\n value: string;\n isRegex: boolean;\n isEqual: boolean;\n}\n\n/**\n * Alert status from the Alertmanager API.\n */\nexport interface AlertStatus {\n state: 'unprocessed' | 'active' | 'suppressed';\n silencedBy: string[];\n inhibitedBy: string[];\n mutedBy: string[];\n}\n\n/**\n * A gettable alert returned by the Alertmanager API.\n */\nexport interface GettableAlert {\n annotations: Record<string, string>;\n endsAt: string;\n fingerprint: string;\n receivers: Array<{ name: string }>;\n startsAt: string;\n status: AlertStatus;\n updatedAt: string;\n generatorURL?: string;\n labels: Record<string, string>;\n}\n\n/**\n * Silence status from the Alertmanager API.\n */\nexport interface SilenceStatus {\n state: 'expired' | 'active' | 'pending';\n}\n\n/**\n * A gettable silence returned by the Alertmanager API.\n */\nexport interface GettableSilence {\n id: string;\n status: SilenceStatus;\n updatedAt: string;\n comment: string;\n createdBy: string;\n endsAt: string;\n matchers: Matcher[];\n startsAt: string;\n}\n\n/**\n * A postable silence used for creating or updating silences.\n */\nexport interface PostableSilence {\n id?: string;\n comment: string;\n createdBy: string;\n endsAt: string;\n matchers: Matcher[];\n startsAt: string;\n}\n\n/**\n * Cluster status from the Alertmanager API.\n */\nexport interface ClusterStatus {\n name?: string;\n status: string;\n peers: Array<{\n name: string;\n address: string;\n }>;\n}\n\n/**\n * Version info from the Alertmanager API.\n */\nexport interface VersionInfo {\n branch: string;\n buildDate: string;\n buildUser: string;\n goVersion: string;\n revision: string;\n version: string;\n}\n\n/**\n * Alertmanager status response.\n */\nexport interface AlertManagerStatus {\n cluster: ClusterStatus;\n config: { original: string };\n uptime: string;\n versionInfo: VersionInfo;\n}\n\n/**\n * Parameters for querying alerts.\n */\nexport interface AlertsQueryParams {\n filter?: string[];\n silenced?: boolean;\n inhibited?: boolean;\n active?: boolean;\n unprocessed?: boolean;\n receiver?: string;\n}\n\n/**\n * Parameters for querying silences.\n */\nexport interface SilencesQueryParams {\n filter?: string[];\n}\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;;;;CAIC,GAED;;CAEC,GAgHD;;CAEC,GACD,WAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './api-types';
|
|
14
|
+
export * from './alertmanager-client';
|
|
15
|
+
export * from './alertmanager-selectors';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { AlertManagerDatasourceSpec } from './types';
|
|
3
|
+
export interface AlertManagerDatasourceEditorProps {
|
|
4
|
+
value: AlertManagerDatasourceSpec;
|
|
5
|
+
onChange: (next: AlertManagerDatasourceSpec) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function AlertManagerDatasourceEditor(props: AlertManagerDatasourceEditorProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=AlertManagerDatasourceEditor.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
|
|
15
|
+
export function AlertManagerDatasourceEditor(props) {
|
|
16
|
+
const { value, onChange, isReadonly } = props;
|
|
17
|
+
const initialSpecDirect = {
|
|
18
|
+
directUrl: ''
|
|
19
|
+
};
|
|
20
|
+
const initialSpecProxy = {
|
|
21
|
+
proxy: {
|
|
22
|
+
kind: 'HTTPProxy',
|
|
23
|
+
spec: {
|
|
24
|
+
allowedEndpoints: [
|
|
25
|
+
{
|
|
26
|
+
endpointPattern: '/api/v2/alerts',
|
|
27
|
+
method: 'GET'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
endpointPattern: '/api/v2/silences',
|
|
31
|
+
method: 'GET'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
endpointPattern: '/api/v2/silences',
|
|
35
|
+
method: 'POST'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
endpointPattern: '/api/v2/silence/.*',
|
|
39
|
+
method: 'GET'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
endpointPattern: '/api/v2/silence/.*',
|
|
43
|
+
method: 'DELETE'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
endpointPattern: '/api/v2/status',
|
|
47
|
+
method: 'GET'
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
url: ''
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/ _jsx(HTTPSettingsEditor, {
|
|
55
|
+
value: value,
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
isReadonly: isReadonly,
|
|
58
|
+
initialSpecDirect: initialSpecDirect,
|
|
59
|
+
initialSpecProxy: initialSpecProxy
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=AlertManagerDatasourceEditor.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PanelPlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import { AlertTablePanelProps } from './AlertTablePanel';
|
|
3
|
+
import { AlertTableOptions } from './alert-table-model';
|
|
4
|
+
/**
|
|
5
|
+
* Panel plugin for displaying Alert Manager alerts in a hierarchical table.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AlertTable: PanelPlugin<AlertTableOptions, AlertTablePanelProps>;
|
|
8
|
+
//# sourceMappingURL=AlertTable.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { AlertTableColumnsEditor } from './AlertTableColumnsEditor';
|
|
14
|
+
import { AlertTableDeduplicationEditor } from './AlertTableDeduplicationEditor';
|
|
15
|
+
import { AlertTableLabelsEditor } from './AlertTableLabelsEditor';
|
|
16
|
+
import { AlertTableOptionsEditor } from './AlertTableOptionsEditor';
|
|
17
|
+
import { AlertTablePanel } from './AlertTablePanel';
|
|
18
|
+
/**
|
|
19
|
+
* Panel plugin for displaying Alert Manager alerts in a hierarchical table.
|
|
20
|
+
*/ export const AlertTable = {
|
|
21
|
+
PanelComponent: AlertTablePanel,
|
|
22
|
+
supportedQueryTypes: [
|
|
23
|
+
'AlertsQuery'
|
|
24
|
+
],
|
|
25
|
+
panelOptionsEditorComponents: [
|
|
26
|
+
{
|
|
27
|
+
label: 'General',
|
|
28
|
+
content: AlertTableOptionsEditor
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Columns',
|
|
32
|
+
content: AlertTableColumnsEditor
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Labels',
|
|
36
|
+
content: AlertTableLabelsEditor
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Deduplication',
|
|
40
|
+
content: AlertTableDeduplicationEditor
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
createInitialOptions: ()=>({
|
|
44
|
+
defaultGroupBy: [
|
|
45
|
+
'alertname'
|
|
46
|
+
]
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=AlertTable.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { AlertTableOptions } from './alert-table-model';
|
|
4
|
+
export declare function AlertTableColumnsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
|
|
5
|
+
//# sourceMappingURL=AlertTableColumnsEditor.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright The Perses Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { TextField } from '@mui/material';
|
|
15
|
+
import { produce } from 'immer';
|
|
16
|
+
import { useCallback } from 'react';
|
|
17
|
+
import { ColumnsEditor } from '../../components/ColumnsEditor';
|
|
18
|
+
const SORT_MODE_LABELS = {
|
|
19
|
+
alphabetical: 'Alphabetical',
|
|
20
|
+
numeric: 'Numeric',
|
|
21
|
+
severity: 'Severity (critical → other)',
|
|
22
|
+
status: 'Status (firing → resolved)'
|
|
23
|
+
};
|
|
24
|
+
export function AlertTableColumnsEditor(props) {
|
|
25
|
+
const { value, onChange } = props;
|
|
26
|
+
const columns = value.columns ?? [];
|
|
27
|
+
const handleAddColumn = useCallback(()=>{
|
|
28
|
+
onChange(produce(value, (draft)=>{
|
|
29
|
+
if (!draft.columns) draft.columns = [];
|
|
30
|
+
draft.columns.push({
|
|
31
|
+
name: ''
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
34
|
+
}, [
|
|
35
|
+
value,
|
|
36
|
+
onChange
|
|
37
|
+
]);
|
|
38
|
+
const handleRemoveColumn = useCallback((index)=>{
|
|
39
|
+
onChange(produce(value, (draft)=>{
|
|
40
|
+
draft.columns?.splice(index, 1);
|
|
41
|
+
}));
|
|
42
|
+
}, [
|
|
43
|
+
value,
|
|
44
|
+
onChange
|
|
45
|
+
]);
|
|
46
|
+
const handleUpdateColumn = useCallback((index, updater)=>{
|
|
47
|
+
onChange(produce(value, (draft)=>{
|
|
48
|
+
const column = draft.columns?.[index];
|
|
49
|
+
if (column) {
|
|
50
|
+
updater(column);
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
}, [
|
|
54
|
+
value,
|
|
55
|
+
onChange
|
|
56
|
+
]);
|
|
57
|
+
const handleMoveUp = useCallback((index)=>{
|
|
58
|
+
if (index <= 0) return;
|
|
59
|
+
onChange(produce(value, (draft)=>{
|
|
60
|
+
if (!draft.columns) return;
|
|
61
|
+
const item = draft.columns.splice(index, 1)[0];
|
|
62
|
+
draft.columns.splice(index - 1, 0, item);
|
|
63
|
+
}));
|
|
64
|
+
}, [
|
|
65
|
+
value,
|
|
66
|
+
onChange
|
|
67
|
+
]);
|
|
68
|
+
const handleMoveDown = useCallback((index)=>{
|
|
69
|
+
onChange(produce(value, (draft)=>{
|
|
70
|
+
if (!draft.columns || index >= draft.columns.length - 1) return;
|
|
71
|
+
const item = draft.columns.splice(index, 1)[0];
|
|
72
|
+
draft.columns.splice(index + 1, 0, item);
|
|
73
|
+
}));
|
|
74
|
+
}, [
|
|
75
|
+
value,
|
|
76
|
+
onChange
|
|
77
|
+
]);
|
|
78
|
+
return /*#__PURE__*/ _jsx(ColumnsEditor, {
|
|
79
|
+
columns: columns,
|
|
80
|
+
description: "Status and Alert Name are always shown. Add extra columns below.",
|
|
81
|
+
sortModeLabels: SORT_MODE_LABELS,
|
|
82
|
+
defaultSortMode: "alphabetical",
|
|
83
|
+
getDisplayName: (col)=>col.header || col.name || 'New column',
|
|
84
|
+
getHeaderPlaceholder: (col)=>col.name || 'Column header',
|
|
85
|
+
onAdd: handleAddColumn,
|
|
86
|
+
onRemove: handleRemoveColumn,
|
|
87
|
+
onUpdate: handleUpdateColumn,
|
|
88
|
+
onMoveUp: handleMoveUp,
|
|
89
|
+
onMoveDown: handleMoveDown,
|
|
90
|
+
renderNameField: (col, index, onUpdate)=>/*#__PURE__*/ _jsx(TextField, {
|
|
91
|
+
label: "Label key",
|
|
92
|
+
value: col.name,
|
|
93
|
+
onChange: (e)=>onUpdate(index, (draft)=>{
|
|
94
|
+
draft.name = e.target.value;
|
|
95
|
+
}),
|
|
96
|
+
size: "small",
|
|
97
|
+
fullWidth: true
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=AlertTableColumnsEditor.js.map
|
|
@@ -0,0 +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;QACF;IAEJ,GACA;QAACZ;QAAOC;KAAS;IAGnB,MAAMY,eAAetB,YACnB,CAACiB;QACC,IAAIA,SAAS,GAAG;QAChBP,SACEX,QAAQU,OAAO,CAACI;YACd,IAAI,CAACA,MAAMF,OAAO,EAAE;YACpB,MAAMY,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,MAAMc,iBAAiBxB,YACrB,CAACiB;QACCP,SACEX,QAAQU,OAAO,CAACI;YACd,IAAI,CAACA,MAAMF,OAAO,IAAIM,SAASJ,MAAMF,OAAO,CAACc,MAAM,GAAG,GAAG;YACzD,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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { AlertTableOptions } from './alert-table-model';
|
|
4
|
+
export declare function AlertTableDeduplicationEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
|
|
5
|
+
//# sourceMappingURL=AlertTableDeduplicationEditor.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 { 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
|
+
const MODE_DESCRIPTIONS = {
|
|
19
|
+
none: 'No deduplication. All alerts from all datasources are shown as-is.',
|
|
20
|
+
fingerprint: 'Alerts with the same fingerprint from different datasources are merged. This is the default.',
|
|
21
|
+
labels: 'Alerts are considered duplicates when all specified label values match.'
|
|
22
|
+
};
|
|
23
|
+
export function AlertTableDeduplicationEditor(props) {
|
|
24
|
+
const { value, onChange } = props;
|
|
25
|
+
const dedup = value.deduplication ?? {
|
|
26
|
+
mode: 'fingerprint'
|
|
27
|
+
};
|
|
28
|
+
const handleModeChange = useCallback((mode)=>{
|
|
29
|
+
onChange(produce(value, (draft)=>{
|
|
30
|
+
draft.deduplication = {
|
|
31
|
+
mode
|
|
32
|
+
};
|
|
33
|
+
if (mode === 'labels') {
|
|
34
|
+
draft.deduplication.labels = draft.deduplication.labels ?? [];
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}, [
|
|
38
|
+
value,
|
|
39
|
+
onChange
|
|
40
|
+
]);
|
|
41
|
+
const handleLabelsChange = useCallback((_event, newLabels)=>{
|
|
42
|
+
onChange(produce(value, (draft)=>{
|
|
43
|
+
if (!draft.deduplication) {
|
|
44
|
+
draft.deduplication = {
|
|
45
|
+
mode: 'labels'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
draft.deduplication.labels = newLabels.length > 0 ? newLabels : undefined;
|
|
49
|
+
}));
|
|
50
|
+
}, [
|
|
51
|
+
value,
|
|
52
|
+
onChange
|
|
53
|
+
]);
|
|
54
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ _jsxs(OptionsEditorGroup, {
|
|
57
|
+
title: "Mode",
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsxs(FormControl, {
|
|
60
|
+
size: "small",
|
|
61
|
+
fullWidth: true,
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ _jsx(InputLabel, {
|
|
64
|
+
id: "dedup-mode-label",
|
|
65
|
+
children: "Deduplication Mode"
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsxs(Select, {
|
|
68
|
+
labelId: "dedup-mode-label",
|
|
69
|
+
value: dedup.mode,
|
|
70
|
+
label: "Deduplication Mode",
|
|
71
|
+
onChange: (e)=>handleModeChange(e.target.value),
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
74
|
+
value: "none",
|
|
75
|
+
children: "None"
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
78
|
+
value: "fingerprint",
|
|
79
|
+
children: "Fingerprint"
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
82
|
+
value: "labels",
|
|
83
|
+
children: "Labels"
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
90
|
+
variant: "body2",
|
|
91
|
+
color: "text.secondary",
|
|
92
|
+
sx: {
|
|
93
|
+
mt: 1
|
|
94
|
+
},
|
|
95
|
+
children: MODE_DESCRIPTIONS[dedup.mode]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
dedup.mode === 'labels' && /*#__PURE__*/ _jsx(OptionsEditorGroup, {
|
|
100
|
+
title: "Deduplication Labels",
|
|
101
|
+
children: /*#__PURE__*/ _jsx(Autocomplete, {
|
|
102
|
+
multiple: true,
|
|
103
|
+
freeSolo: true,
|
|
104
|
+
options: [],
|
|
105
|
+
value: dedup.labels ?? [],
|
|
106
|
+
onChange: handleLabelsChange,
|
|
107
|
+
renderTags: (tagValues, getTagProps)=>tagValues.map((option, index)=>{
|
|
108
|
+
const { key, ...rest } = getTagProps({
|
|
109
|
+
index
|
|
110
|
+
});
|
|
111
|
+
return /*#__PURE__*/ _jsx(Chip, {
|
|
112
|
+
label: option,
|
|
113
|
+
size: "small",
|
|
114
|
+
variant: "outlined",
|
|
115
|
+
...rest
|
|
116
|
+
}, key);
|
|
117
|
+
}),
|
|
118
|
+
renderInput: (params)=>/*#__PURE__*/ _jsx(TextField, {
|
|
119
|
+
...params,
|
|
120
|
+
size: "small",
|
|
121
|
+
placeholder: "Type a label key and press Enter",
|
|
122
|
+
helperText: "Alerts with identical values for all listed labels are considered duplicates."
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=AlertTableDeduplicationEditor.js.map
|
|
@@ -0,0 +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,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACrH,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAAuCC,WAAW,QAAQ,QAAQ;AAGlE,MAAMC,oBAAsE;IAC1EC,MAAM;IACNC,aAAa;IACbC,QAAQ;AACV;AAEA,OAAO,SAASC,8BAA8BC,KAA4C;IACxF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAC5B,MAAMG,QAAQF,MAAMG,aAAa,IAAI;QAAEC,MAAM;IAAuB;IAEpE,MAAMC,mBAAmBZ,YACvB,CAACW;QACCH,SACET,QAAQQ,OAAO,CAACM;YACdA,MAAMH,aAAa,GAAG;gBAAEC;YAAK;YAC7B,IAAIA,SAAS,UAAU;gBACrBE,MAAMH,aAAa,CAACN,MAAM,GAAGS,MAAMH,aAAa,CAACN,MAAM,IAAI,EAAE;YAC/D;QACF;IAEJ,GACA;QAACG;QAAOC;KAAS;IAGnB,MAAMM,qBAAqBd,YACzB,CAACe,QAAwBC;QACvBR,SACET,QAAQQ,OAAO,CAACM;YACd,IAAI,CAACA,MAAMH,aAAa,EAAE;gBACxBG,MAAMH,aAAa,GAAG;oBAAEC,MAAM;gBAAS;YACzC;YACAE,MAAMH,aAAa,CAACN,MAAM,GAAGY,UAAUC,MAAM,GAAG,IAAID,YAAYE;QAClE;IAEJ,GACA;QAACX;QAAOC;KAAS;IAGnB,qBACE;;0BACE,MAACV;gBAAmBqB,OAAM;;kCACxB,MAAC3B;wBAAY4B,MAAK;wBAAQC,SAAS;;0CACjC,KAAC5B;gCAAW6B,IAAG;0CAAmB;;0CAClC,MAAC3B;gCACC4B,SAAQ;gCACRhB,OAAOE,MAAME,IAAI;gCACjBa,OAAM;gCACNhB,UAAU,CAACiB,IAAMb,iBAAiBa,EAAEC,MAAM,CAACnB,KAAK;;kDAEhD,KAACb;wCAASa,OAAM;kDAAO;;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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { AlertTableOptions } from './alert-table-model';
|
|
4
|
+
export declare function AlertTableLabelsEditor(props: OptionsEditorProps<AlertTableOptions>): ReactElement;
|
|
5
|
+
//# sourceMappingURL=AlertTableLabelsEditor.d.ts.map
|
|
@@ -0,0 +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"}
|