@perses-dev/pyroscope-plugin 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/Pyroscope.1e9d1b83.js +5 -0
- package/__mf/js/async/3391.5c0ed426.js +73 -0
- package/__mf/js/async/4368.809601fc.js +2 -0
- package/__mf/js/async/4421.d2b623e9.js +1 -0
- package/__mf/js/async/4778.c791e281.js +1 -0
- package/__mf/js/async/5135.ae4df243.js +1 -0
- package/__mf/js/async/5207.04f840e4.js +2 -0
- package/__mf/js/async/671.2877c17b.js +7 -0
- package/__mf/js/async/6714.98bee612.js +2 -0
- package/__mf/js/async/677.58650020.js +1 -0
- package/__mf/js/async/{__federation_expose_PyroscopeDatasource.76f63abf.js → __federation_expose_PyroscopeDatasource.936db6be.js} +2 -2
- package/__mf/js/async/{__federation_expose_PyroscopeExplorer.d2e8d27c.js → __federation_expose_PyroscopeExplorer.5fcfa90f.js} +2 -2
- package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.81b7d9a3.js +2 -0
- package/__mf/js/main.5bf6c4b8.js +5 -0
- package/lib/cjs/components/DeleteFilterItem.js +9 -4
- package/lib/cjs/components/FilterItem.js +57 -24
- package/lib/cjs/components/LabelName.js +29 -27
- package/lib/cjs/components/LabelValue.js +26 -27
- package/lib/cjs/components/Operator.js +7 -3
- package/lib/cjs/components/ProfileTypeSelector.js +1 -2
- package/lib/cjs/components/Service.js +20 -24
- package/lib/cjs/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +21 -12
- package/lib/components/DeleteFilterItem.d.ts.map +1 -1
- package/lib/components/DeleteFilterItem.js +9 -4
- package/lib/components/DeleteFilterItem.js.map +1 -1
- package/lib/components/FilterItem.d.ts.map +1 -1
- package/lib/components/FilterItem.js +58 -25
- package/lib/components/FilterItem.js.map +1 -1
- package/lib/components/LabelName.d.ts.map +1 -1
- package/lib/components/LabelName.js +30 -28
- package/lib/components/LabelName.js.map +1 -1
- package/lib/components/LabelValue.d.ts.map +1 -1
- package/lib/components/LabelValue.js +27 -28
- package/lib/components/LabelValue.js.map +1 -1
- package/lib/components/Operator.d.ts.map +1 -1
- package/lib/components/Operator.js +7 -3
- package/lib/components/Operator.js.map +1 -1
- package/lib/components/ProfileTypeSelector.js +1 -2
- package/lib/components/ProfileTypeSelector.js.map +1 -1
- package/lib/components/Service.d.ts.map +1 -1
- package/lib/components/Service.js +21 -25
- package/lib/components/Service.js.map +1 -1
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.d.ts.map +1 -1
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js +19 -10
- package/lib/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.js.map +1 -1
- package/mf-manifest.json +37 -37
- package/mf-stats.json +37 -37
- package/package.json +7 -7
- package/__mf/js/Pyroscope.5ee1a2b0.js +0 -5
- package/__mf/js/async/1101.380fb9ae.js +0 -73
- package/__mf/js/async/1339.e58b309f.js +0 -1
- package/__mf/js/async/424.edb69d58.js +0 -1
- package/__mf/js/async/4368.2d817d5d.js +0 -2
- package/__mf/js/async/4421.d44d1d6f.js +0 -1
- package/__mf/js/async/5215.6fd5cc14.js +0 -1
- package/__mf/js/async/5358.40b9537e.js +0 -7
- package/__mf/js/async/5876.38b119d5.js +0 -2
- package/__mf/js/async/9633.a7997138.js +0 -2
- package/__mf/js/async/__federation_expose_PyroscopeProfileQuery.75c9c11b.js +0 -2
- package/__mf/js/main.aa3b0acd.js +0 -5
- /package/__mf/css/async/{1339.6763d50b.css → 2341.6763d50b.css} +0 -0
- /package/__mf/css/async/{9633.6763d50b.css → 5207.6763d50b.css} +0 -0
- /package/__mf/js/async/{1101.380fb9ae.js.LICENSE.txt → 3391.5c0ed426.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4368.2d817d5d.js.LICENSE.txt → 4368.809601fc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9633.a7997138.js.LICENSE.txt → 5207.04f840e4.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5358.40b9537e.js.LICENSE.txt → 671.2877c17b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5876.38b119d5.js.LICENSE.txt → 6714.98bee612.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_PyroscopeDatasource.76f63abf.js.LICENSE.txt → __federation_expose_PyroscopeDatasource.936db6be.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_PyroscopeExplorer.d2e8d27c.js.LICENSE.txt → __federation_expose_PyroscopeExplorer.5fcfa90f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_PyroscopeProfileQuery.75c9c11b.js.LICENSE.txt → __federation_expose_PyroscopeProfileQuery.81b7d9a3.js.LICENSE.txt} +0 -0
|
@@ -1 +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 {
|
|
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, useMemo } from 'react';\nimport { TextField, Autocomplete } 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 const filteredLabelNamesOptions = useMemo(\n () => filterLabelNamesOptions(labelNamesOptions?.names ?? []),\n [labelNamesOptions]\n );\n\n return (\n <Autocomplete\n disableClearable\n options={filteredLabelNamesOptions}\n value={value}\n sx={(theme) => ({\n width: '100%',\n '& .MuiOutlinedInput-root': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n [theme.breakpoints.down('sm')]: {\n borderBottomLeftRadius: 0,\n },\n },\n })}\n loading={isLabelNamesOptionsLoading}\n renderInput={(params) => {\n return <TextField {...params} placeholder=\"Select label name\" size=\"small\" />;\n }}\n onChange={(_event, newValue) => {\n if (newValue !== null) {\n onChange?.(newValue);\n }\n }}\n />\n );\n}\n"],"names":["useMemo","TextField","Autocomplete","useLabelNames","filterLabelNamesOptions","LabelName","props","datasource","value","onChange","data","labelNamesOptions","isLoading","isLabelNamesOptionsLoading","filteredLabelNamesOptions","names","disableClearable","options","sx","theme","width","borderTopRightRadius","borderBottomRightRadius","breakpoints","down","borderBottomLeftRadius","loading","renderInput","params","placeholder","size","_event","newValue"],"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,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,SAAS,EAAEC,YAAY,QAAQ,gBAAgB;AAExD,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,MAAMO,4BAA4Bd,QAChC,IAAMI,wBAAwBO,mBAAmBI,SAAS,EAAE,GAC5D;QAACJ;KAAkB;IAGrB,qBACE,KAACT;QACCc,gBAAgB;QAChBC,SAASH;QACTN,OAAOA;QACPU,IAAI,CAACC,QAAW,CAAA;gBACdC,OAAO;gBACP,4BAA4B;oBAC1BC,sBAAsB;oBACtBC,yBAAyB;oBACzB,CAACH,MAAMI,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;wBAC9BC,wBAAwB;oBAC1B;gBACF;YACF,CAAA;QACAC,SAASb;QACTc,aAAa,CAACC;YACZ,qBAAO,KAAC3B;gBAAW,GAAG2B,MAAM;gBAAEC,aAAY;gBAAoBC,MAAK;;QACrE;QACArB,UAAU,CAACsB,QAAQC;YACjB,IAAIA,aAAa,MAAM;gBACrBvB,WAAWuB;YACb;QACF;;AAGN"}
|
|
@@ -1 +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,
|
|
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,CAgC/D"}
|
|
@@ -11,40 +11,39 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import {
|
|
14
|
+
import { TextField, Autocomplete } from '@mui/material';
|
|
15
15
|
import { useLabelValues } from '../utils/use-query';
|
|
16
16
|
export function LabelValue(props) {
|
|
17
17
|
const { datasource, value, labelName, onChange } = props;
|
|
18
18
|
const { data: labelValuesOptions, isLoading: isLabelValuesOptionsLoading } = useLabelValues(datasource, labelName);
|
|
19
|
-
return /*#__PURE__*/ _jsx(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return /*#__PURE__*/ _jsx(Autocomplete, {
|
|
20
|
+
freeSolo: true,
|
|
21
|
+
disableClearable: true,
|
|
22
|
+
options: labelValuesOptions?.names ?? [],
|
|
23
23
|
value: value,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
sx: (theme)=>({
|
|
25
|
+
width: '100%',
|
|
26
|
+
'& .MuiOutlinedInput-root': {
|
|
27
|
+
borderRadius: 0,
|
|
28
|
+
width: '100%',
|
|
29
|
+
[theme.breakpoints.down('sm')]: {
|
|
30
|
+
borderBottomLeftRadius: 4
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
loading: isLabelValuesOptionsLoading,
|
|
35
|
+
renderInput: (params)=>{
|
|
36
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
37
|
+
...params,
|
|
38
|
+
placeholder: "Select label value",
|
|
39
|
+
size: "small"
|
|
40
|
+
});
|
|
33
41
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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))
|
|
42
|
+
onChange: (_event, newInputValue)=>{
|
|
43
|
+
if (newInputValue !== null) {
|
|
44
|
+
onChange?.(newInputValue);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -1 +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 {
|
|
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 { TextField, Autocomplete } 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 <Autocomplete\n freeSolo\n disableClearable\n options={labelValuesOptions?.names ?? []}\n value={value}\n sx={(theme) => ({\n width: '100%',\n '& .MuiOutlinedInput-root': {\n borderRadius: 0,\n width: '100%',\n [theme.breakpoints.down('sm')]: {\n borderBottomLeftRadius: 4,\n },\n },\n })}\n loading={isLabelValuesOptionsLoading}\n renderInput={(params) => {\n return <TextField {...params} placeholder=\"Select label value\" size=\"small\" />;\n }}\n onChange={(_event, newInputValue) => {\n if (newInputValue !== null) {\n onChange?.(newInputValue);\n }\n }}\n />\n );\n}\n"],"names":["TextField","Autocomplete","useLabelValues","LabelValue","props","datasource","value","labelName","onChange","data","labelValuesOptions","isLoading","isLabelValuesOptionsLoading","freeSolo","disableClearable","options","names","sx","theme","width","borderRadius","breakpoints","down","borderBottomLeftRadius","loading","renderInput","params","placeholder","size","_event","newInputValue"],"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,SAAS,EAAEC,YAAY,QAAQ,gBAAgB;AAExD,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,KAACN;QACCY,QAAQ;QACRC,gBAAgB;QAChBC,SAASL,oBAAoBM,SAAS,EAAE;QACxCV,OAAOA;QACPW,IAAI,CAACC,QAAW,CAAA;gBACdC,OAAO;gBACP,4BAA4B;oBAC1BC,cAAc;oBACdD,OAAO;oBACP,CAACD,MAAMG,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;wBAC9BC,wBAAwB;oBAC1B;gBACF;YACF,CAAA;QACAC,SAASZ;QACTa,aAAa,CAACC;YACZ,qBAAO,KAAC1B;gBAAW,GAAG0B,MAAM;gBAAEC,aAAY;gBAAqBC,MAAK;;QACtE;QACApB,UAAU,CAACqB,QAAQC;YACjB,IAAIA,kBAAkB,MAAM;gBAC1BtB,WAAWsB;YACb;QACF;;AAGN"}
|
|
@@ -1 +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,
|
|
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,CAyB3D"}
|
|
@@ -21,9 +21,13 @@ export function Operator(props) {
|
|
|
21
21
|
'!~'
|
|
22
22
|
];
|
|
23
23
|
return /*#__PURE__*/ _jsx(Select, {
|
|
24
|
-
sx: {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
sx: (theme)=>({
|
|
25
|
+
borderRadius: 0,
|
|
26
|
+
width: '100%',
|
|
27
|
+
[theme.breakpoints.down('sm')]: {
|
|
28
|
+
borderTopRightRadius: 4
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
27
31
|
value: value,
|
|
28
32
|
size: "small",
|
|
29
33
|
onChange: (event)=>onChange?.(event.target.value),
|
|
@@ -1 +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
|
|
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\n sx={(theme) => ({\n borderRadius: 0,\n width: '100%',\n [theme.breakpoints.down('sm')]: {\n borderTopRightRadius: 4,\n },\n })}\n value={value}\n size=\"small\"\n onChange={(event) => onChange?.(event.target.value)}\n >\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","theme","borderRadius","width","breakpoints","down","borderTopRightRadius","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;QACCO,IAAI,CAACC,QAAW,CAAA;gBACdC,cAAc;gBACdC,OAAO;gBACP,CAACF,MAAMG,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;oBAC9BC,sBAAsB;gBACxB;YACF,CAAA;QACAT,OAAOA;QACPU,MAAK;QACLT,UAAU,CAACU,QAAUV,WAAWU,MAAMC,MAAM,CAACZ,KAAK;kBAEjDE,UAAUW,GAAG,CAAC,CAACC,mBACd,KAACjB;gBAAkBG,OAAOc;0BACvBA;eADYA;;AAMvB"}
|
|
@@ -1 +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={{
|
|
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={{ width: '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","width","select","label","size","event","target","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,OAAO;QAAO;kBAC7C,cAAA,KAACf;YACCgB,MAAM;YACNC,OAAM;YACNV,OAAOA;YACPW,MAAK;YACLV,UAAU,CAACW,QAAUX,WAAWW,MAAMC,MAAM,CAACb,KAAK;sBAEjDK,6CACC,KAACb;gBAAMgB,OAAM;gBAAOD,IAAI;oBAAEO,YAAY;oBAAUC,gBAAgB;gBAAS;0BACvE,cAAA,KAACpB;oBAAiBqB,OAAM;oBAAUL,MAAM;;iBAG1CR,qBAAqBc,gBACrBd,qBAAqBc,aAAaC,IAAI,CAACC,qBACrC,KAACzB;oBAAuBM,OAAOmB,KAAKC,EAAE;8BACnCD,KAAKE,IAAI,GAAG,MAAMF,KAAKG,UAAU;mBADrBH,KAAKC,EAAE;;;AAQlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/components/Service.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Service.d.ts","sourceRoot":"","sources":["../../../src/components/Service.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAkB,MAAM,OAAO,CAAC;AAErD,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,CA8BzD"}
|
|
@@ -11,40 +11,36 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { Stack, TextField,
|
|
14
|
+
import { Stack, TextField, Autocomplete } from '@mui/material';
|
|
15
15
|
import { useServices } from '../utils/use-query';
|
|
16
16
|
export function Service(props) {
|
|
17
17
|
const { datasource, value, onChange } = props;
|
|
18
18
|
const { data: servicesOptions, isLoading: isServicesOptionsLoading } = useServices(datasource);
|
|
19
|
+
function handleServiceChange(_event, newValue) {
|
|
20
|
+
if (newValue !== null) {
|
|
21
|
+
onChange?.(newValue);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
19
24
|
return /*#__PURE__*/ _jsx(Stack, {
|
|
20
25
|
position: "relative",
|
|
21
26
|
sx: {
|
|
22
|
-
|
|
23
|
-
maxWidth: '100%',
|
|
24
|
-
[useTheme().breakpoints.down('sm')]: {
|
|
25
|
-
width: '100%'
|
|
26
|
-
}
|
|
27
|
+
width: '100%'
|
|
27
28
|
},
|
|
28
|
-
children: /*#__PURE__*/ _jsx(
|
|
29
|
-
|
|
30
|
-
label: "Service",
|
|
29
|
+
children: /*#__PURE__*/ _jsx(Autocomplete, {
|
|
30
|
+
options: servicesOptions?.names ?? [],
|
|
31
31
|
value: value,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}) : servicesOptions?.names && servicesOptions?.names.map((service)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
45
|
-
value: service,
|
|
46
|
-
children: service
|
|
47
|
-
}, service))
|
|
32
|
+
sx: {
|
|
33
|
+
minWidth: 200
|
|
34
|
+
},
|
|
35
|
+
loading: isServicesOptionsLoading,
|
|
36
|
+
renderInput: (params)=>{
|
|
37
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
38
|
+
...params,
|
|
39
|
+
label: "Service",
|
|
40
|
+
size: "small"
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
onChange: handleServiceChange
|
|
48
44
|
})
|
|
49
45
|
});
|
|
50
46
|
}
|
|
@@ -1 +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,
|
|
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, SyntheticEvent } from 'react';\nimport { Stack, TextField, Autocomplete } 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 function handleServiceChange(_event: SyntheticEvent, newValue: string | null): void {\n if (newValue !== null) {\n onChange?.(newValue);\n }\n }\n\n return (\n <Stack\n position=\"relative\"\n sx={{\n width: '100%',\n }}\n >\n <Autocomplete\n options={servicesOptions?.names ?? []}\n value={value}\n sx={{ minWidth: 200 }}\n loading={isServicesOptionsLoading}\n renderInput={(params) => {\n return <TextField {...params} label=\"Service\" size=\"small\" />;\n }}\n onChange={handleServiceChange}\n />\n </Stack>\n );\n}\n"],"names":["Stack","TextField","Autocomplete","useServices","Service","props","datasource","value","onChange","data","servicesOptions","isLoading","isServicesOptionsLoading","handleServiceChange","_event","newValue","position","sx","width","options","names","minWidth","loading","renderInput","params","label","size"],"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,YAAY,QAAQ,gBAAgB;AAE/D,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,SAASO,oBAAoBC,MAAsB,EAAEC,QAAuB;QAC1E,IAAIA,aAAa,MAAM;YACrBP,WAAWO;QACb;IACF;IAEA,qBACE,KAACf;QACCgB,UAAS;QACTC,IAAI;YACFC,OAAO;QACT;kBAEA,cAAA,KAAChB;YACCiB,SAAST,iBAAiBU,SAAS,EAAE;YACrCb,OAAOA;YACPU,IAAI;gBAAEI,UAAU;YAAI;YACpBC,SAASV;YACTW,aAAa,CAACC;gBACZ,qBAAO,KAACvB;oBAAW,GAAGuB,MAAM;oBAAEC,OAAM;oBAAUC,MAAK;;YACrD;YACAlB,UAAUK;;;AAIlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PyroscopeProfileQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAQrC,OAAO,EACL,uBAAuB,EAKxB,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"PyroscopeProfileQueryEditor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAQrC,OAAO,EACL,uBAAuB,EAKxB,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAqExF"}
|
|
@@ -14,8 +14,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { DatasourceSelect } from '@perses-dev/plugin-system';
|
|
15
15
|
import { useId } from '@perses-dev/components';
|
|
16
16
|
import { produce } from 'immer';
|
|
17
|
-
import { FormControl, InputLabel, Stack, TextField } from '@mui/material';
|
|
18
|
-
import { DEFAULT_PYROSCOPE, isDefaultPyroscopeSelector, isPyroscopeDatasourceSelector, PYROSCOPE_DATASOURCE_KIND } from '../../model
|
|
17
|
+
import { FormControl, InputLabel, Stack, TextField, useTheme } from '@mui/material';
|
|
18
|
+
import { DEFAULT_PYROSCOPE, isDefaultPyroscopeSelector, isPyroscopeDatasourceSelector, PYROSCOPE_DATASOURCE_KIND } from '../../model';
|
|
19
19
|
import { ProfileTypeSelector, Service, Filters } from '../../components';
|
|
20
20
|
import { useMaxNodesState, useProfileTypeState, useServiceState, useFiltersState } from './query-editor-model';
|
|
21
21
|
export function PyroscopeProfileQueryEditor(props) {
|
|
@@ -33,8 +33,7 @@ export function PyroscopeProfileQueryEditor(props) {
|
|
|
33
33
|
if (isPyroscopeDatasourceSelector(next)) {
|
|
34
34
|
onChange(produce(value, (draft)=>{
|
|
35
35
|
// If they're using the default, just omit the datasource prop (i.e. set to undefined)
|
|
36
|
-
|
|
37
|
-
draft.datasource = nextDatasource;
|
|
36
|
+
draft.datasource = isDefaultPyroscopeSelector(next) ? undefined : next;
|
|
38
37
|
}));
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
@@ -65,11 +64,12 @@ export function PyroscopeProfileQueryEditor(props) {
|
|
|
65
64
|
}),
|
|
66
65
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
67
66
|
direction: "row",
|
|
68
|
-
spacing: 0,
|
|
69
67
|
sx: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
[useTheme().breakpoints.down('sm')]: {
|
|
69
|
+
flexWrap: 'wrap'
|
|
70
|
+
},
|
|
71
|
+
gap: 2,
|
|
72
|
+
rowGap: 1
|
|
73
73
|
},
|
|
74
74
|
children: [
|
|
75
75
|
/*#__PURE__*/ _jsx(Service, {
|
|
@@ -83,13 +83,22 @@ export function PyroscopeProfileQueryEditor(props) {
|
|
|
83
83
|
onChange: handleProfileTypeChange
|
|
84
84
|
}),
|
|
85
85
|
/*#__PURE__*/ _jsx(TextField, {
|
|
86
|
+
type: "number",
|
|
86
87
|
size: "small",
|
|
87
88
|
label: "Max Nodes",
|
|
88
89
|
value: maxNodes,
|
|
89
90
|
error: maxNodesHasError,
|
|
90
91
|
onChange: (e)=>handleMaxNodesChange(e.target.value),
|
|
91
|
-
sx: {
|
|
92
|
-
|
|
92
|
+
sx: (theme)=>({
|
|
93
|
+
width: 250,
|
|
94
|
+
[theme.breakpoints.down('sm')]: {
|
|
95
|
+
width: '100%'
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
slotProps: {
|
|
99
|
+
htmlInput: {
|
|
100
|
+
step: 1
|
|
101
|
+
}
|
|
93
102
|
}
|
|
94
103
|
})
|
|
95
104
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.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 { DatasourceSelect, DatasourceSelectProps } from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { produce } from 'immer';\nimport { FormControl, InputLabel, Stack, TextField } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PYROSCOPE,\n isDefaultPyroscopeSelector,\n isPyroscopeDatasourceSelector,\n PYROSCOPE_DATASOURCE_KIND,\n} from '../../model
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/pyroscope-profile-query/PyroscopeProfileQueryEditor.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 { DatasourceSelect, DatasourceSelectProps } from '@perses-dev/plugin-system';\nimport { useId } from '@perses-dev/components';\nimport { produce } from 'immer';\nimport { FormControl, InputLabel, Stack, TextField, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport {\n DEFAULT_PYROSCOPE,\n isDefaultPyroscopeSelector,\n isPyroscopeDatasourceSelector,\n PYROSCOPE_DATASOURCE_KIND,\n} from '../../model';\nimport { ProfileTypeSelector, Service, Filters } from '../../components';\nimport {\n ProfileQueryEditorProps,\n useMaxNodesState,\n useProfileTypeState,\n useServiceState,\n useFiltersState,\n} from './query-editor-model';\n\nexport function PyroscopeProfileQueryEditor(props: ProfileQueryEditorProps): ReactElement {\n const { onChange, value } = props;\n const { datasource } = value;\n const selectedDatasource = datasource ?? DEFAULT_PYROSCOPE;\n const datasourceSelectLabelID = useId('pyroscope-datasource-label');\n\n const { maxNodes, handleMaxNodesChange, maxNodesHasError } = useMaxNodesState(props);\n const { profileType, handleProfileTypeChange } = useProfileTypeState(props);\n const { service, handleServiceChange } = useServiceState(props);\n const { filters, handleFiltersChange } = useFiltersState(props);\n\n const handleDatasourceChange: DatasourceSelectProps['onChange'] = (next) => {\n // Check if the next value is a DatasourceSelector\n if (typeof next === 'object' && 'kind' in next && 'name' in next) {\n if (isPyroscopeDatasourceSelector(next)) {\n onChange(\n produce(value, (draft) => {\n // If they're using the default, just omit the datasource prop (i.e. set to undefined)\n draft.datasource = isDefaultPyroscopeSelector(next) ? undefined : next;\n })\n );\n return;\n }\n }\n\n throw new Error('Got unexpected non-Pyroscope datasource selector');\n };\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\" fullWidth={false}>\n <InputLabel id={datasourceSelectLabelID} shrink>\n Pyroscope Datasource\n </InputLabel>\n <DatasourceSelect\n datasourcePluginKind={PYROSCOPE_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n labelId={datasourceSelectLabelID}\n label=\"Pyroscope Datasource\"\n notched\n />\n </FormControl>\n <Stack\n direction=\"row\"\n sx={{\n [useTheme().breakpoints.down('sm')]: {\n flexWrap: 'wrap',\n },\n gap: 2,\n rowGap: 1,\n }}\n >\n <Service datasource={selectedDatasource} value={service} onChange={handleServiceChange} />\n <ProfileTypeSelector datasource={selectedDatasource} value={profileType} onChange={handleProfileTypeChange} />\n <TextField\n type=\"number\"\n size=\"small\"\n label=\"Max Nodes\"\n value={maxNodes}\n error={maxNodesHasError}\n onChange={(e) => handleMaxNodesChange(e.target.value)}\n sx={(theme) => ({ width: 250, [theme.breakpoints.down('sm')]: { width: '100%' } })}\n slotProps={{ htmlInput: { step: 1 } }}\n />\n </Stack>\n <Filters datasource={selectedDatasource} value={filters} onChange={handleFiltersChange} />\n </Stack>\n );\n}\n"],"names":["DatasourceSelect","useId","produce","FormControl","InputLabel","Stack","TextField","useTheme","DEFAULT_PYROSCOPE","isDefaultPyroscopeSelector","isPyroscopeDatasourceSelector","PYROSCOPE_DATASOURCE_KIND","ProfileTypeSelector","Service","Filters","useMaxNodesState","useProfileTypeState","useServiceState","useFiltersState","PyroscopeProfileQueryEditor","props","onChange","value","datasource","selectedDatasource","datasourceSelectLabelID","maxNodes","handleMaxNodesChange","maxNodesHasError","profileType","handleProfileTypeChange","service","handleServiceChange","filters","handleFiltersChange","handleDatasourceChange","next","draft","undefined","Error","spacing","margin","fullWidth","id","shrink","datasourcePluginKind","labelId","label","notched","direction","sx","breakpoints","down","flexWrap","gap","rowGap","type","size","error","e","target","theme","width","slotProps","htmlInput","step"],"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,SAASA,gBAAgB,QAA+B,4BAA4B;AACpF,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,WAAW,EAAEC,UAAU,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,gBAAgB;AAEpF,SACEC,iBAAiB,EACjBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,yBAAyB,QACpB,cAAc;AACrB,SAASC,mBAAmB,EAAEC,OAAO,EAAEC,OAAO,QAAQ,mBAAmB;AACzE,SAEEC,gBAAgB,EAChBC,mBAAmB,EACnBC,eAAe,EACfC,eAAe,QACV,uBAAuB;AAE9B,OAAO,SAASC,4BAA4BC,KAA8B;IACxE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAC5B,MAAM,EAAEG,UAAU,EAAE,GAAGD;IACvB,MAAME,qBAAqBD,cAAcf;IACzC,MAAMiB,0BAA0BxB,MAAM;IAEtC,MAAM,EAAEyB,QAAQ,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAE,GAAGb,iBAAiBK;IAC9E,MAAM,EAAES,WAAW,EAAEC,uBAAuB,EAAE,GAAGd,oBAAoBI;IACrE,MAAM,EAAEW,OAAO,EAAEC,mBAAmB,EAAE,GAAGf,gBAAgBG;IACzD,MAAM,EAAEa,OAAO,EAAEC,mBAAmB,EAAE,GAAGhB,gBAAgBE;IAEzD,MAAMe,yBAA4D,CAACC;QACjE,kDAAkD;QAClD,IAAI,OAAOA,SAAS,YAAY,UAAUA,QAAQ,UAAUA,MAAM;YAChE,IAAI1B,8BAA8B0B,OAAO;gBACvCf,SACEnB,QAAQoB,OAAO,CAACe;oBACd,sFAAsF;oBACtFA,MAAMd,UAAU,GAAGd,2BAA2B2B,QAAQE,YAAYF;gBACpE;gBAEF;YACF;QACF;QAEA,MAAM,IAAIG,MAAM;IAClB;IAEA,qBACE,MAAClC;QAAMmC,SAAS;;0BACd,MAACrC;gBAAYsC,QAAO;gBAAQC,WAAW;;kCACrC,KAACtC;wBAAWuC,IAAIlB;wBAAyBmB,MAAM;kCAAC;;kCAGhD,KAAC5C;wBACC6C,sBAAsBlC;wBACtBW,OAAOE;wBACPH,UAAUc;wBACVW,SAASrB;wBACTsB,OAAM;wBACNC,OAAO;;;;0BAGX,MAAC3C;gBACC4C,WAAU;gBACVC,IAAI;oBACF,CAAC3C,WAAW4C,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;wBACnCC,UAAU;oBACZ;oBACAC,KAAK;oBACLC,QAAQ;gBACV;;kCAEA,KAAC1C;wBAAQU,YAAYC;wBAAoBF,OAAOS;wBAASV,UAAUW;;kCACnE,KAACpB;wBAAoBW,YAAYC;wBAAoBF,OAAOO;wBAAaR,UAAUS;;kCACnF,KAACxB;wBACCkD,MAAK;wBACLC,MAAK;wBACLV,OAAM;wBACNzB,OAAOI;wBACPgC,OAAO9B;wBACPP,UAAU,CAACsC,IAAMhC,qBAAqBgC,EAAEC,MAAM,CAACtC,KAAK;wBACpD4B,IAAI,CAACW,QAAW,CAAA;gCAAEC,OAAO;gCAAK,CAACD,MAAMV,WAAW,CAACC,IAAI,CAAC,MAAM,EAAE;oCAAEU,OAAO;gCAAO;4BAAE,CAAA;wBAChFC,WAAW;4BAAEC,WAAW;gCAAEC,MAAM;4BAAE;wBAAE;;;;0BAGxC,KAACnD;gBAAQS,YAAYC;gBAAoBF,OAAOW;gBAASZ,UAAUa;;;;AAGzE"}
|