mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Logging dedup tooltips
- use title attribute of toggle button group - add descriptions for all dedup options
This commit is contained in:
parent
e5c547c504
commit
487de2b832
@ -49,9 +49,17 @@ interface ToggleButtonProps {
|
||||
value: any;
|
||||
className?: string;
|
||||
children: ReactNode;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export const ToggleButton: SFC<ToggleButtonProps> = ({ children, selected, className = '', value, onChange }) => {
|
||||
export const ToggleButton: SFC<ToggleButtonProps> = ({
|
||||
children,
|
||||
selected,
|
||||
className = '',
|
||||
title = null,
|
||||
value,
|
||||
onChange,
|
||||
}) => {
|
||||
const handleChange = event => {
|
||||
event.stopPropagation();
|
||||
if (onChange) {
|
||||
@ -61,7 +69,7 @@ export const ToggleButton: SFC<ToggleButtonProps> = ({ children, selected, class
|
||||
|
||||
const btnClassName = `btn ${className} ${selected ? 'active' : ''}`;
|
||||
return (
|
||||
<button className={btnClassName} onClick={handleChange}>
|
||||
<button className={btnClassName} onClick={handleChange} title={title}>
|
||||
<span>{children}</span>
|
||||
</button>
|
||||
);
|
||||
|
@ -88,6 +88,13 @@ export interface LogsStreamLabels {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export enum LogsDedupDescription {
|
||||
none = 'No de-duplication',
|
||||
exact = 'De-duplication of successive lines that are identical, ignoring ISO datetimes.',
|
||||
numbers = 'De-duplication of successive lines that are identical when ignoring numbers, e.g., IP addresses, latencies.',
|
||||
signature = 'De-duplication of successive lines that have identical punctuation and whitespace.',
|
||||
}
|
||||
|
||||
export enum LogsDedupStrategy {
|
||||
none = 'none',
|
||||
exact = 'exact',
|
||||
|
@ -6,6 +6,7 @@ import classnames from 'classnames';
|
||||
import * as rangeUtil from 'app/core/utils/rangeutil';
|
||||
import { RawTimeRange } from 'app/types/series';
|
||||
import {
|
||||
LogsDedupDescription,
|
||||
LogsDedupStrategy,
|
||||
LogsModel,
|
||||
dedupLogRows,
|
||||
@ -445,6 +446,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
|
||||
key={i}
|
||||
value={dedupType}
|
||||
onChange={onChange}
|
||||
title={LogsDedupDescription[dedupType] || null}
|
||||
selected={selectedValue === dedupType}
|
||||
>
|
||||
{dedupType}
|
||||
|
Loading…
Reference in New Issue
Block a user