2019-12-05 04:22:46 -06:00
|
|
|
import React from 'react';
|
2018-04-26 04:58:42 -05:00
|
|
|
import { hot } from 'react-hot-loader';
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
import { css, cx } from 'emotion';
|
2020-04-27 02:09:05 -05:00
|
|
|
import { compose } from 'redux';
|
2019-01-10 07:24:31 -06:00
|
|
|
import { connect } from 'react-redux';
|
2020-01-16 04:11:33 -06:00
|
|
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
2019-08-29 06:41:45 -05:00
|
|
|
import memoizeOne from 'memoize-one';
|
2020-04-27 02:09:05 -05:00
|
|
|
import { selectors } from '@grafana/e2e-selectors';
|
|
|
|
import { ErrorBoundaryAlert, stylesFactory, withTheme } from '@grafana/ui';
|
|
|
|
import {
|
|
|
|
AbsoluteTimeRange,
|
|
|
|
DataQuery,
|
|
|
|
DataSourceApi,
|
|
|
|
GrafanaTheme,
|
|
|
|
GraphSeriesXY,
|
|
|
|
LoadingState,
|
|
|
|
PanelData,
|
|
|
|
RawTimeRange,
|
|
|
|
TimeRange,
|
|
|
|
TimeZone,
|
2020-06-30 07:51:04 -05:00
|
|
|
ExploreUrlState,
|
2020-07-09 09:14:55 -05:00
|
|
|
LogsModel,
|
2020-11-03 06:08:54 -06:00
|
|
|
EventBusExtended,
|
|
|
|
EventBusSrv,
|
2020-04-27 02:09:05 -05:00
|
|
|
} from '@grafana/data';
|
2018-07-13 02:09:36 -05:00
|
|
|
|
2018-08-02 09:43:33 -05:00
|
|
|
import store from 'app/core/store';
|
2019-01-17 10:59:47 -06:00
|
|
|
import LogsContainer from './LogsContainer';
|
|
|
|
import QueryRows from './QueryRows';
|
|
|
|
import TableContainer from './TableContainer';
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
import RichHistoryContainer from './RichHistory/RichHistoryContainer';
|
2020-08-06 10:22:54 -05:00
|
|
|
import ExploreQueryInspector from './ExploreQueryInspector';
|
2020-11-09 07:48:24 -06:00
|
|
|
import { splitOpen } from './state/main';
|
|
|
|
import { changeSize, initializeExplore, refreshExplore } from './state/explorePane';
|
|
|
|
import { updateTimeRange } from './state/time';
|
|
|
|
import { scanStopAction, addQueryRow, modifyQueries, setQueries, scanStart } from './state/query';
|
2020-06-30 07:51:04 -05:00
|
|
|
import { ExploreId, ExploreItemState, ExploreUpdateState } from 'app/types/explore';
|
2019-01-17 10:59:47 -06:00
|
|
|
import { StoreState } from 'app/types';
|
2019-04-29 11:28:41 -05:00
|
|
|
import {
|
|
|
|
DEFAULT_RANGE,
|
2020-03-25 06:25:39 -05:00
|
|
|
ensureQueries,
|
2020-04-27 02:09:05 -05:00
|
|
|
getFirstNonQueryRowSpecificError,
|
2020-01-14 12:20:17 -06:00
|
|
|
getTimeRange,
|
2020-04-27 02:09:05 -05:00
|
|
|
getTimeRangeFromUrl,
|
2019-07-04 09:31:15 -05:00
|
|
|
lastUsedDatasourceKeyForOrgId,
|
2019-04-29 11:28:41 -05:00
|
|
|
} from 'app/core/utils/explore';
|
2019-01-22 07:50:19 -06:00
|
|
|
import { ExploreToolbar } from './ExploreToolbar';
|
2019-03-28 11:17:01 -05:00
|
|
|
import { NoDataSourceCallToAction } from './NoDataSourceCallToAction';
|
2019-04-29 11:28:41 -05:00
|
|
|
import { getTimeZone } from '../profile/state/selectors';
|
2019-05-10 07:00:39 -05:00
|
|
|
import { ErrorContainer } from './ErrorContainer';
|
2019-08-26 01:11:07 -05:00
|
|
|
import { ExploreGraphPanel } from './ExploreGraphPanel';
|
2020-07-09 09:14:55 -05:00
|
|
|
//TODO:unification
|
2020-04-08 10:16:22 -05:00
|
|
|
import { TraceView } from './TraceView/TraceView';
|
2020-04-02 06:34:16 -05:00
|
|
|
import { SecondaryActions } from './SecondaryActions';
|
2020-06-10 00:09:02 -05:00
|
|
|
import { FILTER_FOR_OPERATOR, FILTER_OUT_OPERATOR, FilterItem } from '@grafana/ui/src/components/Table/types';
|
2018-12-31 12:30:32 -06:00
|
|
|
|
2020-04-16 07:28:46 -05:00
|
|
|
const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
2019-09-20 06:00:11 -05:00
|
|
|
return {
|
|
|
|
logsMain: css`
|
|
|
|
label: logsMain;
|
|
|
|
// Is needed for some transition animations to work.
|
|
|
|
position: relative;
|
2020-03-26 07:24:58 -05:00
|
|
|
margin-top: 21px;
|
2019-09-20 06:00:11 -05:00
|
|
|
`,
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
button: css`
|
2020-04-16 07:28:46 -05:00
|
|
|
label: button;
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
margin: 1em 4px 0 0;
|
2019-12-23 05:29:00 -06:00
|
|
|
`,
|
2020-04-16 07:28:46 -05:00
|
|
|
queryContainer: css`
|
|
|
|
label: queryContainer;
|
|
|
|
// Need to override normal css class and don't want to count on ordering of the classes in html.
|
|
|
|
height: auto !important;
|
2020-04-27 16:53:15 -05:00
|
|
|
flex: unset !important;
|
2020-04-16 07:28:46 -05:00
|
|
|
padding: ${theme.panelPadding}px;
|
|
|
|
`,
|
2019-09-20 06:00:11 -05:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-03-11 04:01:58 -05:00
|
|
|
export interface ExploreProps {
|
2019-01-11 11:26:56 -06:00
|
|
|
changeSize: typeof changeSize;
|
2020-07-09 08:16:35 -05:00
|
|
|
datasourceInstance: DataSourceApi | null;
|
2019-01-10 07:24:31 -06:00
|
|
|
datasourceMissing: boolean;
|
2019-01-11 11:26:56 -06:00
|
|
|
exploreId: ExploreId;
|
2019-01-10 07:24:31 -06:00
|
|
|
initializeExplore: typeof initializeExplore;
|
2019-01-12 16:22:28 -06:00
|
|
|
initialized: boolean;
|
2019-01-10 07:24:31 -06:00
|
|
|
modifyQueries: typeof modifyQueries;
|
2019-03-22 09:24:30 -05:00
|
|
|
update: ExploreUpdateState;
|
|
|
|
refreshExplore: typeof refreshExplore;
|
2019-01-10 07:24:31 -06:00
|
|
|
scanning?: boolean;
|
|
|
|
scanRange?: RawTimeRange;
|
|
|
|
scanStart: typeof scanStart;
|
2019-02-04 00:47:10 -06:00
|
|
|
scanStopAction: typeof scanStopAction;
|
2019-01-15 12:52:53 -06:00
|
|
|
setQueries: typeof setQueries;
|
2018-09-28 09:44:07 -05:00
|
|
|
split: boolean;
|
2019-02-04 06:41:29 -06:00
|
|
|
queryKeys: string[];
|
2019-04-29 11:28:41 -05:00
|
|
|
initialDatasource: string;
|
|
|
|
initialQueries: DataQuery[];
|
2020-01-14 12:20:17 -06:00
|
|
|
initialRange: TimeRange;
|
2019-05-20 06:28:23 -05:00
|
|
|
isLive: boolean;
|
2019-10-08 11:55:53 -05:00
|
|
|
syncedTimes: boolean;
|
2019-06-25 07:44:19 -05:00
|
|
|
updateTimeRange: typeof updateTimeRange;
|
2020-07-09 08:16:35 -05:00
|
|
|
graphResult?: GraphSeriesXY[] | null;
|
2020-07-09 09:14:55 -05:00
|
|
|
logsResult?: LogsModel;
|
2019-08-26 01:11:07 -05:00
|
|
|
loading?: boolean;
|
|
|
|
absoluteRange: AbsoluteTimeRange;
|
|
|
|
timeZone?: TimeZone;
|
|
|
|
onHiddenSeriesChanged?: (hiddenSeries: string[]) => void;
|
2019-09-03 02:55:20 -05:00
|
|
|
queryResponse: PanelData;
|
2019-09-05 07:44:37 -05:00
|
|
|
originPanelId: number;
|
2019-12-23 05:29:00 -06:00
|
|
|
addQueryRow: typeof addQueryRow;
|
2020-04-16 07:28:46 -05:00
|
|
|
theme: GrafanaTheme;
|
2020-07-09 09:14:55 -05:00
|
|
|
showMetrics: boolean;
|
|
|
|
showTable: boolean;
|
|
|
|
showLogs: boolean;
|
|
|
|
showTrace: boolean;
|
2020-10-14 17:03:14 -05:00
|
|
|
splitOpen: typeof splitOpen;
|
2018-04-27 11:21:20 -05:00
|
|
|
}
|
|
|
|
|
2020-08-06 10:22:54 -05:00
|
|
|
enum ExploreDrawer {
|
|
|
|
RichHistory,
|
|
|
|
QueryInspector,
|
|
|
|
}
|
|
|
|
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
interface ExploreState {
|
2020-08-06 10:22:54 -05:00
|
|
|
openDrawer?: ExploreDrawer;
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
}
|
|
|
|
|
2018-11-21 07:45:57 -06:00
|
|
|
/**
|
|
|
|
* Explore provides an area for quick query iteration for a given datasource.
|
|
|
|
* Once a datasource is selected it populates the query section at the top.
|
|
|
|
* When queries are run, their results are being displayed in the main section.
|
|
|
|
* The datasource determines what kind of query editor it brings, and what kind
|
2019-01-12 16:44:24 -06:00
|
|
|
* of results viewers it supports. The state is managed entirely in Redux.
|
2018-11-22 05:00:41 -06:00
|
|
|
*
|
2019-01-12 16:44:24 -06:00
|
|
|
* SPLIT VIEW
|
2018-11-22 05:00:41 -06:00
|
|
|
*
|
2019-01-12 16:44:24 -06:00
|
|
|
* Explore can have two Explore areas side-by-side. This is handled in `Wrapper.tsx`.
|
|
|
|
* Since there can be multiple Explores (e.g., left and right) each action needs
|
|
|
|
* the `exploreId` as first parameter so that the reducer knows which Explore state
|
|
|
|
* is affected.
|
2018-11-22 05:00:41 -06:00
|
|
|
*
|
|
|
|
* DATASOURCE REQUESTS
|
|
|
|
*
|
|
|
|
* A click on Run Query creates transactions for all DataQueries for all expanded
|
|
|
|
* result viewers. New runs are discarding previous runs. Upon completion a transaction
|
|
|
|
* saves the result. The result viewers construct their data from the currently existing
|
|
|
|
* transactions.
|
|
|
|
*
|
|
|
|
* The result viewers determine some of the query options sent to the datasource, e.g.,
|
|
|
|
* `format`, to indicate eventual transformations by the datasources' result transformers.
|
2018-11-21 07:45:57 -06:00
|
|
|
*/
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
|
2018-07-17 08:13:44 -05:00
|
|
|
el: any;
|
2020-11-03 06:08:54 -06:00
|
|
|
exploreEvents: EventBusExtended;
|
2018-07-17 08:13:44 -05:00
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
constructor(props: ExploreProps) {
|
2018-04-26 04:58:42 -05:00
|
|
|
super(props);
|
2020-11-03 06:08:54 -06:00
|
|
|
this.exploreEvents = new EventBusSrv();
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
this.state = {
|
2020-08-06 10:22:54 -05:00
|
|
|
openDrawer: undefined,
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
};
|
2018-04-26 04:58:42 -05:00
|
|
|
}
|
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
componentDidMount() {
|
2020-10-01 05:18:21 -05:00
|
|
|
const { initialized, exploreId, initialDatasource, initialQueries, initialRange, originPanelId } = this.props;
|
2019-03-22 09:24:30 -05:00
|
|
|
const width = this.el ? this.el.offsetWidth : 0;
|
2019-04-29 11:28:41 -05:00
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
// initialize the whole explore first time we mount and if browser history contains a change in datasource
|
|
|
|
if (!initialized) {
|
2019-01-11 11:26:56 -06:00
|
|
|
this.props.initializeExplore(
|
|
|
|
exploreId,
|
|
|
|
initialDatasource,
|
|
|
|
initialQueries,
|
|
|
|
initialRange,
|
|
|
|
width,
|
2019-02-01 05:33:15 -06:00
|
|
|
this.exploreEvents,
|
2019-09-05 07:44:37 -05:00
|
|
|
originPanelId
|
2019-01-11 11:26:56 -06:00
|
|
|
);
|
|
|
|
}
|
2018-04-26 04:58:42 -05:00
|
|
|
}
|
|
|
|
|
2018-11-27 07:27:33 -06:00
|
|
|
componentWillUnmount() {
|
|
|
|
this.exploreEvents.removeAllListeners();
|
2018-07-13 02:09:36 -05:00
|
|
|
}
|
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
componentDidUpdate(prevProps: ExploreProps) {
|
|
|
|
this.refreshExplore();
|
|
|
|
}
|
|
|
|
|
|
|
|
getRef = (el: any) => {
|
2018-07-17 08:13:44 -05:00
|
|
|
this.el = el;
|
|
|
|
};
|
|
|
|
|
2019-06-28 05:07:55 -05:00
|
|
|
onChangeTime = (rawRange: RawTimeRange) => {
|
|
|
|
const { updateTimeRange, exploreId } = this.props;
|
2019-06-25 07:44:19 -05:00
|
|
|
updateTimeRange({ exploreId, rawRange });
|
2018-04-30 10:25:25 -05:00
|
|
|
};
|
|
|
|
|
2018-10-09 12:46:31 -05:00
|
|
|
// Use this in help pages to set page to a single query
|
2018-11-21 09:28:30 -06:00
|
|
|
onClickExample = (query: DataQuery) => {
|
2019-01-15 12:52:53 -06:00
|
|
|
this.props.setQueries(this.props.exploreId, [query]);
|
2018-10-09 12:46:31 -05:00
|
|
|
};
|
|
|
|
|
2020-06-10 00:09:02 -05:00
|
|
|
onCellFilterAdded = (filter: FilterItem) => {
|
|
|
|
const { value, key, operator } = filter;
|
|
|
|
if (operator === FILTER_FOR_OPERATOR) {
|
|
|
|
this.onClickFilterLabel(key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (operator === FILTER_OUT_OPERATOR) {
|
|
|
|
this.onClickFilterOutLabel(key, value);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-11-01 04:01:00 -05:00
|
|
|
onClickFilterLabel = (key: string, value: string) => {
|
2018-11-28 03:46:35 -06:00
|
|
|
this.onModifyQueries({ type: 'ADD_FILTER', key, value });
|
2018-08-08 09:50:30 -05:00
|
|
|
};
|
|
|
|
|
2019-11-01 04:01:00 -05:00
|
|
|
onClickFilterOutLabel = (key: string, value: string) => {
|
|
|
|
this.onModifyQueries({ type: 'ADD_FILTER_OUT', key, value });
|
|
|
|
};
|
|
|
|
|
2019-12-23 05:29:00 -06:00
|
|
|
onClickAddQueryRowButton = () => {
|
|
|
|
const { exploreId, queryKeys } = this.props;
|
|
|
|
this.props.addQueryRow(exploreId, queryKeys.length);
|
|
|
|
};
|
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
onModifyQueries = (action: any, index?: number) => {
|
2019-01-10 07:24:31 -06:00
|
|
|
const { datasourceInstance } = this.props;
|
2019-11-26 03:01:32 -06:00
|
|
|
if (datasourceInstance?.modifyQuery) {
|
|
|
|
const modifier = (queries: DataQuery, modification: any) =>
|
|
|
|
datasourceInstance.modifyQuery!(queries, modification);
|
|
|
|
this.props.modifyQueries(this.props.exploreId, action, modifier, index);
|
2018-08-04 04:58:54 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-01-11 11:26:56 -06:00
|
|
|
onResize = (size: { height: number; width: number }) => {
|
|
|
|
this.props.changeSize(this.props.exploreId, size);
|
2018-04-26 04:58:42 -05:00
|
|
|
};
|
|
|
|
|
2018-11-27 09:35:37 -06:00
|
|
|
onStartScanning = () => {
|
2019-01-10 07:24:31 -06:00
|
|
|
// Scanner will trigger a query
|
2019-06-28 05:07:55 -05:00
|
|
|
this.props.scanStart(this.props.exploreId);
|
2018-11-23 10:53:16 -06:00
|
|
|
};
|
|
|
|
|
2018-11-27 09:35:37 -06:00
|
|
|
onStopScanning = () => {
|
2019-02-04 00:47:10 -06:00
|
|
|
this.props.scanStopAction({ exploreId: this.props.exploreId });
|
2018-11-23 10:53:16 -06:00
|
|
|
};
|
|
|
|
|
2019-08-26 01:11:07 -05:00
|
|
|
onUpdateTimeRange = (absoluteRange: AbsoluteTimeRange) => {
|
2019-10-08 11:55:53 -05:00
|
|
|
const { exploreId, updateTimeRange } = this.props;
|
2019-08-26 01:11:07 -05:00
|
|
|
updateTimeRange({ exploreId, absoluteRange });
|
|
|
|
};
|
|
|
|
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
toggleShowRichHistory = () => {
|
|
|
|
this.setState(state => {
|
|
|
|
return {
|
2020-08-06 10:22:54 -05:00
|
|
|
openDrawer: state.openDrawer === ExploreDrawer.RichHistory ? undefined : ExploreDrawer.RichHistory,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
toggleShowQueryInspector = () => {
|
|
|
|
this.setState(state => {
|
|
|
|
return {
|
|
|
|
openDrawer: state.openDrawer === ExploreDrawer.QueryInspector ? undefined : ExploreDrawer.QueryInspector,
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2019-03-22 09:24:30 -05:00
|
|
|
refreshExplore = () => {
|
|
|
|
const { exploreId, update } = this.props;
|
|
|
|
|
2020-10-01 05:18:21 -05:00
|
|
|
if (update.queries || update.range || update.datasource || update.mode) {
|
2019-03-22 09:24:30 -05:00
|
|
|
this.props.refreshExplore(exploreId);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-28 11:17:01 -05:00
|
|
|
renderEmptyState = () => {
|
|
|
|
return (
|
|
|
|
<div className="explore-container">
|
|
|
|
<NoDataSourceCallToAction />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2018-04-26 04:58:42 -05:00
|
|
|
render() {
|
|
|
|
const {
|
2019-01-10 07:24:31 -06:00
|
|
|
datasourceInstance,
|
2018-07-13 02:09:36 -05:00
|
|
|
datasourceMissing,
|
2019-01-11 11:26:56 -06:00
|
|
|
exploreId,
|
2019-01-10 07:24:31 -06:00
|
|
|
split,
|
2019-02-04 06:41:29 -06:00
|
|
|
queryKeys,
|
2019-08-13 00:32:43 -05:00
|
|
|
graphResult,
|
2019-08-26 01:11:07 -05:00
|
|
|
loading,
|
|
|
|
absoluteRange,
|
|
|
|
timeZone,
|
2019-09-03 02:55:20 -05:00
|
|
|
queryResponse,
|
2019-10-08 11:55:53 -05:00
|
|
|
syncedTimes,
|
2019-12-23 05:29:00 -06:00
|
|
|
isLive,
|
2020-04-16 07:28:46 -05:00
|
|
|
theme,
|
2020-07-09 09:14:55 -05:00
|
|
|
showMetrics,
|
|
|
|
showTable,
|
|
|
|
showLogs,
|
|
|
|
showTrace,
|
2020-10-14 17:03:14 -05:00
|
|
|
splitOpen,
|
2019-01-10 07:24:31 -06:00
|
|
|
} = this.props;
|
2020-08-06 10:22:54 -05:00
|
|
|
const { openDrawer } = this.state;
|
2018-05-15 10:07:38 -05:00
|
|
|
const exploreClass = split ? 'explore explore-split' : 'explore';
|
2020-04-16 07:28:46 -05:00
|
|
|
const styles = getStyles(theme);
|
2019-12-05 04:22:46 -06:00
|
|
|
const StartPage = datasourceInstance?.components?.ExploreStartPage;
|
|
|
|
const showStartPage = !queryResponse || queryResponse.state === LoadingState.NotStarted;
|
2019-01-24 02:03:26 -06:00
|
|
|
|
2020-03-11 04:01:58 -05:00
|
|
|
// gets an error without a refID, so non-query-row-related error, like a connection error
|
|
|
|
const queryErrors = queryResponse.error ? [queryResponse.error] : undefined;
|
|
|
|
const queryError = getFirstNonQueryRowSpecificError(queryErrors);
|
|
|
|
|
2020-08-06 10:22:54 -05:00
|
|
|
const showRichHistory = openDrawer === ExploreDrawer.RichHistory;
|
|
|
|
const showQueryInspector = openDrawer === ExploreDrawer.QueryInspector;
|
|
|
|
|
2018-04-26 04:58:42 -05:00
|
|
|
return (
|
2020-04-27 02:09:05 -05:00
|
|
|
<div className={exploreClass} ref={this.getRef} aria-label={selectors.pages.Explore.General.container}>
|
2019-06-28 05:07:55 -05:00
|
|
|
<ExploreToolbar exploreId={exploreId} onChangeTime={this.onChangeTime} />
|
2019-03-28 11:17:01 -05:00
|
|
|
{datasourceMissing ? this.renderEmptyState() : null}
|
2019-04-01 00:38:00 -05:00
|
|
|
{datasourceInstance && (
|
2019-02-19 08:41:35 -06:00
|
|
|
<div className="explore-container">
|
2020-04-16 07:28:46 -05:00
|
|
|
<div className={cx('panel-container', styles.queryContainer)}>
|
|
|
|
<QueryRows exploreEvents={this.exploreEvents} exploreId={exploreId} queryKeys={queryKeys} />
|
|
|
|
<SecondaryActions
|
|
|
|
addQueryRowButtonDisabled={isLive}
|
|
|
|
// We cannot show multiple traces at the same time right now so we do not show add query button.
|
2020-07-09 09:14:55 -05:00
|
|
|
//TODO:unification
|
|
|
|
addQueryRowButtonHidden={false}
|
2020-04-16 07:28:46 -05:00
|
|
|
richHistoryButtonActive={showRichHistory}
|
2020-08-06 10:22:54 -05:00
|
|
|
queryInspectorButtonActive={showQueryInspector}
|
2020-04-16 07:28:46 -05:00
|
|
|
onClickAddQueryRowButton={this.onClickAddQueryRowButton}
|
|
|
|
onClickRichHistoryButton={this.toggleShowRichHistory}
|
2020-08-06 10:22:54 -05:00
|
|
|
onClickQueryInspectorButton={this.toggleShowQueryInspector}
|
2020-04-16 07:28:46 -05:00
|
|
|
/>
|
2020-04-14 04:32:14 -05:00
|
|
|
</div>
|
2020-03-11 04:01:58 -05:00
|
|
|
<ErrorContainer queryError={queryError} />
|
2020-04-08 10:16:22 -05:00
|
|
|
<AutoSizer onResize={this.onResize} disableHeight>
|
2019-02-19 08:41:35 -06:00
|
|
|
{({ width }) => {
|
|
|
|
if (width === 0) {
|
|
|
|
return null;
|
|
|
|
}
|
2019-02-07 11:20:16 -06:00
|
|
|
|
2019-02-19 08:41:35 -06:00
|
|
|
return (
|
2020-04-08 10:16:22 -05:00
|
|
|
<main className={cx(styles.logsMain)} style={{ width }}>
|
2019-09-04 06:59:30 -05:00
|
|
|
<ErrorBoundaryAlert>
|
2019-12-05 04:22:46 -06:00
|
|
|
{showStartPage && StartPage && (
|
Explore: Rich History (#22570)
* Explore: Refactor active buttons css
* Explore: Add query history button
* WIP: Creating drawer
* WIP: Create custom drawer (for now)
* Revert changes to Drawer.tsx
* WIP: Layout finished
* Rich History: Set up boilerplate for Settings
* WIP: Query history cards
* Refactor, split components
* Add resizability, interactivity
* Save history to local storage
* Visualise queries from queryhistory local storage
* Set up query history settings
* Refactor
* Create link, un-refactored verison
* Copyable url
* WIP: Add slider
* Commenting feature
* Slider filtration
* Add headings
* Hide Rich history behind feature toggle
* Cleaning up, refactors
* Update tests
* Implement getQueryDisplayText
* Update lockfile for new dependencies
* Update heading based on sorting
* Fix typescript strinctNullCheck errors
* Fix Forms, new forms
* Fixes based on provided feedback
* Fixes, splitting component into two
* Add tooltips, add delete history button
* Clicking on card adds queries to query rows
* Delete history, width of drawers
* UI/UX changes, updates
* Add number of queries to headings, box shadows
* Fix slider, remove feature toggle
* Fix typo in the beta announcement
* Fix how the rich history state is rendered when initialization
* Move updateFilters when activeDatasourceFilter onlyto RichHistory, remove duplicated code
* Fix typescript strictnull errors, not used variables errors
2020-03-10 09:08:15 -05:00
|
|
|
<div className={'grafana-info-box grafana-info-box--max-lg'}>
|
2019-11-15 09:38:25 -06:00
|
|
|
<StartPage
|
|
|
|
onClickExample={this.onClickExample}
|
|
|
|
datasource={datasourceInstance}
|
2020-05-11 11:43:53 -05:00
|
|
|
exploreId={exploreId}
|
2019-11-15 09:38:25 -06:00
|
|
|
/>
|
2019-09-16 00:17:34 -05:00
|
|
|
</div>
|
|
|
|
)}
|
2019-12-05 04:22:46 -06:00
|
|
|
{!showStartPage && (
|
2019-02-19 08:41:35 -06:00
|
|
|
<>
|
2020-07-09 09:14:55 -05:00
|
|
|
{showMetrics && (
|
2019-08-26 01:11:07 -05:00
|
|
|
<ExploreGraphPanel
|
2020-08-28 11:59:56 -05:00
|
|
|
ariaLabel={selectors.pages.Explore.General.graph}
|
2019-08-26 01:11:07 -05:00
|
|
|
series={graphResult}
|
|
|
|
width={width}
|
|
|
|
loading={loading}
|
|
|
|
absoluteRange={absoluteRange}
|
|
|
|
isStacked={false}
|
|
|
|
showPanel={true}
|
|
|
|
timeZone={timeZone}
|
|
|
|
onUpdateTimeRange={this.onUpdateTimeRange}
|
|
|
|
showBars={false}
|
|
|
|
showLines={true}
|
|
|
|
/>
|
2019-08-13 00:32:43 -05:00
|
|
|
)}
|
2020-07-09 09:14:55 -05:00
|
|
|
{showTable && (
|
2020-06-10 00:09:02 -05:00
|
|
|
<TableContainer
|
2020-08-28 11:59:56 -05:00
|
|
|
ariaLabel={selectors.pages.Explore.General.table}
|
2020-06-10 00:09:02 -05:00
|
|
|
width={width}
|
|
|
|
exploreId={exploreId}
|
|
|
|
onCellFilterAdded={
|
|
|
|
this.props.datasourceInstance?.modifyQuery ? this.onCellFilterAdded : undefined
|
|
|
|
}
|
|
|
|
/>
|
2019-05-16 02:52:22 -05:00
|
|
|
)}
|
2020-07-09 09:14:55 -05:00
|
|
|
{showLogs && (
|
2019-02-19 08:41:35 -06:00
|
|
|
<LogsContainer
|
|
|
|
width={width}
|
|
|
|
exploreId={exploreId}
|
2019-10-08 11:55:53 -05:00
|
|
|
syncedTimes={syncedTimes}
|
2019-11-01 04:01:00 -05:00
|
|
|
onClickFilterLabel={this.onClickFilterLabel}
|
|
|
|
onClickFilterOutLabel={this.onClickFilterOutLabel}
|
2019-02-19 08:41:35 -06:00
|
|
|
onStartScanning={this.onStartScanning}
|
|
|
|
onStopScanning={this.onStopScanning}
|
|
|
|
/>
|
|
|
|
)}
|
2020-07-09 09:14:55 -05:00
|
|
|
{/* TODO:unification */}
|
|
|
|
{showTrace &&
|
2020-04-02 06:34:16 -05:00
|
|
|
// We expect only one trace at the moment to be in the dataframe
|
|
|
|
// If there is not data (like 404) we show a separate error so no need to show anything here
|
|
|
|
queryResponse.series[0] && (
|
2020-10-14 17:03:14 -05:00
|
|
|
<TraceView
|
|
|
|
trace={queryResponse.series[0].fields[0].values.get(0) as any}
|
|
|
|
splitOpenFn={splitOpen}
|
|
|
|
/>
|
2020-04-02 06:34:16 -05:00
|
|
|
)}
|
2019-02-19 08:41:35 -06:00
|
|
|
</>
|
|
|
|
)}
|
2020-03-17 10:06:02 -05:00
|
|
|
{showRichHistory && (
|
|
|
|
<RichHistoryContainer
|
|
|
|
width={width}
|
|
|
|
exploreId={exploreId}
|
|
|
|
onClose={this.toggleShowRichHistory}
|
|
|
|
/>
|
|
|
|
)}
|
2020-08-06 10:22:54 -05:00
|
|
|
{showQueryInspector && (
|
|
|
|
<ExploreQueryInspector
|
|
|
|
exploreId={exploreId}
|
|
|
|
width={width}
|
|
|
|
onClose={this.toggleShowQueryInspector}
|
|
|
|
/>
|
|
|
|
)}
|
2019-09-04 06:59:30 -05:00
|
|
|
</ErrorBoundaryAlert>
|
2019-02-19 08:41:35 -06:00
|
|
|
</main>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
</AutoSizer>
|
|
|
|
</div>
|
|
|
|
)}
|
2018-04-26 04:58:42 -05:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-29 06:41:45 -05:00
|
|
|
const ensureQueriesMemoized = memoizeOne(ensureQueries);
|
|
|
|
const getTimeRangeFromUrlMemoized = memoizeOne(getTimeRangeFromUrl);
|
|
|
|
|
2019-09-24 04:40:16 -05:00
|
|
|
function mapStateToProps(state: StoreState, { exploreId }: ExploreProps): Partial<ExploreProps> {
|
2019-01-11 11:26:56 -06:00
|
|
|
const explore = state.explore;
|
2019-10-08 11:55:53 -05:00
|
|
|
const { split, syncedTimes } = explore;
|
2019-01-11 11:26:56 -06:00
|
|
|
const item: ExploreItemState = explore[exploreId];
|
2019-04-29 11:28:41 -05:00
|
|
|
const timeZone = getTimeZone(state.user);
|
2019-01-10 07:24:31 -06:00
|
|
|
const {
|
|
|
|
datasourceInstance,
|
|
|
|
datasourceMissing,
|
2019-01-12 16:22:28 -06:00
|
|
|
initialized,
|
2019-02-04 06:41:29 -06:00
|
|
|
queryKeys,
|
2019-03-22 09:24:30 -05:00
|
|
|
urlState,
|
|
|
|
update,
|
2019-05-20 06:28:23 -05:00
|
|
|
isLive,
|
2019-08-13 00:32:43 -05:00
|
|
|
graphResult,
|
2020-07-09 09:14:55 -05:00
|
|
|
logsResult,
|
|
|
|
showLogs,
|
|
|
|
showMetrics,
|
|
|
|
showTable,
|
|
|
|
showTrace,
|
2019-09-03 02:55:20 -05:00
|
|
|
loading,
|
2019-08-26 01:11:07 -05:00
|
|
|
absoluteRange,
|
2019-09-03 02:55:20 -05:00
|
|
|
queryResponse,
|
2019-01-11 11:26:56 -06:00
|
|
|
} = item;
|
2019-04-29 11:28:41 -05:00
|
|
|
|
2020-10-01 05:18:21 -05:00
|
|
|
const { datasource, queries, range: urlRange, originPanelId } = (urlState || {}) as ExploreUrlState;
|
2019-07-04 09:31:15 -05:00
|
|
|
const initialDatasource = datasource || store.get(lastUsedDatasourceKeyForOrgId(state.user.orgId));
|
2019-08-29 06:41:45 -05:00
|
|
|
const initialQueries: DataQuery[] = ensureQueriesMemoized(queries);
|
2020-01-14 12:20:17 -06:00
|
|
|
const initialRange = urlRange
|
|
|
|
? getTimeRangeFromUrlMemoized(urlRange, timeZone)
|
|
|
|
: getTimeRange(timeZone, DEFAULT_RANGE);
|
2019-06-27 04:11:49 -05:00
|
|
|
|
2019-01-10 07:24:31 -06:00
|
|
|
return {
|
|
|
|
datasourceInstance,
|
|
|
|
datasourceMissing,
|
2019-01-12 16:22:28 -06:00
|
|
|
initialized,
|
2019-01-11 11:26:56 -06:00
|
|
|
split,
|
2019-02-04 06:41:29 -06:00
|
|
|
queryKeys,
|
2019-03-22 09:24:30 -05:00
|
|
|
update,
|
2019-04-29 11:28:41 -05:00
|
|
|
initialDatasource,
|
|
|
|
initialQueries,
|
|
|
|
initialRange,
|
2019-05-20 06:28:23 -05:00
|
|
|
isLive,
|
2020-07-09 09:14:55 -05:00
|
|
|
graphResult: graphResult ?? undefined,
|
|
|
|
logsResult: logsResult ?? undefined,
|
2019-08-26 01:11:07 -05:00
|
|
|
loading,
|
|
|
|
absoluteRange,
|
2019-09-03 02:55:20 -05:00
|
|
|
queryResponse,
|
2019-09-05 07:44:37 -05:00
|
|
|
originPanelId,
|
2019-10-08 11:55:53 -05:00
|
|
|
syncedTimes,
|
2019-12-03 02:38:47 -06:00
|
|
|
timeZone,
|
2020-07-09 09:14:55 -05:00
|
|
|
showLogs,
|
|
|
|
showMetrics,
|
|
|
|
showTable,
|
|
|
|
showTrace,
|
2019-01-10 07:24:31 -06:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-09-24 04:40:16 -05:00
|
|
|
const mapDispatchToProps: Partial<ExploreProps> = {
|
2019-01-11 11:26:56 -06:00
|
|
|
changeSize,
|
2019-01-10 07:24:31 -06:00
|
|
|
initializeExplore,
|
|
|
|
modifyQueries,
|
2019-03-22 09:24:30 -05:00
|
|
|
refreshExplore,
|
2019-01-10 07:24:31 -06:00
|
|
|
scanStart,
|
2019-02-04 00:47:10 -06:00
|
|
|
scanStopAction,
|
2019-01-15 12:52:53 -06:00
|
|
|
setQueries,
|
2019-06-25 07:44:19 -05:00
|
|
|
updateTimeRange,
|
2019-12-23 05:29:00 -06:00
|
|
|
addQueryRow,
|
2020-10-14 17:03:14 -05:00
|
|
|
splitOpen,
|
2019-01-10 07:24:31 -06:00
|
|
|
};
|
|
|
|
|
2020-04-16 07:28:46 -05:00
|
|
|
export default compose(
|
|
|
|
hot(module),
|
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
|
|
withTheme
|
|
|
|
)(Explore) as React.ComponentType<{ exploreId: ExploreId }>;
|