@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.
Files changed (270) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +23 -0
  3. package/__mf/css/async/1339.6763d50b.css +1 -0
  4. package/__mf/css/async/4758.6763d50b.css +1 -0
  5. package/__mf/css/async/9633.6763d50b.css +1 -0
  6. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  7. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  8. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  9. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  10. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  11. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  12. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  13. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  17. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  18. package/__mf/js/Pyroscope.24cb38f3.js +5 -0
  19. package/__mf/js/async/1101.380fb9ae.js +73 -0
  20. package/__mf/js/async/1101.380fb9ae.js.LICENSE.txt +19 -0
  21. package/__mf/js/async/1339.e58b309f.js +1 -0
  22. package/__mf/js/async/1964.88ffca96.js +2 -0
  23. package/__mf/js/async/1964.88ffca96.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/2002.8fc3eb19.js +1 -0
  25. package/__mf/js/async/2114.6befeb2d.js +1 -0
  26. package/__mf/js/async/2292.ed7843fc.js +2 -0
  27. package/__mf/js/async/2292.ed7843fc.js.LICENSE.txt +24 -0
  28. package/__mf/js/async/2911.ec166b7f.js +38 -0
  29. package/__mf/js/async/3224.755c2f09.js +1 -0
  30. package/__mf/js/async/3431.bc5c0624.js +1 -0
  31. package/__mf/js/async/3863.dbe40473.js +2 -0
  32. package/__mf/js/async/3863.dbe40473.js.LICENSE.txt +9 -0
  33. package/__mf/js/async/3960.a5d41140.js +2 -0
  34. package/__mf/js/async/3960.a5d41140.js.LICENSE.txt +8 -0
  35. package/__mf/js/async/3980.f1ef0ece.js +2 -0
  36. package/__mf/js/async/3980.f1ef0ece.js.LICENSE.txt +9 -0
  37. package/__mf/js/async/4075.cde93ec7.js +1 -0
  38. package/__mf/js/async/4238.f154b81c.js +1 -0
  39. package/__mf/js/async/424.edb69d58.js +1 -0
  40. package/__mf/js/async/4368.2d817d5d.js +2 -0
  41. package/__mf/js/async/4368.2d817d5d.js.LICENSE.txt +15 -0
  42. package/__mf/js/async/4421.d44d1d6f.js +1 -0
  43. package/__mf/js/async/4556.aabe5dff.js +2 -0
  44. package/__mf/js/async/4556.aabe5dff.js.LICENSE.txt +9 -0
  45. package/__mf/js/async/4758.a629b413.js +1 -0
  46. package/__mf/js/async/5214.8d3dd135.js +1 -0
  47. package/__mf/js/async/5215.6fd5cc14.js +1 -0
  48. package/__mf/js/async/5220.d1e40fff.js +10 -0
  49. package/__mf/js/async/5220.d1e40fff.js.LICENSE.txt +17 -0
  50. package/__mf/js/async/5358.40b9537e.js +7 -0
  51. package/__mf/js/async/5358.40b9537e.js.LICENSE.txt +21 -0
  52. package/__mf/js/async/5409.0df9c301.js +1 -0
  53. package/__mf/js/async/5790.677172d7.js +1 -0
  54. package/__mf/js/async/5876.38b119d5.js +2 -0
  55. package/__mf/js/async/5876.38b119d5.js.LICENSE.txt +21 -0
  56. package/__mf/js/async/5924.582b0cc4.js +2 -0
  57. package/__mf/js/async/5924.582b0cc4.js.LICENSE.txt +9 -0
  58. package/__mf/js/async/5981.9c662ef8.js +2 -0
  59. package/__mf/js/async/5981.9c662ef8.js.LICENSE.txt +8 -0
  60. package/__mf/js/async/6292.e30a4c42.js +1 -0
  61. package/__mf/js/async/6377.f6e824aa.js +2 -0
  62. package/__mf/js/async/6377.f6e824aa.js.LICENSE.txt +32 -0
  63. package/__mf/js/async/6770.2f87fe88.js +1 -0
  64. package/__mf/js/async/694.5e15c44d.js +1 -0
  65. package/__mf/js/async/7376.c4cd77b0.js +1 -0
  66. package/__mf/js/async/738.fa73528b.js +1 -0
  67. package/__mf/js/async/7740.474defbd.js +1 -0
  68. package/__mf/js/async/8216.be450b83.js +1 -0
  69. package/__mf/js/async/8488.00c7f348.js +1 -0
  70. package/__mf/js/async/8930.496019db.js +1 -0
  71. package/__mf/js/async/9092.cfd47472.js +101 -0
  72. package/__mf/js/async/9173.5959814f.js +2 -0
  73. package/__mf/js/async/9173.5959814f.js.LICENSE.txt +19 -0
  74. package/__mf/js/async/9478.c76fe552.js +2 -0
  75. package/__mf/js/async/9478.c76fe552.js.LICENSE.txt +9 -0
  76. package/__mf/js/async/9633.a7997138.js +2 -0
  77. package/__mf/js/async/9633.a7997138.js.LICENSE.txt +9 -0
  78. package/__mf/js/async/__federation_expose_PyroscopeDatasource.76f63abf.js +2 -0
  79. package/__mf/js/async/__federation_expose_PyroscopeDatasource.76f63abf.js.LICENSE.txt +9 -0
  80. package/__mf/js/async/__federation_expose_PyroscopeExplorer.88d5e4fb.js +2 -0
  81. package/__mf/js/async/__federation_expose_PyroscopeExplorer.88d5e4fb.js.LICENSE.txt +9 -0
  82. package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.75c9c11b.js +2 -0
  83. package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.75c9c11b.js.LICENSE.txt +9 -0
  84. package/__mf/js/main.4caf1064.js +5 -0
  85. package/lib/bootstrap.d.ts +2 -0
  86. package/lib/bootstrap.d.ts.map +1 -0
  87. package/lib/bootstrap.js +19 -0
  88. package/lib/bootstrap.js.map +1 -0
  89. package/lib/cjs/bootstrap.js +26 -0
  90. package/lib/cjs/components/AddFilterItem.js +38 -0
  91. package/lib/cjs/components/DeleteFilterItem.js +42 -0
  92. package/lib/cjs/components/FilterItem.js +83 -0
  93. package/lib/cjs/components/Filters.js +106 -0
  94. package/lib/cjs/components/LabelName.js +59 -0
  95. package/lib/cjs/components/LabelValue.js +59 -0
  96. package/lib/cjs/components/Operator.js +45 -0
  97. package/lib/cjs/components/ProfileTypeSelector.js +57 -0
  98. package/lib/cjs/components/Service.js +60 -0
  99. package/lib/cjs/components/index.js +32 -0
  100. package/lib/cjs/env.d.js +14 -0
  101. package/lib/cjs/explore/PyroscopeExplorer.js +90 -0
  102. package/lib/cjs/explore/index.js +30 -0
  103. package/lib/cjs/getPluginModule.js +39 -0
  104. package/lib/cjs/index-federation.js +55 -0
  105. package/lib/cjs/index.js +40 -0
  106. package/lib/cjs/model/api-types.js +19 -0
  107. package/lib/cjs/model/index.js +33 -0
  108. package/lib/cjs/model/profile-query-model.js +16 -0
  109. package/lib/cjs/model/pyroscope-client.js +94 -0
  110. package/lib/cjs/model/pyroscope-selectors.js +46 -0
  111. package/lib/cjs/plugins/PyroscopeDatasourceEditor.js +70 -0
  112. package/lib/cjs/plugins/index.js +33 -0
  113. package/lib/cjs/plugins/pyroscope-datasource-types.js +16 -0
  114. package/lib/cjs/plugins/pyroscope-datasource.js +68 -0
  115. package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +41 -0
  116. package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +114 -0
  117. package/lib/cjs/plugins/pyroscope-profile-query/get-profile-data.js +201 -0
  118. package/lib/cjs/plugins/pyroscope-profile-query/index.js +33 -0
  119. package/lib/cjs/plugins/pyroscope-profile-query/query-editor-model.js +120 -0
  120. package/lib/cjs/setup-tests.js +19 -0
  121. package/lib/cjs/test/index.js +30 -0
  122. package/lib/cjs/test/mock-data.js +151 -0
  123. package/lib/cjs/test/setup-tests.js +17 -0
  124. package/lib/cjs/utils/types.js +25 -0
  125. package/lib/cjs/utils/use-query.js +112 -0
  126. package/lib/components/AddFilterItem.d.ts +6 -0
  127. package/lib/components/AddFilterItem.d.ts.map +1 -0
  128. package/lib/components/AddFilterItem.js +25 -0
  129. package/lib/components/AddFilterItem.js.map +1 -0
  130. package/lib/components/DeleteFilterItem.d.ts +6 -0
  131. package/lib/components/DeleteFilterItem.d.ts.map +1 -0
  132. package/lib/components/DeleteFilterItem.js +29 -0
  133. package/lib/components/DeleteFilterItem.js.map +1 -0
  134. package/lib/components/FilterItem.d.ts +11 -0
  135. package/lib/components/FilterItem.d.ts.map +1 -0
  136. package/lib/components/FilterItem.js +75 -0
  137. package/lib/components/FilterItem.js.map +1 -0
  138. package/lib/components/Filters.d.ts +10 -0
  139. package/lib/components/Filters.d.ts.map +1 -0
  140. package/lib/components/Filters.js +98 -0
  141. package/lib/components/Filters.js.map +1 -0
  142. package/lib/components/LabelName.d.ts +9 -0
  143. package/lib/components/LabelName.d.ts.map +1 -0
  144. package/lib/components/LabelName.js +51 -0
  145. package/lib/components/LabelName.js.map +1 -0
  146. package/lib/components/LabelValue.d.ts +10 -0
  147. package/lib/components/LabelValue.d.ts.map +1 -0
  148. package/lib/components/LabelValue.js +51 -0
  149. package/lib/components/LabelValue.js.map +1 -0
  150. package/lib/components/Operator.d.ts +7 -0
  151. package/lib/components/Operator.d.ts.map +1 -0
  152. package/lib/components/Operator.js +37 -0
  153. package/lib/components/Operator.js.map +1 -0
  154. package/lib/components/ProfileTypeSelector.d.ts +9 -0
  155. package/lib/components/ProfileTypeSelector.d.ts.map +1 -0
  156. package/lib/components/ProfileTypeSelector.js +49 -0
  157. package/lib/components/ProfileTypeSelector.js.map +1 -0
  158. package/lib/components/Service.d.ts +9 -0
  159. package/lib/components/Service.d.ts.map +1 -0
  160. package/lib/components/Service.js +52 -0
  161. package/lib/components/Service.js.map +1 -0
  162. package/lib/components/index.d.ts +4 -0
  163. package/lib/components/index.d.ts.map +1 -0
  164. package/lib/components/index.js +17 -0
  165. package/lib/components/index.js.map +1 -0
  166. package/lib/env.d.js +15 -0
  167. package/lib/env.d.js.map +1 -0
  168. package/lib/explore/PyroscopeExplorer.d.ts +3 -0
  169. package/lib/explore/PyroscopeExplorer.d.ts.map +1 -0
  170. package/lib/explore/PyroscopeExplorer.js +82 -0
  171. package/lib/explore/PyroscopeExplorer.js.map +1 -0
  172. package/lib/explore/index.d.ts +2 -0
  173. package/lib/explore/index.d.ts.map +1 -0
  174. package/lib/explore/index.js +15 -0
  175. package/lib/explore/index.js.map +1 -0
  176. package/lib/getPluginModule.d.ts +6 -0
  177. package/lib/getPluginModule.d.ts.map +1 -0
  178. package/lib/getPluginModule.js +28 -0
  179. package/lib/getPluginModule.js.map +1 -0
  180. package/lib/index-federation.d.ts +1 -0
  181. package/lib/index-federation.d.ts.map +1 -0
  182. package/lib/index-federation.js +15 -0
  183. package/lib/index-federation.js.map +1 -0
  184. package/lib/index.d.ts +6 -0
  185. package/lib/index.d.ts.map +1 -0
  186. package/lib/index.js +19 -0
  187. package/lib/index.js.map +1 -0
  188. package/lib/model/api-types.d.ts +82 -0
  189. package/lib/model/api-types.d.ts.map +1 -0
  190. package/lib/model/api-types.js +20 -0
  191. package/lib/model/api-types.js.map +1 -0
  192. package/lib/model/index.d.ts +5 -0
  193. package/lib/model/index.d.ts.map +1 -0
  194. package/lib/model/index.js +18 -0
  195. package/lib/model/index.js.map +1 -0
  196. package/lib/model/profile-query-model.d.ts +13 -0
  197. package/lib/model/profile-query-model.d.ts.map +1 -0
  198. package/lib/model/profile-query-model.js +17 -0
  199. package/lib/model/profile-query-model.js.map +1 -0
  200. package/lib/model/pyroscope-client.d.ts +43 -0
  201. package/lib/model/pyroscope-client.d.ts.map +1 -0
  202. package/lib/model/pyroscope-client.js +77 -0
  203. package/lib/model/pyroscope-client.js.map +1 -0
  204. package/lib/model/pyroscope-selectors.d.ts +21 -0
  205. package/lib/model/pyroscope-selectors.d.ts.map +1 -0
  206. package/lib/model/pyroscope-selectors.js +30 -0
  207. package/lib/model/pyroscope-selectors.js.map +1 -0
  208. package/lib/plugins/PyroscopeDatasourceEditor.d.ts +9 -0
  209. package/lib/plugins/PyroscopeDatasourceEditor.d.ts.map +1 -0
  210. package/lib/plugins/PyroscopeDatasourceEditor.js +57 -0
  211. package/lib/plugins/PyroscopeDatasourceEditor.js.map +1 -0
  212. package/lib/plugins/index.d.ts +5 -0
  213. package/lib/plugins/index.d.ts.map +1 -0
  214. package/lib/plugins/index.js +18 -0
  215. package/lib/plugins/index.js.map +1 -0
  216. package/lib/plugins/pyroscope-datasource-types.d.ts +6 -0
  217. package/lib/plugins/pyroscope-datasource-types.d.ts.map +1 -0
  218. package/lib/plugins/pyroscope-datasource-types.js +15 -0
  219. package/lib/plugins/pyroscope-datasource-types.js.map +1 -0
  220. package/lib/plugins/pyroscope-datasource.d.ts +5 -0
  221. package/lib/plugins/pyroscope-datasource.d.ts.map +1 -0
  222. package/lib/plugins/pyroscope-datasource.js +60 -0
  223. package/lib/plugins/pyroscope-datasource.js.map +1 -0
  224. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.d.ts +14 -0
  225. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.d.ts.map +1 -0
  226. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js +33 -0
  227. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQuery.js.map +1 -0
  228. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.d.ts +4 -0
  229. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.d.ts.map +1 -0
  230. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +106 -0
  231. package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js.map +1 -0
  232. package/lib/plugins/pyroscope-profile-query/get-profile-data.d.ts +9 -0
  233. package/lib/plugins/pyroscope-profile-query/get-profile-data.d.ts.map +1 -0
  234. package/lib/plugins/pyroscope-profile-query/get-profile-data.js +185 -0
  235. package/lib/plugins/pyroscope-profile-query/get-profile-data.js.map +1 -0
  236. package/lib/plugins/pyroscope-profile-query/index.d.ts +5 -0
  237. package/lib/plugins/pyroscope-profile-query/index.d.ts.map +1 -0
  238. package/lib/plugins/pyroscope-profile-query/index.js +18 -0
  239. package/lib/plugins/pyroscope-profile-query/index.js.map +1 -0
  240. package/lib/plugins/pyroscope-profile-query/query-editor-model.d.ts +34 -0
  241. package/lib/plugins/pyroscope-profile-query/query-editor-model.d.ts.map +1 -0
  242. package/lib/plugins/pyroscope-profile-query/query-editor-model.js +106 -0
  243. package/lib/plugins/pyroscope-profile-query/query-editor-model.js.map +1 -0
  244. package/lib/setup-tests.d.ts +2 -0
  245. package/lib/setup-tests.d.ts.map +1 -0
  246. package/lib/setup-tests.js +17 -0
  247. package/lib/setup-tests.js.map +1 -0
  248. package/lib/test/index.d.ts +2 -0
  249. package/lib/test/index.d.ts.map +1 -0
  250. package/lib/test/index.js +15 -0
  251. package/lib/test/index.js.map +1 -0
  252. package/lib/test/mock-data.d.ts +5 -0
  253. package/lib/test/mock-data.d.ts.map +1 -0
  254. package/lib/test/mock-data.js +133 -0
  255. package/lib/test/mock-data.js.map +1 -0
  256. package/lib/test/setup-tests.d.ts +2 -0
  257. package/lib/test/setup-tests.d.ts.map +1 -0
  258. package/lib/test/setup-tests.js +15 -0
  259. package/lib/test/setup-tests.js.map +1 -0
  260. package/lib/utils/types.d.ts +8 -0
  261. package/lib/utils/types.d.ts.map +1 -0
  262. package/lib/utils/types.js +17 -0
  263. package/lib/utils/types.js.map +1 -0
  264. package/lib/utils/use-query.d.ts +9 -0
  265. package/lib/utils/use-query.d.ts.map +1 -0
  266. package/lib/utils/use-query.js +87 -0
  267. package/lib/utils/use-query.js.map +1 -0
  268. package/mf-manifest.json +455 -0
  269. package/mf-stats.json +539 -0
  270. package/package.json +88 -0
@@ -0,0 +1,75 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Stack } from '@mui/material';
15
+ import { LabelName } from './LabelName';
16
+ import { Operator } from './Operator';
17
+ import { LabelValue } from './LabelValue';
18
+ import { DeleteFilterItem } from './DeleteFilterItem';
19
+ export function FilterItem(props) {
20
+ const { datasource, value, onChange, deleteItem } = props;
21
+ const handleLabelNameChange = (label)=>{
22
+ onChange?.({
23
+ labelName: label,
24
+ labelValue: '',
25
+ operator: value.operator
26
+ });
27
+ };
28
+ const handleOperatorChange = (op)=>{
29
+ onChange?.({
30
+ labelName: value.labelName,
31
+ labelValue: value.labelValue,
32
+ operator: op
33
+ });
34
+ };
35
+ const handleLabelValueChange = (val)=>{
36
+ onChange?.({
37
+ labelName: value.labelName,
38
+ labelValue: val,
39
+ operator: value.operator
40
+ });
41
+ };
42
+ const handleDeleteClick = ()=>{
43
+ deleteItem?.();
44
+ };
45
+ return /*#__PURE__*/ _jsxs(Stack, {
46
+ direction: "row",
47
+ spacing: 0,
48
+ sx: {
49
+ flexWrap: 'wrap',
50
+ maxWidth: '100%'
51
+ },
52
+ children: [
53
+ /*#__PURE__*/ _jsx(LabelName, {
54
+ datasource: datasource,
55
+ value: value.labelName,
56
+ onChange: handleLabelNameChange
57
+ }),
58
+ /*#__PURE__*/ _jsx(Operator, {
59
+ value: value.operator,
60
+ onChange: handleOperatorChange
61
+ }),
62
+ /*#__PURE__*/ _jsx(LabelValue, {
63
+ datasource: datasource,
64
+ value: value.labelValue,
65
+ labelName: value.labelName,
66
+ onChange: handleLabelValueChange
67
+ }),
68
+ /*#__PURE__*/ _jsx(DeleteFilterItem, {
69
+ onClick: handleDeleteClick
70
+ })
71
+ ]
72
+ });
73
+ }
74
+
75
+ //# sourceMappingURL=FilterItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/FilterItem.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 { Stack } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { LabelFilter, OperatorType } from '../utils/types';\nimport { LabelName } from './LabelName';\nimport { Operator } from './Operator';\nimport { LabelValue } from './LabelValue';\nimport { DeleteFilterItem } from './DeleteFilterItem';\n\nexport interface FilterItemProps {\n datasource: PyroscopeDatasourceSelector;\n value: LabelFilter;\n onChange?: (value: LabelFilter) => void;\n deleteItem?: () => void; // this function is used to delete the current filter\n}\n\nexport function FilterItem(props: FilterItemProps): ReactElement {\n const { datasource, value, onChange, deleteItem } = props;\n\n const handleLabelNameChange = (label: string) => {\n onChange?.({ labelName: label, labelValue: '', operator: value.operator });\n };\n\n const handleOperatorChange = (op: OperatorType) => {\n onChange?.({ labelName: value.labelName, labelValue: value.labelValue, operator: op });\n };\n\n const handleLabelValueChange = (val: string) => {\n onChange?.({ labelName: value.labelName, labelValue: val, operator: value.operator });\n };\n\n const handleDeleteClick = () => {\n deleteItem?.();\n };\n\n return (\n <Stack direction=\"row\" spacing={0} sx={{ flexWrap: 'wrap', maxWidth: '100%' }}>\n <LabelName datasource={datasource} value={value.labelName} onChange={handleLabelNameChange} />\n <Operator value={value.operator} onChange={handleOperatorChange} />\n <LabelValue\n datasource={datasource}\n value={value.labelValue}\n labelName={value.labelName}\n onChange={handleLabelValueChange}\n />\n <DeleteFilterItem onClick={handleDeleteClick} />\n </Stack>\n );\n}\n"],"names":["Stack","LabelName","Operator","LabelValue","DeleteFilterItem","FilterItem","props","datasource","value","onChange","deleteItem","handleLabelNameChange","label","labelName","labelValue","operator","handleOperatorChange","op","handleLabelValueChange","val","handleDeleteClick","direction","spacing","sx","flexWrap","maxWidth","onClick"],"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,SAASA,KAAK,QAAQ,gBAAgB;AAGtC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,gBAAgB,QAAQ,qBAAqB;AAStD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGJ;IAEpD,MAAMK,wBAAwB,CAACC;QAC7BH,WAAW;YAAEI,WAAWD;YAAOE,YAAY;YAAIC,UAAUP,MAAMO,QAAQ;QAAC;IAC1E;IAEA,MAAMC,uBAAuB,CAACC;QAC5BR,WAAW;YAAEI,WAAWL,MAAMK,SAAS;YAAEC,YAAYN,MAAMM,UAAU;YAAEC,UAAUE;QAAG;IACtF;IAEA,MAAMC,yBAAyB,CAACC;QAC9BV,WAAW;YAAEI,WAAWL,MAAMK,SAAS;YAAEC,YAAYK;YAAKJ,UAAUP,MAAMO,QAAQ;QAAC;IACrF;IAEA,MAAMK,oBAAoB;QACxBV;IACF;IAEA,qBACE,MAACV;QAAMqB,WAAU;QAAMC,SAAS;QAAGC,IAAI;YAAEC,UAAU;YAAQC,UAAU;QAAO;;0BAC1E,KAACxB;gBAAUM,YAAYA;gBAAYC,OAAOA,MAAMK,SAAS;gBAAEJ,UAAUE;;0BACrE,KAACT;gBAASM,OAAOA,MAAMO,QAAQ;gBAAEN,UAAUO;;0BAC3C,KAACb;gBACCI,YAAYA;gBACZC,OAAOA,MAAMM,UAAU;gBACvBD,WAAWL,MAAMK,SAAS;gBAC1BJ,UAAUS;;0BAEZ,KAACd;gBAAiBsB,SAASN;;;;AAGjC"}
@@ -0,0 +1,10 @@
1
+ import { ReactElement } from 'react';
2
+ import { PyroscopeDatasourceSelector } from '../model';
3
+ import { LabelFilter } from '../utils/types';
4
+ export interface FiltersProps {
5
+ datasource: PyroscopeDatasourceSelector;
6
+ value: LabelFilter[];
7
+ onChange?: (value: LabelFilter[]) => void;
8
+ }
9
+ export declare function Filters(props: FiltersProps): ReactElement;
10
+ //# sourceMappingURL=Filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filters.d.ts","sourceRoot":"","sources":["../../../src/components/Filters.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAqEzD"}
@@ -0,0 +1,98 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { InputLabel, Stack, useTheme } from '@mui/material';
15
+ import { FilterItem } from './FilterItem';
16
+ import { AddFilterItem } from './AddFilterItem';
17
+ export function Filters(props) {
18
+ const theme = useTheme();
19
+ const { datasource, value, onChange } = props;
20
+ const addFilterItem = ()=>{
21
+ const newItem = {
22
+ labelName: '',
23
+ labelValue: '',
24
+ operator: '='
25
+ };
26
+ const updatedFilters = [
27
+ ...value,
28
+ newItem
29
+ ];
30
+ onChange?.(updatedFilters);
31
+ };
32
+ const updateFilter = (index, newValue)=>{
33
+ const nextFilters = [
34
+ ...value
35
+ ];
36
+ nextFilters[index] = newValue;
37
+ onChange?.(nextFilters);
38
+ };
39
+ const deleteFilter = (index)=>{
40
+ const nextFilters = [
41
+ ...value
42
+ ];
43
+ nextFilters.splice(index, 1);
44
+ if (nextFilters.length === 0) {
45
+ onChange?.([
46
+ {
47
+ labelName: '',
48
+ labelValue: '',
49
+ operator: '='
50
+ }
51
+ ]); // keep at least one empty filter
52
+ } else {
53
+ onChange?.(nextFilters);
54
+ }
55
+ };
56
+ return /*#__PURE__*/ _jsxs(Stack, {
57
+ position: "relative",
58
+ direction: "row",
59
+ spacing: 0,
60
+ sx: {
61
+ flexWrap: 'wrap',
62
+ rowGap: 1,
63
+ gap: 1,
64
+ padding: '10px',
65
+ border: `1px solid ${theme.palette.action.disabled}`,
66
+ borderRadius: `${theme.shape.borderRadius}px`,
67
+ '&:hover': {
68
+ borderColor: theme.palette.text.primary
69
+ }
70
+ },
71
+ children: [
72
+ /*#__PURE__*/ _jsx(InputLabel, {
73
+ shrink: true,
74
+ sx: {
75
+ position: 'absolute',
76
+ top: '-6px',
77
+ left: '10px',
78
+ padding: '0 4px',
79
+ color: theme.palette.text.primary,
80
+ backgroundColor: theme.palette.background.default,
81
+ zIndex: 1
82
+ },
83
+ children: "Filters"
84
+ }),
85
+ value.map((filter, index)=>/*#__PURE__*/ _jsx(FilterItem, {
86
+ datasource: datasource,
87
+ value: filter,
88
+ onChange: (newValue)=>updateFilter(index, newValue),
89
+ deleteItem: ()=>deleteFilter(index)
90
+ }, `${filter.labelName}:${filter.operator}:${filter.labelValue}`)),
91
+ /*#__PURE__*/ _jsx(AddFilterItem, {
92
+ onClick: addFilterItem
93
+ })
94
+ ]
95
+ });
96
+ }
97
+
98
+ //# sourceMappingURL=Filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Filters.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 { InputLabel, Stack, useTheme } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { LabelFilter } from '../utils/types';\nimport { FilterItem } from './FilterItem';\nimport { AddFilterItem } from './AddFilterItem';\n\nexport interface FiltersProps {\n datasource: PyroscopeDatasourceSelector;\n value: LabelFilter[];\n onChange?: (value: LabelFilter[]) => void;\n}\n\nexport function Filters(props: FiltersProps): ReactElement {\n const theme = useTheme();\n const { datasource, value, onChange } = props;\n\n const addFilterItem = () => {\n const newItem: LabelFilter = { labelName: '', labelValue: '', operator: '=' };\n const updatedFilters = [...value, newItem];\n onChange?.(updatedFilters);\n };\n\n const updateFilter = (index: number, newValue: LabelFilter) => {\n const nextFilters = [...value];\n nextFilters[index] = newValue;\n onChange?.(nextFilters);\n };\n\n const deleteFilter = (index: number) => {\n const nextFilters = [...value];\n nextFilters.splice(index, 1);\n if (nextFilters.length === 0) {\n onChange?.([{ labelName: '', labelValue: '', operator: '=' }]); // keep at least one empty filter\n } else {\n onChange?.(nextFilters);\n }\n };\n\n return (\n <Stack\n position=\"relative\"\n direction=\"row\"\n spacing={0}\n sx={{\n flexWrap: 'wrap',\n rowGap: 1,\n gap: 1,\n padding: '10px',\n border: `1px solid ${theme.palette.action.disabled}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n '&:hover': {\n borderColor: theme.palette.text.primary,\n },\n }}\n >\n <InputLabel\n shrink\n sx={{\n position: 'absolute',\n top: '-6px',\n left: '10px',\n padding: '0 4px',\n color: theme.palette.text.primary,\n backgroundColor: theme.palette.background.default,\n zIndex: 1,\n }}\n >\n Filters\n </InputLabel>\n {value.map((filter, index) => (\n <FilterItem\n key={`${filter.labelName}:${filter.operator}:${filter.labelValue}`}\n datasource={datasource}\n value={filter}\n onChange={(newValue) => updateFilter(index, newValue)}\n deleteItem={() => deleteFilter(index)}\n />\n ))}\n <AddFilterItem onClick={addFilterItem} />\n </Stack>\n );\n}\n"],"names":["InputLabel","Stack","useTheme","FilterItem","AddFilterItem","Filters","props","theme","datasource","value","onChange","addFilterItem","newItem","labelName","labelValue","operator","updatedFilters","updateFilter","index","newValue","nextFilters","deleteFilter","splice","length","position","direction","spacing","sx","flexWrap","rowGap","gap","padding","border","palette","action","disabled","borderRadius","shape","borderColor","text","primary","shrink","top","left","color","backgroundColor","background","default","zIndex","map","filter","deleteItem","onClick"],"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,SAASA,UAAU,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,gBAAgB;AAG5D,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,kBAAkB;AAQhD,OAAO,SAASC,QAAQC,KAAmB;IACzC,MAAMC,QAAQL;IACd,MAAM,EAAEM,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGJ;IAExC,MAAMK,gBAAgB;QACpB,MAAMC,UAAuB;YAAEC,WAAW;YAAIC,YAAY;YAAIC,UAAU;QAAI;QAC5E,MAAMC,iBAAiB;eAAIP;YAAOG;SAAQ;QAC1CF,WAAWM;IACb;IAEA,MAAMC,eAAe,CAACC,OAAeC;QACnC,MAAMC,cAAc;eAAIX;SAAM;QAC9BW,WAAW,CAACF,MAAM,GAAGC;QACrBT,WAAWU;IACb;IAEA,MAAMC,eAAe,CAACH;QACpB,MAAME,cAAc;eAAIX;SAAM;QAC9BW,YAAYE,MAAM,CAACJ,OAAO;QAC1B,IAAIE,YAAYG,MAAM,KAAK,GAAG;YAC5Bb,WAAW;gBAAC;oBAAEG,WAAW;oBAAIC,YAAY;oBAAIC,UAAU;gBAAI;aAAE,GAAG,iCAAiC;QACnG,OAAO;YACLL,WAAWU;QACb;IACF;IAEA,qBACE,MAACnB;QACCuB,UAAS;QACTC,WAAU;QACVC,SAAS;QACTC,IAAI;YACFC,UAAU;YACVC,QAAQ;YACRC,KAAK;YACLC,SAAS;YACTC,QAAQ,CAAC,UAAU,EAAEzB,MAAM0B,OAAO,CAACC,MAAM,CAACC,QAAQ,EAAE;YACpDC,cAAc,GAAG7B,MAAM8B,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;YAC7C,WAAW;gBACTE,aAAa/B,MAAM0B,OAAO,CAACM,IAAI,CAACC,OAAO;YACzC;QACF;;0BAEA,KAACxC;gBACCyC,MAAM;gBACNd,IAAI;oBACFH,UAAU;oBACVkB,KAAK;oBACLC,MAAM;oBACNZ,SAAS;oBACTa,OAAOrC,MAAM0B,OAAO,CAACM,IAAI,CAACC,OAAO;oBACjCK,iBAAiBtC,MAAM0B,OAAO,CAACa,UAAU,CAACC,OAAO;oBACjDC,QAAQ;gBACV;0BACD;;YAGAvC,MAAMwC,GAAG,CAAC,CAACC,QAAQhC,sBAClB,KAACf;oBAECK,YAAYA;oBACZC,OAAOyC;oBACPxC,UAAU,CAACS,WAAaF,aAAaC,OAAOC;oBAC5CgC,YAAY,IAAM9B,aAAaH;mBAJ1B,GAAGgC,OAAOrC,SAAS,CAAC,CAAC,EAAEqC,OAAOnC,QAAQ,CAAC,CAAC,EAAEmC,OAAOpC,UAAU,EAAE;0BAOtE,KAACV;gBAAcgD,SAASzC;;;;AAG9B"}
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import { PyroscopeDatasourceSelector } from '../model';
3
+ export interface LabelNameProps {
4
+ datasource: PyroscopeDatasourceSelector;
5
+ value: string;
6
+ onChange?(value: string): void;
7
+ }
8
+ export declare function LabelName(props: LabelNameProps): ReactElement;
9
+ //# sourceMappingURL=LabelName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelName.d.ts","sourceRoot":"","sources":["../../../src/components/LabelName.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAiC7D"}
@@ -0,0 +1,51 @@
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 { Select, MenuItem, CircularProgress, Stack } from '@mui/material';
15
+ import { useLabelNames, filterLabelNamesOptions } from '../utils/use-query';
16
+ export function LabelName(props) {
17
+ const { datasource, value, onChange } = props;
18
+ const { data: labelNamesOptions, isLoading: isLabelNamesOptionsLoading } = useLabelNames(datasource);
19
+ return /*#__PURE__*/ _jsx(Select, {
20
+ sx: {
21
+ borderTopRightRadius: '0',
22
+ borderBottomRightRadius: '0'
23
+ },
24
+ value: value,
25
+ size: "small",
26
+ onChange: (event)=>onChange?.(event.target.value),
27
+ displayEmpty: true,
28
+ renderValue: (selected)=>{
29
+ if (selected === '') {
30
+ return 'Select label name';
31
+ }
32
+ return selected;
33
+ },
34
+ children: isLabelNamesOptionsLoading ? /*#__PURE__*/ _jsx(Stack, {
35
+ width: "100%",
36
+ sx: {
37
+ alignItems: 'center',
38
+ justifyContent: 'center'
39
+ },
40
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
41
+ color: "inherit",
42
+ size: 20
43
+ })
44
+ }) : labelNamesOptions?.names && filterLabelNamesOptions(labelNamesOptions?.names).map((labelName)=>/*#__PURE__*/ _jsx(MenuItem, {
45
+ value: labelName,
46
+ children: labelName
47
+ }, labelName))
48
+ });
49
+ }
50
+
51
+ //# sourceMappingURL=LabelName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/LabelName.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 { Select, MenuItem, CircularProgress, Stack } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { useLabelNames, filterLabelNamesOptions } from '../utils/use-query';\n\nexport interface LabelNameProps {\n datasource: PyroscopeDatasourceSelector;\n value: string;\n onChange?(value: string): void;\n}\n\nexport function LabelName(props: LabelNameProps): ReactElement {\n const { datasource, value, onChange } = props;\n\n const { data: labelNamesOptions, isLoading: isLabelNamesOptionsLoading } = useLabelNames(datasource);\n\n return (\n <Select\n sx={{ borderTopRightRadius: '0', borderBottomRightRadius: '0' }}\n value={value}\n size=\"small\"\n onChange={(event) => onChange?.(event.target.value)}\n displayEmpty\n renderValue={(selected) => {\n if (selected === '') {\n return 'Select label name';\n }\n return selected;\n }}\n >\n {isLabelNamesOptionsLoading ? (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress color=\"inherit\" size={20} />\n </Stack>\n ) : (\n labelNamesOptions?.names &&\n filterLabelNamesOptions(labelNamesOptions?.names).map((labelName) => (\n <MenuItem key={labelName} value={labelName}>\n {labelName}\n </MenuItem>\n ))\n )}\n </Select>\n );\n}\n"],"names":["Select","MenuItem","CircularProgress","Stack","useLabelNames","filterLabelNamesOptions","LabelName","props","datasource","value","onChange","data","labelNamesOptions","isLoading","isLabelNamesOptionsLoading","sx","borderTopRightRadius","borderBottomRightRadius","size","event","target","displayEmpty","renderValue","selected","width","alignItems","justifyContent","color","names","map","labelName"],"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,SAASA,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAE1E,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,qBAAqB;AAQ5E,OAAO,SAASC,UAAUC,KAAqB;IAC7C,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAExC,MAAM,EAAEI,MAAMC,iBAAiB,EAAEC,WAAWC,0BAA0B,EAAE,GAAGV,cAAcI;IAEzF,qBACE,KAACR;QACCe,IAAI;YAAEC,sBAAsB;YAAKC,yBAAyB;QAAI;QAC9DR,OAAOA;QACPS,MAAK;QACLR,UAAU,CAACS,QAAUT,WAAWS,MAAMC,MAAM,CAACX,KAAK;QAClDY,YAAY;QACZC,aAAa,CAACC;YACZ,IAAIA,aAAa,IAAI;gBACnB,OAAO;YACT;YACA,OAAOA;QACT;kBAECT,2CACC,KAACX;YAAMqB,OAAM;YAAOT,IAAI;gBAAEU,YAAY;gBAAUC,gBAAgB;YAAS;sBACvE,cAAA,KAACxB;gBAAiByB,OAAM;gBAAUT,MAAM;;aAG1CN,mBAAmBgB,SACnBvB,wBAAwBO,mBAAmBgB,OAAOC,GAAG,CAAC,CAACC,0BACrD,KAAC7B;gBAAyBQ,OAAOqB;0BAC9BA;eADYA;;AAOzB"}
@@ -0,0 +1,10 @@
1
+ import { ReactElement } from 'react';
2
+ import { PyroscopeDatasourceSelector } from '../model';
3
+ export interface LabelValueProps {
4
+ datasource: PyroscopeDatasourceSelector;
5
+ value: string;
6
+ labelName: string;
7
+ onChange?(value: string): void;
8
+ }
9
+ export declare function LabelValue(props: LabelValueProps): ReactElement;
10
+ //# sourceMappingURL=LabelValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelValue.d.ts","sourceRoot":"","sources":["../../../src/components/LabelValue.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAkC/D"}
@@ -0,0 +1,51 @@
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 { Select, MenuItem, CircularProgress, Stack } from '@mui/material';
15
+ import { useLabelValues } from '../utils/use-query';
16
+ export function LabelValue(props) {
17
+ const { datasource, value, labelName, onChange } = props;
18
+ const { data: labelValuesOptions, isLoading: isLabelValuesOptionsLoading } = useLabelValues(datasource, labelName);
19
+ return /*#__PURE__*/ _jsx(Select, {
20
+ sx: {
21
+ borderRadius: '0'
22
+ },
23
+ value: value,
24
+ size: "small",
25
+ onChange: (event)=>onChange?.(event.target.value),
26
+ displayEmpty: true,
27
+ disabled: !labelName || labelName === '',
28
+ renderValue: (selected)=>{
29
+ if (selected === '') {
30
+ return 'Select label value';
31
+ }
32
+ return selected;
33
+ },
34
+ children: isLabelValuesOptionsLoading ? /*#__PURE__*/ _jsx(Stack, {
35
+ width: "100%",
36
+ sx: {
37
+ alignItems: 'center',
38
+ justifyContent: 'center'
39
+ },
40
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
41
+ color: "inherit",
42
+ size: 20
43
+ })
44
+ }) : labelValuesOptions?.names && labelValuesOptions?.names.map((labelValue)=>/*#__PURE__*/ _jsx(MenuItem, {
45
+ value: labelValue,
46
+ children: labelValue
47
+ }, labelValue))
48
+ });
49
+ }
50
+
51
+ //# sourceMappingURL=LabelValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/LabelValue.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 { Select, MenuItem, CircularProgress, Stack } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { useLabelValues } from '../utils/use-query';\n\nexport interface LabelValueProps {\n datasource: PyroscopeDatasourceSelector;\n value: string;\n labelName: string;\n onChange?(value: string): void;\n}\n\nexport function LabelValue(props: LabelValueProps): ReactElement {\n const { datasource, value, labelName, onChange } = props;\n\n const { data: labelValuesOptions, isLoading: isLabelValuesOptionsLoading } = useLabelValues(datasource, labelName);\n\n return (\n <Select\n sx={{ borderRadius: '0' }}\n value={value}\n size=\"small\"\n onChange={(event) => onChange?.(event.target.value)}\n displayEmpty\n disabled={!labelName || labelName === ''} // Disabled if labelName is not defined yet\n renderValue={(selected) => {\n if (selected === '') {\n return 'Select label value';\n }\n return selected;\n }}\n >\n {isLabelValuesOptionsLoading ? (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress color=\"inherit\" size={20} />\n </Stack>\n ) : (\n labelValuesOptions?.names &&\n labelValuesOptions?.names.map((labelValue) => (\n <MenuItem key={labelValue} value={labelValue}>\n {labelValue}\n </MenuItem>\n ))\n )}\n </Select>\n );\n}\n"],"names":["Select","MenuItem","CircularProgress","Stack","useLabelValues","LabelValue","props","datasource","value","labelName","onChange","data","labelValuesOptions","isLoading","isLabelValuesOptionsLoading","sx","borderRadius","size","event","target","displayEmpty","disabled","renderValue","selected","width","alignItems","justifyContent","color","names","map","labelValue"],"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,SAASA,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAE1E,SAASC,cAAc,QAAQ,qBAAqB;AASpD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAEnD,MAAM,EAAEK,MAAMC,kBAAkB,EAAEC,WAAWC,2BAA2B,EAAE,GAAGV,eAAeG,YAAYE;IAExG,qBACE,KAACT;QACCe,IAAI;YAAEC,cAAc;QAAI;QACxBR,OAAOA;QACPS,MAAK;QACLP,UAAU,CAACQ,QAAUR,WAAWQ,MAAMC,MAAM,CAACX,KAAK;QAClDY,YAAY;QACZC,UAAU,CAACZ,aAAaA,cAAc;QACtCa,aAAa,CAACC;YACZ,IAAIA,aAAa,IAAI;gBACnB,OAAO;YACT;YACA,OAAOA;QACT;kBAECT,4CACC,KAACX;YAAMqB,OAAM;YAAOT,IAAI;gBAAEU,YAAY;gBAAUC,gBAAgB;YAAS;sBACvE,cAAA,KAACxB;gBAAiByB,OAAM;gBAAUV,MAAM;;aAG1CL,oBAAoBgB,SACpBhB,oBAAoBgB,MAAMC,IAAI,CAACC,2BAC7B,KAAC7B;gBAA0BO,OAAOsB;0BAC/BA;eADYA;;AAOzB"}
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ export interface OperatorProps {
3
+ value: string;
4
+ onChange?(value: string): void;
5
+ }
6
+ export declare function Operator(props: OperatorProps): ReactElement;
7
+ //# sourceMappingURL=Operator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operator.d.ts","sourceRoot":"","sources":["../../../src/components/Operator.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAc3D"}
@@ -0,0 +1,37 @@
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 { Select, MenuItem } from '@mui/material';
15
+ export function Operator(props) {
16
+ const { value, onChange } = props;
17
+ const operators = [
18
+ '=',
19
+ '!=',
20
+ '=~',
21
+ '!~'
22
+ ];
23
+ return /*#__PURE__*/ _jsx(Select, {
24
+ sx: {
25
+ borderRadius: '0'
26
+ },
27
+ value: value,
28
+ size: "small",
29
+ onChange: (event)=>onChange?.(event.target.value),
30
+ children: operators.map((op)=>/*#__PURE__*/ _jsx(MenuItem, {
31
+ value: op,
32
+ children: op
33
+ }, op))
34
+ });
35
+ }
36
+
37
+ //# sourceMappingURL=Operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Operator.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 { Select, MenuItem } from '@mui/material';\n\nexport interface OperatorProps {\n value: string;\n onChange?(value: string): void;\n}\n\nexport function Operator(props: OperatorProps): ReactElement {\n const { value, onChange } = props;\n\n const operators = ['=', '!=', '=~', '!~'];\n\n return (\n <Select sx={{ borderRadius: '0' }} value={value} size=\"small\" onChange={(event) => onChange?.(event.target.value)}>\n {operators.map((op) => (\n <MenuItem key={op} value={op}>\n {op}\n </MenuItem>\n ))}\n </Select>\n );\n}\n"],"names":["Select","MenuItem","Operator","props","value","onChange","operators","sx","borderRadius","size","event","target","map","op"],"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,SAASA,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AAOjD,OAAO,SAASC,SAASC,KAAoB;IAC3C,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAE5B,MAAMG,YAAY;QAAC;QAAK;QAAM;QAAM;KAAK;IAEzC,qBACE,KAACN;QAAOO,IAAI;YAAEC,cAAc;QAAI;QAAGJ,OAAOA;QAAOK,MAAK;QAAQJ,UAAU,CAACK,QAAUL,WAAWK,MAAMC,MAAM,CAACP,KAAK;kBAC7GE,UAAUM,GAAG,CAAC,CAACC,mBACd,KAACZ;gBAAkBG,OAAOS;0BACvBA;eADYA;;AAMvB"}
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import { PyroscopeDatasourceSelector } from '../model';
3
+ export interface ProfileTypeSelectorProps {
4
+ datasource: PyroscopeDatasourceSelector;
5
+ value: string;
6
+ onChange?(value: string): void;
7
+ }
8
+ export declare function ProfileTypeSelector(props: ProfileTypeSelectorProps): ReactElement;
9
+ //# sourceMappingURL=ProfileTypeSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileTypeSelector.d.ts","sourceRoot":"","sources":["../../../src/components/ProfileTypeSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CA6BjF"}
@@ -0,0 +1,49 @@
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 { Stack, TextField, MenuItem, CircularProgress } from '@mui/material';
15
+ import { useProfileTypes } from '../utils/use-query';
16
+ export function ProfileTypeSelector(props) {
17
+ const { datasource, value, onChange } = props;
18
+ const { data: profileTypesOptions, isLoading: isProfileTypesOptionsLoading } = useProfileTypes(datasource);
19
+ return /*#__PURE__*/ _jsx(Stack, {
20
+ position: "relative",
21
+ sx: {
22
+ flexGrow: 1,
23
+ maxWidth: '100%'
24
+ },
25
+ children: /*#__PURE__*/ _jsx(TextField, {
26
+ select: true,
27
+ label: "Profile Type",
28
+ value: value,
29
+ size: "small",
30
+ onChange: (event)=>onChange?.(event.target.value),
31
+ children: isProfileTypesOptionsLoading ? /*#__PURE__*/ _jsx(Stack, {
32
+ width: "100%",
33
+ sx: {
34
+ alignItems: 'center',
35
+ justifyContent: 'center'
36
+ },
37
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
38
+ color: "inherit",
39
+ size: 20
40
+ })
41
+ }) : profileTypesOptions?.profileTypes && profileTypesOptions?.profileTypes.map((type)=>/*#__PURE__*/ _jsx(MenuItem, {
42
+ value: type.ID,
43
+ children: type.name + '/' + type.sampleType
44
+ }, type.ID))
45
+ })
46
+ });
47
+ }
48
+
49
+ //# sourceMappingURL=ProfileTypeSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ProfileTypeSelector.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 { Stack, TextField, MenuItem, CircularProgress } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { useProfileTypes } from '../utils/use-query';\n\nexport interface ProfileTypeSelectorProps {\n datasource: PyroscopeDatasourceSelector;\n value: string;\n onChange?(value: string): void;\n}\n\nexport function ProfileTypeSelector(props: ProfileTypeSelectorProps): ReactElement {\n const { datasource, value, onChange } = props;\n\n const { data: profileTypesOptions, isLoading: isProfileTypesOptionsLoading } = useProfileTypes(datasource);\n\n return (\n <Stack position=\"relative\" sx={{ flexGrow: 1, maxWidth: '100%' }}>\n <TextField\n select\n label=\"Profile Type\"\n value={value}\n size=\"small\"\n onChange={(event) => onChange?.(event.target.value)}\n >\n {isProfileTypesOptionsLoading ? (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress color=\"inherit\" size={20} />\n </Stack>\n ) : (\n profileTypesOptions?.profileTypes &&\n profileTypesOptions?.profileTypes.map((type) => (\n <MenuItem key={type.ID} value={type.ID}>\n {type.name + '/' + type.sampleType}\n </MenuItem>\n ))\n )}\n </TextField>\n </Stack>\n );\n}\n"],"names":["Stack","TextField","MenuItem","CircularProgress","useProfileTypes","ProfileTypeSelector","props","datasource","value","onChange","data","profileTypesOptions","isLoading","isProfileTypesOptionsLoading","position","sx","flexGrow","maxWidth","select","label","size","event","target","width","alignItems","justifyContent","color","profileTypes","map","type","ID","name","sampleType"],"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,SAASA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,gBAAgB;AAE7E,SAASC,eAAe,QAAQ,qBAAqB;AAQrD,OAAO,SAASC,oBAAoBC,KAA+B;IACjE,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAExC,MAAM,EAAEI,MAAMC,mBAAmB,EAAEC,WAAWC,4BAA4B,EAAE,GAAGT,gBAAgBG;IAE/F,qBACE,KAACP;QAAMc,UAAS;QAAWC,IAAI;YAAEC,UAAU;YAAGC,UAAU;QAAO;kBAC7D,cAAA,KAAChB;YACCiB,MAAM;YACNC,OAAM;YACNX,OAAOA;YACPY,MAAK;YACLX,UAAU,CAACY,QAAUZ,WAAWY,MAAMC,MAAM,CAACd,KAAK;sBAEjDK,6CACC,KAACb;gBAAMuB,OAAM;gBAAOR,IAAI;oBAAES,YAAY;oBAAUC,gBAAgB;gBAAS;0BACvE,cAAA,KAACtB;oBAAiBuB,OAAM;oBAAUN,MAAM;;iBAG1CT,qBAAqBgB,gBACrBhB,qBAAqBgB,aAAaC,IAAI,CAACC,qBACrC,KAAC3B;oBAAuBM,OAAOqB,KAAKC,EAAE;8BACnCD,KAAKE,IAAI,GAAG,MAAMF,KAAKG,UAAU;mBADrBH,KAAKC,EAAE;;;AAQlC"}
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import { PyroscopeDatasourceSelector } from '../model';
3
+ export interface ServiceProps {
4
+ datasource: PyroscopeDatasourceSelector;
5
+ value: string;
6
+ onChange?(value: string): void;
7
+ }
8
+ export declare function Service(props: ServiceProps): ReactElement;
9
+ //# sourceMappingURL=Service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/components/Service.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,2BAA2B,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAgCzD"}
@@ -0,0 +1,52 @@
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 { Stack, TextField, MenuItem, CircularProgress, useTheme } from '@mui/material';
15
+ import { useServices } from '../utils/use-query';
16
+ export function Service(props) {
17
+ const { datasource, value, onChange } = props;
18
+ const { data: servicesOptions, isLoading: isServicesOptionsLoading } = useServices(datasource);
19
+ return /*#__PURE__*/ _jsx(Stack, {
20
+ position: "relative",
21
+ sx: {
22
+ flexGrow: 1,
23
+ maxWidth: '100%',
24
+ [useTheme().breakpoints.down('sm')]: {
25
+ width: '100%'
26
+ }
27
+ },
28
+ children: /*#__PURE__*/ _jsx(TextField, {
29
+ select: true,
30
+ label: "Service",
31
+ value: value,
32
+ size: "small",
33
+ onChange: (event)=>onChange?.(event.target.value),
34
+ children: isServicesOptionsLoading ? /*#__PURE__*/ _jsx(Stack, {
35
+ width: "100%",
36
+ sx: {
37
+ alignItems: 'center',
38
+ justifyContent: 'center'
39
+ },
40
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
41
+ color: "inherit",
42
+ size: 20
43
+ })
44
+ }) : servicesOptions?.names && servicesOptions?.names.map((service)=>/*#__PURE__*/ _jsx(MenuItem, {
45
+ value: service,
46
+ children: service
47
+ }, service))
48
+ })
49
+ });
50
+ }
51
+
52
+ //# sourceMappingURL=Service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Service.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 { Stack, TextField, MenuItem, CircularProgress, useTheme } from '@mui/material';\nimport { PyroscopeDatasourceSelector } from '../model';\nimport { useServices } from '../utils/use-query';\n\nexport interface ServiceProps {\n datasource: PyroscopeDatasourceSelector;\n value: string;\n onChange?(value: string): void;\n}\n\nexport function Service(props: ServiceProps): ReactElement {\n const { datasource, value, onChange } = props;\n\n const { data: servicesOptions, isLoading: isServicesOptionsLoading } = useServices(datasource);\n\n return (\n <Stack\n position=\"relative\"\n sx={{\n flexGrow: 1,\n maxWidth: '100%',\n [useTheme().breakpoints.down('sm')]: {\n width: '100%',\n },\n }}\n >\n <TextField select label=\"Service\" value={value} size=\"small\" onChange={(event) => onChange?.(event.target.value)}>\n {isServicesOptionsLoading ? (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress color=\"inherit\" size={20} />\n </Stack>\n ) : (\n servicesOptions?.names &&\n servicesOptions?.names.map((service) => (\n <MenuItem key={service} value={service}>\n {service}\n </MenuItem>\n ))\n )}\n </TextField>\n </Stack>\n );\n}\n"],"names":["Stack","TextField","MenuItem","CircularProgress","useTheme","useServices","Service","props","datasource","value","onChange","data","servicesOptions","isLoading","isServicesOptionsLoading","position","sx","flexGrow","maxWidth","breakpoints","down","width","select","label","size","event","target","alignItems","justifyContent","color","names","map","service"],"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,SAASA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,QAAQ,QAAQ,gBAAgB;AAEvF,SAASC,WAAW,QAAQ,qBAAqB;AAQjD,OAAO,SAASC,QAAQC,KAAmB;IACzC,MAAM,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH;IAExC,MAAM,EAAEI,MAAMC,eAAe,EAAEC,WAAWC,wBAAwB,EAAE,GAAGT,YAAYG;IAEnF,qBACE,KAACR;QACCe,UAAS;QACTC,IAAI;YACFC,UAAU;YACVC,UAAU;YACV,CAACd,WAAWe,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;gBACnCC,OAAO;YACT;QACF;kBAEA,cAAA,KAACpB;YAAUqB,MAAM;YAACC,OAAM;YAAUd,OAAOA;YAAOe,MAAK;YAAQd,UAAU,CAACe,QAAUf,WAAWe,MAAMC,MAAM,CAACjB,KAAK;sBAC5GK,yCACC,KAACd;gBAAMqB,OAAM;gBAAOL,IAAI;oBAAEW,YAAY;oBAAUC,gBAAgB;gBAAS;0BACvE,cAAA,KAACzB;oBAAiB0B,OAAM;oBAAUL,MAAM;;iBAG1CZ,iBAAiBkB,SACjBlB,iBAAiBkB,MAAMC,IAAI,CAACC,wBAC1B,KAAC9B;oBAAuBO,OAAOuB;8BAC5BA;mBADYA;;;AAQ3B"}
@@ -0,0 +1,4 @@
1
+ export * from './ProfileTypeSelector';
2
+ export * from './Service';
3
+ export * from './Filters';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -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
+ export * from './ProfileTypeSelector';
14
+ export * from './Service';
15
+ export * from './Filters';
16
+
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/index.ts"],"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\nexport * from './ProfileTypeSelector';\nexport * from './Service';\nexport * from './Filters';\n"],"names":[],"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;AAEjC,cAAc,wBAAwB;AACtC,cAAc,YAAY;AAC1B,cAAc,YAAY"}