From 8765f49a176d81297b41cb079ec30e471f97b12e Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Mon, 29 Oct 2018 12:02:48 +0300 Subject: [PATCH 1/7] Translate monitoring -> view -> elasticsearch --- .i18nrc.json | 1 + .../elasticsearch/ml_job_listing/index.js | 48 ++++++++++++++++--- .../components/clusterView.js | 10 +++- .../shard_allocation/components/shard.js | 10 +++- .../shard_allocation/components/tableBody.js | 15 ++++-- .../shard_allocation/components/tableHead.js | 6 ++- .../shard_allocation/components/unassigned.js | 10 +++- .../elasticsearch/shard_allocation/index.html | 44 ++++++++++++++--- .../shard_allocation/lib/decorate_shards.js | 15 +++++- .../shard_allocation/lib/labels.js | 22 +++++++-- .../public/directives/kibana/listing/index.js | 44 ++++++++++++++--- 11 files changed, 189 insertions(+), 36 deletions(-) diff --git a/.i18nrc.json b/.i18nrc.json index 5760f0b36bb0f..24300c3aa7253 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -10,6 +10,7 @@ "statusPage": "src/core_plugins/status_page", "tagCloud": "src/core_plugins/tagcloud", "xpack.idxMgmt": "x-pack/plugins/index_management", + "xpack.monitoring": "x-pack/plugins/monitoring", "xpack.watcher": "x-pack/plugins/watcher" }, "exclude": [ 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 0bfd05102cbbc..a17032703a516 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,15 +20,47 @@ import { LARGE_ABBREVIATED, LARGE_BYTES } from '../../../../common/formatting'; import { EuiLink, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; 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 => { @@ -44,7 +76,9 @@ const jobRowFactory = (scope, kbnUrl) => { ); } - return 'N/A'; + return i18n.translate('xpack.monitoring.elasticsearch.mlJobListing.noDataLabel', { + defaultMessage: 'N/A' + }); }; return function JobRow(props) { 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 b6863de16645b..ae8d43d54a9d7 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,13 @@ import React from 'react'; import { TableHead } from './tableHead'; import { TableBody } from './tableBody'; +import { injectI18n } from '@kbn/i18n/react'; -export class ClusterView extends React.Component { - static displayName = 'ClusterView'; +class ClusterViewUI extends React.Component { + static displayName = this.props.intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.shardAllocation.clusterViewDisplayName', + defaultMessage: 'ClusterView', + }); constructor(props) { super(props); @@ -71,3 +75,5 @@ export class ClusterView extends React.Component { ); } } + +export const ClusterView = injectI18n(ClusterViewUI); \ No newline at end of file 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 bc8b3617ed815..37feb5c6b7d1f 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,13 @@ import React from 'react'; import { calculateClass } from '../lib/calculateClass'; import { vents } from '../lib/vents'; +import { injectI18n } from '@kbn/i18n/react'; -export class Shard extends React.Component { - static displayName = 'Shard'; +class ShardUI extends React.Component { + static displayName = this.props.intl.formatMessage({ + id: 'xpack.monitoring.elasticsearch.shardAllocation.shardDisplayName', + defaultMessage: 'Shard', + }); state = { tooltipVisible: false }; componentDidMount() { @@ -85,3 +89,5 @@ export class Shard extends React.Component { ); } } + +export const Shard = injectI18n(ShardUI); 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 2d72ae7ab9692..40051bc7dba84 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,7 @@ import React from 'react'; import { Unassigned } from './unassigned'; import { Assigned } from './assigned'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; const ShardRow = props => { let unassigned; @@ -33,8 +34,11 @@ const ShardRow = props => { ); }; -export class TableBody extends React.Component { - static displayName = 'TableBody'; +class TableBodyUI extends React.Component { + static displayName = this.props.intl.formatMessage({ + id: '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. +

@@ -84,3 +91,5 @@ export class TableBody extends React.Component { } } + +export const TableBody = injectI18n(TableBodyUI); 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 1c11f38ebccb8..3a11b1e4c107f 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'; @@ -29,3 +33,5 @@ export class Unassigned extends React.Component { ); } } + +export const Unassigned = injectI18n(UnassignedUI); 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 a681ba0fc81c6..e1664276a7efd 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 => { From 74c236e8c37222b77d85104c02dc8cbb95c4bbe3 Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Mon, 29 Oct 2018 14:17:19 +0300 Subject: [PATCH 2/7] Fix issues --- .../shard_allocation/components/clusterView.js | 9 +++------ .../shard_allocation/components/shard.js | 9 +++------ .../shard_allocation/components/tableBody.js | 10 ++++------ .../shard_allocation/components/unassigned.js | 9 +++------ .../shard_allocation/directives/clusterView.js | 15 +++++++++------ 5 files changed, 22 insertions(+), 30 deletions(-) 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 ae8d43d54a9d7..f9cf7d57ac1ac 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,11 +9,10 @@ import React from 'react'; import { TableHead } from './tableHead'; import { TableBody } from './tableBody'; -import { injectI18n } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; -class ClusterViewUI extends React.Component { - static displayName = this.props.intl.formatMessage({ - id: 'xpack.monitoring.elasticsearch.shardAllocation.clusterViewDisplayName', +export class ClusterView extends React.Component { + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.clusterViewDisplayName', { defaultMessage: 'ClusterView', }); @@ -75,5 +74,3 @@ class ClusterViewUI extends React.Component { ); } } - -export const ClusterView = injectI18n(ClusterViewUI); \ No newline at end of file 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 37feb5c6b7d1f..ec41258263ed7 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,11 +9,10 @@ import React from 'react'; import { calculateClass } from '../lib/calculateClass'; import { vents } from '../lib/vents'; -import { injectI18n } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; -class ShardUI extends React.Component { - static displayName = this.props.intl.formatMessage({ - id: 'xpack.monitoring.elasticsearch.shardAllocation.shardDisplayName', +export class Shard extends React.Component { + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.shardDisplayName', { defaultMessage: 'Shard', }); state = { tooltipVisible: false }; @@ -89,5 +88,3 @@ class ShardUI extends React.Component { ); } } - -export const Shard = injectI18n(ShardUI); 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 40051bc7dba84..b375a5eec3d33 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,7 +9,8 @@ import React from 'react'; import { Unassigned } from './unassigned'; import { Assigned } from './assigned'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; const ShardRow = props => { let unassigned; @@ -34,9 +35,8 @@ const ShardRow = props => { ); }; -class TableBodyUI extends React.Component { - static displayName = this.props.intl.formatMessage({ - id: 'xpack.monitoring.elasticsearch.shardAllocation.tableBodyDisplayName', +export class TableBody extends React.Component { + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.tableBodyDisplayName', { defaultMessage: 'TableBody', }); @@ -91,5 +91,3 @@ class TableBodyUI extends React.Component { } } - -export const TableBody = injectI18n(TableBodyUI); diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/unassigned.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/unassigned.js index e4c41b1f63124..e350e3b037712 100644 --- a/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/unassigned.js +++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/shard_allocation/components/unassigned.js @@ -9,11 +9,10 @@ import _ from 'lodash'; import React from 'react'; import { Shard } from './shard'; -import { injectI18n } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; -class UnassignedUI extends React.Component { - static displayName = this.props.intl.formatMessage({ - id: 'xpack.monitoring.elasticsearch.shardAllocation.unassignedDisplayName', +export class Unassigned extends React.Component { + static displayName = i18n.translate('xpack.monitoring.elasticsearch.shardAllocation.unassignedDisplayName', { defaultMessage: 'Unassigned', }); @@ -33,5 +32,3 @@ class UnassignedUI extends React.Component { ); } } - -export const Unassigned = injectI18n(UnassignedUI); 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 9244c6e807251..83e052c3f5b52 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] ); } From c617035a2cc82a893a40fb6e0352bf2249eec2df Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Mon, 29 Oct 2018 16:26:07 +0300 Subject: [PATCH 3/7] Translate monitoring - view - elasticsearch and kibana --- .../public/views/elasticsearch/ccr/index.js | 6 ++++-- .../public/views/elasticsearch/ccr/shard/index.js | 14 +++++++++++--- .../views/elasticsearch/index/advanced/index.js | 11 +++++++++-- .../public/views/elasticsearch/index/index.js | 11 +++++++++-- .../public/views/elasticsearch/indices/index.js | 6 ++++-- .../public/views/elasticsearch/ml_jobs/index.html | 6 +++++- .../public/views/elasticsearch/ml_jobs/index.js | 6 ++++-- .../views/elasticsearch/node/advanced/index.js | 11 +++++++++-- .../public/views/elasticsearch/node/index.js | 11 +++++++++-- .../public/views/elasticsearch/nodes/index.js | 6 ++++-- .../public/views/kibana/instance/index.js | 11 +++++++++-- .../public/views/kibana/instances/index.html | 5 ++++- .../public/views/kibana/instances/index.js | 6 ++++-- .../public/views/kibana/overview/index.js | 8 ++++++-- 14 files changed, 91 insertions(+), 27 deletions(-) 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 0c0f496af4676..177061c4e6527 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js @@ -18,9 +18,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 4242ef16405a0..ddf67ac09e79c 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 dc353ac8097f1..3e263f8bd83ec 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 006c622280ea5..32362f8f1960f 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 b71b8f43814f6..912c08cc2b7fd 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js @@ -22,7 +22,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'); @@ -33,7 +33,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 0e0cb6dbab60c..61aa9e49317da 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

+

Date: Tue, 30 Oct 2018 17:16:28 +0300 Subject: [PATCH 4/7] Fix issues --- .../public/directives/kibana/listing/index.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js b/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js index c79d349c84f91..f59e965bcb4a9 100644 --- a/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js +++ b/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js @@ -23,6 +23,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; const filterFields = [ 'kibana.name', 'kibana.host', 'kibana.status', 'kibana.transport_address' ]; const columns = [ @@ -86,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) }
From 55671133afb6d2da337d51ee4bb11498215096de Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Wed, 31 Oct 2018 14:15:18 +0300 Subject: [PATCH 5/7] Fix issues --- .../elasticsearch/ml_job_listing/index.js | 21 +++++-- .../elasticsearch/shard_allocation/index.html | 4 +- .../public/directives/kibana/listing/index.js | 57 ++++++++++--------- 3 files changed, 49 insertions(+), 33 deletions(-) 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 a17032703a516..4f29890b7ba25 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 @@ -101,7 +101,7 @@ const jobRowFactory = (scope, kbnUrl) => { }; const uiModule = uiModules.get('monitoring/directives', []); -uiModule.directive('monitoringMlListing', kbnUrl => { +uiModule.directive('monitoringMlListing', (kbnUrl, i18n) => { return { restrict: 'E', scope: { @@ -117,13 +117,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 Alerts…' + }); + scope.$watch('jobs', (jobs = []) => { const mlTable = (
{ }); }; - return function KibanaRow(props) { + return injectI18n(function KibanaRow(props) { return ( @@ -89,15 +89,15 @@ const instanceRowFactory = (scope, kbnUrl) => {
- )} + title={ + props.intl.formatMessage({ + id: 'xpack.monitoring.kibana.listing.instanceStatusTitle', + defaultMessage: 'Instance status: {kibanaStatus}' + }, { + kibanaStatus: props.kibana.status + } + ) + } >   { !props.availability ? ( @@ -133,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: { @@ -149,22 +149,27 @@ 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 = ( - + + + ); render(kibanasTable, $el[0]); }); From 04ccfc59aee2e98d7c8f6004d70b3671cb1c521f Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Wed, 31 Oct 2018 14:26:13 +0300 Subject: [PATCH 6/7] Fix issues --- .../public/views/elasticsearch/index/advanced/index.js | 2 +- .../monitoring/public/views/elasticsearch/index/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 3e263f8bd83ec..c011e8540c5f1 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 @@ -58,7 +58,7 @@ uiRoutes.when('/elasticsearch/indices/:index/advanced', { const title = $injector.get('title'); const routeTitle = i18n('xpack.monitoring.elasticsearch.indices.advanced.routeTitle', { - defaultMessage: '`Elasticsearch - Indices - {indexName} - Advanced', + defaultMessage: 'Elasticsearch - Indices - {indexName} - Advanced', values: { indexName: $scope.indexName } 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 32362f8f1960f..12b2e961ceea9 100644 --- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js +++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js @@ -58,7 +58,7 @@ uiRoutes.when('/elasticsearch/indices/:index', { const title = $injector.get('title'); const routeTitle = i18n('xpack.monitoring.elasticsearch.indices.overview.routeTitle', { - defaultMessage: '`Elasticsearch - Indices - {indexName} - Overview', + defaultMessage: 'Elasticsearch - Indices - {indexName} - Overview', values: { indexName: $scope.indexName } From 4c4babf1202acddcf6379a4f76e5d3d316448b78 Mon Sep 17 00:00:00 2001 From: Alexandr Ogarkov Date: Tue, 6 Nov 2018 15:02:38 +0300 Subject: [PATCH 7/7] Fix placeholder value --- .../public/directives/elasticsearch/ml_job_listing/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4f29890b7ba25..02e355d761b81 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 @@ -132,7 +132,7 @@ uiModule.directive('monitoringMlListing', (kbnUrl, i18n) => { }; const filterJobsPlaceholder = i18n('xpack.monitoring.elasticsearch.mlJobListing.filterJobsPlaceholder', { - defaultMessage: 'Filter Alerts…' + defaultMessage: 'Filter Jobs…' }); scope.$watch('jobs', (jobs = []) => {