mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Updating invalid model memory limit message (#21329)
* [ ML] Updating invalid modal memory limit message * changing to use template literal
This commit is contained in:
parent
3b6c9e3195
commit
6c46e3b1d9
2 changed files with 6 additions and 2 deletions
|
@ -21,6 +21,7 @@ import saveStatusTemplate from 'plugins/ml/jobs/new_job/advanced/save_status_mod
|
|||
import { createSearchItems, createJobForSaving } from 'plugins/ml/jobs/new_job/utils/new_job_utils';
|
||||
import { loadIndexPatterns, loadCurrentIndexPattern, loadCurrentSavedSearch, timeBasedIndexCheck } from 'plugins/ml/util/index_utils';
|
||||
import { ML_JOB_FIELD_TYPES, ES_FIELD_TYPES } from 'plugins/ml/../common/constants/field_types';
|
||||
import { ALLOWED_DATA_UNITS } from 'plugins/ml/../common/constants/validation';
|
||||
import { checkMlNodesAvailable } from 'plugins/ml/ml_nodes_check/check_ml_nodes';
|
||||
import { loadNewJobDefaults, newJobLimits, newJobDefaults } from 'plugins/ml/jobs/new_job/utils/new_job_defaults';
|
||||
import {
|
||||
|
@ -1028,7 +1029,8 @@ module.controller('MlNewJob',
|
|||
|
||||
if (validationResults.contains('model_memory_limit_units_invalid')) {
|
||||
tabs[0].checks.modelMemoryLimit.valid = false;
|
||||
const msg = `Model memory limit data unit unrecognized. It must be B, KB, MB, GB, TB or PB`;
|
||||
const str = `${(ALLOWED_DATA_UNITS.slice(0, ALLOWED_DATA_UNITS.length - 1).join(', '))} or ${([...ALLOWED_DATA_UNITS].pop())}`;
|
||||
const msg = `Model memory limit data unit unrecognized. It must be ${str}`;
|
||||
tabs[0].checks.modelMemoryLimit.message = msg;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
import { basicJobValidation } from 'plugins/ml/../common/util/job_utils';
|
||||
import { newJobLimits } from 'plugins/ml/jobs/new_job/utils/new_job_defaults';
|
||||
import { ALLOWED_DATA_UNITS } from 'plugins/ml/../common/constants/validation';
|
||||
import _ from 'lodash';
|
||||
|
||||
export function validateJob(job, checks) {
|
||||
|
@ -52,7 +53,8 @@ export function populateValidationMessages(validationResults, checks) {
|
|||
|
||||
if (validationResults.contains('model_memory_limit_units_invalid')) {
|
||||
checks.modelMemoryLimit.valid = false;
|
||||
const msg = `Model memory limit data unit unrecognized. It must be B, KB, MB, GB, TB or PB`;
|
||||
const str = `${(ALLOWED_DATA_UNITS.slice(0, ALLOWED_DATA_UNITS.length - 1).join(', '))} or ${([...ALLOWED_DATA_UNITS].pop())}`;
|
||||
const msg = `Model memory limit data unit unrecognized. It must be ${str}`;
|
||||
checks.modelMemoryLimit.message = msg;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue