mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Add missing document titles (#124125)
* model management titles * settings titles * useDocTitle * data vis titles * ad titles * dfa titles * fix capitalization * update translation files * fix typo * Update x-pack/plugins/ml/public/application/routing/routes/trained_models/nodes_list.tsx Co-authored-by: Lisa Cawley <lcawley@elastic.co> * fix edit calendar and filter * fix data vis titles
This commit is contained in:
parent
aea8aefb84
commit
62fbaf83d4
25 changed files with 133 additions and 121 deletions
|
@ -21,6 +21,7 @@ import {
|
|||
KibanaPageTemplate,
|
||||
RedirectAppLinks,
|
||||
} from '../../../../../../../src/plugins/kibana_react/public';
|
||||
import { useDocTitle } from '../../routing/use_doc_title';
|
||||
|
||||
export const MlPageControlsContext = createContext<{
|
||||
setPageTitle: (v?: React.ReactNode | undefined) => void;
|
||||
|
@ -79,6 +80,8 @@ export const MlPage: FC<{ pageDeps: PageDependencies }> = React.memo(({ pageDeps
|
|||
|
||||
const activeRoute = useActiveRoute(routeList);
|
||||
|
||||
useDocTitle(activeRoute);
|
||||
|
||||
return (
|
||||
<KibanaPageTemplate
|
||||
className={'ml-app'}
|
||||
|
|
|
@ -7,12 +7,11 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { EuiSideNavItemType } from '@elastic/eui';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import type { MlLocatorParams } from '../../../../common/types/locator';
|
||||
import { useUrlState } from '../../util/url_state';
|
||||
import { useMlKibana, useMlLocator, useNavigateToPath } from '../../contexts/kibana';
|
||||
import { useMlLocator, useNavigateToPath } from '../../contexts/kibana';
|
||||
import { isFullLicense } from '../../license';
|
||||
import { ML_APP_NAME } from '../../../../common/constants/app';
|
||||
import type { MlRoute } from '../../routing';
|
||||
import { ML_PAGES } from '../../../../common/constants/locator';
|
||||
import { checkPermission } from '../../capabilities/check_capabilities';
|
||||
|
@ -29,79 +28,13 @@ export interface Tab {
|
|||
highlightNestedRoutes?: boolean;
|
||||
}
|
||||
|
||||
interface TabData {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export const TAB_DATA: Record<string, TabData> = {
|
||||
overview: {
|
||||
name: i18n.translate('xpack.ml.overviewTabLabel', {
|
||||
defaultMessage: 'Overview',
|
||||
}),
|
||||
},
|
||||
// Note that anomaly detection jobs list is mapped to ml#/jobs.
|
||||
anomaly_detection: {
|
||||
name: i18n.translate('xpack.ml.anomalyDetectionTabLabel', {
|
||||
defaultMessage: 'Anomaly Detection',
|
||||
}),
|
||||
},
|
||||
data_frame_analytics: {
|
||||
name: i18n.translate('xpack.ml.dataFrameAnalyticsTabLabel', {
|
||||
defaultMessage: 'Data Frame Analytics',
|
||||
}),
|
||||
},
|
||||
trained_models: {
|
||||
name: i18n.translate('xpack.ml.trainedModelsTabLabel', {
|
||||
defaultMessage: 'Trained Models',
|
||||
}),
|
||||
},
|
||||
datavisualizer: {
|
||||
name: i18n.translate('xpack.ml.dataVisualizerTabLabel', {
|
||||
defaultMessage: 'Data Visualizer',
|
||||
}),
|
||||
},
|
||||
data_view_datavisualizer: {
|
||||
name: i18n.translate('xpack.ml.dataViewDataVisualizerTabLabel', {
|
||||
defaultMessage: 'Data View',
|
||||
}),
|
||||
},
|
||||
filedatavisualizer: {
|
||||
name: i18n.translate('xpack.ml.fileDataVisualizerTabLabel', {
|
||||
defaultMessage: 'File',
|
||||
}),
|
||||
},
|
||||
settings: {
|
||||
name: i18n.translate('xpack.ml.settingsTabLabel', {
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
},
|
||||
'access-denied': {
|
||||
name: i18n.translate('xpack.ml.accessDeniedTabLabel', {
|
||||
defaultMessage: 'Access Denied',
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
export function useSideNavItems(activeRoute: MlRoute | undefined) {
|
||||
const activeRouteId = activeRoute?.id;
|
||||
const {
|
||||
services: {
|
||||
chrome: { docTitle },
|
||||
},
|
||||
} = useMlKibana();
|
||||
const mlLocator = useMlLocator();
|
||||
const navigateToPath = useNavigateToPath();
|
||||
|
||||
const mlFeaturesDisabled = !isFullLicense();
|
||||
const canViewMlNodes = checkPermission('canViewMlNodes');
|
||||
|
||||
useEffect(() => {
|
||||
const title = TAB_DATA[activeRouteId!]?.name;
|
||||
if (title) {
|
||||
docTitle.change([title, ML_APP_NAME]);
|
||||
}
|
||||
}, [activeRouteId]);
|
||||
|
||||
const [globalState] = useUrlState('_g');
|
||||
|
||||
const pageState = useMemo(() => {
|
||||
|
|
|
@ -16,12 +16,14 @@ const breadcrumbs = [
|
|||
text: i18n.translate('xpack.ml.accessDeniedLabel', {
|
||||
defaultMessage: 'Access denied',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
export const accessDeniedRouteFactory = (): MlRoute => ({
|
||||
path: '/access-denied',
|
||||
title: i18n.translate('xpack.ml.accessDeniedLabel', {
|
||||
defaultMessage: 'Access denied',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs,
|
||||
});
|
||||
|
|
|
@ -28,12 +28,15 @@ export const analyticsJobsCreationRouteFactory = (
|
|||
): MlRoute => ({
|
||||
path: '/data_frame_analytics/new_job',
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
title: i18n.translate('xpack.ml.dataFrameAnalytics.createJob.docTitle', {
|
||||
defaultMessage: 'Create Job',
|
||||
}),
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
getBreadcrumbWithUrlForApp('DATA_FRAME_ANALYTICS_BREADCRUMB', navigateToPath, basePath),
|
||||
{
|
||||
text: i18n.translate('xpack.ml.dataFrameAnalyticsBreadcrumbs.dataFrameCreationLabel', {
|
||||
defaultMessage: 'Create job',
|
||||
defaultMessage: 'Create Job',
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
|
|
@ -26,6 +26,9 @@ export const analyticsJobExplorationRouteFactory = (
|
|||
): MlRoute => ({
|
||||
path: '/data_frame_analytics/exploration',
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
title: i18n.translate('xpack.ml.dataFrameAnalytics.exploration.docTitle', {
|
||||
defaultMessage: 'Exploration',
|
||||
}),
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
getBreadcrumbWithUrlForApp('DATA_FRAME_ANALYTICS_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -20,6 +20,9 @@ export const analyticsJobsListRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'data_frame_analytics',
|
||||
path: '/data_frame_analytics',
|
||||
title: i18n.translate('xpack.ml.dataFrameAnalytics.jobs.docTitle', {
|
||||
defaultMessage: 'Data Frame Analytics Jobs',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -22,6 +22,9 @@ export const analyticsMapRouteFactory = (
|
|||
): MlRoute => ({
|
||||
path: '/data_frame_analytics/map',
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
title: i18n.translate('xpack.ml.dataFrameAnalytics.analyticsMap.docTitle', {
|
||||
defaultMessage: 'Analytics Map',
|
||||
}),
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
getBreadcrumbWithUrlForApp('DATA_FRAME_ANALYTICS_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -6,13 +6,11 @@
|
|||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { NavigateToPath } from '../../../contexts/kibana';
|
||||
|
||||
import { MlRoute, PageLoader, PageProps } from '../../router';
|
||||
import { useResolver } from '../../use_resolver';
|
||||
import { DatavisualizerSelector } from '../../../datavisualizer';
|
||||
|
||||
import { checkBasicLicense } from '../../../license';
|
||||
import { checkFindFileStructurePrivilegeResolver } from '../../../capabilities/check_capabilities';
|
||||
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
|
||||
|
@ -23,6 +21,9 @@ export const selectorRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'datavisualizer',
|
||||
path: '/datavisualizer',
|
||||
title: i18n.translate('xpack.ml.dataVisualizer.docTitle', {
|
||||
defaultMessage: 'Data Visualizer',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -26,6 +26,9 @@ export const fileBasedRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'filedatavisualizer',
|
||||
path: '/filedatavisualizer',
|
||||
title: i18n.translate('xpack.ml.dataVisualizer.file.docTitle', {
|
||||
defaultMessage: 'File Data Visualizer',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -34,7 +37,6 @@ export const fileBasedRouteFactory = (
|
|||
text: i18n.translate('xpack.ml.dataVisualizer.fileBasedLabel', {
|
||||
defaultMessage: 'File',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
@ -27,6 +27,9 @@ export const indexBasedRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'data_view_datavisualizer',
|
||||
path: '/jobs/new_job/datavisualizer',
|
||||
title: i18n.translate('xpack.ml.dataVisualizer.dataView.docTitle', {
|
||||
defaultMessage: 'Index Data Visualizer',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -35,7 +38,6 @@ export const indexBasedRouteFactory = (
|
|||
text: i18n.translate('xpack.ml.dataFrameAnalyticsBreadcrumbs.dataViewLabel', {
|
||||
defaultMessage: 'Data View',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
@ -49,6 +49,9 @@ export const explorerRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'explorer',
|
||||
path: '/explorer',
|
||||
title: i18n.translate('xpack.ml.anomalyDetection.anomalyExplorer.docTitle', {
|
||||
defaultMessage: 'Anomaly Explorer',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -57,7 +60,6 @@ export const explorerRouteFactory = (
|
|||
text: i18n.translate('xpack.ml.anomalyDetection.anomalyExplorerLabel', {
|
||||
defaultMessage: 'Anomaly Explorer',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
],
|
||||
enableDatePicker: true,
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
import React, { useEffect, FC, useMemo } from 'react';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { NavigateToPath } from '../../contexts/kibana';
|
||||
|
||||
import { DEFAULT_REFRESH_INTERVAL_MS } from '../../../../common/constants/jobs_list';
|
||||
import { mlTimefilterRefresh$ } from '../../services/timefilter_refresh_service';
|
||||
import { useUrlState } from '../../util/url_state';
|
||||
|
@ -25,8 +23,8 @@ import { MlAnnotationUpdatesContext } from '../../contexts/ml/ml_annotation_upda
|
|||
|
||||
export const jobListRouteFactory = (navigateToPath: NavigateToPath, basePath: string): MlRoute => ({
|
||||
id: 'anomaly_detection',
|
||||
title: i18n.translate('xpack.ml.overview.anomalyDetection.panelTitle', {
|
||||
defaultMessage: 'Anomaly Detection',
|
||||
title: i18n.translate('xpack.ml.anomalyDetection.jobs.docTitle', {
|
||||
defaultMessage: 'Anomaly Detection Jobs',
|
||||
}),
|
||||
path: '/jobs',
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
|
|
|
@ -37,7 +37,6 @@ const getBreadcrumbs = (navigateToPath: NavigateToPath, basePath: string) => [
|
|||
text: i18n.translate('xpack.ml.jobsBreadcrumbs.createJobLabel', {
|
||||
defaultMessage: 'Create job',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -48,7 +47,6 @@ const getDataVisBreadcrumbs = (navigateToPath: NavigateToPath, basePath: string)
|
|||
text: i18n.translate('xpack.ml.jobsBreadcrumbs.selectDateViewLabel', {
|
||||
defaultMessage: 'Data View',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -74,6 +72,9 @@ export const dataVizIndexOrSearchRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'data_view_datavisualizer',
|
||||
path: '/datavisualizer_index_select',
|
||||
title: i18n.translate('xpack.ml.selectDataViewLabel', {
|
||||
defaultMessage: 'Select Data View',
|
||||
}),
|
||||
render: (props, deps) => (
|
||||
<PageWrapper
|
||||
{...props}
|
||||
|
|
|
@ -6,13 +6,10 @@
|
|||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
|
||||
import { NavigateToPath } from '../../../contexts/kibana';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { NavigateToPath, useTimefilter } from '../../../contexts/kibana';
|
||||
import { MlRoute, PageLoader, PageProps } from '../../router';
|
||||
import { useResolver } from '../../use_resolver';
|
||||
|
||||
import { useTimefilter } from '../../../contexts/kibana';
|
||||
import { checkFullLicense } from '../../../license';
|
||||
import {
|
||||
checkGetJobsCapabilitiesResolver,
|
||||
|
@ -27,6 +24,9 @@ export const calendarListRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/calendars_list',
|
||||
title: i18n.translate('xpack.ml.settings.calendarList.docTitle', {
|
||||
defaultMessage: 'Calendars',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -7,13 +7,9 @@
|
|||
|
||||
import React, { FC } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { NavigateToPath } from '../../../contexts/kibana';
|
||||
|
||||
import { NavigateToPath, useTimefilter } from '../../../contexts/kibana';
|
||||
import { MlRoute, PageLoader, PageProps } from '../../router';
|
||||
import { useResolver } from '../../use_resolver';
|
||||
|
||||
import { useTimefilter } from '../../../contexts/kibana';
|
||||
import { checkFullLicense } from '../../../license';
|
||||
import {
|
||||
checkGetJobsCapabilitiesResolver,
|
||||
|
@ -39,6 +35,9 @@ export const newCalendarRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/calendars_list/new_calendar',
|
||||
title: i18n.translate('xpack.ml.settings.createCalendar.docTitle', {
|
||||
defaultMessage: 'Create Calendar',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} mode={MODE.NEW} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -58,6 +57,9 @@ export const editCalendarRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/calendars_list/edit_calendar/:calendarId',
|
||||
title: i18n.translate('xpack.ml.settings.editCalendar.docTitle', {
|
||||
defaultMessage: 'Edit Calendar',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} mode={MODE.EDIT} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -6,13 +6,10 @@
|
|||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
|
||||
import { NavigateToPath } from '../../../contexts/kibana';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { NavigateToPath, useTimefilter } from '../../../contexts/kibana';
|
||||
import { MlRoute, PageLoader, PageProps } from '../../router';
|
||||
import { useResolver } from '../../use_resolver';
|
||||
|
||||
import { useTimefilter } from '../../../contexts/kibana';
|
||||
import { checkFullLicense } from '../../../license';
|
||||
import {
|
||||
checkGetJobsCapabilitiesResolver,
|
||||
|
@ -20,7 +17,6 @@ import {
|
|||
} from '../../../capabilities/check_capabilities';
|
||||
import { getMlNodeCount } from '../../../ml_nodes_check/check_ml_nodes';
|
||||
import { FilterLists } from '../../../settings/filter_lists';
|
||||
|
||||
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
|
||||
|
||||
export const filterListRouteFactory = (
|
||||
|
@ -28,6 +24,9 @@ export const filterListRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/filter_lists',
|
||||
title: i18n.translate('xpack.ml.settings.filterList.docTitle', {
|
||||
defaultMessage: 'Filters',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -40,6 +40,9 @@ export const newFilterListRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/filter_lists/new_filter_list',
|
||||
title: i18n.translate('xpack.ml.settings.createFilter.docTitle', {
|
||||
defaultMessage: 'Create Filter',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} mode={MODE.NEW} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -59,6 +62,9 @@ export const editFilterListRouteFactory = (
|
|||
basePath: string
|
||||
): MlRoute => ({
|
||||
path: '/settings/filter_lists/edit_filter_list/:filterId',
|
||||
title: i18n.translate('xpack.ml.settings.editFilter.docTitle', {
|
||||
defaultMessage: 'Edit Filter',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} mode={MODE.EDIT} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -6,13 +6,10 @@
|
|||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
|
||||
import { NavigateToPath } from '../../../contexts/kibana';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { NavigateToPath, useTimefilter } from '../../../contexts/kibana';
|
||||
import { MlRoute, PageLoader, PageProps } from '../../router';
|
||||
import { useResolver } from '../../use_resolver';
|
||||
|
||||
import { useTimefilter } from '../../../contexts/kibana';
|
||||
import { checkFullLicense } from '../../../license';
|
||||
import {
|
||||
checkGetJobsCapabilitiesResolver,
|
||||
|
@ -28,6 +25,9 @@ export const settingsRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'settings',
|
||||
path: '/settings',
|
||||
title: i18n.translate('xpack.ml.settings.docTitle', {
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -53,6 +53,9 @@ export const timeSeriesExplorerRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'timeseriesexplorer',
|
||||
path: '/timeseriesexplorer',
|
||||
title: i18n.translate('xpack.ml.anomalyDetection.singleMetricViewerLabel', {
|
||||
defaultMessage: 'Single Metric Viewer',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
@ -61,7 +64,6 @@ export const timeSeriesExplorerRouteFactory = (
|
|||
text: i18n.translate('xpack.ml.anomalyDetection.singleMetricViewerLabel', {
|
||||
defaultMessage: 'Single Metric Viewer',
|
||||
}),
|
||||
href: '',
|
||||
},
|
||||
],
|
||||
enableDatePicker: true,
|
||||
|
|
|
@ -23,6 +23,9 @@ export const modelsListRouteFactory = (
|
|||
): MlRoute => ({
|
||||
id: 'trained_models',
|
||||
path: '/trained_models',
|
||||
title: i18n.translate('xpack.ml.modelManagement.trainedModels.docTitle', {
|
||||
defaultMessage: 'Trained Models',
|
||||
}),
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
|
|
|
@ -23,6 +23,9 @@ export const nodesListRouteFactory = (
|
|||
): MlRoute => ({
|
||||
path: '/trained_models/nodes',
|
||||
render: (props, deps) => <PageWrapper {...props} deps={deps} />,
|
||||
title: i18n.translate('xpack.ml.modelManagement.nodesOverview.docTitle', {
|
||||
defaultMessage: 'Nodes',
|
||||
}),
|
||||
breadcrumbs: [
|
||||
getBreadcrumbWithUrlForApp('ML_BREADCRUMB', navigateToPath, basePath),
|
||||
getBreadcrumbWithUrlForApp('TRAINED_MODELS', navigateToPath, basePath),
|
||||
|
|
|
@ -5,16 +5,31 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useLocation, useRouteMatch } from 'react-router-dom';
|
||||
import { keyBy } from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
import type { MlRoute } from './router';
|
||||
|
||||
export const useActiveRoute = (routesList: MlRoute[]): MlRoute => {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
/**
|
||||
* Temp fix for routes with params.
|
||||
*/
|
||||
const editCalendarMatch = useRouteMatch('/settings/calendars_list/edit_calendar/:calendarId');
|
||||
const editFilterMatch = useRouteMatch('/settings/filter_lists/edit_filter_list/:filterId');
|
||||
|
||||
const routesMap = useMemo(() => keyBy(routesList, 'path'), []);
|
||||
|
||||
const activeRoute = useMemo(() => routesMap[pathname], [pathname]);
|
||||
const activeRoute = useMemo(() => {
|
||||
if (editCalendarMatch) {
|
||||
return routesMap[editCalendarMatch.path];
|
||||
}
|
||||
if (editFilterMatch) {
|
||||
return routesMap[editFilterMatch.path];
|
||||
}
|
||||
return routesMap[pathname];
|
||||
}, [pathname]);
|
||||
|
||||
return activeRoute ?? routesMap['/overview'];
|
||||
};
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* 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 { useCallback, useEffect } from 'react';
|
||||
import { ML_APP_NAME } from '../../../common/constants/app';
|
||||
import type { MlRoute } from './router';
|
||||
import { useMlKibana } from '../contexts/kibana';
|
||||
|
||||
/**
|
||||
* Handles document title automatically based on the active route.
|
||||
* Returns a callback for manual title updates.
|
||||
*/
|
||||
export const useDocTitle = (activeRoute: MlRoute | undefined) => {
|
||||
const activeRouteTitle = activeRoute?.title;
|
||||
|
||||
const {
|
||||
services: {
|
||||
chrome: { docTitle },
|
||||
},
|
||||
} = useMlKibana();
|
||||
|
||||
const updateDocTitle = useCallback(
|
||||
(title: string) => {
|
||||
docTitle.change([title, ML_APP_NAME]);
|
||||
},
|
||||
[docTitle]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (activeRouteTitle) {
|
||||
updateDocTitle(activeRouteTitle);
|
||||
}
|
||||
}, [updateDocTitle, activeRouteTitle]);
|
||||
|
||||
return updateDocTitle;
|
||||
};
|
|
@ -15816,7 +15816,6 @@
|
|||
"xpack.maps.visTypeAlias.title": "マップ",
|
||||
"xpack.ml.accessDenied.description": "機械学習プラグインを表示するアクセス権がありません。プラグインにアクセスするには、機械学習機能をこのスペースで表示する必要があります。",
|
||||
"xpack.ml.accessDeniedLabel": "アクセスが拒否されました",
|
||||
"xpack.ml.accessDeniedTabLabel": "アクセス拒否",
|
||||
"xpack.ml.actions.applyEntityFieldsFiltersTitle": "値でフィルター",
|
||||
"xpack.ml.actions.applyInfluencersFiltersTitle": "値でフィルター",
|
||||
"xpack.ml.actions.applyTimeRangeSelectionTitle": "時間範囲選択を適用",
|
||||
|
@ -15991,7 +15990,6 @@
|
|||
"xpack.ml.anomalyDetectionAlert.topNBucketsDescription": "最高の異常を取得するために確認する最新のバケット数。",
|
||||
"xpack.ml.anomalyDetectionAlert.topNBucketsLabel": "最新のバケット数",
|
||||
"xpack.ml.anomalyDetectionBreadcrumbLabel": "異常検知",
|
||||
"xpack.ml.anomalyDetectionTabLabel": "異常検知",
|
||||
"xpack.ml.anomalyExplorerPageLabel": "異常エクスプローラー",
|
||||
"xpack.ml.anomalyResultsViewSelector.anomalyExplorerLabel": "異常エクスプローラーで結果を表示",
|
||||
"xpack.ml.anomalyResultsViewSelector.buttonGroupLegend": "異常結果ビューセレクター",
|
||||
|
@ -16583,7 +16581,6 @@
|
|||
"xpack.ml.dataFrameAnalyticsBreadcrumbs.analyticsMapLabel": "分析マップ",
|
||||
"xpack.ml.dataFrameAnalyticsBreadcrumbs.dataFrameExplorationLabel": "探索",
|
||||
"xpack.ml.dataFrameAnalyticsLabel": "データフレーム分析",
|
||||
"xpack.ml.dataFrameAnalyticsTabLabel": "データフレーム分析",
|
||||
"xpack.ml.dataGrid.CcsWarningCalloutBody": "データビューのデータの取得中に問題が発生しました。ソースプレビューとクラスター横断検索を組み合わせることは、バージョン7.10以上ではサポートされていません。変換を構成して作成することはできます。",
|
||||
"xpack.ml.dataGrid.CcsWarningCalloutTitle": "クラスター横断検索でフィールドデータが返されませんでした。",
|
||||
"xpack.ml.dataGrid.columnChart.ErrorMessageToast": "ヒストグラムデータの取得でエラーが発生しました。{error}",
|
||||
|
@ -16613,7 +16610,6 @@
|
|||
"xpack.ml.datavisualizer.startTrial.subscriptionsLinkText": "PlatinumまたはEnterprise サブスクリプション",
|
||||
"xpack.ml.datavisualizerBreadcrumbLabel": "データビジュアライザー",
|
||||
"xpack.ml.dataVisualizerPageLabel": "データビジュアライザー",
|
||||
"xpack.ml.dataVisualizerTabLabel": "データビジュアライザー",
|
||||
"xpack.ml.deepLink.anomalyDetection": "異常検知",
|
||||
"xpack.ml.deepLink.calendarSettings": "カレンダー",
|
||||
"xpack.ml.deepLink.dataFrameAnalytics": "データフレーム分析",
|
||||
|
@ -17681,7 +17677,6 @@
|
|||
"xpack.ml.overviewJobsList.statsBar.failedJobsLabel": "失敗したジョブ",
|
||||
"xpack.ml.overviewJobsList.statsBar.openJobsLabel": "ジョブを開く",
|
||||
"xpack.ml.overviewJobsList.statsBar.totalJobsLabel": "合計ジョブ数",
|
||||
"xpack.ml.overviewTabLabel": "概要",
|
||||
"xpack.ml.plugin.title": "機械学習",
|
||||
"xpack.ml.previewAlert.hideResultsButtonLabel": "結果を非表示",
|
||||
"xpack.ml.previewAlert.intervalLabel": "ルール条件と間隔を確認",
|
||||
|
@ -17858,7 +17853,6 @@
|
|||
"xpack.ml.settings.filterLists.toolbar.deleteItemButtonLabel": "アイテムを削除",
|
||||
"xpack.ml.settings.title": "設定",
|
||||
"xpack.ml.settingsBreadcrumbLabel": "設定",
|
||||
"xpack.ml.settingsTabLabel": "設定",
|
||||
"xpack.ml.severitySelector.formControlAriaLabel": "重要度のしきい値を選択",
|
||||
"xpack.ml.severitySelector.formControlLabel": "深刻度",
|
||||
"xpack.ml.singleMetricViewerPageLabel": "シングルメトリックビューアー",
|
||||
|
@ -18107,7 +18101,6 @@
|
|||
"xpack.ml.trainedModels.nodesList.nodesFetchError": "ノードの取り込みが失敗しました",
|
||||
"xpack.ml.trainedModels.nodesList.nodeTotalMemoryHeader": "合計メモリー",
|
||||
"xpack.ml.trainedModels.nodesList.totalAmountLabel": "合計機械学習ノード",
|
||||
"xpack.ml.trainedModelsTabLabel": "学習済みモデル",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescription": "機械学習に関連したインデックスは現在アップグレード中です。",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescriptionExtra": "現在いくつかのアクションが利用できません。",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningTitle": "インデックスの移行が進行中です",
|
||||
|
|
|
@ -16025,7 +16025,6 @@
|
|||
"xpack.maps.visTypeAlias.title": "Maps",
|
||||
"xpack.ml.accessDenied.description": "您无权查看 Machine Learning 插件。要访问该插件,需要 Machine Learning 功能在此工作区中可见。",
|
||||
"xpack.ml.accessDeniedLabel": "访问被拒绝",
|
||||
"xpack.ml.accessDeniedTabLabel": "访问被拒绝",
|
||||
"xpack.ml.actions.applyEntityFieldsFiltersTitle": "筛留值",
|
||||
"xpack.ml.actions.applyInfluencersFiltersTitle": "筛留值",
|
||||
"xpack.ml.actions.applyTimeRangeSelectionTitle": "应用时间范围选择",
|
||||
|
@ -16207,7 +16206,6 @@
|
|||
"xpack.ml.anomalyDetectionAlert.topNBucketsDescription": "为获取最高异常而要检查的最新存储桶数目。",
|
||||
"xpack.ml.anomalyDetectionAlert.topNBucketsLabel": "最新存储桶数目",
|
||||
"xpack.ml.anomalyDetectionBreadcrumbLabel": "异常检测",
|
||||
"xpack.ml.anomalyDetectionTabLabel": "异常检测",
|
||||
"xpack.ml.anomalyExplorerPageLabel": "Anomaly Explorer",
|
||||
"xpack.ml.anomalyResultsViewSelector.anomalyExplorerLabel": "在 Anomaly Explorer 中查看结果",
|
||||
"xpack.ml.anomalyResultsViewSelector.buttonGroupLegend": "异常结果视图选择器",
|
||||
|
@ -16807,7 +16805,6 @@
|
|||
"xpack.ml.dataFrameAnalyticsBreadcrumbs.analyticsMapLabel": "分析地图",
|
||||
"xpack.ml.dataFrameAnalyticsBreadcrumbs.dataFrameExplorationLabel": "探查",
|
||||
"xpack.ml.dataFrameAnalyticsLabel": "数据帧分析",
|
||||
"xpack.ml.dataFrameAnalyticsTabLabel": "数据帧分析",
|
||||
"xpack.ml.dataGrid.CcsWarningCalloutBody": "检索数据视图的数据时出现问题。源预览和跨集群搜索仅在 7.10 及以上版本上受支持。可能需要配置和创建转换。",
|
||||
"xpack.ml.dataGrid.CcsWarningCalloutTitle": "跨集群搜索未返回字段数据。",
|
||||
"xpack.ml.dataGrid.columnChart.ErrorMessageToast": "提取直方图数据时发生错误:{error}",
|
||||
|
@ -16838,7 +16835,6 @@
|
|||
"xpack.ml.datavisualizer.startTrial.subscriptionsLinkText": "白金级或企业级订阅",
|
||||
"xpack.ml.datavisualizerBreadcrumbLabel": "数据可视化工具",
|
||||
"xpack.ml.dataVisualizerPageLabel": "数据可视化工具",
|
||||
"xpack.ml.dataVisualizerTabLabel": "数据可视化工具",
|
||||
"xpack.ml.deepLink.anomalyDetection": "异常检测",
|
||||
"xpack.ml.deepLink.calendarSettings": "日历",
|
||||
"xpack.ml.deepLink.dataFrameAnalytics": "数据帧分析",
|
||||
|
@ -17954,7 +17950,6 @@
|
|||
"xpack.ml.overviewJobsList.statsBar.failedJobsLabel": "失败的作业",
|
||||
"xpack.ml.overviewJobsList.statsBar.openJobsLabel": "打开的作业",
|
||||
"xpack.ml.overviewJobsList.statsBar.totalJobsLabel": "总计作业数",
|
||||
"xpack.ml.overviewTabLabel": "概览",
|
||||
"xpack.ml.plugin.title": "Machine Learning",
|
||||
"xpack.ml.previewAlert.hideResultsButtonLabel": "隐藏结果",
|
||||
"xpack.ml.previewAlert.intervalLabel": "检查具有时间间隔的规则条件",
|
||||
|
@ -18137,7 +18132,6 @@
|
|||
"xpack.ml.settings.filterLists.toolbar.deleteItemButtonLabel": "删除项",
|
||||
"xpack.ml.settings.title": "设置",
|
||||
"xpack.ml.settingsBreadcrumbLabel": "设置",
|
||||
"xpack.ml.settingsTabLabel": "设置",
|
||||
"xpack.ml.severitySelector.formControlAriaLabel": "选择严重性阈值",
|
||||
"xpack.ml.severitySelector.formControlLabel": "严重性",
|
||||
"xpack.ml.singleMetricViewerPageLabel": "Single Metric Viewer",
|
||||
|
@ -18394,7 +18388,6 @@
|
|||
"xpack.ml.trainedModels.nodesList.nodesFetchError": "节点提取失败",
|
||||
"xpack.ml.trainedModels.nodesList.nodeTotalMemoryHeader": "总内存",
|
||||
"xpack.ml.trainedModels.nodesList.totalAmountLabel": "Machine Learning 节点总数",
|
||||
"xpack.ml.trainedModelsTabLabel": "已训练模型",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescription": "当前正在升级与 Machine Learning 相关的索引。",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningDescriptionExtra": "此次某些操作不可用。",
|
||||
"xpack.ml.upgrade.upgradeWarning.upgradeInProgressWarningTitle": "正在进行索引迁移",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue