mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
- Set container width to 100% so column widths can be calculated properly - Sets duplicates, level, timestamp, local time to a fixed width based upon em units since the size of these are static - Sets labels to be 20% - Remove min-width:80% on message column so that it now consumes remaining space - Additionally fixes long labels from overflowing into the messages column by properly setting a max-width per label and hiding overflow closes #15673 Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
32 lines
784 B
TypeScript
32 lines
784 B
TypeScript
import React, { PureComponent } from 'react';
|
|
|
|
import { LogsStreamLabels, LogRowModel } from 'app/core/logs_model';
|
|
import { LogLabel } from './LogLabel';
|
|
|
|
interface Props {
|
|
getRows?: () => LogRowModel[];
|
|
labels: LogsStreamLabels;
|
|
plain?: boolean;
|
|
onClickLabel?: (label: string, value: string) => void;
|
|
}
|
|
|
|
export class LogLabels extends PureComponent<Props> {
|
|
render() {
|
|
const { getRows, labels, onClickLabel, plain } = this.props;
|
|
return (
|
|
<span className="logs-labels">
|
|
{Object.keys(labels).map(key => (
|
|
<LogLabel
|
|
key={key}
|
|
getRows={getRows}
|
|
label={key}
|
|
value={labels[key]}
|
|
plain={plain}
|
|
onClickLabel={onClickLabel}
|
|
/>
|
|
))}
|
|
</span>
|
|
);
|
|
}
|
|
}
|