diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job.html b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job.html index 7f5e1bff67c23..523551bb97052 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job.html +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job.html @@ -4,11 +4,22 @@
-

New job from {{ui.pageTitle}}

+

- Chart interval: {{formConfig.chartInterval.getInterval().expression}} + New job from {{ui.pageTitle}}
-

Job settings

+

@@ -31,16 +46,19 @@

Job settings

- Split Data + + i18n-id="xpack.ml.newJob.simple.multiMetric.removeSplitButtonLabel" + i18n-default-message="Remove split" + >

@@ -51,7 +69,7 @@

ng-change="splitChange()" ng-disabled="ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED" > - + {{$select.selected.name}} @@ -79,7 +97,11 @@

-

Job Details

+

@@ -88,7 +110,12 @@

Job Details

@@ -104,33 +131,47 @@

Job Details

-
Analysis running
-
Analysis stopping
+
+ + +
+
+ + +
@@ -138,38 +179,49 @@

Job Details

href='{{resultsUrl}}' id="job_running_view_results_link" ng-click="addNewJobToRecentlyAccessed(formConfig.jobId, resultsUrl)" - aria-label="View results of running job" + aria-label="{{ ::'xpack.ml.newJob.simple.multiMetric.viewResultsOfRunningJobAriaLabel' | i18n: {defaultMessage: 'View results of running job'} }}" ng-show="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING" class="euiButton euiButton--primary euiButton--small euiButton--fill"> - - View Results - +

-

Job {{formConfig.jobId }} created - +

+ +

- - View Results - +
@@ -188,10 +240,18 @@

Job {{formConfig.jobId }} created

-

Results

+

- +
@@ -211,8 +271,27 @@

-

No results found

- Consider using the full {{ui.indexPattern.title}} data +

+ + +

+ + + +
@@ -244,7 +323,13 @@

-

No results found

+

+ + +

diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job_controller.js index 108683a14e0c8..b0dd5ffaca1ec 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/multi_metric/create_job/create_job_controller.js @@ -68,7 +68,8 @@ module $scope, $timeout, Private, - AppState) { + AppState, + i18n) { timefilter.enableTimeRangeSelector(); timefilter.disableAutoRefreshSelector(); @@ -121,7 +122,21 @@ module timeBasedIndexCheck(indexPattern, true); const pageTitle = (savedSearch.id !== undefined) ? - `saved search ${savedSearch.title}` : `index pattern ${indexPattern.title}`; + i18n('xpack.ml.newJob.simple.multiMetric.savedSearchPageTitle', { + defaultMessage: 'saved search {savedSearchTitle}', + values: { savedSearchTitle: savedSearch.title } + }) : + i18n('xpack.ml.newJob.simple.multiMetric.indexPatternPageTitle', { + defaultMessage: 'index pattern {indexPatternTitle}', + values: { indexPatternTitle: indexPattern.title } + }); + + $scope.analysisStoppingLabel = i18n('xpack.ml.newJob.simple.multiMetric.analysisStoppingLabel', { + defaultMessage: 'Analysis stopping' + }); + $scope.stopAnalysisLabel = i18n('xpack.ml.newJob.simple.multiMetric.stopAnalysisLabel', { + defaultMessage: 'Stop analysis' + }); $scope.ui = { indexPattern, @@ -139,34 +154,54 @@ module timeFields: [], splitText: '', intervals: [{ - title: 'Auto', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.autoTitle', { + defaultMessage: 'Auto' + }), value: 'auto', }, { - title: 'Millisecond', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.millisecondTitle', { + defaultMessage: 'Millisecond' + }), value: 'ms' }, { - title: 'Second', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.secondTitle', { + defaultMessage: 'Second' + }), value: 's' }, { - title: 'Minute', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.minuteTitle', { + defaultMessage: 'Minute' + }), value: 'm' }, { - title: 'Hourly', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.hourlyTitle', { + defaultMessage: 'Hourly' + }), value: 'h' }, { - title: 'Daily', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.dailyTitle', { + defaultMessage: 'Daily' + }), value: 'd' }, { - title: 'Weekly', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.weeklyTitle', { + defaultMessage: 'Weekly' + }), value: 'w' }, { - title: 'Monthly', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.monthlyTitle', { + defaultMessage: 'Monthly' + }), value: 'M' }, { - title: 'Yearly', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.yearlyTitle', { + defaultMessage: 'Yearly' + }), value: 'y' }, { - title: 'Custom', + title: i18n('xpack.ml.newJob.simple.multiMetric.intervals.customTitle', { + defaultMessage: 'Custom' + }), value: 'custom' }], eventRateChartHeight: 100, @@ -225,7 +260,10 @@ module if (splitField !== undefined) { $scope.addDefaultFieldsToInfluencerList(); - $scope.ui.splitText = 'Data split by ' + splitField.name; + $scope.ui.splitText = i18n('xpack.ml.newJob.simple.multiMetric.dataSplitByLabel', { + defaultMessage: 'Data split by {splitFieldName}', + values: { splitFieldName: splitField.name } + }); chartDataUtils.getSplitFields($scope.formConfig, $scope.formConfig.splitField.name, 10) .then((resp) => { @@ -279,7 +317,7 @@ module function initAgg() { _.each($scope.ui.aggTypeOptions, (agg) => { - if (agg.title === 'Mean') { + if (agg.mlName === 'mean') { $scope.formConfig.agg.type = agg; } }); @@ -455,8 +493,17 @@ module saveNewDatafeed(job, true); }) .catch((resp) => { - msgs.error('Could not open job: ', resp); - msgs.error('Job created, creating datafeed anyway'); + msgs.error( + i18n('xpack.ml.newJob.simple.multiMetric.couldNotOpenJobErrorMessage', { + defaultMessage: 'Could not open job:' + }), + resp + ); + msgs.error( + i18n('xpack.ml.newJob.simple.multiMetric.jobCreatedAndDatafeedCreatingAnywayErrorMessage', { + defaultMessage: 'Job created, creating datafeed anyway' + }) + ); // if open failed, still attempt to create the datafeed // as it may have failed because we've hit the limit of open jobs saveNewDatafeed(job, false); @@ -465,7 +512,12 @@ module }) .catch((resp) => { // save failed - msgs.error('Save failed: ', resp.resp); + msgs.error( + i18n('xpack.ml.newJob.simple.multiMetric.saveFailedErrorMessage', { + defaultMessage: 'Save failed:' + }), + resp.resp + ); }); } else { // show the advanced section as the model memory limit is invalid @@ -508,12 +560,22 @@ module }) .catch((resp) => { // datafeed failed - msgs.error('Could not start datafeed: ', resp); + msgs.error( + i18n('xpack.ml.newJob.simple.multiMetric.couldNotStartDatafeedErrorMessage', { + defaultMessage: 'Could not start datafeed:' + }), + resp + ); }); } }) .catch((resp) => { - msgs.error('Save datafeed failed: ', resp); + msgs.error( + i18n('xpack.ml.newJob.simple.multiMetric.saveDatafeedFailedErrorMessage', { + defaultMessage: 'Save datafeed failed:', + }), + resp + ); }); } };