The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/explore/SecondaryActions.tsx

60 lines
1.9 KiB

import React from 'react';
import { css, cx } from 'emotion';
import { stylesFactory, Icon } from '@grafana/ui';
type Props = {
addQueryRowButtonDisabled?: boolean;
addQueryRowButtonHidden?: boolean;
richHistoryButtonActive?: boolean;
queryInspectorButtonActive?: boolean;
onClickAddQueryRowButton: () => void;
onClickRichHistoryButton: () => void;
onClickQueryInspectorButton: () => void;
};
const getStyles = stylesFactory(() => {
return {
button: css`
margin: 1em 4px 0 0;
`,
};
});
export function SecondaryActions(props: Props) {
const styles = getStyles();
return (
<div className="gf-form">
{!props.addQueryRowButtonHidden && (
<button
aria-label="Add row button"
className={`gf-form-label gf-form-label--btn ${styles.button}`}
onClick={props.onClickAddQueryRowButton}
disabled={props.addQueryRowButtonDisabled}
>
<Icon className="icon-margin-right" name="plus" size="sm" />
<span className="btn-title">{'\xA0' + 'Add query'}</span>
</button>
)}
<button
aria-label="Rich history button"
className={cx(`gf-form-label gf-form-label--btn ${styles.button}`, {
['explore-active-button']: props.richHistoryButtonActive,
})}
onClick={props.onClickRichHistoryButton}
>
<Icon className="icon-margin-right" name="history" size="sm" />
<span className="btn-title">{'\xA0' + 'Query history'}</span>
</button>
<button
aria-label="Query inspector button"
className={cx(`gf-form-label gf-form-label--btn ${styles.button}`, {
['explore-active-button']: props.queryInspectorButtonActive,
})}
onClick={props.onClickQueryInspectorButton}
>
<Icon className="icon-margin-right" name="info-circle" size="sm" />
<span className="btn-title">{'\xA0' + 'Query inspector'}</span>
</button>
</div>
);
}