mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[i18n] Translate ML - New Job - population (#27388)
* Translate new_job population * Separate id for documentCount chart and other charts * Resolve part of comments * Fix issues
This commit is contained in:
parent
9f3c991232
commit
e5962a37bb
3 changed files with 230 additions and 66 deletions
|
@ -5,11 +5,22 @@
|
|||
<div ng-controller="MlCreatePopulationJob" class="population-job-container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h3 class="euiTitle euiTitle--large">New job from {{ui.pageTitle}}</h3>
|
||||
<h3
|
||||
class="euiTitle euiTitle--large"
|
||||
i18n-id="xpack.ml.newJob.simple.population.newJobFromTitle"
|
||||
i18n-default-message="New job from {pageTitle}"
|
||||
i18n-values="{ pageTitle: ui.pageTitle }"
|
||||
></h3>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="pull-right">
|
||||
<span style="font-size:10px;" ng-show="formConfig.chartInterval !== undefined">Chart interval: {{formConfig.chartInterval.getInterval().expression}}</span>
|
||||
<span
|
||||
style="font-size:10px;"
|
||||
ng-show="formConfig.chartInterval !== undefined"
|
||||
i18n-id="xpack.ml.newJob.simple.population.chartIntervalLabel"
|
||||
i18n-default-message="Chart interval: {interval}"
|
||||
i18n-values="{ interval: formConfig.chartInterval.getInterval().expression }"
|
||||
></span>
|
||||
<ml-full-time-range-selector
|
||||
disabled='(jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED)'
|
||||
index-pattern='ui.indexPattern'
|
||||
|
@ -24,10 +35,18 @@
|
|||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row form-controls">
|
||||
<h4 class="euiTitle euiTitle--small">Job settings</h4>
|
||||
<h4
|
||||
class="euiTitle euiTitle--small"
|
||||
i18n-id="xpack.ml.newJob.simple.population.jobSettingsTitle"
|
||||
i18n-default-message="Job settings"
|
||||
></h4>
|
||||
<div>
|
||||
<div class='form-section form-section-overflow' >
|
||||
<h4 class="euiTitle euiTitle--small">Population</h4>
|
||||
<h4
|
||||
class="euiTitle euiTitle--small"
|
||||
i18n-id="xpack.ml.newJob.simple.population.populationTitle"
|
||||
i18n-default-message="Population"
|
||||
></h4>
|
||||
<div class="euiSpacer euiSpacer--s"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
@ -37,7 +56,7 @@
|
|||
on-select="overChange()"
|
||||
ng-disabled="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
|
||||
append-to-body=true>
|
||||
<ui-select-match placeholder="Select population field">
|
||||
<ui-select-match placeholder="{{ ::'xpack.ml.newJob.simple.population.selectPopulationFieldPlaceholder' | i18n: {defaultMessage: 'Select population field'} }}">
|
||||
<ml-field-type-icon type="$select.selected.mlType"></ml-field-type-icon>{{$select.selected.name}}
|
||||
</ui-select-match>
|
||||
<ui-select-choices repeat="field in ui.overFields | filter: { name: $select.search }" group-by="'mlType'">
|
||||
|
@ -88,7 +107,11 @@
|
|||
|
||||
<div class='form-section' >
|
||||
<div ng-show="jobState !== JOB_STATE.FINISHED">
|
||||
<h4 class="euiTitle euiTitle--small">Job Details</h4>
|
||||
<h4
|
||||
class="euiTitle euiTitle--small"
|
||||
i18n-id="xpack.ml.newJob.simple.population.jobDetailsTitle"
|
||||
i18n-default-message="Job Details"
|
||||
></h4>
|
||||
<div class="euiSpacer euiSpacer--s"></div>
|
||||
</div>
|
||||
|
||||
|
@ -97,7 +120,12 @@
|
|||
<ml-general-job-details></ml-general-job-details>
|
||||
|
||||
<div class="form-group">
|
||||
<a href="" ng-click="moveToAdvancedJobCreation()">Move to advanced job configuration</a>
|
||||
<a
|
||||
href=""
|
||||
ng-click="moveToAdvancedJobCreation()"
|
||||
i18n-id="xpack.ml.newJob.simple.population.moveToAdvancedJobConfigurationLinkText"
|
||||
i18n-default-message="Move to advanced job configuration"
|
||||
></a>
|
||||
</div>
|
||||
|
||||
<div class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--responsive">
|
||||
|
@ -113,33 +141,47 @@
|
|||
</div>
|
||||
<div class="euiFlexItem euiFlexItem--flexGrowZero">
|
||||
<button
|
||||
aria-label="Create Job"
|
||||
aria-label="{{ ::'xpack.ml.newJob.simple.population.createJobButtonAriaLabel' | i18n: {defaultMessage: 'Create Job'} }}"
|
||||
ng-click="createJob()"
|
||||
type="button"
|
||||
ng-show="jobState === JOB_STATE.NOT_STARTED"
|
||||
ng-disabled="!ui.formValid"
|
||||
class="euiButton euiButton--primary euiButton--small euiButton--fill">
|
||||
<span class="euiButton__content">
|
||||
Create Job
|
||||
</span>
|
||||
<span
|
||||
class="euiButton__content"
|
||||
i18n-id="xpack.ml.newJob.simple.population.createJobButtonLabel"
|
||||
i18n-default-message="Create Job"
|
||||
></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='job-state-info' ng-show="jobState === JOB_STATE.RUNNING">Analysis running <i class='fa fa-spinner fa-spin'></i></div>
|
||||
<div class='job-state-info' ng-show="jobState === JOB_STATE.STOPPING">Analysis stopping <i class='fa fa-spinner fa-spin'></i></div>
|
||||
<div class='job-state-info' ng-show="jobState === JOB_STATE.RUNNING">
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.analysisRunningLabel"
|
||||
i18n-default-message="Analysis running"
|
||||
></span>
|
||||
<i class='fa fa-spinner fa-spin'></i>
|
||||
</div>
|
||||
<div class='job-state-info' ng-show="jobState === JOB_STATE.STOPPING">
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.analysisStoppingLabel"
|
||||
i18n-default-message="Analysis stopping"
|
||||
></span>
|
||||
<i class='fa fa-spinner fa-spin'></i>
|
||||
</div>
|
||||
|
||||
<div class="euiSpacer euiSpacer--s"></div>
|
||||
|
||||
<button
|
||||
aria-label="Stop Job"
|
||||
aria-label="{{ ::'xpack.ml.newJob.simple.population.stopJobButtonAriaLabel' | i18n: {defaultMessage: 'Stop Job'} }}"
|
||||
ng-click="stopJob()"
|
||||
type="button"
|
||||
ng-show="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING"
|
||||
ng-disabled="jobState === JOB_STATE.STOPPING"
|
||||
class="euiButton euiButton--danger euiButton--small">
|
||||
<span class="euiButton__content">
|
||||
{{(jobState === JOB_STATE.STOPPING) ? 'Analysis stopping' : 'Stop analysis' }}
|
||||
{{(jobState === JOB_STATE.STOPPING) ? analysisStoppingLabel : stopAnalysisLabel }}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
|
@ -147,38 +189,49 @@
|
|||
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.population.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">
|
||||
<span class="euiButton__content">
|
||||
View Results
|
||||
</span>
|
||||
<span
|
||||
class="euiButton__content"
|
||||
i18n-id="xpack.ml.newJob.simple.population.viewResultsLinkText"
|
||||
i18n-default-message="View Results"
|
||||
></span>
|
||||
</a>
|
||||
</div>
|
||||
<div ng-show="jobState === JOB_STATE.FINISHED">
|
||||
<h3 class="euiTitle euiTitle--large">Job {{formConfig.jobId }} created
|
||||
<i style="color:green;" class="fa fa-check" aria-label="Job finished"></i>
|
||||
<h3 class="euiTitle euiTitle--large">
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.jobCreatedTitle"
|
||||
i18n-default-message="Job {jobId} created"
|
||||
i18n-values="{ jobId: formConfig.jobId }"
|
||||
></span>
|
||||
<i style="color:green;" class="fa fa-check" aria-label="{{ ::'xpack.ml.newJob.simple.population.jobFinishedAriaLabel' | i18n: {defaultMessage: 'Job finished'} }}"></i>
|
||||
</h3>
|
||||
<div class="euiSpacer euiSpacer--m"></div>
|
||||
|
||||
<button
|
||||
aria-label="Reset"
|
||||
aria-label="{{ ::'xpack.ml.newJob.simple.population.resetButtonAriaLabel' | i18n: {defaultMessage: 'Reset'} }}"
|
||||
ng-click="resetJob()"
|
||||
type="button"
|
||||
class="euiButton euiButton--primary euiButton--small euiButton--fill">
|
||||
<span class="euiButton__content">
|
||||
Reset
|
||||
</span>
|
||||
<span
|
||||
class="euiButton__content"
|
||||
i18n-id="xpack.ml.newJob.simple.population.resetButtonLabel"
|
||||
i18n-default-message="Reset"
|
||||
></span>
|
||||
</button>
|
||||
<a
|
||||
href='{{resultsUrl}}'
|
||||
id="job_finished_view_results_link"
|
||||
ng-click="addNewJobToRecentlyAccessed(formConfig.jobId, resultsUrl)"
|
||||
aria-label="View results of finished job"
|
||||
aria-label="{{ ::'xpack.ml.newJob.simple.population.viewResultsOfFinishedJobAriaLabel' | i18n: {defaultMessage: 'View results of finished job'} }}"
|
||||
class="euiButton euiButton--primary euiButton--small euiButton--fill">
|
||||
<span class="euiButton__content">
|
||||
View Results
|
||||
</span>
|
||||
<span
|
||||
class="euiButton__content"
|
||||
i18n-id="xpack.ml.newJob.simple.population.viewResultsLinkText"
|
||||
i18n-default-message="View Results"
|
||||
></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
@ -197,10 +250,18 @@
|
|||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row charts-container">
|
||||
<h4 class="euiTitle euiTitle--small">Results</h4>
|
||||
<h4
|
||||
class="euiTitle euiTitle--small"
|
||||
i18n-id="xpack.ml.newJob.simple.population.resultsTitle"
|
||||
i18n-default-message="Results"
|
||||
></h4>
|
||||
<div>
|
||||
<div class='chart-list-panel event-rate-container' style='height: {{ui.eventRateChartHeight + 70}}px;'>
|
||||
<label class="kuiFormLabel">Document count</label>
|
||||
<label
|
||||
class="kuiFormLabel"
|
||||
i18n-id="xpack.ml.newJob.simple.population.documentCountLabel"
|
||||
i18n-default-message="Document count"
|
||||
></label>
|
||||
|
||||
<div class='chart-container'>
|
||||
<div style='height: {{ui.eventRateChartHeight + 25}}px;'>
|
||||
|
@ -220,8 +281,27 @@
|
|||
</div>
|
||||
<div class='status-label' ng-if="chartStates.eventRate === CHART_STATE.NO_RESULTS">
|
||||
<div class='no-results'>
|
||||
<h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No results found</h4>
|
||||
<span>Consider using the <a ng-click="setFullTimeRange()">full {{ui.indexPattern.title}} data</a></span>
|
||||
<h4 class="euiTitle euiTitle--small">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.noResultsFoundTitle"
|
||||
i18n-default-message="No results found"
|
||||
></span>
|
||||
</h4>
|
||||
<span>
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription"
|
||||
i18n-default-message="Consider using the"
|
||||
i18n-description="Part of composite text xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription + xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
|
||||
></span>
|
||||
<a
|
||||
ng-click="setFullTimeRange()"
|
||||
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
|
||||
i18n-default-message="full {indexPatternTitle} data"
|
||||
i18n-values="{ indexPatternTitle: ui.indexPattern.title }"
|
||||
i18n-description="Part of composite text xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription + xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
|
||||
></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -234,9 +314,26 @@
|
|||
<div class='card-front'>
|
||||
<div class="card-title"></div>
|
||||
<div class='chart' style='height: {{ui.chartHeight + 90}}px;'>
|
||||
<label class="kuiFormLabel">{{formConfig.fields[id].agg.type.title}} {{formConfig.fields[id].name}} over {{formConfig.overField.name}} <span ng-if="formConfig.fields[id].splitField!==undefined"> split by {{formConfig.fields[id].splitField.name}}</span></label>
|
||||
<label
|
||||
ng-if="formConfig.fields[id].splitField === undefined"
|
||||
class="kuiFormLabel"
|
||||
i18n-id="xpack.ml.newJob.simple.population.chart.chartWithoutSplitFieldLabel"
|
||||
i18n-default-message="{aggTypeTitle} {fieldName} over {overFieldName}"
|
||||
i18n-values="{ aggTypeTitle: formConfig.fields[id].agg.type.title, fieldName: formConfig.fields[id].name, overFieldName: formConfig.overField.name }"
|
||||
></label>
|
||||
<label
|
||||
ng-if="formConfig.fields[id].splitField !== undefined"
|
||||
class="kuiFormLabel"
|
||||
i18n-id="xpack.ml.newJob.simple.population.chart.chartWithSplitFieldLabel"
|
||||
i18n-default-message="{aggTypeTitle} {fieldName} over {overFieldName} split by {splitFieldName}"
|
||||
i18n-values="{ aggTypeTitle: formConfig.fields[id].agg.type.title, fieldName: formConfig.fields[id].name, overFieldName: formConfig.overField.name, splitFieldName: formConfig.fields[id].splitField.name }"
|
||||
></label>
|
||||
<div class="split-controls">
|
||||
<div class="split-align">Split data: </div>
|
||||
<div
|
||||
class="split-align"
|
||||
i18n-id="xpack.ml.newJob.simple.population.chart.splitDataLabel"
|
||||
i18n-default-message="Split data:"
|
||||
></div>
|
||||
<div class="split-field-container">
|
||||
<ui-select
|
||||
class="split-field-select"
|
||||
|
@ -245,7 +342,7 @@
|
|||
append-to-body="true"
|
||||
ng-disabled="ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
|
||||
>
|
||||
<ui-select-match placeholder="Select a field">
|
||||
<ui-select-match placeholder="{{ ::'xpack.ml.newJob.simple.population.chart.splitFieldPlaceholder' | i18n: {defaultMessage: 'Select a field'} }}">
|
||||
<ml-field-type-icon type="$select.selected.mlType"></ml-field-type-icon>{{$select.selected.name}}
|
||||
</ui-select-match>
|
||||
<ui-select-choices repeat="field in ui.splitFields | filter: { name: $select.search } | filter: ui.isOverField" group-by="'mlType'">
|
||||
|
@ -262,12 +359,12 @@
|
|||
<button
|
||||
ng-if="formConfig.fields[id].splitField !== undefined && (!ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED)"
|
||||
ng-click="splitReset(id)"
|
||||
aria-label="Remove split"
|
||||
aria-label="{{ ::'xpack.ml.newJob.simple.population.chart.removeSplitButtonAriaLabel' | i18n: {defaultMessage: 'Remove split'} }}"
|
||||
ng-disabled="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
|
||||
class="euiButton euiButton--primary euiButton--small split-align remove-split"
|
||||
>
|
||||
Remove split
|
||||
</button>
|
||||
i18n-id="xpack.ml.newJob.simple.population.chart.removeSplitButtonLabel"
|
||||
i18n-default-message="Remove split"
|
||||
></button>
|
||||
</div>
|
||||
|
||||
<div class='chart-container'>
|
||||
|
@ -289,7 +386,13 @@
|
|||
</div>
|
||||
<div class='status-label' ng-show="chartStates.fields[id] === CHART_STATE.NO_RESULTS">
|
||||
<div class='no-results'>
|
||||
<h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No results found</h4>
|
||||
<h4 class="euiTitle euiTitle--small">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
<span
|
||||
i18n-id="xpack.ml.newJob.simple.population.chart.noResultsFoundTitle"
|
||||
i18n-default-message="No results found"
|
||||
></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@ import { mlChartTooltipService } from '../../../../../components/chart_tooltip/c
|
|||
import { uiModules } from 'ui/modules';
|
||||
const module = uiModules.get('apps/ml');
|
||||
|
||||
module.directive('mlPopulationJobChart', function () {
|
||||
module.directive('mlPopulationJobChart', function (i18n) {
|
||||
|
||||
function link(scope, element) {
|
||||
|
||||
|
@ -233,12 +233,14 @@ module.directive('mlPopulationJobChart', function () {
|
|||
const formattedDate = formatHumanReadableDateTime(data.date);
|
||||
contents += `${formattedDate}<br/><hr/>`;
|
||||
contents += `${mlEscape(scope.overFieldName)}: ${mlEscape(data.label)}<br/>`;
|
||||
if (scope.chartData.fieldFormat !== undefined) {
|
||||
contents += `Value: ${scope.chartData.fieldFormat.convert(data.value, 'text')}`;
|
||||
} else {
|
||||
contents += `Value: ${parseInt(data.value)}`;
|
||||
}
|
||||
|
||||
contents += i18n('xpack.ml.newJob.simple.population.chartTooltipValueLabel', {
|
||||
defaultMessage: 'Value: {dataValue}',
|
||||
values: {
|
||||
dataValue: scope.chartData.fieldFormat !== undefined
|
||||
? scope.chartData.fieldFormat.convert(data.value, 'text')
|
||||
: parseInt(data.value)
|
||||
}
|
||||
});
|
||||
mlChartTooltipService.show(contents, el, {
|
||||
x: 5,
|
||||
y: 10
|
||||
|
|
|
@ -67,7 +67,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.population.savedSearchPageTitle', {
|
||||
defaultMessage: 'saved search {savedSearchTitle}',
|
||||
values: { savedSearchTitle: savedSearch.title }
|
||||
}) :
|
||||
i18n('xpack.ml.newJob.simple.population.indexPatternPageTitle', {
|
||||
defaultMessage: 'index pattern {indexPatternTitle}',
|
||||
values: { indexPatternTitle: indexPattern.title }
|
||||
});
|
||||
|
||||
$scope.analysisStoppingLabel = i18n('xpack.ml.newJob.simple.population.analysisStoppingLabel', {
|
||||
defaultMessage: 'Analysis stopping'
|
||||
});
|
||||
$scope.stopAnalysisLabel = i18n('xpack.ml.newJob.simple.population.stopAnalysisLabel', {
|
||||
defaultMessage: 'Stop analysis'
|
||||
});
|
||||
|
||||
$scope.ui = {
|
||||
indexPattern,
|
||||
|
@ -140,34 +155,54 @@ module
|
|||
timeFields: [],
|
||||
splitText: '',
|
||||
intervals: [{
|
||||
title: 'Auto',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.autoTitle', {
|
||||
defaultMessage: 'Auto'
|
||||
}),
|
||||
value: 'auto',
|
||||
}, {
|
||||
title: 'Millisecond',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.millisecondTitle', {
|
||||
defaultMessage: 'Millisecond'
|
||||
}),
|
||||
value: 'ms'
|
||||
}, {
|
||||
title: 'Second',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.secondTitle', {
|
||||
defaultMessage: 'Second'
|
||||
}),
|
||||
value: 's'
|
||||
}, {
|
||||
title: 'Minute',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.minuteTitle', {
|
||||
defaultMessage: 'Minute'
|
||||
}),
|
||||
value: 'm'
|
||||
}, {
|
||||
title: 'Hourly',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.hourlyTitle', {
|
||||
defaultMessage: 'Hourly'
|
||||
}),
|
||||
value: 'h'
|
||||
}, {
|
||||
title: 'Daily',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.dailyTitle', {
|
||||
defaultMessage: 'Daily'
|
||||
}),
|
||||
value: 'd'
|
||||
}, {
|
||||
title: 'Weekly',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.weeklyTitle', {
|
||||
defaultMessage: 'Weekly'
|
||||
}),
|
||||
value: 'w'
|
||||
}, {
|
||||
title: 'Monthly',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.monthlyTitle', {
|
||||
defaultMessage: 'Monthly'
|
||||
}),
|
||||
value: 'M'
|
||||
}, {
|
||||
title: 'Yearly',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.yearlyTitle', {
|
||||
defaultMessage: 'Yearly'
|
||||
}),
|
||||
value: 'y'
|
||||
}, {
|
||||
title: 'Custom',
|
||||
title: i18n('xpack.ml.newJob.simple.population.intervals.customTitle', {
|
||||
defaultMessage: 'Custom'
|
||||
}),
|
||||
value: 'custom'
|
||||
}],
|
||||
eventRateChartHeight: 100,
|
||||
|
@ -292,7 +327,7 @@ module
|
|||
|
||||
function initAgg() {
|
||||
_.each($scope.ui.aggTypeOptions, (agg) => {
|
||||
if (agg.title === 'Mean') {
|
||||
if (agg.mlName === 'mean') {
|
||||
$scope.formConfig.agg.type = agg;
|
||||
}
|
||||
});
|
||||
|
@ -481,8 +516,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.population.couldNotOpenJobErrorMessage', {
|
||||
defaultMessage: 'Could not open job:',
|
||||
}),
|
||||
resp
|
||||
);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.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);
|
||||
|
@ -491,7 +535,12 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
// save failed
|
||||
msgs.error('Save failed: ', resp.resp);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.saveFailedErrorMessage', {
|
||||
defaultMessage: 'Save failed:',
|
||||
}),
|
||||
resp.resp
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// show the advanced section as the model memory limit is invalid
|
||||
|
@ -534,12 +583,22 @@ module
|
|||
})
|
||||
.catch((resp) => {
|
||||
// datafeed failed
|
||||
msgs.error('Could not start datafeed: ', resp);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.couldNotStartDatafeedErrorMessage', {
|
||||
defaultMessage: 'Could not start datafeed:'
|
||||
}),
|
||||
resp
|
||||
);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((resp) => {
|
||||
msgs.error('Save datafeed failed: ', resp);
|
||||
msgs.error(
|
||||
i18n('xpack.ml.newJob.simple.population.saveDatafeedFailedErrorMessage', {
|
||||
defaultMessage: 'Save datafeed failed:',
|
||||
}),
|
||||
resp
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue