@parca/profile 0.19.67 → 0.19.68
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/CHANGELOG.md +4 -0
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +2 -13
- package/dist/MatchersInput/index.d.ts +1 -1
- package/dist/MatchersInput/index.d.ts.map +1 -1
- package/dist/MatchersInput/index.js +2 -2
- package/dist/ProfileSelector/QueryControls.d.ts +2 -1
- package/dist/ProfileSelector/QueryControls.d.ts.map +1 -1
- package/dist/ProfileSelector/QueryControls.js +14 -5
- package/dist/ProfileSelector/index.js +2 -2
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts +2 -0
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +2 -2
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts +3 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts.map +1 -1
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +4 -9
- package/dist/ProfileView/components/Toolbars/index.d.ts +5 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +2 -2
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +5 -1
- package/dist/ProfileView/types/visualization.d.ts +1 -0
- package/dist/ProfileView/types/visualization.d.ts.map +1 -1
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +3 -1
- package/dist/SelectWithRefresh/index.d.ts +10 -0
- package/dist/SelectWithRefresh/index.d.ts.map +1 -0
- package/dist/SelectWithRefresh/index.js +45 -0
- package/dist/SimpleMatchers/Select.d.ts +1 -1
- package/dist/SimpleMatchers/Select.d.ts.map +1 -1
- package/dist/SimpleMatchers/Select.js +2 -8
- package/dist/SimpleMatchers/index.js +1 -1
- package/dist/contexts/SimpleMatchersLabelContext.d.ts +2 -2
- package/dist/contexts/SimpleMatchersLabelContext.d.ts.map +1 -1
- package/dist/contexts/SimpleMatchersLabelContext.js +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/styles.css +1 -1
- package/dist/useQuery.d.ts +2 -0
- package/dist/useQuery.d.ts.map +1 -1
- package/dist/useQuery.js +10 -3
- package/package.json +4 -4
- package/src/MatchersInput/SuggestionsList.tsx +1 -40
- package/src/MatchersInput/index.tsx +3 -3
- package/src/ProfileSelector/QueryControls.tsx +19 -3
- package/src/ProfileSelector/index.tsx +6 -6
- package/src/ProfileView/components/ActionButtons/GroupByDropdown.tsx +11 -1
- package/src/ProfileView/components/GroupByLabelsDropdown/index.tsx +16 -18
- package/src/ProfileView/components/Toolbars/index.tsx +8 -2
- package/src/ProfileView/index.tsx +5 -1
- package/src/ProfileView/types/visualization.ts +1 -0
- package/src/ProfileViewWithData.tsx +3 -0
- package/src/SelectWithRefresh/index.tsx +98 -0
- package/src/SimpleMatchers/Select.tsx +10 -30
- package/src/SimpleMatchers/index.tsx +1 -1
- package/src/contexts/SimpleMatchersLabelContext.tsx +6 -6
- package/src/index.tsx +9 -1
- package/src/useQuery.tsx +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.19.68](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.67...@parca/profile@0.19.68) (2025-10-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.19.67](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.66...@parca/profile@0.19.67) (2025-10-21)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"AAuBA,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;gBAEF,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3D;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;;CAO3B;AAED,UAAU,KAAK;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAaD,QAAA,MAAM,eAAe,GAAI,yKAWtB,KAAK,KAAG,GAAG,CAAC,OAsUd,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// Copyright 2022 The Parca Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -13,10 +13,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
|
15
15
|
import { Transition } from '@headlessui/react';
|
|
16
|
-
import { Icon } from '@iconify/react';
|
|
17
|
-
import cx from 'classnames';
|
|
18
16
|
import { usePopper } from 'react-popper';
|
|
19
|
-
import { useParcaContext } from '@parca/components';
|
|
17
|
+
import { RefreshButton, useParcaContext } from '@parca/components';
|
|
20
18
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
21
19
|
import SuggestionItem from './SuggestionItem';
|
|
22
20
|
export class Suggestion {
|
|
@@ -37,15 +35,6 @@ const LoadingSpinner = () => {
|
|
|
37
35
|
const { loader: Spinner } = useParcaContext();
|
|
38
36
|
return _jsx("div", { className: "pt-2 pb-4", children: Spinner });
|
|
39
37
|
};
|
|
40
|
-
const RefreshButton = ({ onClick, disabled, title, testId }) => {
|
|
41
|
-
return (_jsx("div", { className: "w-full flex items-center justify-center px-3 py-2 bg-gray-50 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-700", children: _jsxs("button", { onClick: e => {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
onClick();
|
|
45
|
-
}, disabled: disabled, className: cx('py-1 px-2 flex items-center gap-1 rounded-full transition-all duration-200 w-auto justify-center', disabled
|
|
46
|
-
? 'cursor-wait opacity-50'
|
|
47
|
-
: 'hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer'), title: title, type: "button", "data-testid": testId, children: [_jsx(Icon, { icon: "system-uicons:reset", className: cx('w-3 h-3 text-gray-500 dark:text-gray-400', disabled && 'animate-spin') }), _jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Refresh results" })] }) }));
|
|
48
|
-
};
|
|
49
38
|
const transformLabelsForSuggestions = (labelNames, shouldTrimPrefix = false) => {
|
|
50
39
|
const trimmedLabel = shouldTrimPrefix ? labelNames.split('.').pop() ?? labelNames : labelNames;
|
|
51
40
|
return trimmedLabel;
|
|
@@ -17,7 +17,7 @@ export interface ILabelNamesResult {
|
|
|
17
17
|
interface UseLabelNames {
|
|
18
18
|
result: ILabelNamesResult;
|
|
19
19
|
loading: boolean;
|
|
20
|
-
refetch: () => void
|
|
20
|
+
refetch: () => Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
export declare const useLabelNames: (client: QueryServiceClient, profileType: string, start?: number, end?: number, match?: string[]) => UseLabelNames;
|
|
23
23
|
interface UseLabelValues {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAgB,cAAc,EAAE,kBAAkB,EAAgB,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAKrD,UAAU,kBAAkB;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","s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eAAO,MAAM,8BAA8B,GACzC,WAAW,MAAM,EACjB,oBAAoB,iBAAiB,KACpC,MAAM,EAWR,CAAC;AA2MF,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAWxF"}
|
|
@@ -47,8 +47,8 @@ export const useLabelNames = (client, profileType, start, end, match) => {
|
|
|
47
47
|
return {
|
|
48
48
|
result: { response: data, error: error },
|
|
49
49
|
loading: isLoading,
|
|
50
|
-
refetch: () => {
|
|
51
|
-
|
|
50
|
+
refetch: async () => {
|
|
51
|
+
await refetch();
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -36,7 +36,8 @@ interface QueryControlsProps {
|
|
|
36
36
|
setUserSumBySelection: (sumBy: string[]) => void;
|
|
37
37
|
sumByRef: React.RefObject<SelectInstance>;
|
|
38
38
|
profileType: ProfileType;
|
|
39
|
+
refreshLabelNames: () => Promise<void>;
|
|
39
40
|
}
|
|
40
|
-
export declare function QueryControls({ showProfileTypeSelector, profileTypesData, profileTypesLoading, selectedProfileName, setProfileName, viewComponent, setQueryBrowserMode, advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser, setMatchersString, setQueryExpression, query, queryBrowserRef, timeRangeSelection, setTimeRangeSelection, searchDisabled, queryClient, labels, sumBySelection, sumBySelectionLoading, setUserSumBySelection, sumByRef, profileType, showSumBySelector, profileTypesError, }: QueryControlsProps): JSX.Element;
|
|
41
|
+
export declare function QueryControls({ showProfileTypeSelector, profileTypesData, profileTypesLoading, selectedProfileName, setProfileName, viewComponent, setQueryBrowserMode, advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser, setMatchersString, setQueryExpression, query, queryBrowserRef, timeRangeSelection, setTimeRangeSelection, searchDisabled, queryClient, labels, sumBySelection, sumBySelectionLoading, setUserSumBySelection, sumByRef, profileType, showSumBySelector, profileTypesError, refreshLabelNames, }: QueryControlsProps): JSX.Element;
|
|
41
42
|
export {};
|
|
42
43
|
//# sourceMappingURL=QueryControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryControls.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/QueryControls.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,
|
|
1
|
+
{"version":3,"file":"QueryControls.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/QueryControls.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,KAAK,cAAc,EAAC,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACvE,OAAO,EAAS,aAAa,EAAuC,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAC,WAAW,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAcjD,UAAU,kBAAkB;IAC1B,uBAAuB,EAAE,OAAO,CAAC;IACjC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0BAA0B,EAAE,OAAO,CAAC;IACpC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACnD,iBAAiB,CAAC,EAAE,QAAQ,CAAC;IAC7B,aAAa,CAAC,EAAE;QACd,2BAA2B,CAAC,EAAE,OAAO,CAAC;QACtC,0BAA0B,CAAC,EAAE,OAAO,CAAC;QACrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KACvC,CAAC;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI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MlC"}
|
|
@@ -13,14 +13,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { useState } from 'react';
|
|
15
15
|
import { Switch } from '@headlessui/react';
|
|
16
|
-
import Select from 'react-select';
|
|
17
16
|
import { Button, DateTimeRangePicker, useParcaContext } from '@parca/components';
|
|
18
17
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
19
18
|
import MatchersInput from '../MatchersInput';
|
|
20
19
|
import ProfileTypeSelector from '../ProfileTypeSelector';
|
|
20
|
+
import SelectWithRefresh from '../SelectWithRefresh';
|
|
21
21
|
import SimpleMatchers from '../SimpleMatchers';
|
|
22
22
|
import ViewMatchers from '../ViewMatchers';
|
|
23
|
-
export function QueryControls({ showProfileTypeSelector, profileTypesData, profileTypesLoading, selectedProfileName, setProfileName, viewComponent, setQueryBrowserMode, advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser, setMatchersString, setQueryExpression, query, queryBrowserRef, timeRangeSelection, setTimeRangeSelection, searchDisabled, queryClient, labels, sumBySelection, sumBySelectionLoading, setUserSumBySelection, sumByRef, profileType, showSumBySelector, profileTypesError, }) {
|
|
23
|
+
export function QueryControls({ showProfileTypeSelector, profileTypesData, profileTypesLoading, selectedProfileName, setProfileName, viewComponent, setQueryBrowserMode, advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser, setMatchersString, setQueryExpression, query, queryBrowserRef, timeRangeSelection, setTimeRangeSelection, searchDisabled, queryClient, labels, sumBySelection, sumBySelectionLoading, setUserSumBySelection, sumByRef, profileType, showSumBySelector, profileTypesError, refreshLabelNames, }) {
|
|
24
24
|
const { timezone } = useParcaContext();
|
|
25
25
|
const [searchExecutedTimestamp, setSearchExecutedTimestamp] = useState(0);
|
|
26
26
|
return (_jsxs("div", { className: "flex w-full flex-wrap items-start gap-2", ...testId(TEST_IDS.QUERY_CONTROLS_CONTAINER), children: [showProfileTypeSelector && (_jsxs("div", { children: [_jsx("label", { className: "text-xs", ...testId(TEST_IDS.PROFILE_TYPE_LABEL), children: "Profile type" }), _jsx(ProfileTypeSelector, { profileTypesData: profileTypesData, loading: profileTypesLoading, selectedKey: selectedProfileName, onSelection: setProfileName, error: profileTypesError, disabled: viewComponent?.disableProfileTypesDropdown })] })), _jsxs("div", { className: "w-full flex-1 flex flex-col gap-1 mt-auto", ref: queryBrowserRef, ...testId(TEST_IDS.QUERY_BROWSER_CONTAINER), children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("label", { className: "text-xs", ...testId(TEST_IDS.QUERY_LABEL), children: "Query" }), viewComponent?.disableExplorativeQuerying !== true && (_jsxs(_Fragment, { children: [_jsxs(Switch, { checked: advancedModeForQueryBrowser, onChange: () => {
|
|
@@ -28,11 +28,20 @@ export function QueryControls({ showProfileTypeSelector, profileTypesData, profi
|
|
|
28
28
|
setQueryBrowserMode(advancedModeForQueryBrowser ? 'simple' : 'advanced');
|
|
29
29
|
}, className: `${advancedModeForQueryBrowser ? 'bg-indigo-600' : 'bg-gray-400 dark:bg-gray-800'} relative inline-flex h-[20px] w-[44px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75`, ...testId(TEST_IDS.ADVANCED_MODE_SWITCH), children: [_jsx("span", { className: "sr-only", children: "Use setting" }), _jsx("span", { "aria-hidden": "true", className: `${advancedModeForQueryBrowser ? 'translate-x-6' : 'translate-x-0'} pointer-events-none inline-block h-[16px] w-[16px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out` })] }), _jsx("label", { className: "text-xs", ...testId(TEST_IDS.QUERY_MODE_LABEL), children: "Advanced Mode" })] }))] }), viewComponent?.createViewComponent] }), viewComponent?.disableExplorativeQuerying === true &&
|
|
30
30
|
viewComponent?.labelnames !== undefined &&
|
|
31
|
-
viewComponent?.labelnames.length >= 1 ? (_jsx(ViewMatchers, { labelNames: viewComponent.labelnames, setMatchersString: setMatchersString, profileType: selectedProfileName, runQuery: setQueryExpression, currentQuery: query, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs() })) : advancedModeForQueryBrowser ? (_jsx(MatchersInput, { setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query, profileType: selectedProfileName, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs() })) : (_jsx(SimpleMatchers, { setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query, profileType: selectedProfileName, queryBrowserRef: queryBrowserRef, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs(), searchExecutedTimestamp: searchExecutedTimestamp }))] }), showSumBySelector && (_jsxs("div", { ...testId(TEST_IDS.SUM_BY_CONTAINER), children: [_jsx("div", { className: "mb-0.5 mt-1.5 flex items-center justify-between", children: _jsx("label", { className: "text-xs", ...testId(TEST_IDS.SUM_BY_LABEL), children: "Sum by" }) }), _jsx(
|
|
31
|
+
viewComponent?.labelnames.length >= 1 ? (_jsx(ViewMatchers, { labelNames: viewComponent.labelnames, setMatchersString: setMatchersString, profileType: selectedProfileName, runQuery: setQueryExpression, currentQuery: query, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs() })) : advancedModeForQueryBrowser ? (_jsx(MatchersInput, { setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query, profileType: selectedProfileName, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs() })) : (_jsx(SimpleMatchers, { setMatchersString: setMatchersString, runQuery: setQueryExpression, currentQuery: query, profileType: selectedProfileName, queryBrowserRef: queryBrowserRef, queryClient: queryClient, start: timeRangeSelection.getFromMs(), end: timeRangeSelection.getToMs(), searchExecutedTimestamp: searchExecutedTimestamp }))] }), showSumBySelector && (_jsxs("div", { ...testId(TEST_IDS.SUM_BY_CONTAINER), children: [_jsx("div", { className: "mb-0.5 mt-1.5 flex items-center justify-between", children: _jsx("label", { className: "text-xs", ...testId(TEST_IDS.SUM_BY_LABEL), children: "Sum by" }) }), _jsx(SelectWithRefresh, { id: "h-sum-by-selector", "data-testid": testId(TEST_IDS.SUM_BY_SELECT)['data-testid'], defaultValue: [], isMulti: true, isClearable: false, name: "colors", options: labels.map(label => ({ label, value: label })), className: "parca-select-container text-sm w-full max-w-80", classNamePrefix: "parca-select", value: (sumBySelection ?? []).map(sumBy => ({ label: sumBy, value: sumBy })), onChange: newValue => {
|
|
32
32
|
setUserSumBySelection(newValue.map(option => option.value));
|
|
33
33
|
}, placeholder: "Labels...", styles: {
|
|
34
34
|
indicatorSeparator: () => ({ display: 'none' }),
|
|
35
|
-
menu: provided => ({
|
|
35
|
+
menu: provided => ({
|
|
36
|
+
...provided,
|
|
37
|
+
marginBottom: 0,
|
|
38
|
+
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
39
|
+
marginTop: 10,
|
|
40
|
+
zIndex: 50,
|
|
41
|
+
minWidth: '320px',
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
}),
|
|
44
|
+
// menu: provided => ({...provided, width: 'max-content', zIndex: 50}), // Setting the same zIndex as drop down menus
|
|
36
45
|
}, isLoading: sumBySelectionLoading, isDisabled: !profileType.delta,
|
|
37
46
|
// @ts-expect-error
|
|
38
47
|
ref: sumByRef, onKeyDown: e => {
|
|
@@ -51,7 +60,7 @@ export function QueryControls({ showProfileTypeSelector, profileTypesData, profi
|
|
|
51
60
|
setQueryExpression(true);
|
|
52
61
|
currentRef.blur();
|
|
53
62
|
}
|
|
54
|
-
} })] })), _jsx(DateTimeRangePicker, { onRangeSelection: setTimeRangeSelection, range: timeRangeSelection, timezone: timezone, ...testId(TEST_IDS.DATE_TIME_RANGE_PICKER) }), _jsxs("div", { children: [_jsx("label", { className: "text-xs", ...testId(TEST_IDS.SEARCH_BUTTON_LABEL), children: "\u00A0" }), _jsx(Button, { disabled: searchDisabled, onClick: (e) => {
|
|
63
|
+
}, onRefresh: refreshLabelNames, refreshTitle: "Refresh label names", refreshTestId: "sum-by-refresh-button", menuTestId: TEST_IDS.SUM_BY_SELECT_FLYOUT })] })), _jsx(DateTimeRangePicker, { onRangeSelection: setTimeRangeSelection, range: timeRangeSelection, timezone: timezone, ...testId(TEST_IDS.DATE_TIME_RANGE_PICKER) }), _jsxs("div", { children: [_jsx("label", { className: "text-xs", ...testId(TEST_IDS.SEARCH_BUTTON_LABEL), children: "\u00A0" }), _jsx(Button, { disabled: searchDisabled, onClick: (e) => {
|
|
55
64
|
e.preventDefault();
|
|
56
65
|
setSearchExecutedTimestamp(Date.now());
|
|
57
66
|
setQueryExpression(true);
|
|
@@ -56,7 +56,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
|
|
|
56
56
|
}, [querySelection.expression]);
|
|
57
57
|
const from = timeRangeSelection.getFromMs();
|
|
58
58
|
const to = timeRangeSelection.getToMs();
|
|
59
|
-
const { loading: labelNamesLoading, result } = useLabelNames(queryClient, profileType.toString(), from, to);
|
|
59
|
+
const { loading: labelNamesLoading, result, refetch, } = useLabelNames(queryClient, profileType.toString(), from, to);
|
|
60
60
|
const { loading: selectedLabelNamesLoading, result: selectedLabelNamesResult } = useLabelNames(queryClient, selectedProfileType.toString(), from, to);
|
|
61
61
|
const labels = useMemo(() => {
|
|
62
62
|
return result.response?.labelNames === undefined ? [] : result.response.labelNames;
|
|
@@ -143,7 +143,7 @@ const ProfileSelector = ({ queryClient, querySelection, selectProfile, selectQue
|
|
|
143
143
|
queryExpressionString === '{}';
|
|
144
144
|
const queryBrowserRef = useRef(null);
|
|
145
145
|
const sumByRef = useRef(null);
|
|
146
|
-
return (_jsx(UtilizationLabelsProvider, { value: { ...utilizationLabels }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex", children: [_jsx(QueryControls, { showProfileTypeSelector: showProfileTypeSelector, showSumBySelector: showSumBySelector, disableExplorativeQuerying: disableExplorativeQuerying, profileTypesData: profileTypesData, profileTypesLoading: profileTypesLoading, selectedProfileName: selectedProfileName, setProfileName: setProfileName, setMatchersString: setMatchersString, setQueryExpression: setQueryExpression, query: query, queryBrowserRef: queryBrowserRef, timeRangeSelection: timeRangeSelection, setTimeRangeSelection: setTimeRangeSelection, searchDisabled: searchDisabled, queryBrowserMode: queryBrowserMode, setQueryBrowserMode: setQueryBrowserMode, advancedModeForQueryBrowser: advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser: setAdvancedModeForQueryBrowser, queryClient: queryClient, sumByRef: sumByRef, labels: labels, sumBySelection: sumBySelection ?? [], sumBySelectionLoading: sumBySelectionLoading, setUserSumBySelection: setUserSumBySelection, profileType: profileType, profileTypesError: error, viewComponent: viewComponent }), comparing && (_jsx("div", { children: _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}), ...testId(TEST_IDS.COMPARE_CLOSE_BUTTON) }) }))] }), _jsx(MetricsGraphSection, { showMetricsGraph: showMetricsGraph, setDisplayHideMetricsGraphButton: setDisplayHideMetricsGraphButton, heightStyle: utilizationMetrics !== undefined && utilizationMetrics?.length > 0
|
|
146
|
+
return (_jsx(UtilizationLabelsProvider, { value: { ...utilizationLabels }, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-2 flex", children: [_jsx(QueryControls, { showProfileTypeSelector: showProfileTypeSelector, showSumBySelector: showSumBySelector, disableExplorativeQuerying: disableExplorativeQuerying, profileTypesData: profileTypesData, profileTypesLoading: profileTypesLoading, selectedProfileName: selectedProfileName, setProfileName: setProfileName, setMatchersString: setMatchersString, setQueryExpression: setQueryExpression, query: query, queryBrowserRef: queryBrowserRef, timeRangeSelection: timeRangeSelection, setTimeRangeSelection: setTimeRangeSelection, searchDisabled: searchDisabled, queryBrowserMode: queryBrowserMode, setQueryBrowserMode: setQueryBrowserMode, advancedModeForQueryBrowser: advancedModeForQueryBrowser, setAdvancedModeForQueryBrowser: setAdvancedModeForQueryBrowser, queryClient: queryClient, sumByRef: sumByRef, labels: labels, sumBySelection: sumBySelection ?? [], sumBySelectionLoading: sumBySelectionLoading, setUserSumBySelection: setUserSumBySelection, profileType: profileType, profileTypesError: error, viewComponent: viewComponent, refreshLabelNames: refetch }), comparing && (_jsx("div", { children: _jsx(IconButton, { onClick: () => closeProfile(), icon: _jsx(CloseIcon, {}), ...testId(TEST_IDS.COMPARE_CLOSE_BUTTON) }) }))] }), _jsx(MetricsGraphSection, { showMetricsGraph: showMetricsGraph, setDisplayHideMetricsGraphButton: setDisplayHideMetricsGraphButton, heightStyle: utilizationMetrics !== undefined && utilizationMetrics?.length > 0
|
|
147
147
|
? 'auto'
|
|
148
148
|
: heightStyle, querySelection: querySelection, profileSelection: profileSelection, comparing: comparing, sumBy: querySelection.sumBy ?? defaultSumBy ?? [], defaultSumByLoading: defaultSumByLoading, queryClient: queryClient, queryExpressionString: queryExpressionString, setTimeRangeSelection: setTimeRangeSelection, selectQuery: selectQuery, selectProfile: selectProfile, query: query, setQueryExpression: setQueryExpression, setNewQueryExpression: setNewQueryExpression, utilizationMetrics: utilizationMetrics, utilizationMetricsLoading: utilizationMetricsLoading, onUtilizationSeriesSelect: onUtilizationSeriesSelect })] }) }));
|
|
149
149
|
};
|
|
@@ -3,6 +3,8 @@ interface GroupByControlsProps {
|
|
|
3
3
|
groupBy: string[];
|
|
4
4
|
labels: string[];
|
|
5
5
|
setGroupByLabels: (labels: string[]) => void;
|
|
6
|
+
metadataRefetch?: () => Promise<void>;
|
|
7
|
+
metadataLoading: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const GroupByControls: React.FC<GroupByControlsProps>;
|
|
8
10
|
export default GroupByControls;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupByDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ActionButtons/GroupByDropdown.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupByDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ActionButtons/GroupByDropdown.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import GroupByLabelsDropdown from '../GroupByLabelsDropdown';
|
|
3
|
-
const GroupByControls = ({ groupBy, labels, setGroupByLabels }) => {
|
|
4
|
-
return (_jsx("div", { className: "relative flex", id: "h-group-by-controls", children: _jsx(GroupByLabelsDropdown, { labels: labels, groupBy: groupBy, setGroupByLabels: setGroupByLabels }) }));
|
|
3
|
+
const GroupByControls = ({ groupBy, labels, setGroupByLabels, metadataRefetch, metadataLoading, }) => {
|
|
4
|
+
return (_jsx("div", { className: "relative flex", id: "h-group-by-controls", children: _jsx(GroupByLabelsDropdown, { labels: labels, groupBy: groupBy, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }) }));
|
|
5
5
|
};
|
|
6
6
|
export default GroupByControls;
|
|
@@ -2,7 +2,9 @@ interface Props {
|
|
|
2
2
|
labels: string[];
|
|
3
3
|
groupBy: string[];
|
|
4
4
|
setGroupByLabels: (labels: string[]) => void;
|
|
5
|
+
metadataRefetch?: () => Promise<void>;
|
|
6
|
+
metadataLoading: boolean;
|
|
5
7
|
}
|
|
6
|
-
declare const GroupByLabelsDropdown: ({ labels, groupBy, setGroupByLabels }: Props) => JSX.Element;
|
|
8
|
+
declare const GroupByLabelsDropdown: ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, }: Props) => JSX.Element;
|
|
7
9
|
export default GroupByLabelsDropdown;
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/GroupByLabelsDropdown/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/GroupByLabelsDropdown/index.tsx"],"names":[],"mappings":"AAuBA,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,qBAAqB,GAAI,0EAM5B,KAAK,KAAG,GAAG,CAAC,OAiFd,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -11,20 +11,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import Select from 'react-select';
|
|
15
14
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
16
15
|
import { FIELD_LABELS } from '../../../ProfileFlameGraph/FlameGraphArrow';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
MenuList: ({ children, innerProps }) => (_jsx("div", { className: "overflow-y-auto", ...testId(TEST_IDS.GROUP_BY_SELECT_FLYOUT), ...innerProps,
|
|
21
|
-
// eslint-disable-next-line react/prop-types
|
|
22
|
-
style: { ...innerProps.style, height: '332px', maxHeight: '332px', fontSize: '14px' }, children: children })),
|
|
23
|
-
}, value: groupBy
|
|
16
|
+
import { SelectWithRefresh } from '../../../SelectWithRefresh';
|
|
17
|
+
const GroupByLabelsDropdown = ({ labels, groupBy, setGroupByLabels, metadataRefetch, metadataLoading, }) => {
|
|
18
|
+
return (_jsxs("div", { className: "flex flex-col relative", ...testId(TEST_IDS.GROUP_BY_CONTAINER), children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("label", { className: "text-sm", ...testId(TEST_IDS.GROUP_BY_LABEL), children: "Group by" }) }), _jsx(SelectWithRefresh, { isMulti: true, defaultMenuIsOpen: false, defaultValue: undefined, name: "labels", options: labels.map(label => ({ label, value: `${FIELD_LABELS}.${label}` })), className: "parca-select-container text-sm rounded-md bg-white", classNamePrefix: "parca-select", onRefresh: metadataRefetch, refreshTitle: "Refresh label names", refreshTestId: "group-by-refresh-button", menuTestId: TEST_IDS.GROUP_BY_SELECT_FLYOUT, value: groupBy
|
|
24
19
|
.filter(l => l.startsWith(FIELD_LABELS))
|
|
25
20
|
.map(l => ({ value: l, label: l.slice(FIELD_LABELS.length + 1) })), onChange: newValue => {
|
|
26
21
|
setGroupByLabels(newValue.map(option => option.value));
|
|
27
|
-
}, placeholder: "Select labels...", styles: {
|
|
22
|
+
}, placeholder: "Select labels...", isLoading: metadataLoading, styles: {
|
|
28
23
|
menu: provided => ({
|
|
29
24
|
...provided,
|
|
30
25
|
marginBottom: 0,
|
|
@@ -16,7 +16,6 @@ export interface VisualisationToolbarProps {
|
|
|
16
16
|
profileType?: ProfileType;
|
|
17
17
|
total: bigint;
|
|
18
18
|
filtered: bigint;
|
|
19
|
-
groupByLabels: string[];
|
|
20
19
|
preferencesModal?: boolean;
|
|
21
20
|
profileViewExternalSubActions?: React.ReactNode;
|
|
22
21
|
setGroupByLabels: (labels: string[]) => void;
|
|
@@ -26,6 +25,11 @@ export interface VisualisationToolbarProps {
|
|
|
26
25
|
setAlignFunctionName: (align: string) => void;
|
|
27
26
|
colorBy: string;
|
|
28
27
|
setColorBy: (colorBy: string) => void;
|
|
28
|
+
metadata: {
|
|
29
|
+
labels: string[];
|
|
30
|
+
refetch?: () => Promise<void>;
|
|
31
|
+
loading: boolean;
|
|
32
|
+
};
|
|
29
33
|
}
|
|
30
34
|
export interface TableToolbarProps {
|
|
31
35
|
profileType?: ProfileType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,gBAAgB,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AAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,8BAA8B;IAC7C,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAQ9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkBxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAmBxE,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmG9D,CAAC"}
|
|
@@ -20,7 +20,7 @@ export const SandwichFlameGraphToolbar = ({ resetSandwichFunctionName, sandwichF
|
|
|
20
20
|
return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end justify-between", children: _jsx(Button, { color: "neutral", onClick: () => resetSandwichFunctionName(), className: "w-auto", variant: "neutral", disabled: sandwichFunctionName === undefined || sandwichFunctionName.length === 0, children: "Reset view" }) }) }));
|
|
21
21
|
};
|
|
22
22
|
const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
|
|
23
|
-
export const VisualisationToolbar = ({ groupBy, toggleGroupBy,
|
|
23
|
+
export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, showVisualizationSelector = true, alignFunctionName, setAlignFunctionName, colorBy, setColorBy, metadata: { labels: groupByLabels, refetch: metadataRefetch, loading: metadataLoading }, }) => {
|
|
24
24
|
const { dashboardItems } = useDashboard();
|
|
25
25
|
const isTableViz = dashboardItems?.includes('table');
|
|
26
26
|
const isTableVizOnly = dashboardItems?.length === 1 && isTableViz;
|
|
@@ -32,5 +32,5 @@ export const VisualisationToolbar = ({ groupBy, toggleGroupBy, groupByLabels, se
|
|
|
32
32
|
fields: groupBy ?? [],
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels }), _jsx(InvertCallStack, {})] })), _jsxs("div", { className: "flex mt-5", children: [_jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
|
|
35
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }), _jsx(InvertCallStack, {})] })), _jsxs("div", { className: "flex mt-5", children: [_jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAC,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,WAAW,GAAI,iMAczB,gBAAgB,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAC,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,WAAW,GAAI,iMAczB,gBAAgB,KAAG,GAAG,CAAC,OAsIzB,CAAC"}
|
|
@@ -61,5 +61,9 @@ export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, t
|
|
|
61
61
|
sandwich: (_jsx(SandwichFlameGraphToolbar, { resetSandwichFunctionName: resetSandwichFunctionName, sandwichFunctionName: sandwichFunctionName })),
|
|
62
62
|
};
|
|
63
63
|
const hasProfileSource = profileSource !== undefined && profileSource.toString(timezone) !== '';
|
|
64
|
-
return (_jsx(KeyDownProvider, { children: _jsx(ProfileViewContextProvider, { value: { profileSource, compareMode }, children: _jsxs(DashboardProvider, { children: [_jsx(ProfileHeader, { profileSourceString: profileSource?.toString(timezone), hasProfileSource: hasProfileSource, externalMainActions: profileViewExternalMainActions }), _jsx(VisualisationToolbar, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, hasProfileSource: hasProfileSource, pprofdownloading: pprofDownloading, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: onDownloadPProf, curPath: curPathArrow, setNewCurPath: setCurPathArrow, profileType: profileSource?.ProfileType(), total: total, filtered: filtered,
|
|
64
|
+
return (_jsx(KeyDownProvider, { children: _jsx(ProfileViewContextProvider, { value: { profileSource, compareMode }, children: _jsxs(DashboardProvider, { children: [_jsx(ProfileHeader, { profileSourceString: profileSource?.toString(timezone), hasProfileSource: hasProfileSource, externalMainActions: profileViewExternalMainActions }), _jsx(VisualisationToolbar, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, hasProfileSource: hasProfileSource, pprofdownloading: pprofDownloading, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: onDownloadPProf, curPath: curPathArrow, setNewCurPath: setCurPathArrow, profileType: profileSource?.ProfileType(), total: total, filtered: filtered, metadata: {
|
|
65
|
+
labels: flamegraphData.metadataLabels ?? [],
|
|
66
|
+
refetch: flamegraphData.metadataRefetch,
|
|
67
|
+
loading: flamegraphData.metadataLoading,
|
|
68
|
+
}, preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, setGroupByLabels: setGroupByLabels, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), isColorStackLegendEnabled && (_jsx(ColorStackLegend, { compareMode: compareMode, mappings: colorMappings, loading: flamegraphData.metadataLoading })), _jsx("div", { className: "w-full", ref: ref, children: _jsx(DashboardLayout, { getDashboardItemByType: getDashboardItemByType, actionButtons: actionButtons }) })] }) }) }));
|
|
65
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/types/visualization.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAEtF,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC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WAAW,GACX,OAAO,GACP,QAAQ,GACR,YAAY,GACZ,UAAU,CAAC;AAEf,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAM1E,OAAO,EAAsB,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAMnE,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,GAAI,4DAIjC,wBAAwB,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAM1E,OAAO,EAAsB,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAMnE,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,GAAI,4DAIjC,wBAAwB,KAAG,GAAG,CAAC,OAgTjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -79,10 +79,11 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
79
79
|
invertCallStack,
|
|
80
80
|
protoFilters,
|
|
81
81
|
});
|
|
82
|
-
const { isLoading: profileMetadataLoading, response: profileMetadataResponse, error: profileMetadataError, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
|
|
82
|
+
const { isLoading: profileMetadataLoading, response: profileMetadataResponse, error: profileMetadataError, refetch: metadataRefetch, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
|
|
83
83
|
nodeTrimThreshold,
|
|
84
84
|
groupBy,
|
|
85
85
|
protoFilters,
|
|
86
|
+
staleTime: 0,
|
|
86
87
|
});
|
|
87
88
|
const { perf } = useParcaContext();
|
|
88
89
|
const { isLoading: tableLoading, response: tableResponse, error: tableError, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.TABLE_ARROW, {
|
|
@@ -191,6 +192,7 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
|
|
|
191
192
|
? profileMetadataResponse?.report?.profileMetadata?.labels
|
|
192
193
|
: undefined,
|
|
193
194
|
metadataLoading: profileMetadataLoading,
|
|
195
|
+
metadataRefetch,
|
|
194
196
|
}, flamechartData: {
|
|
195
197
|
loading: flamechartLoading && profileMetadataLoading,
|
|
196
198
|
arrow: flamechartResponse?.report.oneofKind === 'flamegraphArrow'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Props as ReactSelectProps } from 'react-select';
|
|
2
|
+
export interface SelectWithRefreshProps<Option, IsMulti extends boolean> extends ReactSelectProps<Option, IsMulti> {
|
|
3
|
+
onRefresh?: () => Promise<void>;
|
|
4
|
+
refreshTitle?: string;
|
|
5
|
+
refreshTestId?: string;
|
|
6
|
+
menuTestId?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function SelectWithRefresh<Option, IsMulti extends boolean = false>(props: SelectWithRefreshProps<Option, IsMulti>): JSX.Element;
|
|
9
|
+
export default SelectWithRefresh;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SelectWithRefresh/index.tsx"],"names":[],"mappings":"AAeA,OAAoB,EAAqB,KAAK,KAAK,IAAI,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAI7F,MAAM,WAAW,sBAAsB,CAAC,MAAM,EAAE,OAAO,SAAS,OAAO,CACrE,SAAQ,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,SAAS,OAAO,GAAG,KAAK,EACvE,KAAK,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7C,GAAG,CAAC,OAAO,CAkEb;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2022 The Parca Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { useCallback, useState } from 'react';
|
|
15
|
+
import ReactSelect from 'react-select';
|
|
16
|
+
import { RefreshButton } from '@parca/components';
|
|
17
|
+
export function SelectWithRefresh(props) {
|
|
18
|
+
const { onRefresh, refreshTitle = 'Refresh label names', refreshTestId = 'select-refresh-button', menuTestId, components, ...selectProps } = props;
|
|
19
|
+
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
20
|
+
const handleRefetch = useCallback(async () => {
|
|
21
|
+
if (onRefresh == null || isRefreshing)
|
|
22
|
+
return;
|
|
23
|
+
setIsRefreshing(true);
|
|
24
|
+
try {
|
|
25
|
+
await onRefresh();
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Error during refresh:', error);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
setIsRefreshing(false);
|
|
32
|
+
}
|
|
33
|
+
}, [onRefresh, isRefreshing]);
|
|
34
|
+
const MenuListWithRefresh = useCallback(({ children, innerProps }) => {
|
|
35
|
+
const testIdProps = menuTestId != null ? { 'data-testid': menuTestId } : {};
|
|
36
|
+
return (_jsxs("div", { className: "flex flex-col", style: { maxHeight: '332px' }, children: [_jsx("div", { className: "overflow-y-auto flex-1", ...innerProps, ...testIdProps, style: { ...innerProps?.style, fontSize: '14px' }, children: children }), onRefresh != null && (_jsx(RefreshButton, { onClick: () => void handleRefetch(), disabled: isRefreshing, title: refreshTitle, testId: refreshTestId }))] }));
|
|
37
|
+
}, [onRefresh, isRefreshing, handleRefetch, refreshTitle, refreshTestId, menuTestId]);
|
|
38
|
+
const combinedLoadingState = isRefreshing || (selectProps.isLoading ?? false);
|
|
39
|
+
return (_jsx(ReactSelect, { ...selectProps, isLoading: combinedLoadingState, components: {
|
|
40
|
+
...components,
|
|
41
|
+
// eslint-disable-next-line react/display-name
|
|
42
|
+
MenuList: MenuListWithRefresh,
|
|
43
|
+
} }));
|
|
44
|
+
}
|
|
45
|
+
export default SelectWithRefresh;
|
|
@@ -31,7 +31,7 @@ interface CustomSelectProps {
|
|
|
31
31
|
searchable?: boolean;
|
|
32
32
|
onButtonClick?: () => void;
|
|
33
33
|
editable?: boolean;
|
|
34
|
-
refetchValues?: () => void
|
|
34
|
+
refetchValues?: () => Promise<void>;
|
|
35
35
|
showLoadingInButton?: boolean;
|
|
36
36
|
}
|
|
37
37
|
declare const CustomSelect: React.FC<CustomSelectProps & Record<string, any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/Select.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAStE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,iBAAiB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC1C,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;I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,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwUnE,CAAC;AAkDF,eAAe,YAAY,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
15
15
|
import { Icon } from '@iconify/react';
|
|
16
16
|
import cx from 'classnames';
|
|
17
17
|
import levenshtein from 'fast-levenshtein';
|
|
18
|
-
import { Button, DividerWithLabel, useParcaContext } from '@parca/components';
|
|
18
|
+
import { Button, DividerWithLabel, RefreshButton, useParcaContext } from '@parca/components';
|
|
19
19
|
import { TEST_IDS, testId } from '@parca/test-utils/dist/test-ids';
|
|
20
20
|
const CustomSelect = ({ items: itemsProp, selectedKey, onSelection, placeholder = 'Select an item', width, className = '', loading, primary = false, disabled = false, icon, id, optionsClassname = '', searchable = false, onButtonClick, editable = false, refetchValues, showLoadingInButton = false, ...restProps }) => {
|
|
21
21
|
const { loader } = useParcaContext();
|
|
@@ -179,13 +179,7 @@ const CustomSelect = ({ items: itemsProp, selectedKey, onSelection, placeholder
|
|
|
179
179
|
setIsOpen(false);
|
|
180
180
|
}, children: "Add" }) }))] })) : (_jsx("input", { ref: searchInputRef, type: "text", className: "w-full px-4 h-[45px] text-sm border-none rounded-none ring-0 outline-none bg-gray-50 dark:bg-gray-800 dark:text-white", placeholder: "Search...", value: searchTerm, onChange: e => setSearchTerm(e.target.value) })) }) })), _jsx("div", { className: "flex-1 min-h-0", children: loading === true ? (_jsx("div", { className: "w-[270px]", children: loader })) : groupedFilteredItems.length === 0 ? (_jsx("div", { className: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center", ...testId(TEST_IDS.LABEL_VALUE_NO_RESULTS), children: "No values found" })) : (groupedFilteredItems.map(group => (_jsxs(_Fragment, { children: [groupedFilteredItems.length > 1 &&
|
|
181
181
|
groupedFilteredItems.every(g => g.type !== '') &&
|
|
182
|
-
group.type !== '' ? (_jsx("div", { className: "pl-2", children: _jsx(DividerWithLabel, { label: group.type }) })) : null, group.values.map((item, index) => (_jsx(OptionItem, { item: item, index: index, optionRefs: optionRefs, focusedIndex: focusedIndex, selectedKey: selectedKey, handleSelection: handleSelection }, item.key)))] })))) }), refetchValues !== undefined && loading !== true && (_jsx(
|
|
183
|
-
e.preventDefault();
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
void handleRefetch();
|
|
186
|
-
}, disabled: isRefetching, className: cx('py-1 px-2 flex items-center gap-1 rounded-full transition-all duration-200 w-auto justify-center', isRefetching
|
|
187
|
-
? 'cursor-wait opacity-50'
|
|
188
|
-
: 'hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer'), title: "Refresh label values", type: "button", ...testId(TEST_IDS.LABEL_VALUE_REFRESH_BUTTON), children: [_jsx(Icon, { icon: "system-uicons:reset", className: cx('w-3 h-3 text-gray-500 dark:text-gray-400', isRefetching && 'animate-spin') }), _jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Refresh results" })] }) }))] }) }))] }));
|
|
182
|
+
group.type !== '' ? (_jsx("div", { className: "pl-2", children: _jsx(DividerWithLabel, { label: group.type }) })) : null, group.values.map((item, index) => (_jsx(OptionItem, { item: item, index: index, optionRefs: optionRefs, focusedIndex: focusedIndex, selectedKey: selectedKey, handleSelection: handleSelection }, item.key)))] })))) }), refetchValues !== undefined && loading !== true && (_jsx(RefreshButton, { onClick: () => void handleRefetch(), disabled: isRefetching, title: "Refresh label values", testId: TEST_IDS.LABEL_VALUE_REFRESH_BUTTON, sticky: true, loading: isRefetching }))] }) }))] }));
|
|
189
183
|
};
|
|
190
184
|
const OptionItem = ({ item, optionRefs, index, focusedIndex, selectedKey, handleSelection, }) => {
|
|
191
185
|
return (_jsxs("div", { ref: el => {
|
|
@@ -318,7 +318,7 @@ const SimpleMatchers = ({ queryClient, setMatchersString, currentQuery, profileT
|
|
|
318
318
|
? [...row.labelValues, row.labelValue]
|
|
319
319
|
: row.labelValues), onSelection: value => handleUpdateRow(index, 'labelValue', value), placeholder: "Select label value", selectedKey: row.labelValue, className: "rounded-none ring-0 focus:ring-0 outline-none max-w-48", optionsClassname: cx('max-w-[600px]', {
|
|
320
320
|
'w-[300px]': isRowRegex(row),
|
|
321
|
-
}), searchable: true, disabled: row.labelName === '', loading: row.isLoading, onButtonClick: () => handleLabelValueClick(index), editable: isRowRegex(row), ...testId(TEST_IDS.LABEL_VALUE_SELECT), refetchValues: () => refetchLabelValues(row.labelName), showLoadingInButton: true }), _jsx("button", { onClick: () => removeRow(index), className: cx('p-2 border-gray-200 border rounded rounded-tl-none rounded-bl-none focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900'), ...testId(TEST_IDS.REMOVE_MATCHER_BUTTON), children: _jsx(Icon, { icon: "carbon:close", className: "h-5 w-5 text-gray-400", "aria-hidden": "true" }) })] }, index))), queryRows.length > 3 && !isActivelyEditing && (_jsx("button", { onClick: () => {
|
|
321
|
+
}), searchable: true, disabled: row.labelName === '', loading: row.isLoading, onButtonClick: () => handleLabelValueClick(index), editable: isRowRegex(row), ...testId(TEST_IDS.LABEL_VALUE_SELECT), refetchValues: async () => await refetchLabelValues(row.labelName), showLoadingInButton: true }), _jsx("button", { onClick: () => removeRow(index), className: cx('p-2 border-gray-200 border rounded rounded-tl-none rounded-bl-none focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900'), ...testId(TEST_IDS.REMOVE_MATCHER_BUTTON), children: _jsx(Icon, { icon: "carbon:close", className: "h-5 w-5 text-gray-400", "aria-hidden": "true" }) })] }, index))), queryRows.length > 3 && !isActivelyEditing && (_jsx("button", { onClick: () => {
|
|
322
322
|
if (showAll) {
|
|
323
323
|
// Clicking "Show less" - collapse and stop editing mode
|
|
324
324
|
setShowAll(false);
|
|
@@ -8,8 +8,8 @@ interface LabelContextValue {
|
|
|
8
8
|
labelNameOptions: LabelNameSection[];
|
|
9
9
|
isLoading: boolean;
|
|
10
10
|
error: Error | null;
|
|
11
|
-
refetchLabelValues: (labelName?: string) => void
|
|
12
|
-
refetchLabelNames: () => void
|
|
11
|
+
refetchLabelValues: (labelName?: string) => Promise<void>;
|
|
12
|
+
refetchLabelNames: () => Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
interface LabelProviderProps {
|
|
15
15
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleMatchersLabelContext.d.ts","sourceRoot":"","sources":["../../src/contexts/SimpleMatchersLabelContext.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAIjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAGzD,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,kBAAkB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SimpleMatchersLabelContext.d.ts","sourceRoot":"","sources":["../../src/contexts/SimpleMatchersLabelContext.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAIjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAGzD,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,kBAAkB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAID,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAKD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,KAAK,EACL,GAAG,GACJ,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CA0HlC;AAED,wBAAgB,SAAS,IAAI,iBAAiB,CAM7C"}
|
|
@@ -79,8 +79,8 @@ export function LabelProvider({ children, queryClient, profileType, labelNameFro
|
|
|
79
79
|
error: null,
|
|
80
80
|
};
|
|
81
81
|
}, [profileValues, utilizationValues, labelNameFromMatchers]);
|
|
82
|
-
const refetchLabelValues = useCallback((labelName) => {
|
|
83
|
-
|
|
82
|
+
const refetchLabelValues = useCallback(async (labelName) => {
|
|
83
|
+
await reactQueryClient.refetchQueries({
|
|
84
84
|
predicate: query => {
|
|
85
85
|
const key = query.queryKey;
|
|
86
86
|
const matchesStructure = Array.isArray(key) &&
|
|
@@ -96,8 +96,8 @@ export function LabelProvider({ children, queryClient, profileType, labelNameFro
|
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
98
|
}, [reactQueryClient, profileType]);
|
|
99
|
-
const refetchLabelNames = useCallback(() => {
|
|
100
|
-
refetchLabelNamesQuery();
|
|
99
|
+
const refetchLabelNames = useCallback(async () => {
|
|
100
|
+
await refetchLabelNamesQuery();
|
|
101
101
|
}, [refetchLabelNamesQuery]);
|
|
102
102
|
const contextValue = useMemo(() => ({
|
|
103
103
|
...value,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLabelNames } from './MatchersInput';
|
|
2
2
|
import ProfileExplorer, { getExpressionAsAString } from './ProfileExplorer';
|
|
3
3
|
import ProfileTypeSelector from './ProfileTypeSelector';
|
|
4
|
+
import SelectWithRefresh from './SelectWithRefresh';
|
|
4
5
|
import CustomSelect from './SimpleMatchers/Select';
|
|
5
6
|
export * from './ProfileFlameGraph';
|
|
6
7
|
export * from './ProfileSource';
|
|
@@ -17,5 +18,5 @@ export { useProfileFiltersUrlState } from './ProfileView/components/ProfileFilte
|
|
|
17
18
|
export declare const DEFAULT_PROFILE_EXPLORER_PARAM_VALUES: {
|
|
18
19
|
dashboard_items: string;
|
|
19
20
|
};
|
|
20
|
-
export { ProfileExplorer, ProfileTypeSelector, getExpressionAsAString, CustomSelect, useLabelNames };
|
|
21
|
+
export { ProfileExplorer, ProfileTypeSelector, getExpressionAsAString, CustomSelect, SelectWithRefresh, useLabelNames, };
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|