"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public/app/plugins/panel/logs/LogsPanel.tsx" between
grafana-8.0.0.tar.gz and grafana-8.0.1.tar.gz

About: Grafana is a visualization tool for monitoring, metric analytics and dashboards for Graphite, InfluxDB, Prometheus and many more.

LogsPanel.tsx  (grafana-8.0.0):LogsPanel.tsx  (grafana-8.0.1)
import React from 'react'; import React from 'react';
import { LogRows, CustomScrollbar } from '@grafana/ui'; import { css } from '@emotion/css';
import { LogRows, CustomScrollbar, useTheme2 } from '@grafana/ui';
import { PanelProps, Field } from '@grafana/data'; import { PanelProps, Field } from '@grafana/data';
import { Options } from './types'; import { Options } from './types';
import { dataFrameToLogsModel, dedupLogRows } from 'app/core/logs_model'; import { dataFrameToLogsModel, dedupLogRows } from 'app/core/logs_model';
import { getFieldLinksForExplore } from 'app/features/explore/utils/links'; import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
interface LogsPanelProps extends PanelProps<Options> {} interface LogsPanelProps extends PanelProps<Options> {}
export const LogsPanel: React.FunctionComponent<LogsPanelProps> = ({ export const LogsPanel: React.FunctionComponent<LogsPanelProps> = ({
data, data,
timeZone, timeZone,
options: { showLabels, showTime, wrapLogMessage, sortOrder, dedupStrategy, ena bleLogDetails }, options: { showLabels, showTime, wrapLogMessage, sortOrder, dedupStrategy, ena bleLogDetails },
title,
}) => { }) => {
const theme = useTheme2();
if (!data) { if (!data) {
return ( return (
<div className="panel-empty"> <div className="panel-empty">
<p>No data found in response</p> <p>No data found in response</p>
</div> </div>
); );
} }
const spacing = css`
margin-bottom: ${theme.spacing(1.5)};
//We can remove this hot-fix when we fix panel menu with no title overflowin
g top of all panels
margin-top: ${theme.spacing(!title ? 2.5 : 0)};
`;
const newResults = data ? dataFrameToLogsModel(data.series, data.request?.inte rvalMs) : null; const newResults = data ? dataFrameToLogsModel(data.series, data.request?.inte rvalMs) : null;
const logRows = newResults?.rows || []; const logRows = newResults?.rows || [];
const deduplicatedRows = dedupLogRows(logRows, dedupStrategy); const deduplicatedRows = dedupLogRows(logRows, dedupStrategy);
const getFieldLinks = (field: Field, rowIndex: number) => { const getFieldLinks = (field: Field, rowIndex: number) => {
return getFieldLinksForExplore({ field, rowIndex, range: data.timeRange }); return getFieldLinksForExplore({ field, rowIndex, range: data.timeRange });
}; };
return ( return (
<CustomScrollbar autoHide> <CustomScrollbar autoHide>
<LogRows <div className={spacing}>
logRows={logRows} <LogRows
deduplicatedRows={deduplicatedRows} logRows={logRows}
dedupStrategy={dedupStrategy} deduplicatedRows={deduplicatedRows}
highlighterExpressions={[]} dedupStrategy={dedupStrategy}
showLabels={showLabels} highlighterExpressions={[]}
showTime={showTime} showLabels={showLabels}
wrapLogMessage={wrapLogMessage} showTime={showTime}
timeZone={timeZone} wrapLogMessage={wrapLogMessage}
getFieldLinks={getFieldLinks} timeZone={timeZone}
logsSortOrder={sortOrder} getFieldLinks={getFieldLinks}
enableLogDetails={enableLogDetails} logsSortOrder={sortOrder}
/> enableLogDetails={enableLogDetails}
/>
</div>
</CustomScrollbar> </CustomScrollbar>
); );
}; };
 End of changes. 5 change blocks. 
14 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)