diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js index f05496d9adeb7..3ddbe31bcd373 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js @@ -18,12 +18,13 @@ import { } from '@elastic/eui'; import './ccr.css'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; function toSeconds(ms) { return Math.floor(ms / 1000) + 's'; } -export class Ccr extends Component { +class CcrUI extends Component { constructor(props) { super(props); this.state = { @@ -32,6 +33,7 @@ export class Ccr extends Component { } toggleShards(index, shards) { + const { intl } = this.props; const itemIdToExpandedRowMap = { ...this.state.itemIdToExpandedRowMap }; @@ -54,7 +56,10 @@ export class Ccr extends Component { columns={[ { field: 'shardId', - name: 'Shard', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.shardsTable.shardColumnTitle', + defaultMessage: 'Shard' + }), render: shardId => { return ( @@ -68,7 +73,10 @@ export class Ccr extends Component { }, { field: 'syncLagOps', - name: 'Sync Lag (ops)', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.shardsTable.syncLagOpsColumnTitle', + defaultMessage: 'Sync Lag (ops)' + }), render: (syncLagOps, data) => ( {syncLagOps} @@ -78,9 +86,25 @@ export class Ccr extends Component { type="iInCircle" content={( - Leader lag: {data.syncLagOpsLeader} + + +
- Follower lag: {data.syncLagOpsFollower} + + +
)} position="right" @@ -90,16 +114,25 @@ export class Ccr extends Component { }, { field: 'syncLagTime', - name: 'Last fetch time', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.shardsTable.lastFetchTimeColumnTitle', + defaultMessage: 'Last fetch time' + }), render: syncLagTime => {toSeconds(syncLagTime)} }, { field: 'opsSynced', - name: 'Ops synced' + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.shardsTable.opsSyncedColumnTitle', + defaultMessage: 'Ops synced' + }), }, { field: 'error', - name: 'Error', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.shardsTable.errorColumnTitle', + defaultMessage: 'Error' + }), render: error => ( {error} @@ -116,7 +149,7 @@ export class Ccr extends Component { } renderTable() { - const { data } = this.props; + const { data, intl } = this.props; const items = data; let pagination = { @@ -141,7 +174,10 @@ export class Ccr extends Component { columns={[ { field: 'index', - name: 'Index', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.indexColumnTitle', + defaultMessage: 'Index' + }), sortable: true, render: (index, { shards }) => { const expanded = !!this.state.itemIdToExpandedRowMap[index]; @@ -157,28 +193,43 @@ export class Ccr extends Component { { field: 'follows', sortable: true, - name: 'Follows' + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.followsColumnTitle', + defaultMessage: 'Follows' + }), }, { field: 'syncLagOps', sortable: true, - name: 'Sync Lag (ops)', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.syncLagOpsColumnTitle', + defaultMessage: 'Sync Lag (ops)' + }), }, { field: 'syncLagTime', sortable: true, - name: 'Last fetch time', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.lastFetchTimeColumnTitle', + defaultMessage: 'Last fetch time' + }), render: syncLagTime => {toSeconds(syncLagTime)} }, { field: 'opsSynced', sortable: true, - name: 'Ops synced' + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.opsSyncedColumnTitle', + defaultMessage: 'Ops synced' + }), }, { field: 'error', sortable: true, - name: 'Error', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccr.ccrListingTable.errorColumnTitle', + defaultMessage: 'Error' + }), render: error => ( {error} @@ -209,3 +260,5 @@ export class Ccr extends Component { ); } } + +export const Ccr = injectI18n(CcrUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.test.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.test.js index 8df42974c6633..838d3fcb5c6c4 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.test.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.test.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallowWithIntl } from '../../../../../../test_utils/enzyme_helpers'; import { Ccr } from './ccr'; describe('Ccr', () => { @@ -67,7 +67,7 @@ describe('Ccr', () => { } ]; - const component = shallow(); + const component = shallowWithIntl(); expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/__snapshots__/ccr_shard.test.js.snap b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/__snapshots__/ccr_shard.test.js.snap index 70051f82611c5..aa5059ed84e16 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/__snapshots__/ccr_shard.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/__snapshots__/ccr_shard.test.js.snap @@ -16,7 +16,11 @@ exports[`CcrShard that is renders an exception properly 1`] = ` color="danger" component="span" > - Errors + @@ -63,7 +67,7 @@ exports[`CcrShard that it renders normally 1`] = ` -

- Advanced +

} diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js index 552b00dbeb8f3..872bfd94ca8fc 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js @@ -22,8 +22,9 @@ import { import { MonitoringTimeseriesContainer } from '../../chart'; import { Status } from './status'; import { formatDateTimeLocal } from '../../../../common/formatting'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -export class CcrShard extends PureComponent { +class CcrShardUI extends PureComponent { renderCharts() { const { metrics } = this.props; const seriesToShow = [ @@ -49,14 +50,19 @@ export class CcrShard extends PureComponent { } renderErrors() { - const { stat } = this.props; + const { stat, intl } = this.props; if (stat.read_exceptions && stat.read_exceptions.length > 0) { return (

- Errors + + +

@@ -64,11 +70,17 @@ export class CcrShard extends PureComponent { items={stat.read_exceptions} columns={[ { - name: 'Type', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.errorsTable.typeColumnTitle', + defaultMessage: 'Type' + }), field: 'exception.type' }, { - name: 'Reason', + name: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.errorsTable.reasonColumnTitle', + defaultMessage: 'Reason' + }), field: 'exception.reason', width: '75%' } @@ -88,7 +100,16 @@ export class CcrShard extends PureComponent { return (

Advanced

} + buttonContent={( + +

+ +

+
+ )} paddingSize="l" > @@ -123,3 +144,5 @@ export class CcrShard extends PureComponent { ); } } + +export const CcrShard = injectI18n(CcrShardUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.test.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.test.js index 40a0f32931d3e..cbd1ce79a383c 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.test.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.test.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallowWithIntl } from '../../../../../../test_utils/enzyme_helpers'; import { CcrShard } from './ccr_shard'; describe('CcrShard', () => { @@ -45,7 +45,7 @@ describe('CcrShard', () => { }; test('that it renders normally', () => { - const component = shallow(); + const component = shallowWithIntl(); expect(component).toMatchSnapshot(); }); @@ -63,7 +63,7 @@ describe('CcrShard', () => { } }; - const component = shallow(); + const component = shallowWithIntl(); expect(component.find('EuiPanel').get(0)).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/status.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/status.js index 969f6fe2fc45e..89da6c6d4fac3 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/status.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/status.js @@ -7,8 +7,9 @@ import React from 'react'; import { SummaryStatus } from '../../summary_status'; import { formatMetric } from '../../../lib/format_number'; +import { injectI18n } from '@kbn/i18n/react'; -export function Status({ stat, formattedLeader, oldestStat }) { +function StatusUI({ stat, formattedLeader, oldestStat, intl }) { const { follower_index: followerIndex, shard_id: shardId, @@ -23,27 +24,42 @@ export function Status({ stat, formattedLeader, oldestStat }) { const metrics = [ { - label: 'Follower Index', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.status.followerIndexLabel', + defaultMessage: 'Follower Index', + }), value: followerIndex, dataTestSubj: 'followerIndex' }, { - label: 'Shard Id', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.status.shardIdLabel', + defaultMessage: 'Shard Id', + }), value: shardId, dataTestSubj: 'shardId' }, { - label: 'Leader Index', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.status.leaderIndexLabel', + defaultMessage: 'Leader Index', + }), value: formattedLeader, dataTestSubj: 'leaderIndex' }, { - label: 'Ops Synced', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.status.opsSyncedLabel', + defaultMessage: 'Ops Synced', + }), value: formatMetric(operationsReceived - oldestOperationsReceived, 'int_commas'), dataTestSubj: 'operationsReceived' }, { - label: 'Failed Fetches', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.ccrShard.status.failedFetchesLabel', + defaultMessage: 'Failed Fetches', + }), value: formatMetric(failedFetches - oldestFailedFetches, 'int_commas'), dataTestSubj: 'failedFetches' }, @@ -56,3 +72,5 @@ export function Status({ stat, formattedLeader, oldestStat }) { /> ); } + +export const Status = injectI18n(StatusUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/cluster_status/index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/cluster_status/index.js index 9fc2ba4c1e8e3..a7d007e4d22f1 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/cluster_status/index.js @@ -8,8 +8,9 @@ import React from 'react'; import { SummaryStatus } from '../../summary_status'; import { ElasticsearchStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; +import { injectI18n } from '@kbn/i18n/react'; -export function ClusterStatus({ stats }) { +function ClusterStatusUI({ stats, intl }) { const { dataSize, nodesCount, @@ -24,37 +25,58 @@ export function ClusterStatus({ stats }) { const metrics = [ { - label: 'Nodes', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.nodesLabel', + defaultMessage: 'Nodes', + }), value: nodesCount, dataTestSubj: 'nodesCount' }, { - label: 'Indices', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.indicesLabel', + defaultMessage: 'Indices', + }), value: indicesCount, dataTestSubj: 'indicesCount' }, { - label: 'Memory', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.memoryLabel', + defaultMessage: 'Memory', + }), value: formatMetric(memUsed, 'byte') + ' / ' + formatMetric(memMax, 'byte'), dataTestSubj: 'memory' }, { - label: 'Total Shards', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.totalShardsLabel', + defaultMessage: 'Total Shards', + }), value: totalShards, dataTestSubj: 'totalShards' }, { - label: 'Unassigned Shards', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.unassignedShardsLabel', + defaultMessage: 'Unassigned Shards', + }), value: unassignedShards, dataTestSubj: 'unassignedShards' }, { - label: 'Documents', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.documentsLabel', + defaultMessage: 'Documents', + }), value: formatMetric(documentCount, 'int_commas'), dataTestSubj: 'documentCount' }, { - label: 'Data', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.clusterStatus.dataLabel', + defaultMessage: 'Data', + }), value: formatMetric(dataSize, 'byte'), dataTestSubj: 'dataSize' } @@ -73,3 +95,5 @@ export function ClusterStatus({ stats }) { /> ); } + +export const ClusterStatus = injectI18n(ClusterStatusUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js index 2eb378b298085..55e65608b81f7 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js @@ -8,8 +8,9 @@ import React, { Fragment } from 'react'; import { SummaryStatus } from '../../summary_status'; import { ElasticsearchStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -export function IndexDetailStatus({ stats }) { +function IndexDetailStatusUI({ stats, intl }) { const { dataSize, documents: documentCount, @@ -20,27 +21,42 @@ export function IndexDetailStatus({ stats }) { const metrics = [ { - label: 'Total', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indexDetailStatus.totalTitle', + defaultMessage: 'Total', + }), value: formatMetric(dataSize.total, '0.0 b'), dataTestSubj: 'dataSize' }, { - label: 'Primaries', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indexDetailStatus.primariesTitle', + defaultMessage: 'Primaries', + }), value: formatMetric(dataSize.primaries, '0.0 b'), dataTestSubj: 'dataSizePrimaries' }, { - label: 'Documents', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indexDetailStatus.documentsTitle', + defaultMessage: 'Documents', + }), value: formatMetric(documentCount, '0.[0]a'), dataTestSubj: 'documentCount' }, { - label: 'Total Shards', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indexDetailStatus.totalShardsTitle', + defaultMessage: 'Total Shards', + }), value: formatMetric(totalShards, 'int_commas'), dataTestSubj: 'totalShards' }, { - label: 'Unassigned Shards', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indexDetailStatus.unassignedShardsTitle', + defaultMessage: 'Unassigned Shards', + }), value: formatMetric(unassignedShards, 'int_commas'), dataTestSubj: 'unassignedShards' } @@ -48,7 +64,15 @@ export function IndexDetailStatus({ stats }) { const IconComponent = ({ status }) => ( - Health: + + ) + }} + /> ); @@ -61,3 +85,5 @@ export function IndexDetailStatus({ stats }) { /> ); } + +export const IndexDetailStatus = injectI18n(IndexDetailStatusUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js index bd497142ad846..ba41ea8fb82d6 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js @@ -15,18 +15,57 @@ import { MonitoringTable } from '../../table'; import { EuiLink } from '@elastic/eui'; import { KuiTableRowCell, KuiTableRow } from '@kbn/ui-framework/components'; import { SystemIndicesCheckbox } from './system_indices_checkbox'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; const filterFields = ['name', 'status']; const columns = [ - { title: 'Name', sortKey: 'name', secondarySortOrder: SORT_ASCENDING }, - { title: 'Status', sortKey: 'status_sort', sortOrder: SORT_DESCENDING }, // default sort: red, then yellow, then green - { title: 'Document Count', sortKey: 'doc_count' }, - { title: 'Data', sortKey: 'data_size' }, - { title: 'Index Rate', sortKey: 'index_rate' }, - { title: 'Search Rate', sortKey: 'search_rate' }, - { title: 'Unassigned Shards', sortKey: 'unassigned_shards' } + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.nameTitle', { + defaultMessage: 'Name', + }), + sortKey: 'name', + secondarySortOrder: SORT_ASCENDING + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.statusTitle', { + defaultMessage: 'Status', + }), + sortKey: 'status_sort', + sortOrder: SORT_DESCENDING // default sort: red, then yellow, then green + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.documentCountTitle', { + defaultMessage: 'Document Count', + }), + sortKey: 'doc_count' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.dataTitle', { + defaultMessage: 'Data', + }), + sortKey: 'data_size' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.indexRateTitle', { + defaultMessage: 'Index Rate', + }), + sortKey: 'index_rate' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.searchRateTitle', { + defaultMessage: 'Search Rate', + }), + sortKey: 'search_rate' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.indices.unassignedShardsTitle', { + defaultMessage: 'Unassigned Shards', + }), + sortKey: 'unassigned_shards' + } ]; -const IndexRow = ({ status, ...props }) => ( +const IndexRow = injectI18n(({ status, ...props }) => ( ( -
+
  {capitalize(status)}
@@ -58,26 +103,45 @@ const IndexRow = ({ status, ...props }) => ( {formatMetric(get(props, 'unassigned_shards'), '0')} -); +)); const getNoDataMessage = filterText => { + const howToShowSystemIndicesDescription = ( + + ); if (filterText) { return (

- There are no indices that match your selection with the filter [{filterText.trim()}]. - Try changing the filter or the time range selection. +

- If you are looking for system indices (e.g., .kibana), try checking ‘Show system indices’. + {howToShowSystemIndicesDescription}

); } return (
-

There are no indices that match your selections. Try changing the time range selection.

-

If you are looking for system indices (e.g., .kibana), try checking ‘Show system indices’.

+

+ +

+

+ {howToShowSystemIndicesDescription} +

); }; @@ -90,7 +154,7 @@ const renderToolBarSection = ({ showSystemIndices, toggleShowSystemIndices, ...p /> ); -export function ElasticsearchIndices({ clusterStatus, indices, ...props }) { +function ElasticsearchIndicesUI({ clusterStatus, indices, intl, ...props }) { return ( @@ -102,7 +166,10 @@ export function ElasticsearchIndices({ clusterStatus, indices, ...props }) { sortKey={props.sortKey} sortOrder={props.sortOrder} onNewState={props.onNewState} - placeholder="Filter Indices..." + placeholder={intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.indices.monitoringTablePlaceholder', + defaultMessage: 'Filter Indices…', + })} filterFields={filterFields} renderToolBarSections={renderToolBarSection} columns={columns} @@ -115,3 +182,4 @@ export function ElasticsearchIndices({ clusterStatus, indices, ...props }) { ); } +export const ElasticsearchIndices = injectI18n(ElasticsearchIndicesUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/system_indices_checkbox.js b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/system_indices_checkbox.js index 4620d144f24bc..4d341f00b4c93 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/system_indices_checkbox.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/system_indices_checkbox.js @@ -13,6 +13,7 @@ import { EuiSwitch, } from '@elastic/eui'; import { TABLE_ACTION_RESET_PAGING } from '../../../../common/constants'; +import { FormattedMessage } from '@kbn/i18n/react'; export class SystemIndicesCheckbox extends React.Component { constructor(props) { @@ -31,7 +32,12 @@ export class SystemIndicesCheckbox extends React.Component { + )} onChange={this.toggleShowSystemIndices} checked={this.state.showSystemIndices} /> diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ml_job_listing/status_icon.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ml_job_listing/status_icon.js index 58063a35434bd..110cfc9f06e2a 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ml_job_listing/status_icon.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ml_job_listing/status_icon.js @@ -6,8 +6,9 @@ import React from 'react'; import { StatusIcon } from 'plugins/monitoring/components/status_icon'; +import { injectI18n } from '@kbn/i18n/react'; -export function MachineLearningJobStatusIcon({ status }) { +export function MachineLearningJobStatusIconUI({ status, intl }) { const type = (() => { const statusKey = status.toUpperCase(); @@ -24,6 +25,14 @@ export function MachineLearningJobStatusIcon({ status }) { })(); return ( - + ); } + +export const MachineLearningJobStatusIcon = injectI18n(MachineLearningJobStatusIconUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node/status_icon.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node/status_icon.js index 5a7ed469eba35..73d9abcf59904 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node/status_icon.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node/status_icon.js @@ -6,11 +6,20 @@ import React from 'react'; import { StatusIcon } from '../../status_icon'; +import { injectI18n } from '@kbn/i18n/react'; -export function NodeStatusIcon({ isOnline, status }) { +export function NodeStatusIconUI({ isOnline, status, intl }) { const type = isOnline ? StatusIcon.TYPES.GREEN : StatusIcon.TYPES.GRAY; return ( - + ); } + +export const NodeStatusIcon = injectI18n(NodeStatusIconUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js index 099114baa253c..a901a36c7325a 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node_detail_status/index.js @@ -8,8 +8,9 @@ import React, { Fragment } from 'react'; import { SummaryStatus } from '../../summary_status'; import { NodeStatusIcon } from '../node'; import { formatMetric } from '../../../lib/format_number'; +import { injectI18n } from '@kbn/i18n/react'; -export function NodeDetailStatus({ stats }) { +function NodeDetailStatusUI({ stats, intl }) { const { transport_address: transportAddress, usedHeap, @@ -29,37 +30,59 @@ export function NodeDetailStatus({ stats }) { dataTestSubj: 'transportAddress' }, { - label: 'JVM Heap', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.jvmHeapLabel', + defaultMessage: '{javaVirtualMachine} Heap' }, { + javaVirtualMachine: 'JVM' + }), value: formatMetric(usedHeap, '0,0.[00]', '%', { prependSpace: false }), dataTestSubj: 'jvmHeap' }, { - label: 'Free Disk Space', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.freeDiskSpaceLabel', + defaultMessage: 'Free Disk Space', + }), value: formatMetric(freeSpace, '0.0 b'), dataTestSubj: 'freeDiskSpace' }, { - label: 'Documents', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.documentsLabel', + defaultMessage: 'Documents', + }), value: formatMetric(documents, '0.[0]a'), dataTestSubj: 'documentCount' }, { - label: 'Data', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.dataLabel', + defaultMessage: 'Data', + }), value: formatMetric(dataSize, '0.0 b'), dataTestSubj: 'dataSize' }, { - label: 'Indices', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.indicesLabel', + defaultMessage: 'Indices', + }), value: formatMetric(indexCount, 'int_commas'), dataTestSubj: 'indicesCount' }, { - label: 'Shards', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.shardsLabel', + defaultMessage: 'Shards', + }), value: formatMetric(totalShards, 'int_commas'), dataTestSubj: 'shardsCount' }, { - label: 'Type', + label: intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodeDetailStatus.typeLabel', + defaultMessage: 'Type', + }), value: nodeTypeLabel, dataTestSubj: 'nodeType' } @@ -81,3 +104,5 @@ export function NodeDetailStatus({ stats }) { /> ); } + +export const NodeDetailStatus = injectI18n(NodeDetailStatusUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__tests__/cells.test.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__tests__/cells.test.js index 39a7b2e62307a..bdd453bb976cf 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__tests__/cells.test.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__tests__/cells.test.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../../test_utils/enzyme_helpers'; import { MetricCell } from '../cells'; describe('Node Listing Metric Cell', () => { @@ -28,7 +28,7 @@ describe('Node Listing Metric Cell', () => { summary: { minVal: 0, maxVal: 2, lastVal: 0, slope: -1 } } }; - expect(render()).toMatchSnapshot(); + expect(renderWithIntl()).toMatchSnapshot(); }); it('should format a non-percentage metric', () => { @@ -55,11 +55,11 @@ describe('Node Listing Metric Cell', () => { } } }; - expect(render()).toMatchSnapshot(); + expect(renderWithIntl()).toMatchSnapshot(); }); it('should format N/A as the metric for an offline node', () => { const props = { isOnline: false }; - expect(render()).toMatchSnapshot(); + expect(renderWithIntl()).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js index a6faa0433351f..8fb336a8fc85e 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/cells.js @@ -8,12 +8,16 @@ import React from 'react'; import { get } from 'lodash'; import { formatMetric } from '../../../lib/format_number'; import { KuiTableRowCell } from '@kbn/ui-framework/components'; +import { FormattedMessage } from '@kbn/i18n/react'; function OfflineCell() { return (
- N/A +
); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 7129f7c09dc8e..9f05ccf50ed15 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -14,25 +14,72 @@ import { MonitoringTable } from '../../table'; import { MetricCell, OfflineCell } from './cells'; import { EuiLink, EuiToolTip } from '@elastic/eui'; import { KuiTableRowCell, KuiTableRow } from '@kbn/ui-framework/components'; +import { i18n } from '@kbn/i18n'; +import { injectI18n } from '@kbn/i18n/react'; const filterFields = ['name']; const getColumns = showCgroupMetricsElasticsearch => { const cols = []; - cols.push({ title: 'Name', sortKey: 'name', sortOrder: SORT_ASCENDING }); - cols.push({ title: 'Status', sortKey: 'isOnline' }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.nameColumnTitle', { + defaultMessage: 'Name', + }), + sortKey: 'name', + sortOrder: SORT_ASCENDING + }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.statusColumnTitle', { + defaultMessage: 'Status', + }), + sortKey: 'isOnline' + }); + const cpuUsageColumnTitle = i18n.translate('xpack.monitoring.elasticsearch.nodes.cpuUsageColumnTitle', { + defaultMessage: 'CPU Usage', + }); if (showCgroupMetricsElasticsearch) { - cols.push({ title: 'CPU Usage', sortKey: 'node_cgroup_quota' }); cols.push({ - title: 'CPU Throttling', + title: cpuUsageColumnTitle, + sortKey: 'node_cgroup_quota' + }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.cpuThrottlingColumnTitle', { + defaultMessage: 'CPU Throttling', + }), sortKey: 'node_cgroup_throttled' }); } else { - cols.push({ title: 'CPU Usage', sortKey: 'node_cpu_utilization' }); - cols.push({ title: 'Load Average', sortKey: 'node_load_average' }); + cols.push({ + title: cpuUsageColumnTitle, + sortKey: 'node_cpu_utilization' + }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.loadAverageColumnTitle', { + defaultMessage: 'Load Average', + }), + sortKey: 'node_load_average' + }); } - cols.push({ title: 'JVM Memory', sortKey: 'node_jvm_mem_percent' }); - cols.push({ title: 'Disk Free Space', sortKey: 'node_free_space' }); - cols.push({ title: 'Shards', sortKey: 'shardCount' }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.jvmMemoryColumnTitle', { + defaultMessage: '{javaVirtualMachine} Memory', + values: { + javaVirtualMachine: 'JVM' + } + }), + sortKey: 'node_jvm_mem_percent' + }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.diskFreeSpaceColumnTitle', { + defaultMessage: 'Disk Free Space', + }), + sortKey: 'node_free_space' + }); + cols.push({ + title: i18n.translate('xpack.monitoring.elasticsearch.nodes.shardsColumnTitle', { + defaultMessage: 'Shards', + }), + sortKey: 'shardCount' + }); return cols; }; @@ -154,7 +201,7 @@ const nodeRowFactory = showCgroupMetricsElasticsearch => { }; }; -export function ElasticsearchNodes({ clusterStatus, nodes, showCgroupMetricsElasticsearch, ...props }) { +function ElasticsearchNodesUI({ clusterStatus, nodes, showCgroupMetricsElasticsearch, intl, ...props }) { const columns = getColumns(showCgroupMetricsElasticsearch); return ( @@ -169,7 +216,10 @@ export function ElasticsearchNodes({ clusterStatus, nodes, showCgroupMetricsElas sortKey={props.sortKey} sortOrder={props.sortOrder} onNewState={props.onNewState} - placeholder="Filter Nodes..." + placeholder={intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.nodes.monitoringTablePlaceholder', + defaultMessage: 'Filter Nodes…', + })} filterFields={filterFields} columns={columns} rowComponent={nodeRowFactory(showCgroupMetricsElasticsearch)} @@ -177,3 +227,5 @@ export function ElasticsearchNodes({ clusterStatus, nodes, showCgroupMetricsElas
); } + +export const ElasticsearchNodes = injectI18n(ElasticsearchNodesUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js index c014b41785e03..b40938ba3a96a 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js @@ -5,6 +5,7 @@ */ import React, { Fragment } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; export const FilesProgress = ({ filesPercent, filesDone, filesTotal }) => { return ( @@ -30,6 +31,11 @@ export const TranslogProgress = ({ hasTranslog, translogPercent, translogDone, t {translogPercent}
{translogDone} / {translogTotal} - ) : 'n/a'; + ) : ( + + ); }; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js index f33401f06d655..45c1a432a491d 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js @@ -7,6 +7,7 @@ import React, { Fragment } from 'react'; import { EuiLink } from '@elastic/eui'; import { Snapshot } from './snapshot'; +import { FormattedMessage } from '@kbn/i18n/react'; export const RecoveryIndex = (props) => { const { name, shard, relocationType } = props; @@ -14,8 +15,20 @@ export const RecoveryIndex = (props) => { return ( {name}
- Shard: {shard}
- Recovery type: {relocationType} +
+
diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js index eec1e8ec49542..b41424bc6620f 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js @@ -18,15 +18,52 @@ import { TotalTime } from './total_time'; import { SourceDestination } from './source_destination'; import { FilesProgress, BytesProgress, TranslogProgress } from './progress'; import { parseProps } from './parse_props'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; const columns = [ - { title: 'Index', sortKey: null }, - { title: 'Stage', sortKey: null }, - { title: 'Total Time', sortKey: null }, - { title: 'Source / Destination', sortKey: null }, - { title: 'Files', sortKey: null }, - { title: 'Bytes', sortKey: null }, - { title: 'Translog', sortKey: null } + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.indexTitle', { + defaultMessage: 'Index' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.stageTitle', { + defaultMessage: 'Stage' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.totalTimeTitle', { + defaultMessage: 'Total Time' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.sourceDestinationTitle', { + defaultMessage: 'Source / Destination' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.filesTitle', { + defaultMessage: 'Files' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.bytesTitle', { + defaultMessage: 'Bytes' + }), + sortKey: null + }, + { + title: i18n.translate('xpack.monitoring.kibana.shardActivity.translogTitle', { + defaultMessage: 'Translog' + }), + sortKey: null + } ]; const ActivityRow = props => ( @@ -57,7 +94,12 @@ const ToggleCompletedSwitch = ({ toggleHistory, showHistory }) => ( + )} onChange={toggleHistory} checked={showHistory} /> @@ -65,7 +107,7 @@ const ToggleCompletedSwitch = ({ toggleHistory, showHistory }) => ( ); -export class ShardActivity extends React.Component { +class ShardActivityUI extends React.Component { constructor(props) { super(props); this.getNoDataMessage = this.getNoDataMessage.bind(this); @@ -73,12 +115,31 @@ export class ShardActivity extends React.Component { getNoDataMessage() { if (this.props.showShardActivityHistory) { - return 'There are no historical shard activity records for the selected time range.'; + return this.props.intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.shardActivity.noDataMessage', + defaultMessage: 'There are no historical shard activity records for the selected time range.' + }); } return ( - There are no active shard recoveries for this cluster.
- Try viewing completed recoveries. +
+ + + + ) + }} + />
); } @@ -102,7 +163,12 @@ export class ShardActivity extends React.Component { -

Shard Activity

+

+ +

@@ -120,3 +186,5 @@ export class ShardActivity extends React.Component { ); } } + +export const ShardActivity = injectI18n(ShardActivityUI); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js index be7b5daece091..ece2fae9b7a7a 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js @@ -5,11 +5,19 @@ */ import React, { Fragment } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; export const Snapshot = ({ isSnapshot, repo, snapshot }) => { return isSnapshot ? ( - Repo: {repo} / Snapshot: {snapshot} + ) : null; }; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js index 440cf56fde33f..0325d077cab82 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js @@ -7,6 +7,7 @@ import React, { Fragment } from 'react'; import { EuiLink } from '@elastic/eui'; import { Tooltip } from 'plugins/monitoring/components/tooltip'; +import { FormattedMessage } from '@kbn/i18n/react'; export const SourceTooltip = ({ isCopiedFromPrimary, sourceTransportAddress, children }) => { if (!sourceTransportAddress) { @@ -17,7 +18,24 @@ export const SourceTooltip = ({ isCopiedFromPrimary, sourceTransportAddress, chi {sourceTransportAddress}
- Copied from { isCopiedFromPrimary ? 'primary' : 'replica' } shard + + ) : ( + + ), + }} + />
); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js index c55531dfdee7c..a456646218f06 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js @@ -7,10 +7,23 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { Tooltip } from 'plugins/monitoring/components/tooltip'; +import { FormattedMessage } from '@kbn/i18n/react'; export const TotalTime = ({ startTime, totalTime }) => { return ( - + + } + placement="bottom" + trigger="hover" + > {totalTime} ); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/status_icon.js b/x-pack/plugins/monitoring/public/components/elasticsearch/status_icon.js index 623fbbfde30a6..0015071d08228 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/status_icon.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/status_icon.js @@ -6,14 +6,25 @@ import React from 'react'; import { StatusIcon } from '../status_icon'; +import { injectI18n } from '@kbn/i18n/react'; -export function ElasticsearchStatusIcon({ status }) { +function ElasticsearchStatusIconUI({ intl, status }) { const type = (() => { const statusKey = status.toUpperCase(); return StatusIcon.TYPES[statusKey] || StatusIcon.TYPES.GRAY; })(); return ( - + ); } + +export const ElasticsearchStatusIcon = injectI18n(ElasticsearchStatusIconUI); diff --git a/x-pack/plugins/monitoring/public/components/kibana/cluster_status/index.js b/x-pack/plugins/monitoring/public/components/kibana/cluster_status/index.js index 20fa1fcbdee00..28b2dbbc87ca6 100644 --- a/x-pack/plugins/monitoring/public/components/kibana/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/components/kibana/cluster_status/index.js @@ -8,8 +8,9 @@ import React from 'react'; import { SummaryStatus } from '../../summary_status'; import { KibanaStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; +import { injectI18n } from '@kbn/i18n/react'; -export function ClusterStatus({ stats }) { +function ClusterStatusUI({ stats, intl }) { const { concurrent_connections: connections, count: instances, @@ -22,27 +23,42 @@ export function ClusterStatus({ stats }) { const metrics = [ { - label: 'Instances', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.clusterStatus.instancesLabel', + defaultMessage: 'Instances' + }), value: instances, dataTestSubj: 'instances' }, { - label: 'Memory', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.clusterStatus.memoryLabel', + defaultMessage: 'Memory' + }), value: formatMetric(memSize, 'byte') + ' / ' + formatMetric(memLimit, 'byte'), dataTestSubj: 'memory' }, { - label: 'Requests', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.clusterStatus.requestsLabel', + defaultMessage: 'Requests' + }), value: requests, dataTestSubj: 'requests' }, { - label: 'Connections', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.clusterStatus.connectionsLabel', + defaultMessage: 'Connections' + }), value: connections, dataTestSubj: 'connections' }, { - label: 'Max. Response Time', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.clusterStatus.maxResponseTimeLabel', + defaultMessage: 'Max. Response Time' + }), value: formatMetric(maxResponseTime, '0', 'ms'), dataTestSubj: 'maxResponseTime' } @@ -61,3 +77,5 @@ export function ClusterStatus({ stats }) { /> ); } + +export const ClusterStatus = injectI18n(ClusterStatusUI); diff --git a/x-pack/plugins/monitoring/public/components/kibana/detail_status/index.js b/x-pack/plugins/monitoring/public/components/kibana/detail_status/index.js index bffe4082a2b62..b8b4cd2ce498b 100644 --- a/x-pack/plugins/monitoring/public/components/kibana/detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/kibana/detail_status/index.js @@ -8,8 +8,9 @@ import React from 'react'; import { SummaryStatus } from '../../summary_status'; import { KibanaStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; +import { injectI18n } from '@kbn/i18n/react'; -export function DetailStatus({ stats }) { +function DetailStatusUI({ stats, intl }) { const { transport_address: transportAddress, os_memory_free: osFreeMemory, @@ -24,17 +25,26 @@ export function DetailStatus({ stats }) { dataTestSubj: 'transportAddress' }, { - label: 'OS Free Memory', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.detailStatus.osFreeMemoryLabel', + defaultMessage: 'OS Free Memory' + }), value: formatMetric(osFreeMemory, 'byte'), dataTestSubj: 'osFreeMemory' }, { - label: 'Version', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.detailStatus.versionLabel', + defaultMessage: 'Version' + }), value: version, dataTestSubj: 'version' }, { - label: 'Uptime', + label: intl.formatMessage({ + id: 'xpack.monitoring.kibana.detailStatus.uptimeLabel', + defaultMessage: 'Uptime' + }), value: formatMetric(uptime, 'time_since'), dataTestSubj: 'uptime' } @@ -53,3 +63,5 @@ export function DetailStatus({ stats }) { /> ); } + +export const DetailStatus = injectI18n(DetailStatusUI); diff --git a/x-pack/plugins/monitoring/public/components/kibana/status_icon.js b/x-pack/plugins/monitoring/public/components/kibana/status_icon.js index a9fa9e163289f..6ce9f2dc5bea6 100644 --- a/x-pack/plugins/monitoring/public/components/kibana/status_icon.js +++ b/x-pack/plugins/monitoring/public/components/kibana/status_icon.js @@ -6,8 +6,9 @@ import React from 'react'; import { StatusIcon } from 'plugins/monitoring/components/status_icon'; +import { injectI18n } from '@kbn/i18n/react'; -export function KibanaStatusIcon({ status, availability = true }) { +function KibanaStatusIconUI({ status, availability = true, intl }) { const type = (() => { if (!availability) { return StatusIcon.TYPES.GRAY; @@ -18,6 +19,15 @@ export function KibanaStatusIcon({ status, availability = true }) { })(); return ( - + ); } + +export const KibanaStatusIcon = injectI18n(KibanaStatusIconUI); diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js index 0be64b18406a8..7f0d5a665c334 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { render } from 'react-dom'; import { uiModules } from 'ui/modules'; import { ClusterStatus } from 'plugins/monitoring/components/elasticsearch/cluster_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringClusterStatusElasticsearch', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringClusterStatusElasticsearch', () => { }, link(scope, $el) { scope.$watch('status', status => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js index e1fa222a0ee80..24e48609c4781 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { render } from 'react-dom'; import { uiModules } from 'ui/modules'; import { IndexDetailStatus } from 'plugins/monitoring/components/elasticsearch/index_detail_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringIndexSummary', () => { @@ -16,7 +17,7 @@ uiModule.directive('monitoringIndexSummary', () => { scope: { summary: '=' }, link(scope, $el) { scope.$watch('summary', summary => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js index 638e2423233ef..81a8a55f58b0a 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { render } from 'react-dom'; import { uiModules } from 'ui/modules'; import { NodeDetailStatus } from 'plugins/monitoring/components/elasticsearch/node_detail_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringNodeSummary', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringNodeSummary', () => { }, link(scope, $el) { scope.$watch('node', node => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js b/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js index 1582966b5951d..1fd57f1b5c2c4 100644 --- a/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { render } from 'react-dom'; import { uiModules } from 'ui/modules'; import { ClusterStatus } from 'plugins/monitoring/components/kibana/cluster_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringClusterStatusKibana', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringClusterStatusKibana', () => { }, link(scope, $el) { scope.$watch('status', status => { - render(, $el[0]); + render(, $el[0]); }); }, }; diff --git a/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js b/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js index 1077ed579420a..521fc37a650ce 100644 --- a/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js +++ b/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { render } from 'react-dom'; import { uiModules } from 'ui/modules'; import { DetailStatus } from 'plugins/monitoring/components/kibana/detail_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringKibanaSummary', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringKibanaSummary', () => { }, link(scope, $el) { scope.$watch('kibana', kibana => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js index a2404273d38e1..d4f52621f3723 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js @@ -11,6 +11,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init'; import template from './index.html'; import { Ccr } from '../../../components/elasticsearch/ccr'; import { MonitoringViewBaseController } from '../../base_controller'; +import { I18nProvider } from '@kbn/i18n/react'; uiRoutes.when('/elasticsearch/ccr', { template, @@ -40,7 +41,9 @@ uiRoutes.when('/elasticsearch/ccr', { this.renderReact = ({ data }) => { super.renderReact( - + + + ); }; } diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js index ddf67ac09e79c..554aaaea31969 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js @@ -12,6 +12,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init'; import template from './index.html'; import { MonitoringViewBaseController } from '../../../base_controller'; import { CcrShard } from '../../../../components/elasticsearch/ccr_shard'; +import { I18nProvider } from '@kbn/i18n/react'; uiRoutes.when('/elasticsearch/ccr/:index/shard/:shardId', { template, @@ -49,7 +50,7 @@ uiRoutes.when('/elasticsearch/ccr/:index/shard/:shardId', { this.renderReact = (props) => { super.renderReact( - + ); }; }