@perses-dev/alert-manager-plugin 0.2.0-beta.2 → 0.2.0-beta.3
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/__mf/js/{AlertManager.42d95b33.js → AlertManager.f6767b3e.js} +5 -5
- package/__mf/js/async/{1299.d5af4767.js → 1299.982921a1.js} +1 -1
- package/__mf/js/async/{1616.0c9baa4c.js → 1616.9fc43f1b.js} +1 -1
- package/__mf/js/async/{1871.5e21fb62.js → 1871.6538032b.js} +1 -1
- package/__mf/js/async/{1969.e54f3991.js → 1969.20c05344.js} +1 -1
- package/__mf/js/async/{2043.4e8f2371.js → 2043.590d0b56.js} +2 -2
- package/__mf/js/async/2197.35bb8607.js +1 -0
- package/__mf/js/async/{2218.8b7e30c2.js → 2218.f9b609b1.js} +2 -2
- package/__mf/js/async/{2317.e656eab3.js → 2317.53a1e673.js} +2 -2
- package/__mf/js/async/{2377.5295b064.js → 2377.b832000f.js} +1 -1
- package/__mf/js/async/{2657.e6a11726.js → 2657.1d9fecb1.js} +1 -1
- package/__mf/js/async/2830.7365f7c5.js +22 -0
- package/__mf/js/async/{3222.6ad1b128.js → 3222.cced5ca3.js} +1 -1
- package/__mf/js/async/{3514.e71d5cb9.js → 3514.5ab6f0e6.js} +2 -2
- package/__mf/js/async/{3910.1bd28e15.js → 3910.60ee9c10.js} +1 -1
- package/__mf/js/async/{392.26ae5cc4.js → 392.e89c9a0a.js} +2 -2
- package/__mf/js/async/{3963.181d3782.js → 3963.bdb382cd.js} +1 -1
- package/__mf/js/async/{4077.91abd1da.js → 4077.229ded9e.js} +1 -1
- package/__mf/js/async/{4121.f9595b70.js → 4121.64cff28e.js} +2 -2
- package/__mf/js/async/{4133.cc678ae9.js → 4133.1b0b31ea.js} +1 -1
- package/__mf/js/async/{4213.005a1a65.js → 4213.69382a3d.js} +1 -1
- package/__mf/js/async/{4466.7cca717d.js → 4466.11e5cf55.js} +1 -1
- package/__mf/js/async/{4481.5bc5aa13.js → 4481.6ed8711e.js} +1 -1
- package/__mf/js/async/{4496.3760da2f.js → 4496.7eabf058.js} +1 -1
- package/__mf/js/async/{4978.f1550309.js → 4978.81fe8a09.js} +1 -1
- package/__mf/js/async/{5038.b1e9133a.js → 5038.fe8ba8f6.js} +2 -2
- package/__mf/js/async/{5071.eeb1c9b1.js → 5071.b474a0c5.js} +1 -1
- package/__mf/js/async/{5759.84fc4d0b.js → 5759.06d9847b.js} +5 -5
- package/__mf/js/async/5944.5e72d52e.js +1 -0
- package/__mf/js/async/{6274.9f68ee7d.js → 6274.e86d96dc.js} +2 -2
- package/__mf/js/async/{6390.0fd40bd8.js → 6390.c7ef7335.js} +2 -2
- package/__mf/js/async/{6401.7bf2c4c2.js → 6401.d90d614b.js} +1 -1
- package/__mf/js/async/{6594.b3a19fc1.js → 6594.39fe2d63.js} +2 -2
- package/__mf/js/async/{6854.f05f8da0.js → 6854.20abc22d.js} +1 -1
- package/__mf/js/async/{6911.bc380f0c.js → 6911.36e58efc.js} +1 -1
- package/__mf/js/async/7177.2deb59f0.js +1 -0
- package/__mf/js/async/{7192.715c4cb3.js → 7192.f36295ba.js} +1 -1
- package/__mf/js/async/{733.8bc3bc96.js → 733.1392f91a.js} +1 -1
- package/__mf/js/async/7607.0509832f.js +52 -0
- package/__mf/js/async/{7862.10a19eef.js → 7862.0073336d.js} +2 -2
- package/__mf/js/async/{7978.4ca49c3a.js → 7978.dec4f496.js} +1 -1
- package/__mf/js/async/{8470.7ebe8e66.js → 8470.5d67493f.js} +2 -2
- package/__mf/js/async/{8697.7b6d10e1.js → 8697.e521f02c.js} +1 -1
- package/__mf/js/async/{873.fcc6e5b7.js → 873.9a6121aa.js} +1 -1
- package/__mf/js/async/{8907.5d1f9505.js → 8907.3755a812.js} +1 -1
- package/__mf/js/async/{9040.8de751d6.js → 9040.b32c9cb1.js} +2 -2
- package/__mf/js/async/{9184.307e83da.js → 9184.62cff779.js} +1 -1
- package/__mf/js/async/{9235.1b0d1de0.js → 9235.81d32de9.js} +1 -1
- package/__mf/js/async/{941.36858244.js → 941.f15d1506.js} +2 -2
- package/__mf/js/async/{9588.31544c69.js → 9588.e03c3890.js} +1 -1
- package/__mf/js/async/{9836.e4cf02db.js → 9836.3cba759d.js} +1 -1
- package/__mf/js/async/{__federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js → __federation_expose_AlertManagerAlertsExplorer.02d5bc8d.js} +2 -2
- package/__mf/js/async/{__federation_expose_AlertManagerAlertsQuery.27d99dac.js → __federation_expose_AlertManagerAlertsQuery.922d9637.js} +1 -1
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.76982b7f.js +2 -0
- package/__mf/js/async/{__federation_expose_AlertManagerSilencesExplorer.65e1901a.js → __federation_expose_AlertManagerSilencesExplorer.3c54ffb8.js} +2 -2
- package/__mf/js/async/{__federation_expose_AlertManagerSilencesQuery.f619a448.js → __federation_expose_AlertManagerSilencesQuery.40f5bea0.js} +2 -2
- package/__mf/js/async/{__federation_expose_AlertTable.6c37126b.js → __federation_expose_AlertTable.ae0f4d1e.js} +1 -1
- package/__mf/js/async/{__federation_expose_SilenceTable.3a614a2f.js → __federation_expose_SilenceTable.adfc4870.js} +1 -1
- package/__mf/js/async/{lib-router.20ba053c.js → lib-router.7d0dbc0c.js} +2 -2
- package/__mf/js/{main.babca431.js → main.9c7df2d5.js} +5 -5
- package/lib/model/alertmanager-selectors.d.ts +1 -1
- package/lib/plugins/AlertManagerDatasourceEditor.d.ts +2 -5
- package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -1
- package/lib/plugins/AlertManagerDatasourceEditor.js +4 -3
- package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -1
- package/lib/plugins/alertmanager-datasource.d.ts.map +1 -1
- package/lib/plugins/alertmanager-datasource.js +2 -1
- package/lib/plugins/alertmanager-datasource.js.map +1 -1
- package/mf-manifest.json +294 -294
- package/mf-stats.json +294 -294
- package/package.json +6 -6
- package/__mf/js/async/1522.04dc197d.js +0 -22
- package/__mf/js/async/2197.53bcb69e.js +0 -1
- package/__mf/js/async/2650.0b5955b5.js +0 -3
- package/__mf/js/async/5428.6922d4df.js +0 -1
- package/__mf/js/async/7177.83345474.js +0 -1
- package/__mf/js/async/__federation_expose_AlertManagerDatasource.c2b36e70.js +0 -2
- /package/__mf/js/async/{2043.4e8f2371.js.LICENSE.txt → 2043.590d0b56.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2218.8b7e30c2.js.LICENSE.txt → 2218.f9b609b1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2317.e656eab3.js.LICENSE.txt → 2317.53a1e673.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{1522.04dc197d.js.LICENSE.txt → 2830.7365f7c5.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3514.e71d5cb9.js.LICENSE.txt → 3514.5ab6f0e6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.26ae5cc4.js.LICENSE.txt → 392.e89c9a0a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.f9595b70.js.LICENSE.txt → 4121.64cff28e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5038.b1e9133a.js.LICENSE.txt → 5038.fe8ba8f6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5759.84fc4d0b.js.LICENSE.txt → 5759.06d9847b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.9f68ee7d.js.LICENSE.txt → 6274.e86d96dc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6390.0fd40bd8.js.LICENSE.txt → 6390.c7ef7335.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6594.b3a19fc1.js.LICENSE.txt → 6594.39fe2d63.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7862.10a19eef.js.LICENSE.txt → 7862.0073336d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.7ebe8e66.js.LICENSE.txt → 8470.5d67493f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9040.8de751d6.js.LICENSE.txt → 9040.b32c9cb1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.36858244.js.LICENSE.txt → 941.f15d1506.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js.LICENSE.txt → __federation_expose_AlertManagerAlertsExplorer.02d5bc8d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_AlertManagerDatasource.c2b36e70.js.LICENSE.txt → __federation_expose_AlertManagerDatasource.76982b7f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_AlertManagerSilencesExplorer.65e1901a.js.LICENSE.txt → __federation_expose_AlertManagerSilencesExplorer.3c54ffb8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_AlertManagerSilencesQuery.f619a448.js.LICENSE.txt → __federation_expose_AlertManagerSilencesQuery.40f5bea0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.20ba053c.js.LICENSE.txt → lib-router.7d0dbc0c.js.LICENSE.txt} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DatasourceSelectValue } from '@perses-dev/plugin-system';
|
|
2
2
|
import type { DatasourceSelector, QueryDefinition } from '@perses-dev/spec';
|
|
3
|
-
export declare const ALERTMANAGER_DATASOURCE_KIND:
|
|
3
|
+
export declare const ALERTMANAGER_DATASOURCE_KIND: 'AlertManagerDatasource';
|
|
4
4
|
export interface AlertManagerDatasourceSelector extends DatasourceSelector {
|
|
5
5
|
kind: typeof ALERTMANAGER_DATASOURCE_KIND;
|
|
6
6
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import type { DatasourceEditorProps } from '@perses-dev/plugin-system';
|
|
1
2
|
import type { ReactElement } from 'react';
|
|
2
3
|
import type { AlertManagerDatasourceSpec } from './types';
|
|
3
|
-
export
|
|
4
|
-
value: AlertManagerDatasourceSpec;
|
|
5
|
-
onChange: (next: AlertManagerDatasourceSpec) => void;
|
|
6
|
-
isReadonly?: boolean;
|
|
7
|
-
}
|
|
4
|
+
export type AlertManagerDatasourceEditorProps = DatasourceEditorProps<AlertManagerDatasourceSpec>;
|
|
8
5
|
export declare function AlertManagerDatasourceEditor(props: AlertManagerDatasourceEditorProps): ReactElement;
|
|
9
6
|
//# sourceMappingURL=AlertManagerDatasourceEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertManagerDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/AlertManagerDatasourceEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AlertManagerDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../src/plugins/AlertManagerDatasourceEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,iCAAiC,GAAG,qBAAqB,CAAC,0BAA0B,CAAC,CAAC;AAElG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,iCAAiC,GAAG,YAAY,CAoDnG"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
// Copyright The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,9 +10,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { HTTPSettingsEditor } from "@perses-dev/plugin-system";
|
|
15
15
|
export function AlertManagerDatasourceEditor(props) {
|
|
16
|
-
const { value, onChange, isReadonly } = props;
|
|
16
|
+
const { value, onChange, isReadonly, testConnection } = props;
|
|
17
17
|
const initialSpecDirect = {
|
|
18
18
|
directUrl: ''
|
|
19
19
|
};
|
|
@@ -56,7 +56,8 @@ export function AlertManagerDatasourceEditor(props) {
|
|
|
56
56
|
onChange: onChange,
|
|
57
57
|
isReadonly: isReadonly,
|
|
58
58
|
initialSpecDirect: initialSpecDirect,
|
|
59
|
-
initialSpecProxy: initialSpecProxy
|
|
59
|
+
initialSpecProxy: initialSpecProxy,
|
|
60
|
+
testConnection: testConnection
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugins/AlertManagerDatasourceEditor.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\n\nimport type { AlertManagerDatasourceSpec } from './types';\n\nexport
|
|
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 type { DatasourceEditorProps } from '@perses-dev/plugin-system';\nimport { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport type { ReactElement } from 'react';\n\nimport type { AlertManagerDatasourceSpec } from './types';\n\nexport type AlertManagerDatasourceEditorProps = DatasourceEditorProps<AlertManagerDatasourceSpec>;\n\nexport function AlertManagerDatasourceEditor(props: AlertManagerDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly, testConnection } = 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 testConnection={testConnection}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","AlertManagerDatasourceEditor","props","value","onChange","isReadonly","testConnection","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;;AAGjC,SAASA,kBAAkB,QAAQ,4BAA4B;AAO/D,OAAO,SAASC,6BAA6BC,KAAwC;IACnF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,cAAc,EAAE,GAAGJ;IAExD,MAAMK,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,KAAChB;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZE,mBAAmBA;QACnBE,kBAAkBA;QAClBH,gBAAgBA;;AAGtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alertmanager-datasource.d.ts","sourceRoot":"","sources":["../../../src/plugins/alertmanager-datasource.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AA6B1D,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,0BAA0B,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"alertmanager-datasource.d.ts","sourceRoot":"","sources":["../../../src/plugins/alertmanager-datasource.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AA6B1D,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,0BAA0B,EAAE,kBAAkB,CAKnG,CAAC"}
|
|
@@ -55,7 +55,8 @@ export const AlertManagerDatasource = {
|
|
|
55
55
|
OptionsEditorComponent: AlertManagerDatasourceEditor,
|
|
56
56
|
createInitialOptions: ()=>({
|
|
57
57
|
directUrl: ''
|
|
58
|
-
})
|
|
58
|
+
}),
|
|
59
|
+
healthCheckPath: '/api/v2/status'
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
//# sourceMappingURL=alertmanager-datasource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugins/alertmanager-datasource.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 type { DatasourcePlugin } from '@perses-dev/plugin-system';\n\nimport type { AlertManagerClient } from '../model';\nimport { getAlerts, getSilences, getSilence, createSilence, deleteSilence, getStatus } from '../model';\nimport { AlertManagerDatasourceEditor } from './AlertManagerDatasourceEditor';\nimport type { AlertManagerDatasourceSpec } from './types';\n\nconst createClient: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient>['createClient'] = (\n spec,\n options,\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Alert Manager client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n getAlerts: (params, headers) => getAlerts(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilences: (params, headers) => getSilences(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilence: (id, headers) => getSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n createSilence: (silence, headers) => createSilence(silence, { datasourceUrl, headers: headers ?? specHeaders }),\n deleteSilence: (id, headers) => deleteSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n getStatus: (headers) => getStatus({ datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const AlertManagerDatasource: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient> = {\n createClient,\n OptionsEditorComponent: AlertManagerDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["getAlerts","getSilences","getSilence","createSilence","deleteSilence","getStatus","AlertManagerDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","id","silence","AlertManagerDatasource","OptionsEditorComponent","createInitialOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAKjC,SAASA,SAAS,EAAEC,WAAW,EAAEC,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,SAAS,QAAQ,oBAAW;AACvG,SAASC,4BAA4B,QAAQ,oCAAiC;AAG9E,MAAMC,eAAiG,CACrGC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAb,WAAW,CAACkB,QAAQD,UAAYjB,UAAUkB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACnGf,aAAa,CAACiB,QAAQD,UAAYhB,YAAYiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACvGd,YAAY,CAACiB,IAAIF,UAAYf,WAAWiB,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QAC7Fb,eAAe,CAACiB,SAASH,UAAYd,cAAciB,SAAS;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QAC7GZ,eAAe,CAACe,IAAIF,UAAYb,cAAce,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QACnGX,WAAW,CAACY,UAAYZ,UAAU;gBAAEQ;gBAAeI,SAASA,WAAWD;YAAY;IACrF;AACF;AAEA,OAAO,MAAMK,yBAA2F;IACtGd;IACAe,wBAAwBhB;IACxBiB,sBAAsB,IAAO,CAAA;YAAEb,WAAW;QAAG,CAAA;
|
|
1
|
+
{"version":3,"sources":["../../../src/plugins/alertmanager-datasource.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 type { DatasourcePlugin } from '@perses-dev/plugin-system';\n\nimport type { AlertManagerClient } from '../model';\nimport { getAlerts, getSilences, getSilence, createSilence, deleteSilence, getStatus } from '../model';\nimport { AlertManagerDatasourceEditor } from './AlertManagerDatasourceEditor';\nimport type { AlertManagerDatasourceSpec } from './types';\n\nconst createClient: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient>['createClient'] = (\n spec,\n options,\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error('No URL specified for Alert Manager client. You can use directUrl in the spec to configure it.');\n }\n\n const specHeaders = proxy?.spec.headers;\n\n return {\n options: {\n datasourceUrl,\n },\n getAlerts: (params, headers) => getAlerts(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilences: (params, headers) => getSilences(params, { datasourceUrl, headers: headers ?? specHeaders }),\n getSilence: (id, headers) => getSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n createSilence: (silence, headers) => createSilence(silence, { datasourceUrl, headers: headers ?? specHeaders }),\n deleteSilence: (id, headers) => deleteSilence(id, { datasourceUrl, headers: headers ?? specHeaders }),\n getStatus: (headers) => getStatus({ datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const AlertManagerDatasource: DatasourcePlugin<AlertManagerDatasourceSpec, AlertManagerClient> = {\n createClient,\n OptionsEditorComponent: AlertManagerDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n healthCheckPath: '/api/v2/status',\n};\n"],"names":["getAlerts","getSilences","getSilence","createSilence","deleteSilence","getStatus","AlertManagerDatasourceEditor","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","id","silence","AlertManagerDatasource","OptionsEditorComponent","createInitialOptions","healthCheckPath"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAKjC,SAASA,SAAS,EAAEC,WAAW,EAAEC,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,SAAS,QAAQ,oBAAW;AACvG,SAASC,4BAA4B,QAAQ,oCAAiC;AAG9E,MAAMC,eAAiG,CACrGC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,cAAcL,OAAOH,KAAKS;IAEhC,OAAO;QACLR,SAAS;YACPI;QACF;QACAb,WAAW,CAACkB,QAAQD,UAAYjB,UAAUkB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACnGf,aAAa,CAACiB,QAAQD,UAAYhB,YAAYiB,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;QACvGd,YAAY,CAACiB,IAAIF,UAAYf,WAAWiB,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QAC7Fb,eAAe,CAACiB,SAASH,UAAYd,cAAciB,SAAS;gBAAEP;gBAAeI,SAASA,WAAWD;YAAY;QAC7GZ,eAAe,CAACe,IAAIF,UAAYb,cAAce,IAAI;gBAAEN;gBAAeI,SAASA,WAAWD;YAAY;QACnGX,WAAW,CAACY,UAAYZ,UAAU;gBAAEQ;gBAAeI,SAASA,WAAWD;YAAY;IACrF;AACF;AAEA,OAAO,MAAMK,yBAA2F;IACtGd;IACAe,wBAAwBhB;IACxBiB,sBAAsB,IAAO,CAAA;YAAEb,WAAW;QAAG,CAAA;IAC7Cc,iBAAiB;AACnB,EAAE"}
|