Explore: Add padding to query content in query inspector (#85309)
Add padding
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { CoreApp, LoadingState } from '@grafana/data';
|
||||
import { CoreApp, GrafanaTheme2, LoadingState } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime/src';
|
||||
import { defaultTimeZone, TimeZone } from '@grafana/schema';
|
||||
import { TabbedContainer, TabConfig } from '@grafana/ui';
|
||||
import { TabbedContainer, TabConfig, useStyles2 } from '@grafana/ui';
|
||||
import { requestIdGenerator } from 'app/core/utils/explore';
|
||||
import { ExploreDrawer } from 'app/features/explore/ExploreDrawer';
|
||||
import { InspectDataTab } from 'app/features/inspector/InspectDataTab';
|
||||
@@ -40,6 +41,7 @@ export function ExploreQueryInspector(props: Props) {
|
||||
if (!errors?.length && queryResponse?.error) {
|
||||
errors = [queryResponse.error];
|
||||
}
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
useEffect(() => {
|
||||
reportInteraction('grafana_explore_query_inspector_opened');
|
||||
@@ -82,11 +84,13 @@ export function ExploreQueryInspector(props: Props) {
|
||||
value: 'query',
|
||||
icon: 'info-circle',
|
||||
content: (
|
||||
<QueryInspector
|
||||
instanceId={isMixed ? mixedRequestId(0, requestIdGenerator(exploreId)) : requestIdGenerator(exploreId)}
|
||||
data={queryResponse}
|
||||
onRefreshQuery={() => props.runQueries({ exploreId })}
|
||||
/>
|
||||
<div className={styles.queryInspectorWrapper}>
|
||||
<QueryInspector
|
||||
instanceId={isMixed ? mixedRequestId(0, requestIdGenerator(exploreId)) : requestIdGenerator(exploreId)}
|
||||
data={queryResponse}
|
||||
onRefreshQuery={() => props.runQueries({ exploreId })}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
};
|
||||
|
||||
@@ -121,6 +125,12 @@ const mapDispatchToProps = {
|
||||
runQueries,
|
||||
};
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => ({
|
||||
queryInspectorWrapper: css({
|
||||
paddingBottom: theme.spacing(3),
|
||||
}),
|
||||
});
|
||||
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
export default connector(ExploreQueryInspector);
|
||||
|
||||
Reference in New Issue
Block a user