Commit 837a6215 by Torkel Ödegaard Committed by GitHub

Merge pull request #14410 from grafana/davkal/explore-logging-dedup-description

Explore: Logging dedup tooltips
parents c58f818e 487de2b8
......@@ -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,
......@@ -449,6 +450,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
key={i}
value={dedupType}
onChange={onChange}
title={LogsDedupDescription[dedupType] || null}
selected={selectedValue === dedupType}
>
{dedupType}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment