|
|
|
@ -17,7 +17,7 @@ import { getLogsVolumeDataSourceInfo, isLogsVolumeLimited } from '../../logs/uti |
|
|
|
|
import { ExploreGraph } from '../Graph/ExploreGraph'; |
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
|
logsVolumeData: DataQueryResponse | undefined; |
|
|
|
|
logsVolumeData: DataQueryResponse; |
|
|
|
|
allLogsVolumeMaximum: number; |
|
|
|
|
absoluteRange: AbsoluteTimeRange; |
|
|
|
|
timeZone: TimeZone; |
|
|
|
@ -36,10 +36,6 @@ export function LogsVolumePanel(props: Props) { |
|
|
|
|
const spacing = parseInt(theme.spacing(2).slice(0, -2), 10); |
|
|
|
|
const height = 150; |
|
|
|
|
|
|
|
|
|
if (props.logsVolumeData === undefined) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const logsVolumeData = props.logsVolumeData; |
|
|
|
|
|
|
|
|
|
const logsVolumeInfo = getLogsVolumeDataSourceInfo(logsVolumeData?.data); |
|
|
|
@ -54,11 +50,21 @@ export function LogsVolumePanel(props: Props) { |
|
|
|
|
.join('. '); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let LogsVolumePanelContent; |
|
|
|
|
let extraInfoComponent = <span>{extraInfo}</span>; |
|
|
|
|
|
|
|
|
|
if (logsVolumeData.state === LoadingState.Streaming) { |
|
|
|
|
extraInfoComponent = ( |
|
|
|
|
<> |
|
|
|
|
{extraInfoComponent} |
|
|
|
|
<Tooltip content="Streaming"> |
|
|
|
|
<Icon name="circle-mono" size="md" className={styles.streaming} data-testid="logs-volume-streaming" /> |
|
|
|
|
</Tooltip> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (logsVolumeData?.data) { |
|
|
|
|
if (logsVolumeData.data.length > 0) { |
|
|
|
|
LogsVolumePanelContent = ( |
|
|
|
|
return ( |
|
|
|
|
<div style={{ height }} className={styles.contentContainer}> |
|
|
|
|
<ExploreGraph |
|
|
|
|
graphStyle="lines" |
|
|
|
|
loadingState={logsVolumeData.state ?? LoadingState.Done} |
|
|
|
@ -75,28 +81,6 @@ export function LogsVolumePanel(props: Props) { |
|
|
|
|
yAxisMaximum={allLogsVolumeMaximum} |
|
|
|
|
eventBus={props.eventBus} |
|
|
|
|
/> |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
LogsVolumePanelContent = <span>No volume data.</span>; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let extraInfoComponent = <span>{extraInfo}</span>; |
|
|
|
|
|
|
|
|
|
if (logsVolumeData.state === LoadingState.Streaming) { |
|
|
|
|
extraInfoComponent = ( |
|
|
|
|
<> |
|
|
|
|
{extraInfoComponent} |
|
|
|
|
<Tooltip content="Streaming"> |
|
|
|
|
<Icon name="circle-mono" size="md" className={styles.streaming} data-testid="logs-volume-streaming" /> |
|
|
|
|
</Tooltip> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div style={{ height }} className={styles.contentContainer}> |
|
|
|
|
{LogsVolumePanelContent} |
|
|
|
|
{extraInfoComponent && <div className={styles.extraInfoContainer}>{extraInfoComponent}</div>} |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|