diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js index 1de1861b52bf..2fac710fef7f 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js @@ -20,16 +20,48 @@ import { LARGE_ABBREVIATED, LARGE_BYTES } from '../../../../common/formatting'; import { EuiLink, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { I18nProvider } from '@kbn/i18n/react'; const filterFields = [ 'job_id', 'state', 'node.name' ]; const columns = [ - { title: 'Job ID', sortKey: 'job_id', sortOrder: SORT_ASCENDING }, - { title: 'State', sortKey: 'state' }, - { title: 'Processed Records', sortKey: 'data_counts.processed_record_count' }, - { title: 'Model Size', sortKey: 'model_size_stats.model_bytes' }, - { title: 'Forecasts', sortKey: 'forecasts_stats.total' }, - { title: 'Node', sortKey: 'node.name' } + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.jobIdTitle', { + defaultMessage: 'Job ID' + }), + sortKey: 'job_id', + sortOrder: SORT_ASCENDING + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.stateTitle', { + defaultMessage: 'State' + }), + sortKey: 'state' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.processedRecordsTitle', { + defaultMessage: 'Processed Records' + }), + sortKey: 'data_counts.processed_record_count' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.modelSizeTitle', { + defaultMessage: 'Model Size' + }), + sortKey: 'model_size_stats.model_bytes' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.forecastsTitle', { + defaultMessage: 'Forecasts' + }), + sortKey: 'forecasts_stats.total' + }, + { + title: i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.nodeTitle', { + defaultMessage: 'Node' + }), + sortKey: 'node.name' + } ]; const jobRowFactory = (scope, kbnUrl) => { const goToNode = nodeId => { @@ -45,7 +77,9 @@ const jobRowFactory = (scope, kbnUrl) => { ); } - return 'N/A'; + return i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.noDataLabel', { + defaultMessage: 'N/A' + }); }; return function JobRow(props) { @@ -68,7 +102,7 @@ const jobRowFactory = (scope, kbnUrl) => { }; const uiModule = uiModules.get('monitoring/directives', []); -uiModule.directive('monitoringMlListing', kbnUrl => { +uiModule.directive('monitoringMlListing', (kbnUrl, i18n) => { return { restrict: 'E', scope: { @@ -84,13 +118,24 @@ uiModule.directive('monitoringMlListing', kbnUrl => { const getNoDataMessage = filterText => { if (filterText) { return ( - `There are no Machine Learning Jobs that match the filter [${filterText.trim()}] or the time range. -Try changing the filter or time range.` + i18n('xpack.monitoring.elasticsearch.mlJobListing.noFilteredJobsDescription', { + // eslint-disable-next-line max-len + defaultMessage: 'There are no Machine Learning Jobs that match the filter [{filterText}] or the time range. Try changing the filter or time range.', + values: { + filterText: filterText.trim() + } + }) ); } - return 'There are no Machine Learning Jobs that match your query. Try changing the time range selection.'; + return i18n('xpack.monitoring.elasticsearch.mlJobListing.noJobsDescription', { + defaultMessage: 'There are no Machine Learning Jobs that match your query. Try changing the time range selection.' + }); }; + const filterJobsPlaceholder = i18n('xpack.monitoring.elasticsearch.mlJobListing.filterJobsPlaceholder', { + defaultMessage: 'Filter Jobs…' + }); + scope.$watch('jobs', (jobs = []) => { const mlTable = ( @@ -102,7 +147,7 @@ Try changing the filter or time range.` sortKey={scope.sortKey} sortOrder={scope.sortOrder} onNewState={scope.onNewState} - placeholder="Filter Jobs..." + placeholder={filterJobsPlaceholder} filterFields={filterFields} columns={columns} rowComponent={jobRowFactory(scope, kbnUrl)} diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/clusterView.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/clusterView.js index b6863de16645..f9cf7d57ac1a 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/clusterView.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/clusterView.js @@ -9,9 +9,12 @@ import React from 'react'; import { TableHead } from './tableHead'; import { TableBody } from './tableBody'; +import { i18n } from '@kbn/i18n'; export class ClusterView extends React.Component { - static displayName = 'ClusterView'; + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.clusterViewDisplayName', { + defaultMessage: 'ClusterView', + }); constructor(props) { super(props); diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/shard.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/shard.js index bc8b3617ed81..ec41258263ed 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/shard.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/shard.js @@ -9,9 +9,12 @@ import React from 'react'; import { calculateClass } from '../lib/calculateClass'; import { vents } from '../lib/vents'; +import { i18n } from '@kbn/i18n'; export class Shard extends React.Component { - static displayName = 'Shard'; + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.shardDisplayName', { + defaultMessage: 'Shard', + }); state = { tooltipVisible: false }; componentDidMount() { diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableBody.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableBody.js index 2d72ae7ab969..b375a5eec3d3 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableBody.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableBody.js @@ -9,6 +9,8 @@ import React from 'react'; import { Unassigned } from './unassigned'; import { Assigned } from './assigned'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; const ShardRow = props => { let unassigned; @@ -34,7 +36,9 @@ const ShardRow = props => { }; export class TableBody extends React.Component { - static displayName = 'TableBody'; + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.tableBodyDisplayName', { + defaultMessage: 'TableBody', + }); createRow = (data, index) => { return ( @@ -55,7 +59,10 @@ export class TableBody extends React.Component {

- There are no shards allocated. +

diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableHead.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableHead.js index 1c11f38ebccb..3a11b1e4c107 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableHead.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/tableHead.js @@ -12,6 +12,7 @@ import { EuiFlexItem, EuiSwitch, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; class IndexLabel extends React.Component { @@ -38,7 +39,10 @@ class IndexLabel extends React.Component { - Indices + { const type = shard.primary ? 'primary' : 'replica'; diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/directives/clusterView.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/directives/clusterView.js index 9244c6e80725..83e052c3f5b5 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/directives/clusterView.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/directives/clusterView.js @@ -10,6 +10,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { ClusterView } from '../components/clusterView'; import { uiModules } from 'ui/modules'; +import { I18nProvider } from '@kbn/i18n/react'; const uiModule = uiModules.get('monitoring/directives', []); uiModule.directive('clusterView', kbnUrl => { @@ -26,12 +27,14 @@ uiModule.directive('clusterView', kbnUrl => { }, link: function (scope, element) { ReactDOM.render( - , + + + , element[0] ); } diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/index.html b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/index.html index a681ba0fc81c..f62b70882e90 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/index.html +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/index.html @@ -1,19 +1,49 @@
-

Shard Legend

+

  - Primary +   - Replica +   - Relocating +   - Initializing +   - Unassigned Primary +   - Unassigned Replica +
{ const goToInstance = uuid => { @@ -40,7 +72,7 @@ const instanceRowFactory = (scope, kbnUrl) => { }); }; - return function KibanaRow(props) { + return injectI18n(function KibanaRow(props) { return ( @@ -55,9 +87,25 @@ const instanceRowFactory = (scope, kbnUrl) => {
{ get(props, 'kibana.transport_address') }
-
+
  - { !props.availability ? 'Offline' : capitalize(props.kibana.status) } + { !props.availability ? ( + + ) : capitalize(props.kibana.status) }
@@ -85,11 +133,11 @@ const instanceRowFactory = (scope, kbnUrl) => { ); - }; + }); }; const uiModule = uiModules.get('monitoring/directives', []); -uiModule.directive('monitoringKibanaListing', kbnUrl => { +uiModule.directive('monitoringKibanaListing', (kbnUrl, i18n) => { return { restrict: 'E', scope: { @@ -101,6 +149,9 @@ uiModule.directive('monitoringKibanaListing', kbnUrl => { onNewState: '=', }, link(scope, $el) { + const filterInstancesPlaceholder = i18n('xpack.monitoring.kibana.listing.filterInstancesPlaceholder', { + defaultMessage: 'Filter Instances…' + }); scope.$watch('instances', (instances = []) => { const kibanasTable = ( @@ -113,7 +164,7 @@ uiModule.directive('monitoringKibanaListing', kbnUrl => { sortKey={scope.sortKey} sortOrder={scope.sortOrder} onNewState={scope.onNewState} - placeholder="Filter Instances..." + placeholder={filterInstancesPlaceholder} filterFields={filterFields} columns={columns} rowComponent={instanceRowFactory(scope, kbnUrl)} 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 b8c04718a19e..a2404273d38e 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js @@ -23,9 +23,11 @@ uiRoutes.when('/elasticsearch/ccr', { }, controllerAs: 'elasticsearchCcr', controller: class ElasticsearchCcrController extends MonitoringViewBaseController { - constructor($injector, $scope) { + constructor($injector, $scope, i18n) { super({ - title: 'Elasticsearch - Ccr', + title: i18n('xpack.monitoring.elasticsearch.ccr.routeTitle', { + defaultMessage: 'Elasticsearch - Ccr' + }), reactNodeId: 'elasticsearchCcrReact', getPageData, $scope, 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 4242ef16405a..ddf67ac09e79 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 @@ -24,16 +24,24 @@ uiRoutes.when('/elasticsearch/ccr/:index/shard/:shardId', { }, controllerAs: 'elasticsearchCcr', controller: class ElasticsearchCcrController extends MonitoringViewBaseController { - constructor($injector, $scope, pageData) { + constructor($injector, $scope, pageData, i18n) { super({ - title: 'Elasticsearch - Ccr - Shard', + title: i18n('xpack.monitoring.elasticsearch.ccr.shard.routeTitle', { + defaultMessage: 'Elasticsearch - Ccr - Shard' + }), reactNodeId: 'elasticsearchCcrShardReact', getPageData, $scope, $injector }); - $scope.instance = `Index: ${get(pageData, 'stat.follower_index')} Shard: ${get(pageData, 'stat.shard_id')}`; + $scope.instance = i18n('xpack.monitoring.elasticsearch.ccr.shard.instanceTitle', { + defaultMessage: 'Index: {followerIndex} Shard: {shardId}', + values: { + followerIndex: get(pageData, 'stat.follower_index'), + shardId: get(pageData, 'stat.shard_id') + } + }); $scope.$watch(() => this.data, data => { this.renderReact(data); diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js index dc353ac8097f..c011e8540c5f 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js @@ -46,7 +46,7 @@ uiRoutes.when('/elasticsearch/indices/:index/advanced', { }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); @@ -57,7 +57,14 @@ uiRoutes.when('/elasticsearch/indices/:index/advanced', { $scope.pageData = $route.current.locals.pageData; const title = $injector.get('title'); - title($scope.cluster, `Elasticsearch - Indices - ${$scope.indexName} - Advanced`); + const routeTitle = i18n('xpack.monitoring.elasticsearch.indices.advanced.routeTitle', { + defaultMessage: 'Elasticsearch - Indices - {indexName} - Advanced', + values: { + indexName: $scope.indexName + } + }); + + title($scope.cluster, routeTitle); const $executor = $injector.get('$executor'); $executor.register({ diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js index 006c622280ea..12b2e961ceea 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js @@ -46,7 +46,7 @@ uiRoutes.when('/elasticsearch/indices/:index', { }, pageData: getPageData }, - controller($injector, $scope) { + controller($injector, $scope, i18n) { timefilter.enableTimeRangeSelector(); timefilter.enableAutoRefreshSelector(); @@ -57,7 +57,14 @@ uiRoutes.when('/elasticsearch/indices/:index', { $scope.indexName = $route.current.params.index; const title = $injector.get('title'); - title($scope.cluster, `Elasticsearch - Indices - ${$scope.indexName} - Overview`); + const routeTitle = i18n('xpack.monitoring.elasticsearch.indices.overview.routeTitle', { + defaultMessage: 'Elasticsearch - Indices - {indexName} - Overview', + values: { + indexName: $scope.indexName + } + }); + + title($scope.cluster, routeTitle); const $executor = $injector.get('$executor'); $executor.register({ diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js index 07b291dbe020..f8615657500d 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js @@ -23,7 +23,7 @@ uiRoutes.when('/elasticsearch/indices', { }, controllerAs: 'elasticsearchIndices', controller: class ElasticsearchIndicesController extends MonitoringViewBaseTableController { - constructor($injector, $scope) { + constructor($injector, $scope, i18n) { const $route = $injector.get('$route'); const globalState = $injector.get('globalState'); const features = $injector.get('features'); @@ -34,7 +34,9 @@ uiRoutes.when('/elasticsearch/indices', { let showSystemIndices = features.isEnabled('showSystemIndices', false); super({ - title: 'Elasticsearch - Indices', + title: i18n('xpack.monitoring.elasticsearch.indices.routeTitle', { + defaultMessage: 'Elasticsearch - Indices' + }), storageKey: 'elasticsearch.indices', apiUrlFn: () => `../api/monitoring/v1/clusters/${clusterUuid}/elasticsearch/indices?show_system_indices=${showSystemIndices}`, reactNodeId: 'elasticsearchIndicesReact', diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/ml_jobs/index.html b/x-pack/plugins/monitoring/public/views/elasticsearch/ml_jobs/index.html index 0e0cb6dbab60..61aa9e49317d 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/ml_jobs/index.html +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ml_jobs/index.html @@ -1,7 +1,11 @@
-

Machine Learning Jobs

+

-

Kibana Instances

+