diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 1b1973e35ec525..a8d63137fa0a92 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -622,6 +622,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { }, apis: { bulkIndexAlias: `${ELASTICSEARCH_DOCS}indices-aliases.html`, + indexStats: `${ELASTICSEARCH_DOCS}indices-stats.html`, byteSizeUnits: `${ELASTICSEARCH_DOCS}api-conventions.html#byte-units`, createAutoFollowPattern: `${ELASTICSEARCH_DOCS}ccr-put-auto-follow-pattern.html`, createFollower: `${ELASTICSEARCH_DOCS}ccr-put-follow.html`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index b29017f71d7391..428ef86267dd1d 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -361,6 +361,7 @@ export interface DocLinks { readonly visualize: Record; readonly apis: Readonly<{ bulkIndexAlias: string; + indexStats: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx index a9d7a6674f16f2..c581d84cb9fe1f 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page.tsx @@ -6,6 +6,7 @@ */ import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { css } from '@emotion/react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; import { Route, Routes } from '@kbn/shared-ux-router'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -25,7 +26,7 @@ import { DiscoverLink } from '../../../../lib/discover_link'; import { Section } from '../../home'; import { DetailsPageError } from './details_page_error'; import { ManageIndexButton } from './manage_index_button'; -import { StatsTab } from './tabs'; +import { DetailsPageStats } from './tabs'; export enum IndexDetailsSection { Overview = 'overview', @@ -139,7 +140,6 @@ export const DetailsPage: React.FunctionComponent< if (error || !index) { return ; } - return ( <> @@ -176,7 +176,12 @@ export const DetailsPage: React.FunctionComponent< -
+
{config.enableIndexStats && ( } + path={`/${Section.Indices}/:indexName/${IndexDetailsSection.Stats}`} + component={DetailsPageStats} /> )} = ({ indexName }) => { +export const DetailsPageStats: FunctionComponent> = ({ + match: { + params: { indexName }, + }, +}) => { const { data: indexStats, isLoading, error, resendRequest } = useLoadIndexStats(indexName); if (isLoading) { return ( @@ -51,7 +54,7 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => { title={

@@ -60,7 +63,7 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => { <> = ({ indexName }) => { data-test-subj="reloadIndexStatsButton" > @@ -87,18 +90,23 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => { } if (indexStats) { + // using "rowReverse" to keep docs links on the top of the stats code block on smaller screen return ( - - - - - {JSON.stringify(indexStats, null, 2)} - - - - - - + + + @@ -108,7 +116,7 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => {

@@ -116,10 +124,12 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => {
+ +

primaries, @@ -128,6 +138,39 @@ export const StatsTab: React.FunctionComponent = ({ indexName }) => { />

+ + + + + +
+
+ + + + + {JSON.stringify(indexStats, null, 2)} +
diff --git a/x-pack/plugins/index_management/public/application/services/documentation.ts b/x-pack/plugins/index_management/public/application/services/documentation.ts index 0eb9f62fffd099..3fc34477cacae8 100644 --- a/x-pack/plugins/index_management/public/application/services/documentation.ts +++ b/x-pack/plugins/index_management/public/application/services/documentation.ts @@ -59,6 +59,7 @@ class DocumentationService { private runtimeFields: string = ''; private indicesComponentTemplate: string = ''; private bulkIndexAlias: string = ''; + private indexStats: string = ''; public setup(docLinks: DocLinksStart): void { const { links } = docLinks; @@ -111,6 +112,7 @@ class DocumentationService { this.runtimeFields = links.runtimeFields.overview; this.indicesComponentTemplate = links.apis.putComponentTemplate; this.bulkIndexAlias = links.apis.bulkIndexAlias; + this.indexStats = links.apis.indexStats; } public getEsDocsBase() { @@ -311,6 +313,10 @@ class DocumentationService { return this.bulkIndexAlias; } + public getIndexStats() { + return this.indexStats; + } + public getWellKnownTextLink() { return 'http://docs.opengeospatial.org/is/12-063r5/12-063r5.html'; } diff --git a/x-pack/plugins/index_management/public/application/services/index.ts b/x-pack/plugins/index_management/public/application/services/index.ts index 53fabecdd80807..7375cf27db653e 100644 --- a/x-pack/plugins/index_management/public/application/services/index.ts +++ b/x-pack/plugins/index_management/public/application/services/index.ts @@ -33,3 +33,4 @@ export { sortTable } from './sort_table'; export { UiMetricService } from './ui_metric'; export { HttpService } from './http'; export { NotificationService } from './notification'; +export { documentationService } from './documentation';