From 8378d308c83a55207350bab94a57f9f51df3fd84 Mon Sep 17 00:00:00 2001 From: Igor Zaytsev Date: Tue, 17 Dec 2019 13:06:35 -0500 Subject: [PATCH] initial changes --- .../public/components/alerts/alerts.js | 4 ++++ .../cluster/listing/alerts_indicator.js | 4 ++++ .../components/cluster/listing/listing.js | 5 +++++ .../cluster/overview/elasticsearch_panel.js | 2 +- .../components/elasticsearch/nodes/nodes.js | 20 +++++++++++++++---- .../shard_activity/source_destination.js | 12 ++++++----- .../shard_allocation/components/shard.js | 8 ++------ .../public/components/table/eui_table_ssp.js | 5 +++++ 8 files changed, 44 insertions(+), 16 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/public/components/alerts/alerts.js b/x-pack/legacy/plugins/monitoring/public/components/alerts/alerts.js index 908e369ec0386..d320f410a2149 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/alerts/alerts.js +++ b/x-pack/legacy/plugins/monitoring/public/components/alerts/alerts.js @@ -31,6 +31,10 @@ const getColumns = (kbnUrl, scope) => [ render: severity => { const severityIcon = mapSeverity(severity); + if (!severityIcon || !severityIcon.title) { + return null; + } + return ( diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js index 432aa124e6069..ac56736cb080b 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/listing/listing.js @@ -46,6 +46,11 @@ const IsAlertsSupported = props => { } const message = alertsMeta.message || clusterMeta.message; + + if (!message || !message.length) { + return null; + } + return ( diff --git a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js index 7ce3e890cdeaf..07a8b73c28cfd 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js +++ b/x-pack/legacy/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js @@ -124,7 +124,7 @@ function renderLog(log) { {log.levels.map((level, index) => ( - + {formatNumber(level.count, 'int_commas')} diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 74aea88e812f6..3a2b4ec30fefe 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -29,6 +29,21 @@ import _ from 'lodash'; import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; import { ListingCallOut } from '../../setup_mode/listing_callout'; +const getNodeTooltip = node => { + const { nodeTypeLabel, nodeTypeClass } = node; + if (nodeTypeLabel) { + return ( + <> + + {nodeTypeClass && } + {' '} +   + + ); + } + return null; +}; + const getSortHandler = type => item => _.get(item, [type, 'summary', 'lastVal']); const getColumns = (showCgroupMetricsElasticsearch, setupMode, clusterUuid) => { const cols = []; @@ -86,10 +101,7 @@ const getColumns = (showCgroupMetricsElasticsearch, setupMode, clusterUuid) => {
- - {node.nodeTypeClass && } - -   + {getNodeTooltip(node)} {nameLink}
diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_activity/source_destination.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_activity/source_destination.js index febdf1835faf5..18bf7c96c6a1b 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_activity/source_destination.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_activity/source_destination.js @@ -18,11 +18,13 @@ export const SourceDestination = props => { - - - {targetName} - - + {targetTransportAddress && ( + + + {targetName} + + + )} ); }; diff --git a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/shard.js b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/shard.js index ac70f952008c5..d72e3d9fac21d 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/shard.js +++ b/x-pack/legacy/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/shard.js @@ -96,13 +96,9 @@ export class Shard extends React.Component { let shardUi = {shard.shard}; - if (this.state.tooltipVisible) { + if (this.state.tooltipVisible && shard.tooltip_message) { shardUi = ( - +

{shardUi}

); diff --git a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table_ssp.js b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table_ssp.js index 4d87548cb8ddd..78e5917c5d9af 100644 --- a/x-pack/legacy/plugins/monitoring/public/components/table/eui_table_ssp.js +++ b/x-pack/legacy/plugins/monitoring/public/components/table/eui_table_ssp.js @@ -26,6 +26,11 @@ export function EuiMonitoringSSPTable({ index: pagination.pageIndex, size: pagination.pageSize, }); + + if (!pagination.totalItemCount) { + pagination.totalItemCount = (items && items.length) || 0; + } + const [sort, setSort] = React.useState(props.sorting); if (search.box && !search.box['data-test-subj']) {