-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ObsUX] Add Profiling prompt to Host CPU card (#173177)
Closes #173150 This adds a prompt under the CPU card to open the Profiling tab. ![CleanShot 2023-12-12 at 16 56 55@2x](https://github.com/elastic/kibana/assets/793851/5beae41d-45da-426f-9d38-eb4b4376b346) Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
7e168c7
commit 669235a
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...plugins/infra/public/components/asset_details/tabs/overview/kpis/cpu_profiling_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { EuiButtonEmpty } from '@elastic/eui'; | ||
import { EuiBadge } from '@elastic/eui'; | ||
import { EuiFlexGroup } from '@elastic/eui'; | ||
import { usePluginConfig } from '../../../../../containers/plugin_config_context'; | ||
import { useTabSwitcherContext } from '../../../hooks/use_tab_switcher'; | ||
|
||
export function CpuProfilingPrompt() { | ||
const { showTab } = useTabSwitcherContext(); | ||
const { featureFlags } = usePluginConfig(); | ||
|
||
if (!featureFlags.profilingEnabled) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<EuiFlexGroup alignItems="center" justifyContent="flexStart" gutterSize="s"> | ||
<EuiBadge color="success"> | ||
{i18n.translate('xpack.infra.cpuProfilingPrompt.newBadgeLabel', { | ||
defaultMessage: 'NEW', | ||
})} | ||
</EuiBadge> | ||
<EuiFlexGroup alignItems="baseline" justifyContent="flexStart" gutterSize="xs"> | ||
{i18n.translate('xpack.infra.cpuProfilingPrompt.p.viewCPUBreakdownUsingLabel', { | ||
defaultMessage: 'View CPU Breakdown using', | ||
})} | ||
<EuiButtonEmpty | ||
data-test-subj="infraCpuProfilingPromptProfilingButton" | ||
onClick={() => showTab('profiling')} | ||
flush="both" | ||
> | ||
{i18n.translate('xpack.infra.cpuProfilingPrompt.profilingButtonEmptyLabel', { | ||
defaultMessage: 'Profiling', | ||
})} | ||
</EuiButtonEmpty> | ||
</EuiFlexGroup> | ||
</EuiFlexGroup> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters