@perses-dev/pyroscope-plugin 0.2.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 +23 -0
- package/__mf/css/async/1339.6763d50b.css +1 -0
- package/__mf/css/async/4758.6763d50b.css +1 -0
- package/__mf/css/async/9633.6763d50b.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/Pyroscope.24cb38f3.js +5 -0
- package/__mf/js/async/1101.380fb9ae.js +73 -0
- package/__mf/js/async/1101.380fb9ae.js.LICENSE.txt +19 -0
- package/__mf/js/async/1339.e58b309f.js +1 -0
- package/__mf/js/async/1964.88ffca96.js +2 -0
- package/__mf/js/async/1964.88ffca96.js.LICENSE.txt +9 -0
- package/__mf/js/async/2002.8fc3eb19.js +1 -0
- package/__mf/js/async/2114.6befeb2d.js +1 -0
- package/__mf/js/async/2292.ed7843fc.js +2 -0
- package/__mf/js/async/2292.ed7843fc.js.LICENSE.txt +24 -0
- package/__mf/js/async/2911.ec166b7f.js +38 -0
- package/__mf/js/async/3224.755c2f09.js +1 -0
- package/__mf/js/async/3431.bc5c0624.js +1 -0
- package/__mf/js/async/3863.dbe40473.js +2 -0
- package/__mf/js/async/3863.dbe40473.js.LICENSE.txt +9 -0
- package/__mf/js/async/3960.a5d41140.js +2 -0
- package/__mf/js/async/3960.a5d41140.js.LICENSE.txt +8 -0
- package/__mf/js/async/3980.f1ef0ece.js +2 -0
- package/__mf/js/async/3980.f1ef0ece.js.LICENSE.txt +9 -0
- package/__mf/js/async/4075.cde93ec7.js +1 -0
- package/__mf/js/async/4238.f154b81c.js +1 -0
- package/__mf/js/async/424.edb69d58.js +1 -0
- package/__mf/js/async/4368.2d817d5d.js +2 -0
- package/__mf/js/async/4368.2d817d5d.js.LICENSE.txt +15 -0
- package/__mf/js/async/4421.d44d1d6f.js +1 -0
- package/__mf/js/async/4556.aabe5dff.js +2 -0
- package/__mf/js/async/4556.aabe5dff.js.LICENSE.txt +9 -0
- package/__mf/js/async/4758.a629b413.js +1 -0
- package/__mf/js/async/5214.8d3dd135.js +1 -0
- package/__mf/js/async/5215.6fd5cc14.js +1 -0
- package/__mf/js/async/5220.d1e40fff.js +10 -0
- package/__mf/js/async/5220.d1e40fff.js.LICENSE.txt +17 -0
- package/__mf/js/async/5358.40b9537e.js +7 -0
- package/__mf/js/async/5358.40b9537e.js.LICENSE.txt +21 -0
- package/__mf/js/async/5409.0df9c301.js +1 -0
- package/__mf/js/async/5790.677172d7.js +1 -0
- package/__mf/js/async/5876.38b119d5.js +2 -0
- package/__mf/js/async/5876.38b119d5.js.LICENSE.txt +21 -0
- package/__mf/js/async/5924.582b0cc4.js +2 -0
- package/__mf/js/async/5924.582b0cc4.js.LICENSE.txt +9 -0
- package/__mf/js/async/5981.9c662ef8.js +2 -0
- package/__mf/js/async/5981.9c662ef8.js.LICENSE.txt +8 -0
- package/__mf/js/async/6292.e30a4c42.js +1 -0
- package/__mf/js/async/6377.f6e824aa.js +2 -0
- package/__mf/js/async/6377.f6e824aa.js.LICENSE.txt +32 -0
- package/__mf/js/async/6770.2f87fe88.js +1 -0
- package/__mf/js/async/694.5e15c44d.js +1 -0
- package/__mf/js/async/7376.c4cd77b0.js +1 -0
- package/__mf/js/async/738.fa73528b.js +1 -0
- package/__mf/js/async/7740.474defbd.js +1 -0
- package/__mf/js/async/8216.be450b83.js +1 -0
- package/__mf/js/async/8488.00c7f348.js +1 -0
- package/__mf/js/async/8930.496019db.js +1 -0
- package/__mf/js/async/9092.cfd47472.js +101 -0
- package/__mf/js/async/9173.5959814f.js +2 -0
- package/__mf/js/async/9173.5959814f.js.LICENSE.txt +19 -0
- package/__mf/js/async/9478.c76fe552.js +2 -0
- package/__mf/js/async/9478.c76fe552.js.LICENSE.txt +9 -0
- package/__mf/js/async/9633.a7997138.js +2 -0
- package/__mf/js/async/9633.a7997138.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_PyroscopeDatasource.76f63abf.js +2 -0
- package/__mf/js/async/__federation_expose_PyroscopeDatasource.76f63abf.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_PyroscopeExplorer.88d5e4fb.js +2 -0
- package/__mf/js/async/__federation_expose_PyroscopeExplorer.88d5e4fb.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.75c9c11b.js +2 -0
- package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.75c9c11b.js.LICENSE.txt +9 -0
- package/__mf/js/main.4caf1064.js +5 -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/AddFilterItem.js +38 -0
- package/lib/cjs/components/DeleteFilterItem.js +42 -0
- package/lib/cjs/components/FilterItem.js +83 -0
- package/lib/cjs/components/Filters.js +106 -0
- package/lib/cjs/components/LabelName.js +59 -0
- package/lib/cjs/components/LabelValue.js +59 -0
- package/lib/cjs/components/Operator.js +45 -0
- package/lib/cjs/components/ProfileTypeSelector.js +57 -0
- package/lib/cjs/components/Service.js +60 -0
- package/lib/cjs/components/index.js +32 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/explore/PyroscopeExplorer.js +90 -0
- package/lib/cjs/explore/index.js +30 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +40 -0
- package/lib/cjs/model/api-types.js +19 -0
- package/lib/cjs/model/index.js +33 -0
- package/lib/cjs/model/profile-query-model.js +16 -0
- package/lib/cjs/model/pyroscope-client.js +94 -0
- package/lib/cjs/model/pyroscope-selectors.js +46 -0
- package/lib/cjs/plugins/PyroscopeDatasourceEditor.js +70 -0
- package/lib/cjs/plugins/index.js +33 -0
- package/lib/cjs/plugins/pyroscope-datasource-types.js +16 -0
- package/lib/cjs/plugins/pyroscope-datasource.js +68 -0
- package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +41 -0
- package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +114 -0
- package/lib/cjs/plugins/pyroscope-profile-query/get-profile-data.js +201 -0
- package/lib/cjs/plugins/pyroscope-profile-query/index.js +33 -0
- package/lib/cjs/plugins/pyroscope-profile-query/query-editor-model.js +120 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/cjs/test/index.js +30 -0
- package/lib/cjs/test/mock-data.js +151 -0
- package/lib/cjs/test/setup-tests.js +17 -0
- package/lib/cjs/utils/types.js +25 -0
- package/lib/cjs/utils/use-query.js +112 -0
- package/lib/components/AddFilterItem.d.ts +6 -0
- package/lib/components/AddFilterItem.d.ts.map +1 -0
- package/lib/components/AddFilterItem.js +25 -0
- package/lib/components/AddFilterItem.js.map +1 -0
- package/lib/components/DeleteFilterItem.d.ts +6 -0
- package/lib/components/DeleteFilterItem.d.ts.map +1 -0
- package/lib/components/DeleteFilterItem.js +29 -0
- package/lib/components/DeleteFilterItem.js.map +1 -0
- package/lib/components/FilterItem.d.ts +11 -0
- package/lib/components/FilterItem.d.ts.map +1 -0
- package/lib/components/FilterItem.js +75 -0
- package/lib/components/FilterItem.js.map +1 -0
- package/lib/components/Filters.d.ts +10 -0
- package/lib/components/Filters.d.ts.map +1 -0
- package/lib/components/Filters.js +98 -0
- package/lib/components/Filters.js.map +1 -0
- package/lib/components/LabelName.d.ts +9 -0
- package/lib/components/LabelName.d.ts.map +1 -0
- package/lib/components/LabelName.js +51 -0
- package/lib/components/LabelName.js.map +1 -0
- package/lib/components/LabelValue.d.ts +10 -0
- package/lib/components/LabelValue.d.ts.map +1 -0
- package/lib/components/LabelValue.js +51 -0
- package/lib/components/LabelValue.js.map +1 -0
- package/lib/components/Operator.d.ts +7 -0
- package/lib/components/Operator.d.ts.map +1 -0
- package/lib/components/Operator.js +37 -0
- package/lib/components/Operator.js.map +1 -0
- package/lib/components/ProfileTypeSelector.d.ts +9 -0
- package/lib/components/ProfileTypeSelector.d.ts.map +1 -0
- package/lib/components/ProfileTypeSelector.js +49 -0
- package/lib/components/ProfileTypeSelector.js.map +1 -0
- package/lib/components/Service.d.ts +9 -0
- package/lib/components/Service.d.ts.map +1 -0
- package/lib/components/Service.js +52 -0
- package/lib/components/Service.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +17 -0
- package/lib/components/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/explore/PyroscopeExplorer.d.ts +3 -0
- package/lib/explore/PyroscopeExplorer.d.ts.map +1 -0
- package/lib/explore/PyroscopeExplorer.js +82 -0
- package/lib/explore/PyroscopeExplorer.js.map +1 -0
- package/lib/explore/index.d.ts +2 -0
- package/lib/explore/index.d.ts.map +1 -0
- package/lib/explore/index.js +15 -0
- package/lib/explore/index.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +28 -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 +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/model/api-types.d.ts +82 -0
- package/lib/model/api-types.d.ts.map +1 -0
- package/lib/model/api-types.js +20 -0
- package/lib/model/api-types.js.map +1 -0
- package/lib/model/index.d.ts +5 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +18 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/profile-query-model.d.ts +13 -0
- package/lib/model/profile-query-model.d.ts.map +1 -0
- package/lib/model/profile-query-model.js +17 -0
- package/lib/model/profile-query-model.js.map +1 -0
- package/lib/model/pyroscope-client.d.ts +43 -0
- package/lib/model/pyroscope-client.d.ts.map +1 -0
- package/lib/model/pyroscope-client.js +77 -0
- package/lib/model/pyroscope-client.js.map +1 -0
- package/lib/model/pyroscope-selectors.d.ts +21 -0
- package/lib/model/pyroscope-selectors.d.ts.map +1 -0
- package/lib/model/pyroscope-selectors.js +30 -0
- package/lib/model/pyroscope-selectors.js.map +1 -0
- package/lib/plugins/PyroscopeDatasourceEditor.d.ts +9 -0
- package/lib/plugins/PyroscopeDatasourceEditor.d.ts.map +1 -0
- package/lib/plugins/PyroscopeDatasourceEditor.js +57 -0
- package/lib/plugins/PyroscopeDatasourceEditor.js.map +1 -0
- package/lib/plugins/index.d.ts +5 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +18 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/pyroscope-datasource-types.d.ts +6 -0
- package/lib/plugins/pyroscope-datasource-types.d.ts.map +1 -0
- package/lib/plugins/pyroscope-datasource-types.js +15 -0
- package/lib/plugins/pyroscope-datasource-types.js.map +1 -0
- package/lib/plugins/pyroscope-datasource.d.ts +5 -0
- package/lib/plugins/pyroscope-datasource.d.ts.map +1 -0
- package/lib/plugins/pyroscope-datasource.js +60 -0
- package/lib/plugins/pyroscope-datasource.js.map +1 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.d.ts +14 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.d.ts.map +1 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +33 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js.map +1 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.d.ts +4 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.d.ts.map +1 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +106 -0
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js.map +1 -0
- package/lib/plugins/pyroscope-profile-query/get-profile-data.d.ts +9 -0
- package/lib/plugins/pyroscope-profile-query/get-profile-data.d.ts.map +1 -0
- package/lib/plugins/pyroscope-profile-query/get-profile-data.js +185 -0
- package/lib/plugins/pyroscope-profile-query/get-profile-data.js.map +1 -0
- package/lib/plugins/pyroscope-profile-query/index.d.ts +5 -0
- package/lib/plugins/pyroscope-profile-query/index.d.ts.map +1 -0
- package/lib/plugins/pyroscope-profile-query/index.js +18 -0
- package/lib/plugins/pyroscope-profile-query/index.js.map +1 -0
- package/lib/plugins/pyroscope-profile-query/query-editor-model.d.ts +34 -0
- package/lib/plugins/pyroscope-profile-query/query-editor-model.d.ts.map +1 -0
- package/lib/plugins/pyroscope-profile-query/query-editor-model.js +106 -0
- package/lib/plugins/pyroscope-profile-query/query-editor-model.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 +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/lib/test/index.d.ts +2 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +15 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/mock-data.d.ts +5 -0
- package/lib/test/mock-data.d.ts.map +1 -0
- package/lib/test/mock-data.js +133 -0
- package/lib/test/mock-data.js.map +1 -0
- package/lib/test/setup-tests.d.ts +2 -0
- package/lib/test/setup-tests.d.ts.map +1 -0
- package/lib/test/setup-tests.js +15 -0
- package/lib/test/setup-tests.js.map +1 -0
- package/lib/utils/types.d.ts +8 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +17 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/use-query.d.ts +9 -0
- package/lib/utils/use-query.d.ts.map +1 -0
- package/lib/utils/use-query.js +87 -0
- package/lib/utils/use-query.js.map +1 -0
- package/mf-manifest.json +455 -0
- package/mf-stats.json +539 -0
- package/package.json +88 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 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("./get-profile-data"), exports);
|
|
18
|
+
_export_star(require("./PyroscopeProfileQuery"), exports);
|
|
19
|
+
_export_star(require("./PyroscopeProfileQueryEditor"), exports);
|
|
20
|
+
_export_star(require("./query-editor-model"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Copyright 2025 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
useFiltersState: function() {
|
|
25
|
+
return useFiltersState;
|
|
26
|
+
},
|
|
27
|
+
useMaxNodesState: function() {
|
|
28
|
+
return useMaxNodesState;
|
|
29
|
+
},
|
|
30
|
+
useProfileTypeState: function() {
|
|
31
|
+
return useProfileTypeState;
|
|
32
|
+
},
|
|
33
|
+
useServiceState: function() {
|
|
34
|
+
return useServiceState;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const _react = require("react");
|
|
38
|
+
const _immer = require("immer");
|
|
39
|
+
function useMaxNodesState(props) {
|
|
40
|
+
const { onChange, value } = props;
|
|
41
|
+
const [maxNodes, setMaxNodes] = (0, _react.useState)(value.maxNodes ? value.maxNodes.toString() : '');
|
|
42
|
+
const [lastSyncedMaxNodes, setLastSyncedMaxNodes] = (0, _react.useState)(value.maxNodes);
|
|
43
|
+
if (value.maxNodes !== lastSyncedMaxNodes) {
|
|
44
|
+
setMaxNodes(value.maxNodes ? value.maxNodes.toString() : '');
|
|
45
|
+
setLastSyncedMaxNodes(value.maxNodes);
|
|
46
|
+
}
|
|
47
|
+
// maxNodes must be empty or an integer between 0 and max_flamegraph_nodes_max (0 < maxNodes <= max_flamegraph_nodes_max)
|
|
48
|
+
// what is the actual value of max_flamegraph_nodes_max?
|
|
49
|
+
// todo: add a constraint to the maxNodes related to max_flamegraph_nodes_max
|
|
50
|
+
const maxNodesHasError = !(maxNodes === '' || /^[0-9]+$/.test(maxNodes) && parseInt(maxNodes) > 0);
|
|
51
|
+
// Update our local state as the user types
|
|
52
|
+
const handleMaxNodesChange = (e)=>{
|
|
53
|
+
setMaxNodes(e);
|
|
54
|
+
// Propagate changes to the panel immediately
|
|
55
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
56
|
+
draft.maxNodes = e === '' ? undefined : parseInt(e);
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
maxNodes,
|
|
61
|
+
handleMaxNodesChange,
|
|
62
|
+
maxNodesHasError
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function useProfileTypeState(props) {
|
|
66
|
+
const { onChange, value } = props;
|
|
67
|
+
const [profileType, setProfileType] = (0, _react.useState)(value.profileType ? value.profileType : '');
|
|
68
|
+
const [lastSyncedProfileType, setLastSyncedProfileType] = (0, _react.useState)(value.profileType);
|
|
69
|
+
if (value.profileType !== lastSyncedProfileType) {
|
|
70
|
+
setProfileType(value.profileType);
|
|
71
|
+
setLastSyncedProfileType(value.profileType);
|
|
72
|
+
}
|
|
73
|
+
// Update our local state as the user types
|
|
74
|
+
const handleProfileTypeChange = (e)=>{
|
|
75
|
+
setProfileType(e);
|
|
76
|
+
// Propagate changes to the panel immediately
|
|
77
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
78
|
+
draft.profileType = e;
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
profileType,
|
|
83
|
+
handleProfileTypeChange
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function useServiceState(props) {
|
|
87
|
+
const { onChange, value } = props;
|
|
88
|
+
const [service, setService] = (0, _react.useState)(value.service ? value.service : '');
|
|
89
|
+
const [lastSyncedService, setLastSyncedService] = (0, _react.useState)(value.service);
|
|
90
|
+
if (value.service !== lastSyncedService) {
|
|
91
|
+
setService(value.service || '');
|
|
92
|
+
setLastSyncedService(value.service);
|
|
93
|
+
}
|
|
94
|
+
// Update our local state as the user types
|
|
95
|
+
const handleServiceChange = (e)=>{
|
|
96
|
+
setService(e);
|
|
97
|
+
// Propagate changes to the panel immediately
|
|
98
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
99
|
+
draft.service = e;
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
service,
|
|
104
|
+
handleServiceChange
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function useFiltersState(props) {
|
|
108
|
+
const { onChange, value } = props;
|
|
109
|
+
const [filters, setFilters] = (0, _react.useState)(value.filters ? value.filters : []);
|
|
110
|
+
const handleFiltersChange = (f)=>{
|
|
111
|
+
setFilters(f);
|
|
112
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
113
|
+
draft.filters = f;
|
|
114
|
+
}));
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
filters,
|
|
118
|
+
handleFiltersChange
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
require("@testing-library/jest-dom");
|
|
18
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
19
|
+
jest.mock('echarts/core');
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2025 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("./mock-data"), exports);
|
|
18
|
+
function _export_star(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
+
Object.defineProperty(to, k, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return from[k];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Copyright 2025 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
MOCK_LABEL_NAMES_RESPONSE: function() {
|
|
25
|
+
return MOCK_LABEL_NAMES_RESPONSE;
|
|
26
|
+
},
|
|
27
|
+
MOCK_LABEL_VALUES_RESPONSE_NAME_REGION: function() {
|
|
28
|
+
return MOCK_LABEL_VALUES_RESPONSE_NAME_REGION;
|
|
29
|
+
},
|
|
30
|
+
MOCK_PROFILE_TYPES_RESPONSE: function() {
|
|
31
|
+
return MOCK_PROFILE_TYPES_RESPONSE;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const MOCK_PROFILE_TYPES_RESPONSE = {
|
|
35
|
+
profileTypes: [
|
|
36
|
+
{
|
|
37
|
+
ID: 'block:contentions:count:contentions:count',
|
|
38
|
+
name: 'block',
|
|
39
|
+
sampleType: 'contentions',
|
|
40
|
+
sampleUnit: 'count',
|
|
41
|
+
periodType: 'contentions',
|
|
42
|
+
periodUnit: 'count'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
ID: 'block:delay:nanoseconds:contentions:count',
|
|
46
|
+
name: 'block',
|
|
47
|
+
sampleType: 'delay',
|
|
48
|
+
sampleUnit: 'nanoseconds',
|
|
49
|
+
periodType: 'contentions',
|
|
50
|
+
periodUnit: 'count'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
ID: 'goroutines:goroutine:count:goroutine:count',
|
|
54
|
+
name: 'goroutines',
|
|
55
|
+
sampleType: 'goroutine',
|
|
56
|
+
sampleUnit: 'count',
|
|
57
|
+
periodType: 'goroutine',
|
|
58
|
+
periodUnit: 'count'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
ID: 'memory:alloc_objects:count:space:bytes',
|
|
62
|
+
name: 'memory',
|
|
63
|
+
sampleType: 'alloc_objects',
|
|
64
|
+
sampleUnit: 'count',
|
|
65
|
+
periodType: 'space',
|
|
66
|
+
periodUnit: 'bytes'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
ID: 'memory:alloc_space:bytes:space:bytes',
|
|
70
|
+
name: 'memory',
|
|
71
|
+
sampleType: 'alloc_space',
|
|
72
|
+
sampleUnit: 'bytes',
|
|
73
|
+
periodType: 'space',
|
|
74
|
+
periodUnit: 'bytes'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
ID: 'memory:inuse_objects:count:space:bytes',
|
|
78
|
+
name: 'memory',
|
|
79
|
+
sampleType: 'inuse_objects',
|
|
80
|
+
sampleUnit: 'count',
|
|
81
|
+
periodType: 'space',
|
|
82
|
+
periodUnit: 'bytes'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
ID: 'memory:inuse_space:bytes:space:bytes',
|
|
86
|
+
name: 'memory',
|
|
87
|
+
sampleType: 'inuse_space',
|
|
88
|
+
sampleUnit: 'bytes',
|
|
89
|
+
periodType: 'space',
|
|
90
|
+
periodUnit: 'bytes'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
ID: 'mutex:contentions:count:contentions:count',
|
|
94
|
+
name: 'mutex',
|
|
95
|
+
sampleType: 'contentions',
|
|
96
|
+
sampleUnit: 'count',
|
|
97
|
+
periodType: 'contentions',
|
|
98
|
+
periodUnit: 'count'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
ID: 'mutex:delay:nanoseconds:contentions:count',
|
|
102
|
+
name: 'mutex',
|
|
103
|
+
sampleType: 'delay',
|
|
104
|
+
sampleUnit: 'nanoseconds',
|
|
105
|
+
periodType: 'contentions',
|
|
106
|
+
periodUnit: 'count'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
ID: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds',
|
|
110
|
+
name: 'process_cpu',
|
|
111
|
+
sampleType: 'cpu',
|
|
112
|
+
sampleUnit: 'nanoseconds',
|
|
113
|
+
periodType: 'cpu',
|
|
114
|
+
periodUnit: 'nanoseconds'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
ID: 'process_cpu:samples:count:cpu:nanoseconds',
|
|
118
|
+
name: 'process_cpu',
|
|
119
|
+
sampleType: 'samples',
|
|
120
|
+
sampleUnit: 'count',
|
|
121
|
+
periodType: 'cpu',
|
|
122
|
+
periodUnit: 'nanoseconds'
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
};
|
|
126
|
+
const MOCK_LABEL_NAMES_RESPONSE = {
|
|
127
|
+
names: [
|
|
128
|
+
'__name__',
|
|
129
|
+
'__period_type__',
|
|
130
|
+
'__period_unit__',
|
|
131
|
+
'__profile_type__',
|
|
132
|
+
'__service_name__',
|
|
133
|
+
'__type__',
|
|
134
|
+
'__unit__',
|
|
135
|
+
'hostname',
|
|
136
|
+
'pyroscope_spy',
|
|
137
|
+
'region',
|
|
138
|
+
'service_git_ref',
|
|
139
|
+
'service_name',
|
|
140
|
+
'service_repository',
|
|
141
|
+
'target',
|
|
142
|
+
'vehicle'
|
|
143
|
+
]
|
|
144
|
+
};
|
|
145
|
+
const MOCK_LABEL_VALUES_RESPONSE_NAME_REGION = {
|
|
146
|
+
names: [
|
|
147
|
+
'ap-south',
|
|
148
|
+
'eu-north',
|
|
149
|
+
'us-east'
|
|
150
|
+
]
|
|
151
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
require("@testing-library/jest-dom/extend-expect");
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2025 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, "computeFilterExpr", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return computeFilterExpr;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function computeFilterExpr(filters) {
|
|
24
|
+
return `${filters.filter((filter)=>filter.labelName !== '' && filter.labelValue !== '').map((filter)=>`${filter.labelName}${filter.operator}"${filter.labelValue}"`).join(',')}`;
|
|
25
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Copyright 2025 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
filterLabelNamesOptions: function() {
|
|
25
|
+
return filterLabelNamesOptions;
|
|
26
|
+
},
|
|
27
|
+
useLabelNames: function() {
|
|
28
|
+
return useLabelNames;
|
|
29
|
+
},
|
|
30
|
+
useLabelValues: function() {
|
|
31
|
+
return useLabelValues;
|
|
32
|
+
},
|
|
33
|
+
useProfileTypes: function() {
|
|
34
|
+
return useProfileTypes;
|
|
35
|
+
},
|
|
36
|
+
useServices: function() {
|
|
37
|
+
return useServices;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
41
|
+
const _reactquery = require("@tanstack/react-query");
|
|
42
|
+
function useLabelNames(datasource) {
|
|
43
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
44
|
+
return (0, _reactquery.useQuery)({
|
|
45
|
+
enabled: !!client,
|
|
46
|
+
queryKey: [
|
|
47
|
+
'searchLabelNames',
|
|
48
|
+
'datasource',
|
|
49
|
+
datasource
|
|
50
|
+
],
|
|
51
|
+
queryFn: async ()=>{
|
|
52
|
+
return await client.searchLabelNames({}, {
|
|
53
|
+
'content-type': 'application/json'
|
|
54
|
+
}, {});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function useLabelValues(datasource, labelName) {
|
|
59
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
60
|
+
return (0, _reactquery.useQuery)({
|
|
61
|
+
enabled: !!client,
|
|
62
|
+
queryKey: [
|
|
63
|
+
'searchLabelValues',
|
|
64
|
+
labelName,
|
|
65
|
+
'datasource',
|
|
66
|
+
datasource
|
|
67
|
+
],
|
|
68
|
+
queryFn: async ()=>{
|
|
69
|
+
return await client.searchLabelValues({}, {
|
|
70
|
+
'content-type': 'application/json'
|
|
71
|
+
}, {
|
|
72
|
+
name: labelName
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function useProfileTypes(datasource) {
|
|
78
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
79
|
+
return (0, _reactquery.useQuery)({
|
|
80
|
+
enabled: !!client,
|
|
81
|
+
queryKey: [
|
|
82
|
+
'searchProfileTypes',
|
|
83
|
+
'datasource',
|
|
84
|
+
datasource
|
|
85
|
+
],
|
|
86
|
+
queryFn: async ()=>{
|
|
87
|
+
return await client.searchProfileTypes({}, {
|
|
88
|
+
'content-type': 'application/json'
|
|
89
|
+
}, {});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function useServices(datasource) {
|
|
94
|
+
const { data: client } = (0, _pluginsystem.useDatasourceClient)(datasource);
|
|
95
|
+
return (0, _reactquery.useQuery)({
|
|
96
|
+
enabled: !!client,
|
|
97
|
+
queryKey: [
|
|
98
|
+
'searchServices',
|
|
99
|
+
'datasource',
|
|
100
|
+
datasource
|
|
101
|
+
],
|
|
102
|
+
queryFn: async ()=>{
|
|
103
|
+
return await client.searchServices({}, {
|
|
104
|
+
'content-type': 'application/json'
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function filterLabelNamesOptions(labelNamesOptions) {
|
|
110
|
+
const regex = /^__.*__$/;
|
|
111
|
+
return labelNamesOptions.filter((labelName)=>!regex.test(labelName) && labelName !== 'service_name');
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddFilterItem.d.ts","sourceRoot":"","sources":["../../../src/components/AddFilterItem.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAQrE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2025 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 { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import PlusIcon from 'mdi-material-ui/Plus';
|
|
15
|
+
import { ToolbarIconButton } from '@perses-dev/components';
|
|
16
|
+
export function AddFilterItem(props) {
|
|
17
|
+
const { onClick } = props;
|
|
18
|
+
return /*#__PURE__*/ _jsx(ToolbarIconButton, {
|
|
19
|
+
"aria-label": "add filter",
|
|
20
|
+
onClick: onClick,
|
|
21
|
+
children: /*#__PURE__*/ _jsx(PlusIcon, {})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=AddFilterItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/AddFilterItem.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport { ToolbarIconButton } from '@perses-dev/components';\n\nexport interface AddFilterItemProps {\n onClick: () => void;\n}\n\nexport function AddFilterItem(props: AddFilterItemProps): ReactElement {\n const { onClick } = props;\n\n return (\n <ToolbarIconButton aria-label=\"add filter\" onClick={onClick}>\n <PlusIcon />\n </ToolbarIconButton>\n );\n}\n"],"names":["PlusIcon","ToolbarIconButton","AddFilterItem","props","onClick","aria-label"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,OAAOA,cAAc,uBAAuB;AAC5C,SAASC,iBAAiB,QAAQ,yBAAyB;AAM3D,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,qBACE,KAACF;QAAkBI,cAAW;QAAaD,SAASA;kBAClD,cAAA,KAACJ;;AAGP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteFilterItem.d.ts","sourceRoot":"","sources":["../../../src/components/DeleteFilterItem.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAe3E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright 2025 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 { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import CloseIcon from 'mdi-material-ui/Close';
|
|
15
|
+
import { ToolbarIconButton } from '@perses-dev/components';
|
|
16
|
+
export function DeleteFilterItem(props) {
|
|
17
|
+
const { onClick } = props;
|
|
18
|
+
return /*#__PURE__*/ _jsx(ToolbarIconButton, {
|
|
19
|
+
sx: {
|
|
20
|
+
borderTopLeftRadius: '0',
|
|
21
|
+
borderBottomLeftRadius: '0'
|
|
22
|
+
},
|
|
23
|
+
"aria-label": "delete filter",
|
|
24
|
+
onClick: onClick,
|
|
25
|
+
children: /*#__PURE__*/ _jsx(CloseIcon, {})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=DeleteFilterItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DeleteFilterItem.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { ToolbarIconButton } from '@perses-dev/components';\n\nexport interface DeleteFilterItemProps {\n onClick: () => void;\n}\n\nexport function DeleteFilterItem(props: DeleteFilterItemProps): ReactElement {\n const { onClick } = props;\n\n return (\n <ToolbarIconButton\n sx={{\n borderTopLeftRadius: '0',\n borderBottomLeftRadius: '0',\n }}\n aria-label=\"delete filter\"\n onClick={onClick}\n >\n <CloseIcon />\n </ToolbarIconButton>\n );\n}\n"],"names":["CloseIcon","ToolbarIconButton","DeleteFilterItem","props","onClick","sx","borderTopLeftRadius","borderBottomLeftRadius","aria-label"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,OAAOA,eAAe,wBAAwB;AAC9C,SAASC,iBAAiB,QAAQ,yBAAyB;AAM3D,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,qBACE,KAACF;QACCI,IAAI;YACFC,qBAAqB;YACrBC,wBAAwB;QAC1B;QACAC,cAAW;QACXJ,SAASA;kBAET,cAAA,KAACJ;;AAGP"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { PyroscopeDatasourceSelector } from '../model';
|
|
3
|
+
import { LabelFilter } from '../utils/types';
|
|
4
|
+
export interface FilterItemProps {
|
|
5
|
+
datasource: PyroscopeDatasourceSelector;
|
|
6
|
+
value: LabelFilter;
|
|
7
|
+
onChange?: (value: LabelFilter) => void;
|
|
8
|
+
deleteItem?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function FilterItem(props: FilterItemProps): ReactElement;
|
|
11
|
+
//# sourceMappingURL=FilterItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterItem.d.ts","sourceRoot":"","sources":["../../../src/components/FilterItem.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAM3D,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAgC/D"}
|