@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,128 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get createSilence () {
|
|
25
|
+
return createSilence;
|
|
26
|
+
},
|
|
27
|
+
get deleteSilence () {
|
|
28
|
+
return deleteSilence;
|
|
29
|
+
},
|
|
30
|
+
get getAlerts () {
|
|
31
|
+
return getAlerts;
|
|
32
|
+
},
|
|
33
|
+
get getSilence () {
|
|
34
|
+
return getSilence;
|
|
35
|
+
},
|
|
36
|
+
get getSilences () {
|
|
37
|
+
return getSilences;
|
|
38
|
+
},
|
|
39
|
+
get getStatus () {
|
|
40
|
+
return getStatus;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const _client = require("@perses-dev/client");
|
|
44
|
+
async function throwOnError(response) {
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
let message = response.statusText;
|
|
47
|
+
try {
|
|
48
|
+
const body = await response.json();
|
|
49
|
+
if (body?.message) message = body.message;
|
|
50
|
+
} catch {
|
|
51
|
+
// no JSON body
|
|
52
|
+
}
|
|
53
|
+
throw new Error(message);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const executeRequest = async (...args)=>{
|
|
57
|
+
const response = await (0, _client.fetch)(...args);
|
|
58
|
+
await throwOnError(response);
|
|
59
|
+
try {
|
|
60
|
+
return await response.json();
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.error('Invalid response from server', e);
|
|
63
|
+
throw new Error('Invalid response from server');
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
function buildSearchParams(params) {
|
|
67
|
+
const urlSearchParams = new URLSearchParams();
|
|
68
|
+
Object.entries(params).forEach(([key, value])=>{
|
|
69
|
+
if (value === undefined) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
value.forEach((entry)=>urlSearchParams.append(key, String(entry)));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
urlSearchParams.append(key, String(value));
|
|
77
|
+
});
|
|
78
|
+
return urlSearchParams;
|
|
79
|
+
}
|
|
80
|
+
function fetchWithGet(apiURI, params, queryOptions) {
|
|
81
|
+
const { datasourceUrl, headers = {} } = queryOptions;
|
|
82
|
+
let url = `${datasourceUrl}${apiURI}`;
|
|
83
|
+
const urlParams = buildSearchParams(params).toString();
|
|
84
|
+
if (urlParams !== '') {
|
|
85
|
+
url += `?${urlParams}`;
|
|
86
|
+
}
|
|
87
|
+
return executeRequest(url, {
|
|
88
|
+
method: 'GET',
|
|
89
|
+
headers
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function getAlerts(params, queryOptions) {
|
|
93
|
+
const opts = queryOptions ?? {
|
|
94
|
+
datasourceUrl: ''
|
|
95
|
+
};
|
|
96
|
+
return fetchWithGet('/api/v2/alerts', params ?? {}, opts);
|
|
97
|
+
}
|
|
98
|
+
function getSilences(params, queryOptions) {
|
|
99
|
+
const opts = queryOptions ?? {
|
|
100
|
+
datasourceUrl: ''
|
|
101
|
+
};
|
|
102
|
+
return fetchWithGet('/api/v2/silences', params ?? {}, opts);
|
|
103
|
+
}
|
|
104
|
+
function getSilence(id, queryOptions) {
|
|
105
|
+
return fetchWithGet(`/api/v2/silence/${encodeURIComponent(id)}`, {}, queryOptions);
|
|
106
|
+
}
|
|
107
|
+
function createSilence(silence, queryOptions) {
|
|
108
|
+
const { datasourceUrl, headers = {} } = queryOptions;
|
|
109
|
+
return executeRequest(`${datasourceUrl}/api/v2/silences`, {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
headers: {
|
|
112
|
+
...headers,
|
|
113
|
+
'Content-Type': 'application/json'
|
|
114
|
+
},
|
|
115
|
+
body: JSON.stringify(silence)
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
async function deleteSilence(id, queryOptions) {
|
|
119
|
+
const { datasourceUrl, headers = {} } = queryOptions;
|
|
120
|
+
const response = await (0, _client.fetch)(`${datasourceUrl}/api/v2/silence/${encodeURIComponent(id)}`, {
|
|
121
|
+
method: 'DELETE',
|
|
122
|
+
headers
|
|
123
|
+
});
|
|
124
|
+
await throwOnError(response);
|
|
125
|
+
}
|
|
126
|
+
function getStatus(queryOptions) {
|
|
127
|
+
return fetchWithGet('/api/v2/status', {}, queryOptions);
|
|
128
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get ALERTMANAGER_DATASOURCE_KIND () {
|
|
25
|
+
return ALERTMANAGER_DATASOURCE_KIND;
|
|
26
|
+
},
|
|
27
|
+
get DEFAULT_ALERTMANAGER () {
|
|
28
|
+
return DEFAULT_ALERTMANAGER;
|
|
29
|
+
},
|
|
30
|
+
get extractDatasourceSelector () {
|
|
31
|
+
return extractDatasourceSelector;
|
|
32
|
+
},
|
|
33
|
+
get isAlertManagerDatasourceSelector () {
|
|
34
|
+
return isAlertManagerDatasourceSelector;
|
|
35
|
+
},
|
|
36
|
+
get isDefaultAlertManagerSelector () {
|
|
37
|
+
return isDefaultAlertManagerSelector;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
41
|
+
const ALERTMANAGER_DATASOURCE_KIND = 'AlertManagerDatasource';
|
|
42
|
+
const DEFAULT_ALERTMANAGER = {
|
|
43
|
+
kind: ALERTMANAGER_DATASOURCE_KIND
|
|
44
|
+
};
|
|
45
|
+
function isDefaultAlertManagerSelector(datasourceSelectValue) {
|
|
46
|
+
return !(0, _pluginsystem.isVariableDatasource)(datasourceSelectValue) && datasourceSelectValue.name === undefined;
|
|
47
|
+
}
|
|
48
|
+
function isAlertManagerDatasourceSelector(datasourceSelectValue) {
|
|
49
|
+
return (0, _pluginsystem.isVariableDatasource)(datasourceSelectValue) || datasourceSelectValue.kind === ALERTMANAGER_DATASOURCE_KIND;
|
|
50
|
+
}
|
|
51
|
+
function extractDatasourceSelector(queryResults) {
|
|
52
|
+
const defSpec = queryResults[0]?.definition?.spec;
|
|
53
|
+
if (defSpec && typeof defSpec === 'object' && 'plugin' in defSpec) {
|
|
54
|
+
const plugin = defSpec.plugin;
|
|
55
|
+
if (plugin && typeof plugin === 'object' && 'spec' in plugin) {
|
|
56
|
+
const spec = plugin.spec;
|
|
57
|
+
if (spec && typeof spec === 'object' && 'datasource' in spec) {
|
|
58
|
+
const ds = spec.datasource;
|
|
59
|
+
if (ds && typeof ds === 'object' && 'kind' in ds) {
|
|
60
|
+
return ds;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return DEFAULT_ALERTMANAGER;
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* Alert Manager v2 API response types.
|
|
15
|
+
* Based on the Alertmanager OpenAPI v2 spec.
|
|
16
|
+
* @see https://github.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml
|
|
17
|
+
*/ /**
|
|
18
|
+
* A matcher used by silences and alerts.
|
|
19
|
+
*/ "use strict";
|
|
20
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./api-types"), exports);
|
|
18
|
+
_export_star(require("./alertmanager-client"), exports);
|
|
19
|
+
_export_star(require("./alertmanager-selectors"), exports);
|
|
20
|
+
function _export_star(from, to) {
|
|
21
|
+
Object.keys(from).forEach(function(k) {
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
+
Object.defineProperty(to, k, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return from[k];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return from;
|
|
32
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "AlertManagerDatasourceEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return AlertManagerDatasourceEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
function AlertManagerDatasourceEditor(props) {
|
|
26
|
+
const { value, onChange, isReadonly } = props;
|
|
27
|
+
const initialSpecDirect = {
|
|
28
|
+
directUrl: ''
|
|
29
|
+
};
|
|
30
|
+
const initialSpecProxy = {
|
|
31
|
+
proxy: {
|
|
32
|
+
kind: 'HTTPProxy',
|
|
33
|
+
spec: {
|
|
34
|
+
allowedEndpoints: [
|
|
35
|
+
{
|
|
36
|
+
endpointPattern: '/api/v2/alerts',
|
|
37
|
+
method: 'GET'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
endpointPattern: '/api/v2/silences',
|
|
41
|
+
method: 'GET'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
endpointPattern: '/api/v2/silences',
|
|
45
|
+
method: 'POST'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
endpointPattern: '/api/v2/silence/.*',
|
|
49
|
+
method: 'GET'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
endpointPattern: '/api/v2/silence/.*',
|
|
53
|
+
method: 'DELETE'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
endpointPattern: '/api/v2/status',
|
|
57
|
+
method: 'GET'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
url: ''
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
|
|
65
|
+
value: value,
|
|
66
|
+
onChange: onChange,
|
|
67
|
+
isReadonly: isReadonly,
|
|
68
|
+
initialSpecDirect: initialSpecDirect,
|
|
69
|
+
initialSpecProxy: initialSpecProxy
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "AlertTable", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return AlertTable;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _AlertTableColumnsEditor = require("./AlertTableColumnsEditor");
|
|
24
|
+
const _AlertTableDeduplicationEditor = require("./AlertTableDeduplicationEditor");
|
|
25
|
+
const _AlertTableLabelsEditor = require("./AlertTableLabelsEditor");
|
|
26
|
+
const _AlertTableOptionsEditor = require("./AlertTableOptionsEditor");
|
|
27
|
+
const _AlertTablePanel = require("./AlertTablePanel");
|
|
28
|
+
const AlertTable = {
|
|
29
|
+
PanelComponent: _AlertTablePanel.AlertTablePanel,
|
|
30
|
+
supportedQueryTypes: [
|
|
31
|
+
'AlertsQuery'
|
|
32
|
+
],
|
|
33
|
+
panelOptionsEditorComponents: [
|
|
34
|
+
{
|
|
35
|
+
label: 'General',
|
|
36
|
+
content: _AlertTableOptionsEditor.AlertTableOptionsEditor
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Columns',
|
|
40
|
+
content: _AlertTableColumnsEditor.AlertTableColumnsEditor
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Labels',
|
|
44
|
+
content: _AlertTableLabelsEditor.AlertTableLabelsEditor
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Deduplication',
|
|
48
|
+
content: _AlertTableDeduplicationEditor.AlertTableDeduplicationEditor
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
createInitialOptions: ()=>({
|
|
52
|
+
defaultGroupBy: [
|
|
53
|
+
'alertname'
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "AlertTableColumnsEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return AlertTableColumnsEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _immer = require("immer");
|
|
26
|
+
const _react = require("react");
|
|
27
|
+
const _ColumnsEditor = require("../../components/ColumnsEditor");
|
|
28
|
+
const SORT_MODE_LABELS = {
|
|
29
|
+
alphabetical: 'Alphabetical',
|
|
30
|
+
numeric: 'Numeric',
|
|
31
|
+
severity: 'Severity (critical → other)',
|
|
32
|
+
status: 'Status (firing → resolved)'
|
|
33
|
+
};
|
|
34
|
+
function AlertTableColumnsEditor(props) {
|
|
35
|
+
const { value, onChange } = props;
|
|
36
|
+
const columns = value.columns ?? [];
|
|
37
|
+
const handleAddColumn = (0, _react.useCallback)(()=>{
|
|
38
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
39
|
+
if (!draft.columns) draft.columns = [];
|
|
40
|
+
draft.columns.push({
|
|
41
|
+
name: ''
|
|
42
|
+
});
|
|
43
|
+
}));
|
|
44
|
+
}, [
|
|
45
|
+
value,
|
|
46
|
+
onChange
|
|
47
|
+
]);
|
|
48
|
+
const handleRemoveColumn = (0, _react.useCallback)((index)=>{
|
|
49
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
50
|
+
draft.columns?.splice(index, 1);
|
|
51
|
+
}));
|
|
52
|
+
}, [
|
|
53
|
+
value,
|
|
54
|
+
onChange
|
|
55
|
+
]);
|
|
56
|
+
const handleUpdateColumn = (0, _react.useCallback)((index, updater)=>{
|
|
57
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
58
|
+
const column = draft.columns?.[index];
|
|
59
|
+
if (column) {
|
|
60
|
+
updater(column);
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
}, [
|
|
64
|
+
value,
|
|
65
|
+
onChange
|
|
66
|
+
]);
|
|
67
|
+
const handleMoveUp = (0, _react.useCallback)((index)=>{
|
|
68
|
+
if (index <= 0) return;
|
|
69
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
70
|
+
if (!draft.columns) 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
|
+
const handleMoveDown = (0, _react.useCallback)((index)=>{
|
|
79
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
80
|
+
if (!draft.columns || index >= draft.columns.length - 1) return;
|
|
81
|
+
const item = draft.columns.splice(index, 1)[0];
|
|
82
|
+
draft.columns.splice(index + 1, 0, item);
|
|
83
|
+
}));
|
|
84
|
+
}, [
|
|
85
|
+
value,
|
|
86
|
+
onChange
|
|
87
|
+
]);
|
|
88
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ColumnsEditor.ColumnsEditor, {
|
|
89
|
+
columns: columns,
|
|
90
|
+
description: "Status and Alert Name are always shown. Add extra columns below.",
|
|
91
|
+
sortModeLabels: SORT_MODE_LABELS,
|
|
92
|
+
defaultSortMode: "alphabetical",
|
|
93
|
+
getDisplayName: (col)=>col.header || col.name || 'New column',
|
|
94
|
+
getHeaderPlaceholder: (col)=>col.name || 'Column header',
|
|
95
|
+
onAdd: handleAddColumn,
|
|
96
|
+
onRemove: handleRemoveColumn,
|
|
97
|
+
onUpdate: handleUpdateColumn,
|
|
98
|
+
onMoveUp: handleMoveUp,
|
|
99
|
+
onMoveDown: handleMoveDown,
|
|
100
|
+
renderNameField: (col, index, onUpdate)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
101
|
+
label: "Label key",
|
|
102
|
+
value: col.name,
|
|
103
|
+
onChange: (e)=>onUpdate(index, (draft)=>{
|
|
104
|
+
draft.name = e.target.value;
|
|
105
|
+
}),
|
|
106
|
+
size: "small",
|
|
107
|
+
fullWidth: true
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "AlertTableDeduplicationEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return AlertTableDeduplicationEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _components = require("@perses-dev/components");
|
|
26
|
+
const _immer = require("immer");
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
const MODE_DESCRIPTIONS = {
|
|
29
|
+
none: 'No deduplication. All alerts from all datasources are shown as-is.',
|
|
30
|
+
fingerprint: 'Alerts with the same fingerprint from different datasources are merged. This is the default.',
|
|
31
|
+
labels: 'Alerts are considered duplicates when all specified label values match.'
|
|
32
|
+
};
|
|
33
|
+
function AlertTableDeduplicationEditor(props) {
|
|
34
|
+
const { value, onChange } = props;
|
|
35
|
+
const dedup = value.deduplication ?? {
|
|
36
|
+
mode: 'fingerprint'
|
|
37
|
+
};
|
|
38
|
+
const handleModeChange = (0, _react.useCallback)((mode)=>{
|
|
39
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
40
|
+
draft.deduplication = {
|
|
41
|
+
mode
|
|
42
|
+
};
|
|
43
|
+
if (mode === 'labels') {
|
|
44
|
+
draft.deduplication.labels = draft.deduplication.labels ?? [];
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
}, [
|
|
48
|
+
value,
|
|
49
|
+
onChange
|
|
50
|
+
]);
|
|
51
|
+
const handleLabelsChange = (0, _react.useCallback)((_event, newLabels)=>{
|
|
52
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
53
|
+
if (!draft.deduplication) {
|
|
54
|
+
draft.deduplication = {
|
|
55
|
+
mode: 'labels'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
draft.deduplication.labels = newLabels.length > 0 ? newLabels : undefined;
|
|
59
|
+
}));
|
|
60
|
+
}, [
|
|
61
|
+
value,
|
|
62
|
+
onChange
|
|
63
|
+
]);
|
|
64
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_components.OptionsEditorGroup, {
|
|
67
|
+
title: "Mode",
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.FormControl, {
|
|
70
|
+
size: "small",
|
|
71
|
+
fullWidth: true,
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
74
|
+
id: "dedup-mode-label",
|
|
75
|
+
children: "Deduplication Mode"
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
|
|
78
|
+
labelId: "dedup-mode-label",
|
|
79
|
+
value: dedup.mode,
|
|
80
|
+
label: "Deduplication Mode",
|
|
81
|
+
onChange: (e)=>handleModeChange(e.target.value),
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
84
|
+
value: "none",
|
|
85
|
+
children: "None"
|
|
86
|
+
}),
|
|
87
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
88
|
+
value: "fingerprint",
|
|
89
|
+
children: "Fingerprint"
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
92
|
+
value: "labels",
|
|
93
|
+
children: "Labels"
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
100
|
+
variant: "body2",
|
|
101
|
+
color: "text.secondary",
|
|
102
|
+
sx: {
|
|
103
|
+
mt: 1
|
|
104
|
+
},
|
|
105
|
+
children: MODE_DESCRIPTIONS[dedup.mode]
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
}),
|
|
109
|
+
dedup.mode === 'labels' && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.OptionsEditorGroup, {
|
|
110
|
+
title: "Deduplication Labels",
|
|
111
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Autocomplete, {
|
|
112
|
+
multiple: true,
|
|
113
|
+
freeSolo: true,
|
|
114
|
+
options: [],
|
|
115
|
+
value: dedup.labels ?? [],
|
|
116
|
+
onChange: handleLabelsChange,
|
|
117
|
+
renderTags: (tagValues, getTagProps)=>tagValues.map((option, index)=>{
|
|
118
|
+
const { key, ...rest } = getTagProps({
|
|
119
|
+
index
|
|
120
|
+
});
|
|
121
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
|
|
122
|
+
label: option,
|
|
123
|
+
size: "small",
|
|
124
|
+
variant: "outlined",
|
|
125
|
+
...rest
|
|
126
|
+
}, key);
|
|
127
|
+
}),
|
|
128
|
+
renderInput: (params)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
129
|
+
...params,
|
|
130
|
+
size: "small",
|
|
131
|
+
placeholder: "Type a label key and press Enter",
|
|
132
|
+
helperText: "Alerts with identical values for all listed labels are considered duplicates."
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|