diff --git a/.i18nrc.json b/.i18nrc.json index cfef3cf80c631..68fa80b55fe6a 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -17,6 +17,7 @@ "xpack.grokDebugger": "x-pack/plugins/grokdebugger", "xpack.idxMgmt": "x-pack/plugins/index_management", "xpack.licenseMgmt": "x-pack/plugins/license_management", + "xpack.monitoring": "x-pack/plugins/monitoring", "xpack.rollupJobs": "x-pack/plugins/rollup", "xpack.searchProfiler": "x-pack/plugins/searchprofiler", "xpack.security": "x-pack/plugins/security", diff --git a/x-pack/plugins/monitoring/public/components/logstash/cluster_status/index.js b/x-pack/plugins/monitoring/public/components/logstash/cluster_status/index.js index 923cd9e17d93e..2666924c9e0e8 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/components/logstash/cluster_status/index.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 ClusterStatus({ stats }) { +function ClusterStatusUi({ stats, intl }) { const { node_count: nodeCount, avg_memory_used: avgMemoryUsed, @@ -19,22 +20,30 @@ export function ClusterStatus({ stats }) { const metrics = [ { - label: 'Nodes', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.clusterStatus.nodesLabel', defaultMessage: 'Nodes' + }), value: nodeCount, dataTestSubj: 'node_count' }, { - label: 'Memory', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.clusterStatus.memoryLabel', defaultMessage: 'Memory' + }), value: formatMetric(avgMemoryUsed, 'byte') + ' / ' + formatMetric(avgMemory, 'byte'), dataTestSubj: 'memory_used' }, { - label: 'Events Received', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.clusterStatus.eventsReceivedLabel', defaultMessage: 'Events Received' + }), value: formatMetric(eventsInTotal, '0.[0]a'), dataTestSubj: 'events_in_total' }, { - label: 'Events Emitted', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.clusterStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted' + }), value: formatMetric(eventsOutTotal, '0.[0]a'), dataTestSubj: 'events_out_total' } @@ -47,3 +56,5 @@ export function ClusterStatus({ stats }) { /> ); } + +export const ClusterStatus = injectI18n(ClusterStatusUi); diff --git a/x-pack/plugins/monitoring/public/components/logstash/detail_status/index.js b/x-pack/plugins/monitoring/public/components/logstash/detail_status/index.js index a441396f40656..c4ec3768dfc0b 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/logstash/detail_status/index.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 DetailStatus({ stats }) { +function DetailStatusUi({ stats, intl }) { const { http_address: httpAddress, events, @@ -25,27 +26,37 @@ export function DetailStatus({ stats }) { dataTestSubj: 'httpAddress' }, { - label: 'Events Received', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.eventsReceivedLabel', defaultMessage: 'Events Received' + }), value: formatMetric(events.in, '0.[0]a'), dataTestSubj: 'eventsIn' }, { - label: 'Events Emitted', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.eventsEmittedLabel', defaultMessage: 'Events Emitted' + }), value: formatMetric(events.out, '0.[0]a'), dataTestSubj: 'eventsOut' }, { - label: 'Config Reloads', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.configReloadsLabel', defaultMessage: 'Config Reloads' + }), value: reloads.successes, dataTestSubj: 'numReloads' }, { - label: 'Pipeline Workers', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.pipelineWorkersLabel', defaultMessage: 'Pipeline Workers' + }), value: pipeline.workers, dataTestSubj: 'pipelineWorkers' }, { - label: 'Batch Size', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.batchSizeLabel', defaultMessage: 'Batch Size' + }), value: pipeline.batch_size, dataTestSubj: 'pipelineBatchSize' } @@ -53,12 +64,16 @@ export function DetailStatus({ stats }) { const lastMetrics = [ { - label: 'Version', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.versionLabel', defaultMessage: 'Version' + }), value: version, dataTestSubj: 'version' }, { - label: 'Uptime', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.uptimeLabel', defaultMessage: 'Uptime' + }), value: formatMetric(uptime, 'time_since'), dataTestSubj: 'uptime' } @@ -68,7 +83,9 @@ export function DetailStatus({ stats }) { const metrics = [...firstMetrics]; if (queueType) { metrics.push({ - label: 'Queue Type', + label: intl.formatMessage({ + id: 'xpack.monitoring.logstash.detailStatus.queueTypeLabel', defaultMessage: 'Queue Type' + }), value: queueType, dataTestSubj: 'queueType' }); @@ -82,3 +99,5 @@ export function DetailStatus({ stats }) { /> ); } + +export const DetailStatus = injectI18n(DetailStatusUi); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap index 807a4ebfb4e20..b4798048eb9d5 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap @@ -52,7 +52,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if >

- This is a conditional statement in your pipeline. +

if ([type] == "apache_log") { @@ -64,7 +68,11 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if />

- There are currently no metrics to show for this if condition. +

@@ -123,9 +131,15 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID >

- This - plugin - does not have an ID explicitly specified. Specifying an ID allows you to track differences across pipeline changes. You can explicitly specify an ID for this plugin like so: +

@@ -148,7 +162,11 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID align="left" textOnly={true} > - Events Latency + - Events Emitted Rate + - Events Received + - Events Emitted +

- This - plugin - 's ID is - - parse_apache_logline - - . + + parse_apache_logline + , + "vertexType": "plugin", + } + } + />

- Events Latency +
- Events Emitted Rate + - Events Received + - Events Emitted +

- This is an internal structure used by Logstash to buffer events between inputs and the rest of the pipeline. +

- There are currently no metrics to show for the queue. +

diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/queue.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/queue.test.js.snap index 22ccf38863062..08f13e9ddf868 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/queue.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/queue.test.js.snap @@ -14,7 +14,11 @@ exports[`Queue component renders default elements 1`] = ` grow={true} size="m" > - Queue metrics not available +
`; diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/statement.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/statement.test.js.snap index bcf2d3fab5c7f..038b1b61fd472 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/statement.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/statement.test.js.snap @@ -94,7 +94,7 @@ exports[`Statement component renders a PluginStatement component for plugin mode
- { @@ -44,11 +44,11 @@ describe('PipelineViewer component', () => { }, }; - component = ; + component = ; }); it('passes expected props', () => { - const renderedComponent = shallow(component); + const renderedComponent = shallowWithIntl(component); expect(renderedComponent).toMatchSnapshot(); }); @@ -56,7 +56,7 @@ describe('PipelineViewer component', () => { it('changes selected vertex', () => { const vertex = { id: 'stdin' }; - const instance = shallow(component).instance(); + const instance = shallowWithIntl(component).instance(); instance.onShowVertexDetails(vertex); expect(get(instance, 'state.detailDrawer.vertex')).toBe(vertex); @@ -65,7 +65,7 @@ describe('PipelineViewer component', () => { it('toggles selected vertex on second pass', () => { const vertex = { id: 'stdin' }; - const instance = shallow(component).instance(); + const instance = shallowWithIntl(component).instance(); instance.onShowVertexDetails(vertex); instance.onShowVertexDetails(vertex); @@ -75,7 +75,7 @@ describe('PipelineViewer component', () => { it('renders DetailDrawer when selected vertex is not null', () => { const vertex = { id: 'stdin' }; - const wrapper = shallow(component); + const wrapper = shallowWithIntl(component); const instance = wrapper.instance(); instance.onShowVertexDetails(vertex); wrapper.update(); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/plugin_statement.test.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/plugin_statement.test.js index f0e2eecca70f5..4da97d09678ff 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/plugin_statement.test.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/plugin_statement.test.js @@ -6,7 +6,7 @@ import React from 'react'; import { PluginStatement } from '../plugin_statement'; -import { shallow } from 'enzyme'; +import { shallowWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; import { EuiButtonEmpty, EuiBadge } from '@elastic/eui'; @@ -49,7 +49,7 @@ describe('PluginStatement component', () => { }; }); - const render = props => shallow(); + const render = props => shallowWithIntl(); it('renders input metrics and explicit id fields', () => { expect(render(props)).toMatchSnapshot(); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js index 2bed6ed4d9f7b..b6ffad53de8e2 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js @@ -25,6 +25,7 @@ import { } from '@elastic/eui'; import { Sparkline } from '../../../sparkline'; import { formatMetric } from '../../../../lib/format_number'; +import { FormattedMessage } from '@kbn/i18n/react'; function renderIcon(vertex) { return ( @@ -46,7 +47,12 @@ function renderPluginBasicStats(vertex, timeseriesTooltipXValueFormatter) { ? null : ( - Events Latency + + +
formatMetric(value, '0.[0]a', 'e/s'); const eventsOutRateRow = ( - Events Emitted Rate + + +
- Events Received + + +
- Events Emitted + + +
There are currently no metrics to show for this if condition.

+

+ +

); } function renderQueueBasicStats(_vertex) { return ( -

There are currently no metrics to show for the queue.

+

+ +

); } @@ -187,15 +218,25 @@ function renderBasicStats(vertex, timeseriesTooltipXValueFormatter) { function renderPluginBasicInfo(vertex) { if (vertex.hasExplicitId) { return ( -

This {vertex.typeString}'s ID is { vertex.id }.

+

+ { vertex.id }) }} + /> +

); } return (

- This {vertex.typeString} does not have an ID explicitly specified. Specifying an ID allows you to track differences - across pipeline changes. You can explicitly specify an ID for this plugin like so: +

{vertex.name} {`{ @@ -215,7 +256,10 @@ function renderIfBasicInfo(vertex) { return (

- This is a conditional statement in your pipeline. +

{ ifCode } @@ -226,8 +270,11 @@ function renderIfBasicInfo(vertex) { function renderQueueBasicInfo(_vertex) { return (

- This is an internal structure used by Logstash to buffer events between - inputs and the rest of the pipeline. +

); } diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js index 8ffc4740c2c25..ddebfc74fb53a 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js @@ -9,6 +9,7 @@ import PropTypes from 'prop-types'; import { DetailDrawer } from './detail_drawer'; import { Queue } from './queue'; import { StatementSection } from './statement_section'; +import { injectI18n } from '@kbn/i18n/react'; import { EuiSpacer, EuiPage, @@ -16,7 +17,7 @@ import { EuiPageBody, } from '@elastic/eui'; -export class PipelineViewer extends React.Component { +class PipelineViewerUi extends React.Component { constructor() { super(); this.state = { @@ -68,6 +69,7 @@ export class PipelineViewer extends React.Component { outputs, queue } = this.props.pipeline; + const { intl } = this.props; return ( @@ -75,7 +77,7 @@ export class PipelineViewer extends React.Component { { @@ -99,7 +101,9 @@ export function PluginStatement({ {id} @@ -116,7 +120,7 @@ export function PluginStatement({ ); } -PluginStatement.propTypes = { +PluginStatementUi.propTypes = { onShowVertexDetails: PropTypes.func.isRequired, statement: PropTypes.shape({ hasExplicitId: PropTypes.bool.isRequired, @@ -130,3 +134,5 @@ PluginStatement.propTypes = { }).isRequired, }).isRequired, }; + +export const PluginStatement = injectI18n(PluginStatementUi); diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js index a1cecb0926fbb..c3fd9986474cf 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js @@ -7,6 +7,7 @@ import React from 'react'; import { StatementListHeading } from './statement_list_heading'; import { EuiSpacer, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export function Queue() { return ( @@ -14,7 +15,10 @@ export function Queue() { - Queue metrics not available +
); diff --git a/x-pack/plugins/monitoring/public/directives/logstash/cluster_status/index.js b/x-pack/plugins/monitoring/public/directives/logstash/cluster_status/index.js index e3c0f2dac08d7..1db1a6895702c 100644 --- a/x-pack/plugins/monitoring/public/directives/logstash/cluster_status/index.js +++ b/x-pack/plugins/monitoring/public/directives/logstash/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/logstash/cluster_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringClusterStatusLogstash', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringClusterStatusLogstash', () => { }, link(scope, $el) { scope.$watch('status', status => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/directives/logstash/listing/index.js b/x-pack/plugins/monitoring/public/directives/logstash/listing/index.js index b00adec468c7b..53b257a3cb7ec 100644 --- a/x-pack/plugins/monitoring/public/directives/logstash/listing/index.js +++ b/x-pack/plugins/monitoring/public/directives/logstash/listing/index.js @@ -21,16 +21,54 @@ import { formatNumber, formatPercentageUsage } from '../../../lib/format_number'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; const filterFields = [ 'logstash.name', 'logstash.host', 'logstash.http_address' ]; const columns = [ - { title: 'Name', sortKey: 'logstash.name', sortOrder: SORT_ASCENDING }, - { title: 'CPU Usage', sortKey: 'process.cpu.percent' }, - { title: 'Load Average', sortKey: 'os.cpu.load_average.1m', }, - { title: 'JVM Heap Used', sortKey: 'jvm.mem.heap_used_percent' }, - { title: 'Events Ingested', sortKey: 'events.out' }, - { title: 'Config Reloads' }, - { title: 'Version', sortKey: 'logstash.version' } + { + title: i18n.translate('xpack.monitoring.logstash.nodes.nameTitle', { + defaultMessage: 'Name' + }), + sortKey: 'logstash.name', + sortOrder: SORT_ASCENDING + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.cpuUsageTitle', { + defaultMessage: 'CPU Usage' + }), + sortKey: 'process.cpu.percent' + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.loadAverageTitle', { + defaultMessage: 'Load Average' + }), + sortKey: 'os.cpu.load_average.1m', + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.jvmHeapUsedTitle', { + defaultMessage: '{javaVirtualMachine} Heap Used', + values: { javaVirtualMachine: 'JVM' } + }), + sortKey: 'jvm.mem.heap_used_percent' + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.eventsIngestedTitle', { + defaultMessage: 'Events Ingested' + }), + sortKey: 'events.out' + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.configReloadsTitle', { + defaultMessage: 'Config Reloads' + }) + }, + { + title: i18n.translate('xpack.monitoring.logstash.nodes.versionTitle', { + defaultMessage: 'Version' + }), + sortKey: 'logstash.version' + } ]; const nodeRowFactory = (scope, kbnUrl) => { const goToNode = uuid => { @@ -73,8 +111,20 @@ const nodeRowFactory = (scope, kbnUrl) => {
-
{ props.reloads.successes } successes
-
{ props.reloads.failures } failures
+
+ +
+
+ +
@@ -87,7 +137,7 @@ const nodeRowFactory = (scope, kbnUrl) => { }; const uiModule = uiModules.get('monitoring/directives', []); -uiModule.directive('monitoringLogstashNodeListing', kbnUrl => { +uiModule.directive('monitoringLogstashNodeListing', (kbnUrl, i18n) => { return { restrict: 'E', scope: { @@ -101,20 +151,23 @@ uiModule.directive('monitoringLogstashNodeListing', kbnUrl => { link: function (scope, $el) { scope.$watch('nodes', (nodes = []) => { + const filterNodesPlaceholder = i18n('xpack.monitoring.logstash.filterNodesPlaceholder', { defaultMessage: 'Filter Nodes…' }); const nodesTable = ( - + + + ); render(nodesTable, $el[0]); }); diff --git a/x-pack/plugins/monitoring/public/directives/logstash/node_summary/index.js b/x-pack/plugins/monitoring/public/directives/logstash/node_summary/index.js index b7d13f61afaa5..1f3342266608d 100644 --- a/x-pack/plugins/monitoring/public/directives/logstash/node_summary/index.js +++ b/x-pack/plugins/monitoring/public/directives/logstash/node_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/logstash/detail_status'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringLogstashNodeSummary', () => { @@ -18,7 +19,7 @@ uiModule.directive('monitoringLogstashNodeSummary', () => { }, link(scope, $el) { scope.$watch('logstash', logstash => { - render(, $el[0]); + render(, $el[0]); }); } }; diff --git a/x-pack/plugins/monitoring/public/directives/logstash/pipeline_listing/index.js b/x-pack/plugins/monitoring/public/directives/logstash/pipeline_listing/index.js index 0df57bff80de1..bcb2fedfacc32 100644 --- a/x-pack/plugins/monitoring/public/directives/logstash/pipeline_listing/index.js +++ b/x-pack/plugins/monitoring/public/directives/logstash/pipeline_listing/index.js @@ -24,12 +24,29 @@ import { Sparkline } from 'plugins/monitoring/components/sparkline'; import { SORT_ASCENDING } from '../../../../common/constants'; import { formatMetric } from '../../../lib/format_number'; import { timefilter } from 'ui/timefilter'; +import { i18n } from '@kbn/i18n'; const filterFields = [ 'id' ]; const columns = [ - { title: 'ID', sortKey: 'id', sortOrder: SORT_ASCENDING }, - { title: 'Events Emitted Rate', sortKey: 'latestThroughput' }, - { title: 'Number of Nodes', sortKey: 'latestNodesCount', } + { + title: i18n.translate('xpack.monitoring.logstash.pipelines.idTitle', { + defaultMessage: 'ID' + }), + sortKey: 'id', + sortOrder: SORT_ASCENDING + }, + { + title: i18n.translate('xpack.monitoring.logstash.pipelines.eventsEmittedRateTitle', { + defaultMessage: 'Events Emitted Rate' + }), + sortKey: 'latestThroughput' + }, + { + title: i18n.translate('xpack.monitoring.logstash.pipelines.numberOfNodesTitle', { + defaultMessage: 'Number of Nodes' + }), + sortKey: 'latestNodesCount', + } ]; const pipelineRowFactory = (onPipelineClick, onBrush, tooltipXValueFormatter, tooltipYValueFormatter) => { @@ -104,7 +121,7 @@ const pipelineRowFactory = (onPipelineClick, onBrush, tooltipXValueFormatter, to }; const uiModule = uiModules.get('monitoring/directives', []); -uiModule.directive('monitoringLogstashPipelineListing', ($injector) => { +uiModule.directive('monitoringLogstashPipelineListing', ($injector, i18n) => { const kbnUrl = $injector.get('kbnUrl'); const config = $injector.get('config'); @@ -150,6 +167,10 @@ uiModule.directive('monitoringLogstashPipelineListing', ($injector) => { return; } + const filterPipelinesPlaceholder = i18n('xpack.monitoring.logstash.filterPipelinesPlaceholder', { + defaultMessage: 'Filter Pipelines…' + }); + const pipelinesTable = ( { sortKey={scope.sortKey} sortOrder={scope.sortOrder} onNewState={scope.onNewState} - placeholder="Filter Pipelines..." + placeholder={filterPipelinesPlaceholder} filterFields={filterFields} columns={columns} rowComponent={pipelineRowFactory(onPipelineClick, onBrush, tooltipXValueFormatter, tooltipYValueFormatter)} diff --git a/x-pack/plugins/monitoring/public/directives/logstash/pipeline_viewer/index.js b/x-pack/plugins/monitoring/public/directives/logstash/pipeline_viewer/index.js index da2d90ab49ac1..fcc143ad29e45 100644 --- a/x-pack/plugins/monitoring/public/directives/logstash/pipeline_viewer/index.js +++ b/x-pack/plugins/monitoring/public/directives/logstash/pipeline_viewer/index.js @@ -12,6 +12,7 @@ import { PipelineViewer } from 'plugins/monitoring/components/logstash/pipeline_ import { Pipeline } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/pipeline'; import { List } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/list'; import { PipelineState } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/pipeline_state'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('monitoringLogstashPipelineViewer', $injector => { @@ -33,12 +34,14 @@ uiModule.directive('monitoringLogstashPipelineViewer', $injector => { pipelineState.update(updatedPipeline); render( - , + + + , $el[0] ); }); diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js index ab530fdaef9c3..97484bdfe0eae 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js @@ -46,7 +46,7 @@ uiRoutes.when('/logstash/node/:uuid/advanced', { }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); @@ -56,7 +56,13 @@ uiRoutes.when('/logstash/node/:uuid/advanced', { $scope.pageData = $route.current.locals.pageData; const title = $injector.get('title'); - title($scope.cluster, `Logstash - ${$scope.pageData.nodeSummary.name} - Advanced`); + const routeTitle = i18n('xpack.monitoring.logstash.node.advanced.routeTitle', { + defaultMessage: 'Logstash - {nodeName} - Advanced', + values: { + nodeName: $scope.pageData.nodeSummary.name + } + }); + title($scope.cluster, routeTitle); const $executor = $injector.get('$executor'); $executor.register({ diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/index.js index fee91294e5a35..f316740d83c11 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/node/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/node/index.js @@ -46,7 +46,7 @@ uiRoutes.when('/logstash/node/:uuid', { }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); @@ -56,7 +56,13 @@ uiRoutes.when('/logstash/node/:uuid', { $scope.pageData = $route.current.locals.pageData; const title = $injector.get('title'); - title($scope.cluster, `Logstash - ${$scope.pageData.nodeSummary.name}`); + const routeTitle = i18n('xpack.monitoring.logstash.node.routeTitle', { + defaultMessage: 'Logstash - {nodeName}', + values: { + nodeName: $scope.pageData.nodeSummary.name + } + }); + title($scope.cluster, routeTitle); const $executor = $injector.get('$executor'); $executor.register({ diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js index f6b55b0cc94c1..e8d59fe9b8b67 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js @@ -42,12 +42,18 @@ const getPageData = ($injector) => { }); }; -function makeUpgradeMessage(logstashVersion) { +function makeUpgradeMessage(logstashVersion, i18n) { if (isPipelineMonitoringSupportedInVersion(logstashVersion)) { return null; } - return `Pipeline monitoring is only available in Logstash version 6.0.0 or higher. This node is running version ${logstashVersion}.`; + return i18n('xpack.monitoring.logstash.node.pipelines.notAvailableDescription', { + defaultMessage: + 'Pipeline monitoring is only available in Logstash version 6.0.0 or higher. This node is running version {logstashVersion}.', + values: { + logstashVersion + } + }); } uiRoutes @@ -60,7 +66,7 @@ uiRoutes }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { const $route = $injector.get('$route'); const globalState = $injector.get('globalState'); const title = $injector.get('title'); @@ -69,11 +75,17 @@ uiRoutes $scope.cluster = find($route.current.locals.clusters, { cluster_uuid: globalState.cluster_uuid }); $scope.pageData = $route.current.locals.pageData; - $scope.upgradeMessage = makeUpgradeMessage($scope.pageData.nodeSummary.version); + $scope.upgradeMessage = makeUpgradeMessage($scope.pageData.nodeSummary.version, i18n); timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); - title($scope.cluster, `Logstash - ${$scope.pageData.nodeSummary.name} - Pipelines`); + const routeTitle = i18n('xpack.monitoring.logstash.node.pipelines.routeTitle', { + defaultMessage: 'Logstash - {nodeName} - Pipelines', + values: { + nodeName: $scope.pageData.nodeSummary.name + } + }); + title($scope.cluster, routeTitle); $executor.register({ execute: () => getPageData($injector), diff --git a/x-pack/plugins/monitoring/public/views/logstash/nodes/index.html b/x-pack/plugins/monitoring/public/views/logstash/nodes/index.html index 51f75f4f2a9f7..8385a12a92e83 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/nodes/index.html +++ b/x-pack/plugins/monitoring/public/views/logstash/nodes/index.html @@ -1,7 +1,12 @@
-

Logstash Nodes

+

+

getPageData($injector), diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js index 97cda776e87ed..27e68ae56976b 100644 --- a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js +++ b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js @@ -40,14 +40,16 @@ const getPageData = ($injector) => { }); }; -function makeUpgradeMessage(logstashVersions) { +function makeUpgradeMessage(logstashVersions, i18n) { if (!Array.isArray(logstashVersions) || (logstashVersions.length === 0) || logstashVersions.some(isPipelineMonitoringSupportedInVersion)) { return null; } - return 'Pipeline monitoring is only available in Logstash version 6.0.0 or higher.'; + return i18n('xpack.monitoring.logstash.pipelines.notAvalibleDescription', { + defaultMessage: 'Pipeline monitoring is only available in Logstash version 6.0.0 or higher.' + }); } uiRoutes @@ -60,7 +62,7 @@ uiRoutes }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { const $route = $injector.get('$route'); const globalState = $injector.get('globalState'); const title = $injector.get('title'); @@ -69,11 +71,13 @@ uiRoutes $scope.cluster = find($route.current.locals.clusters, { cluster_uuid: globalState.cluster_uuid }); $scope.pageData = $route.current.locals.pageData; - $scope.upgradeMessage = makeUpgradeMessage($scope.pageData.clusterStatus.versions); + $scope.upgradeMessage = makeUpgradeMessage($scope.pageData.clusterStatus.versions, i18n); timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); - title($scope.cluster, 'Logstash Pipelines'); + title($scope.cluster, i18n('xpack.monitoring.logstash.pipelines.routeTitle', { + defaultMessage: 'Logstash Pipelines' + })); $executor.register({ execute: () => getPageData($injector),