mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
908ce15a52
commit
4130ddd93b
5 changed files with 25 additions and 9 deletions
10
x-pack/plugins/ml/common/constants/jobs_list.js
Normal file
10
x-pack/plugins/ml/common/constants/jobs_list.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
|
||||
export const DEFAULT_REFRESH_INTERVAL_MS = 30000;
|
||||
export const MINIMUM_REFRESH_INTERVAL_MS = 5000;
|
||||
export const DELETING_JOBS_REFRESH_INTERVAL_MS = 2000;
|
|
@ -12,14 +12,14 @@ export const DATAFEED_STATE = {
|
|||
STARTING: 'starting',
|
||||
STOPPED: 'stopped',
|
||||
STOPPING: 'stopping',
|
||||
DELETED: 'deleted'
|
||||
DELETED: 'deleted',
|
||||
};
|
||||
|
||||
export const FORECAST_REQUEST_STATE = {
|
||||
FAILED: 'failed',
|
||||
FINISHED: 'finished',
|
||||
SCHEDULED: 'scheduled',
|
||||
STARTED: 'started'
|
||||
STARTED: 'started',
|
||||
};
|
||||
|
||||
export const JOB_STATE = {
|
||||
|
@ -27,5 +27,6 @@ export const JOB_STATE = {
|
|||
CLOSING: 'closing',
|
||||
FAILED: 'failed',
|
||||
OPENED: 'opened',
|
||||
OPENING: 'opening'
|
||||
OPENING: 'opening',
|
||||
DELETED: 'deleted',
|
||||
};
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
|
||||
import { deleteJobs } from '../utils';
|
||||
import { DELETING_JOBS_REFRESH_INTERVAL_MS } from '../../../../../common/constants/jobs_list';
|
||||
import { injectI18n, FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
export const DeleteJobModal = injectI18n(class extends Component {
|
||||
|
@ -70,9 +71,9 @@ export const DeleteJobModal = injectI18n(class extends Component {
|
|||
deleteJobs(this.state.jobs);
|
||||
|
||||
setTimeout(() => {
|
||||
this.closeModal();
|
||||
this.refreshJobs();
|
||||
}, 500);
|
||||
this.closeModal();
|
||||
}, DELETING_JOBS_REFRESH_INTERVAL_MS);
|
||||
}
|
||||
|
||||
setEL = (el) => {
|
||||
|
|
|
@ -24,6 +24,12 @@ import { UpgradeWarning } from '../../../../components/upgrade';
|
|||
import { RefreshJobsListButton } from '../refresh_jobs_list_button';
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import {
|
||||
DEFAULT_REFRESH_INTERVAL_MS,
|
||||
MINIMUM_REFRESH_INTERVAL_MS,
|
||||
DELETING_JOBS_REFRESH_INTERVAL_MS,
|
||||
} from '../../../../../common/constants/jobs_list';
|
||||
|
||||
import React, {
|
||||
Component
|
||||
} from 'react';
|
||||
|
@ -34,9 +40,7 @@ import {
|
|||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
|
||||
const DEFAULT_REFRESH_INTERVAL_MS = 30000;
|
||||
const MINIMUM_REFRESH_INTERVAL_MS = 5000;
|
||||
const DELETING_JOBS_REFRESH_INTERVAL_MS = 2000;
|
||||
|
||||
let jobsRefreshInterval = null;
|
||||
let deletingJobsRefreshTimeout = null;
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ export function deleteJobs(jobs, finish = () => {}) {
|
|||
const jobIds = jobs.map(j => j.id);
|
||||
mlJobService.deleteJobs(jobIds)
|
||||
.then((resp) => {
|
||||
showResults(resp, DATAFEED_STATE.DELETED);
|
||||
showResults(resp, JOB_STATE.DELETED);
|
||||
finish();
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue