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 { ...@@ -49,9 +49,17 @@ interface ToggleButtonProps {
value: any; value: any;
className?: string; className?: string;
children: ReactNode; 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 => { const handleChange = event => {
event.stopPropagation(); event.stopPropagation();
if (onChange) { if (onChange) {
...@@ -61,7 +69,7 @@ export const ToggleButton: SFC<ToggleButtonProps> = ({ children, selected, class ...@@ -61,7 +69,7 @@ export const ToggleButton: SFC<ToggleButtonProps> = ({ children, selected, class
const btnClassName = `btn ${className} ${selected ? 'active' : ''}`; const btnClassName = `btn ${className} ${selected ? 'active' : ''}`;
return ( return (
<button className={btnClassName} onClick={handleChange}> <button className={btnClassName} onClick={handleChange} title={title}>
<span>{children}</span> <span>{children}</span>
</button> </button>
); );
......
...@@ -88,6 +88,13 @@ export interface LogsStreamLabels { ...@@ -88,6 +88,13 @@ export interface LogsStreamLabels {
[key: string]: string; [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 { export enum LogsDedupStrategy {
none = 'none', none = 'none',
exact = 'exact', exact = 'exact',
......
...@@ -6,6 +6,7 @@ import classnames from 'classnames'; ...@@ -6,6 +6,7 @@ import classnames from 'classnames';
import * as rangeUtil from 'app/core/utils/rangeutil'; import * as rangeUtil from 'app/core/utils/rangeutil';
import { RawTimeRange } from 'app/types/series'; import { RawTimeRange } from 'app/types/series';
import { import {
LogsDedupDescription,
LogsDedupStrategy, LogsDedupStrategy,
LogsModel, LogsModel,
dedupLogRows, dedupLogRows,
...@@ -449,6 +450,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> { ...@@ -449,6 +450,7 @@ export default class Logs extends PureComponent<LogsProps, LogsState> {
key={i} key={i}
value={dedupType} value={dedupType}
onChange={onChange} onChange={onChange}
title={LogsDedupDescription[dedupType] || null}
selected={selectedValue === dedupType} selected={selectedValue === dedupType}
> >
{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