mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Adds waiting state for transforms. (#98592)
When no transform nodes are available, existing continuous transform end up in a waiting state. This PR adds support for this state in the transforms UI. Without the fix, transforms in a waiting state would fail to show up in the transform list.
This commit is contained in:
parent
fe48ae396b
commit
42d361c644
3 changed files with 10 additions and 3 deletions
|
@ -17,6 +17,7 @@ export const transformIdsSchema = schema.arrayOf(
|
|||
|
||||
export type TransformIdsSchema = TypeOf<typeof transformIdsSchema>;
|
||||
|
||||
// reflects https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java#L250
|
||||
export const transformStateSchema = schema.oneOf([
|
||||
schema.literal(TRANSFORM_STATE.ABORTING),
|
||||
schema.literal(TRANSFORM_STATE.FAILED),
|
||||
|
@ -24,6 +25,7 @@ export const transformStateSchema = schema.oneOf([
|
|||
schema.literal(TRANSFORM_STATE.STARTED),
|
||||
schema.literal(TRANSFORM_STATE.STOPPED),
|
||||
schema.literal(TRANSFORM_STATE.STOPPING),
|
||||
schema.literal(TRANSFORM_STATE.WAITING),
|
||||
]);
|
||||
|
||||
export const indexPatternTitleSchema = schema.object({
|
||||
|
|
|
@ -77,7 +77,7 @@ export const APP_CREATE_TRANSFORM_CLUSTER_PRIVILEGES = [
|
|||
|
||||
export const APP_INDEX_PRIVILEGES = ['monitor'];
|
||||
|
||||
// reflects https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/dataframe/transforms/DataFrameTransformStats.java#L243
|
||||
// reflects https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java#L250
|
||||
export const TRANSFORM_STATE = {
|
||||
ABORTING: 'aborting',
|
||||
FAILED: 'failed',
|
||||
|
@ -85,6 +85,7 @@ export const TRANSFORM_STATE = {
|
|||
STARTED: 'started',
|
||||
STOPPED: 'stopped',
|
||||
STOPPING: 'stopping',
|
||||
WAITING: 'waiting',
|
||||
} as const;
|
||||
|
||||
const transformStates = Object.values(TRANSFORM_STATE);
|
||||
|
|
|
@ -30,6 +30,7 @@ import { TRANSFORM_STATE } from '../../../../../../common/constants';
|
|||
import { getTransformProgress, TransformListRow, TRANSFORM_LIST_COLUMN } from '../../../../common';
|
||||
import { useActions } from './use_actions';
|
||||
|
||||
// reflects https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformStats.java#L250
|
||||
const STATE_COLOR = {
|
||||
aborting: 'warning',
|
||||
failed: 'danger',
|
||||
|
@ -37,6 +38,7 @@ const STATE_COLOR = {
|
|||
started: 'primary',
|
||||
stopped: 'hollow',
|
||||
stopping: 'hollow',
|
||||
waiting: 'hollow',
|
||||
} as const;
|
||||
|
||||
export const getTaskStateBadge = (
|
||||
|
@ -202,13 +204,15 @@ export const useColumns = (
|
|||
{!isBatchTransform && (
|
||||
<Fragment>
|
||||
<EuiFlexItem style={{ width: '40px' }} grow={false}>
|
||||
{/* If not stopped or failed show the animated progress bar */}
|
||||
{/* If not stopped, failed or waiting show the animated progress bar */}
|
||||
{item.stats.state !== TRANSFORM_STATE.STOPPED &&
|
||||
item.stats.state !== TRANSFORM_STATE.WAITING &&
|
||||
item.stats.state !== TRANSFORM_STATE.FAILED && (
|
||||
<EuiProgress color="primary" size="m" />
|
||||
)}
|
||||
{/* If stopped or failed show an empty (0%) progress bar */}
|
||||
{/* If stopped, failed or waiting show an empty (0%) progress bar */}
|
||||
{(item.stats.state === TRANSFORM_STATE.STOPPED ||
|
||||
item.stats.state === TRANSFORM_STATE.WAITING ||
|
||||
item.stats.state === TRANSFORM_STATE.FAILED) && (
|
||||
<EuiProgress value={0} max={100} color="primary" size="m" />
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue