mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ObsUX][Profiling, Infra] Show "No Data" messages when there is no profiling data (#173633)
Closes https://github.com/elastic/kibana/issues/173153
## Summary
Adds a message when there is no data for flamegraph or top functions.
2a6158ca
-86d3-4b23-9807-dc177ce0361b
This commit is contained in:
parent
366a4afe02
commit
9215e17cb7
3 changed files with 48 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export function EmptyDataPrompt() {
|
||||
return (
|
||||
<>
|
||||
<EuiSpacer />
|
||||
<EuiEmptyPrompt
|
||||
color="subdued"
|
||||
iconType="search"
|
||||
titleSize="xs"
|
||||
title={
|
||||
<h2>
|
||||
{i18n.translate('xpack.infra.profiling.emptyDataPromptTitle', {
|
||||
defaultMessage: 'No data found',
|
||||
})}
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{i18n.translate('xpack.infra.profiling.emptyDataPromptBody', {
|
||||
defaultMessage:
|
||||
'Make sure this host is sending profiling data or try selecting a different date range.',
|
||||
})}
|
||||
</p>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -17,6 +17,7 @@ import { useTabSwitcherContext } from '../../hooks/use_tab_switcher';
|
|||
import { ContentTabIds } from '../../types';
|
||||
import { ErrorPrompt } from './error_prompt';
|
||||
import { ProfilingLinks } from './profiling_links';
|
||||
import { EmptyDataPrompt } from './empty_data_prompt';
|
||||
|
||||
export function Flamegraph() {
|
||||
const { services } = useKibanaContextForPlugin();
|
||||
|
@ -47,6 +48,10 @@ export function Flamegraph() {
|
|||
return <ErrorPrompt />;
|
||||
}
|
||||
|
||||
if (!loading && response?.TotalSamples === 0) {
|
||||
return <EmptyDataPrompt />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ProfilingLinks
|
||||
|
|
|
@ -17,6 +17,7 @@ import { useTabSwitcherContext } from '../../hooks/use_tab_switcher';
|
|||
import { ContentTabIds } from '../../types';
|
||||
import { ErrorPrompt } from './error_prompt';
|
||||
import { ProfilingLinks } from './profiling_links';
|
||||
import { EmptyDataPrompt } from './empty_data_prompt';
|
||||
|
||||
export function Functions() {
|
||||
const { services } = useKibanaContextForPlugin();
|
||||
|
@ -50,6 +51,10 @@ export function Functions() {
|
|||
return <ErrorPrompt />;
|
||||
}
|
||||
|
||||
if (!loading && response?.TotalCount === 0) {
|
||||
return <EmptyDataPrompt />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ProfilingLinks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue