mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Fix table layout on the Stack Management page (#137442)
* AD management table fixes * DFA management table fixes * Models management table fixes, add titles to links * datafeed state width * remove unused refresh button * style refresh button * loading indicator * remove unused translation
This commit is contained in:
parent
e19714a17e
commit
7791671371
10 changed files with 37 additions and 45 deletions
|
@ -142,7 +142,11 @@ export const DFAnalyticsJobIdLink = ({ jobId }: { jobId: string }) => {
|
||||||
pageState: { jobId },
|
pageState: { jobId },
|
||||||
});
|
});
|
||||||
|
|
||||||
return <EuiLink href={href}>{jobId}</EuiLink>;
|
return (
|
||||||
|
<EuiLink href={href} css={{ overflow: 'hidden', 'text-overflow': 'ellipsis' }} title={jobId}>
|
||||||
|
{jobId}
|
||||||
|
</EuiLink>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useColumns = (
|
export const useColumns = (
|
||||||
|
|
|
@ -59,14 +59,18 @@ export const AnomalyDetectionJobIdLink = (props: AnomalyDetectionJobIdLinkProps)
|
||||||
|
|
||||||
if (isGroupIdLink(props)) {
|
if (isGroupIdLink(props)) {
|
||||||
return (
|
return (
|
||||||
// Set margin-left to match EuiBadge (in JobGroup) built-in left margin for consistent badge spacing in management and plugin jobs list
|
<EuiLink key={props.groupId} href={href}>
|
||||||
<EuiLink style={{ marginLeft: '4px' }} key={props.groupId} href={href}>
|
|
||||||
<JobGroup name={props.groupId} />
|
<JobGroup name={props.groupId} />
|
||||||
</EuiLink>
|
</EuiLink>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<EuiLink key={props.id} href={href}>
|
<EuiLink
|
||||||
|
key={props.id}
|
||||||
|
href={href}
|
||||||
|
css={{ overflow: 'hidden', 'text-overflow': 'ellipsis' }}
|
||||||
|
title={props.id}
|
||||||
|
>
|
||||||
{props.id}
|
{props.id}
|
||||||
</EuiLink>
|
</EuiLink>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the Elastic License
|
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
||||||
* 2.0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export { RefreshJobsListButton } from './refresh_jobs_list_button';
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the Elastic License
|
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
||||||
* 2.0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import { EuiButtonEmpty } from '@elastic/eui';
|
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
|
||||||
|
|
||||||
export const RefreshJobsListButton = ({ onRefreshClick, isRefreshing }) => (
|
|
||||||
<EuiButtonEmpty
|
|
||||||
data-test-subj={`mlRefreshJobListButton${isRefreshing ? ' loading' : ' loaded'}`}
|
|
||||||
onClick={onRefreshClick}
|
|
||||||
isLoading={isRefreshing}
|
|
||||||
>
|
|
||||||
<FormattedMessage id="xpack.ml.jobsList.refreshButtonLabel" defaultMessage="Refresh" />
|
|
||||||
</EuiButtonEmpty>
|
|
||||||
);
|
|
||||||
|
|
||||||
RefreshJobsListButton.propTypes = {
|
|
||||||
onRefreshClick: PropTypes.func.isRequired,
|
|
||||||
isRefreshing: PropTypes.bool.isRequired,
|
|
||||||
};
|
|
|
@ -41,6 +41,7 @@ const adColumns: Array<EuiBasicTableColumn<AnomalyDetectionManagementItems>> = [
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
||||||
scope: 'row',
|
scope: 'row',
|
||||||
|
width: '250px',
|
||||||
render: (id: string) => <AnomalyDetectionJobIdLink id={id} />,
|
render: (id: string) => <AnomalyDetectionJobIdLink id={id} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -66,6 +67,7 @@ const adColumns: Array<EuiBasicTableColumn<AnomalyDetectionManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnJobState',
|
'data-test-subj': 'mlSpaceManagementTableColumnJobState',
|
||||||
|
width: '100px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'datafeedState',
|
field: 'datafeedState',
|
||||||
|
@ -75,6 +77,7 @@ const adColumns: Array<EuiBasicTableColumn<AnomalyDetectionManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnDatafeedState',
|
'data-test-subj': 'mlSpaceManagementTableColumnDatafeedState',
|
||||||
|
width: '150px',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -88,6 +91,7 @@ const dfaColumns: Array<EuiBasicTableColumn<AnalyticsManagementItems>> = [
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
||||||
scope: 'row',
|
scope: 'row',
|
||||||
|
width: '250px',
|
||||||
render: (id: string) => <DFAnalyticsJobIdLink jobId={id} />,
|
render: (id: string) => <DFAnalyticsJobIdLink jobId={id} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -107,6 +111,7 @@ const dfaColumns: Array<EuiBasicTableColumn<AnalyticsManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnSourceIndex',
|
'data-test-subj': 'mlSpaceManagementTableColumnSourceIndex',
|
||||||
|
width: '200px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dest_index',
|
field: 'dest_index',
|
||||||
|
@ -116,6 +121,7 @@ const dfaColumns: Array<EuiBasicTableColumn<AnalyticsManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnDestIndex',
|
'data-test-subj': 'mlSpaceManagementTableColumnDestIndex',
|
||||||
|
width: '200px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'job_type',
|
field: 'job_type',
|
||||||
|
@ -125,6 +131,7 @@ const dfaColumns: Array<EuiBasicTableColumn<AnalyticsManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnJobType',
|
'data-test-subj': 'mlSpaceManagementTableColumnJobType',
|
||||||
|
width: '150px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'state',
|
field: 'state',
|
||||||
|
@ -134,6 +141,7 @@ const dfaColumns: Array<EuiBasicTableColumn<AnalyticsManagementItems>> = [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnState',
|
'data-test-subj': 'mlSpaceManagementTableColumnState',
|
||||||
|
width: '100px',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -147,6 +155,7 @@ const trainedModelColumns: Array<EuiBasicTableColumn<TrainedModelsManagementItem
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
'data-test-subj': 'mlSpaceManagementTableColumnId',
|
||||||
scope: 'row',
|
scope: 'row',
|
||||||
|
width: '250px',
|
||||||
render: (id: string) => <TrainedModelLink id={id} />,
|
render: (id: string) => <TrainedModelLink id={id} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -169,6 +178,7 @@ const trainedModelColumns: Array<EuiBasicTableColumn<TrainedModelsManagementItem
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnType',
|
'data-test-subj': 'mlSpaceManagementTableColumnType',
|
||||||
|
width: '250px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'state',
|
field: 'state',
|
||||||
|
@ -178,5 +188,6 @@ const trainedModelColumns: Array<EuiBasicTableColumn<TrainedModelsManagementItem
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnState',
|
'data-test-subj': 'mlSpaceManagementTableColumnState',
|
||||||
|
width: '100px',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -16,6 +16,7 @@ import {
|
||||||
EuiInMemoryTable,
|
EuiInMemoryTable,
|
||||||
SearchFilterConfig,
|
SearchFilterConfig,
|
||||||
EuiBasicTableColumn,
|
EuiBasicTableColumn,
|
||||||
|
EuiProgress,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
|
|
||||||
import type { SpacesPluginStart } from '@kbn/spaces-plugin/public';
|
import type { SpacesPluginStart } from '@kbn/spaces-plugin/public';
|
||||||
|
@ -102,6 +103,8 @@ export const SpaceManagement: FC<Props> = ({ spacesApi, setCurrentTab }) => {
|
||||||
'data-test-subj': 'mlSpaceManagementTableColumnSpaces',
|
'data-test-subj': 'mlSpaceManagementTableColumnSpaces',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
truncateText: true,
|
truncateText: true,
|
||||||
|
align: 'right',
|
||||||
|
width: '10%',
|
||||||
render: (item: ManagementItems) => {
|
render: (item: ManagementItems) => {
|
||||||
return (
|
return (
|
||||||
<MLSavedObjectsSpacesList
|
<MLSavedObjectsSpacesList
|
||||||
|
@ -122,11 +125,12 @@ export const SpaceManagement: FC<Props> = ({ spacesApi, setCurrentTab }) => {
|
||||||
const getTable = useCallback(() => {
|
const getTable = useCallback(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{isLoading ? <EuiProgress size="xs" color="accent" /> : null}
|
||||||
|
|
||||||
<EuiSpacer size="m" />
|
<EuiSpacer size="m" />
|
||||||
{items === undefined ? null : (
|
{items === undefined ? null : (
|
||||||
<>
|
<>
|
||||||
<EuiFlexGroup>
|
<EuiFlexGroup justifyContent={'flexEnd'} gutterSize={'none'}>
|
||||||
<EuiFlexItem />
|
|
||||||
<EuiFlexItem grow={false}>
|
<EuiFlexItem grow={false}>
|
||||||
<RefreshButton
|
<RefreshButton
|
||||||
onRefreshClick={refresh.bind(null, currentTabId)}
|
onRefreshClick={refresh.bind(null, currentTabId)}
|
||||||
|
@ -210,6 +214,9 @@ export const RefreshButton: FC<{ onRefreshClick: () => void; isRefreshing: boole
|
||||||
data-test-subj={`mlRefreshJobListButton${isRefreshing ? ' loading' : ' loaded'}`}
|
data-test-subj={`mlRefreshJobListButton${isRefreshing ? ' loading' : ' loaded'}`}
|
||||||
onClick={onRefreshClick}
|
onClick={onRefreshClick}
|
||||||
isLoading={isRefreshing}
|
isLoading={isRefreshing}
|
||||||
|
iconType={'refresh'}
|
||||||
|
iconSide={'left'}
|
||||||
|
iconSize={'m'}
|
||||||
>
|
>
|
||||||
<FormattedMessage id="xpack.ml.management.list.refreshButtonLabel" defaultMessage="Refresh" />
|
<FormattedMessage id="xpack.ml.management.list.refreshButtonLabel" defaultMessage="Refresh" />
|
||||||
</EuiButtonEmpty>
|
</EuiButtonEmpty>
|
||||||
|
|
|
@ -20,5 +20,9 @@ export const TrainedModelLink: FC<TrainedModelLinkProps> = ({ id }) => {
|
||||||
pageState: { modelId: id },
|
pageState: { modelId: id },
|
||||||
});
|
});
|
||||||
|
|
||||||
return <EuiLink href={href}>{id}</EuiLink>;
|
return (
|
||||||
|
<EuiLink href={href} css={{ overflow: 'hidden', 'text-overflow': 'ellipsis' }} title={id}>
|
||||||
|
{id}
|
||||||
|
</EuiLink>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -19223,7 +19223,6 @@
|
||||||
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "Vous ne pourrez ni créer ni exécuter de tâches.",
|
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "Vous ne pourrez ni créer ni exécuter de tâches.",
|
||||||
"xpack.ml.jobsList.noJobsFoundLabel": "Aucune tâche n'a été trouvée",
|
"xpack.ml.jobsList.noJobsFoundLabel": "Aucune tâche n'a été trouvée",
|
||||||
"xpack.ml.jobsList.processedRecordsLabel": "Enregistrements traités",
|
"xpack.ml.jobsList.processedRecordsLabel": "Enregistrements traités",
|
||||||
"xpack.ml.jobsList.refreshButtonLabel": "Actualiser",
|
|
||||||
"xpack.ml.jobsList.resetActionStatusText": "réinitialiser",
|
"xpack.ml.jobsList.resetActionStatusText": "réinitialiser",
|
||||||
"xpack.ml.jobsList.resetJobErrorMessage": "Impossible de réinitialiser les tâches",
|
"xpack.ml.jobsList.resetJobErrorMessage": "Impossible de réinitialiser les tâches",
|
||||||
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "Annuler",
|
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "Annuler",
|
||||||
|
|
|
@ -19308,7 +19308,6 @@
|
||||||
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "ジョブの作成または実行はできません。",
|
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "ジョブの作成または実行はできません。",
|
||||||
"xpack.ml.jobsList.noJobsFoundLabel": "ジョブが見つかりません",
|
"xpack.ml.jobsList.noJobsFoundLabel": "ジョブが見つかりません",
|
||||||
"xpack.ml.jobsList.processedRecordsLabel": "処理済みレコード",
|
"xpack.ml.jobsList.processedRecordsLabel": "処理済みレコード",
|
||||||
"xpack.ml.jobsList.refreshButtonLabel": "更新",
|
|
||||||
"xpack.ml.jobsList.resetActionStatusText": "リセット",
|
"xpack.ml.jobsList.resetActionStatusText": "リセット",
|
||||||
"xpack.ml.jobsList.resetJobErrorMessage": "ジョブのリセットに失敗しました",
|
"xpack.ml.jobsList.resetJobErrorMessage": "ジョブのリセットに失敗しました",
|
||||||
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "キャンセル",
|
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "キャンセル",
|
||||||
|
|
|
@ -19328,7 +19328,6 @@
|
||||||
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "您将无法创建或运行作业。",
|
"xpack.ml.jobsList.nodeAvailableWarning.unavailableCreateOrRunJobsDescription": "您将无法创建或运行作业。",
|
||||||
"xpack.ml.jobsList.noJobsFoundLabel": "找不到作业",
|
"xpack.ml.jobsList.noJobsFoundLabel": "找不到作业",
|
||||||
"xpack.ml.jobsList.processedRecordsLabel": "已处理记录",
|
"xpack.ml.jobsList.processedRecordsLabel": "已处理记录",
|
||||||
"xpack.ml.jobsList.refreshButtonLabel": "刷新",
|
|
||||||
"xpack.ml.jobsList.resetActionStatusText": "重置",
|
"xpack.ml.jobsList.resetActionStatusText": "重置",
|
||||||
"xpack.ml.jobsList.resetJobErrorMessage": "作业无法重置",
|
"xpack.ml.jobsList.resetJobErrorMessage": "作业无法重置",
|
||||||
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "取消",
|
"xpack.ml.jobsList.resetJobModal.cancelButtonLabel": "取消",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue