[Index Management] Add Overview tab (#164628)

This commit is contained in:
Alison Goryachev 2023-09-08 10:17:39 -04:00 committed by GitHub
parent ac86737e34
commit 4c2f702e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 610 additions and 40 deletions

View file

@ -1,3 +1,3 @@
.serverlessSearchCodeBoxPanel {
.codeBoxPanel {
border-top: $euiBorderThin $euiColorLightShade;
}

View file

@ -86,7 +86,7 @@ export const CodeBox: React.FC<CodeBoxProps> = ({
return (
<EuiThemeProvider colorMode="dark">
<EuiPanel paddingSize="xs" className="serverlessSearchCodeBlockControlsPanel">
<EuiPanel paddingSize="xs" className="codeBoxPanel" data-test-subj="codeBlockControlsPanel">
<EuiFlexGroup alignItems="center">
<EuiFlexItem>
<EuiThemeProvider colorMode="light">

View file

@ -96,15 +96,19 @@ export const InstallClientPanel: React.FC<InstallClientProps> = ({
defaultMessage:
'Elastic builds and maintains clients in several popular languages and our community has contributed many more. Install your favorite language client to get started.',
})}
links={[
{
href: language.docLink,
label: i18n.translate('searchApiPanels.welcomeBanner.installClient.clientDocLink', {
defaultMessage: '{languageName} client documentation',
values: { languageName: language.name },
}),
},
]}
links={
language.docLink
? [
{
href: language.docLink,
label: i18n.translate('searchApiPanels.welcomeBanner.installClient.clientDocLink', {
defaultMessage: '{languageName} client documentation',
values: { languageName: language.name },
}),
},
]
: []
}
title={i18n.translate('searchApiPanels.welcomeBanner.installClient.title', {
defaultMessage: 'Install a client',
})}

View file

@ -54,10 +54,14 @@ export const WelcomeBanner: React.FC<WelcomeBannerProps> = ({
<EuiFlexItem grow={false}>
<EuiTitle size="xxxs">
<h2>
{i18n.translate('searchApiPanels.welcomeBanner.header.greeting.title', {
defaultMessage: 'Hi {name}!',
values: { name: user?.full_name || user.username },
})}
{user
? i18n.translate('searchApiPanels.welcomeBanner.header.greeting.customTitle', {
defaultMessage: 'Hi {name}!',
values: { name: user.full_name || user.username },
})
: i18n.translate('searchApiPanels.welcomeBanner.header.greeting.defaultTitle', {
defaultMessage: 'Hi!',
})}
</h2>
</EuiTitle>
</EuiFlexItem>

View file

@ -8,6 +8,8 @@
import { LanguageDefinition } from '../types';
const INDEX_NAME_PLACEHOLDER = 'index_name';
export const consoleDefinition: Partial<LanguageDefinition> = {
buildSearchQuery: `POST /books/_search?pretty
{
@ -30,4 +32,8 @@ export const consoleDefinition: Partial<LanguageDefinition> = {
{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
{ "index" : { "_index" : "books" } }
{"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}`,
ingestDataIndex: ({ indexName }) => `POST _bulk?pretty
{ "index" : { "_index" : "${indexName ?? INDEX_NAME_PLACEHOLDER}" } }
{"name": "foo", "title": "bar"}
`,
};

View file

@ -30,22 +30,22 @@ export interface LanguageDefinitionSnippetArguments {
type CodeSnippet = string | ((args: LanguageDefinitionSnippetArguments) => string);
export interface LanguageDefinition {
name: string;
id: Languages;
iconType: string;
docLink?: string;
configureClient?: CodeSnippet;
ingestData?: CodeSnippet;
ingestDataIndex?: CodeSnippet;
installClient?: string;
buildSearchQuery?: CodeSnippet;
testConnection?: CodeSnippet;
advancedConfig?: string;
apiReference?: string;
basicConfig?: string;
configureClient: CodeSnippet;
docLink: string;
github?: {
link: string;
label: string;
};
iconType: string;
id: Languages;
ingestData: CodeSnippet;
ingestDataIndex: CodeSnippet;
installClient: string;
languageStyling?: string;
name: string;
buildSearchQuery: CodeSnippet;
testConnection: CodeSnippet;
}

View file

@ -0,0 +1,37 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { consoleDefinition } from './languages/console';
import { getConsoleRequest } from './utils';
describe('utils', () => {
describe('getConsoleRequest()', () => {
test('accepts string values', () => {
const consoleRequest = getConsoleRequest('ingestData');
expect(consoleRequest).toEqual(consoleDefinition.ingestData);
});
test('accepts function values', () => {
const consoleRequest = getConsoleRequest('ingestDataIndex', {
url: 'https://your_deployment_url',
apiKey: 'yourApiKey',
indexName: 'test-index',
});
expect(consoleRequest).toContain(`POST _bulk?pretty
{ \"index\" : { \"_index\" : \"test-index\" } }
{\"name\": \"foo\", \"title\": \"bar\"}`);
});
test('returns undefined if language definition is undefined', () => {
// @ts-ignore TS should not allow an invalid language definition
// We add @ts-ignore here to test the safeguard
const consoleRequest = getConsoleRequest('nonExistentRequest');
expect(consoleRequest).toEqual(undefined);
});
});
});

View file

@ -26,7 +26,23 @@ export const getLanguageDefinitionCodeSnippet = (
}
};
export const getConsoleRequest = (code: keyof LanguageDefinition): string | undefined =>
code in consoleDefinition && typeof consoleDefinition[code] === 'string'
? (consoleDefinition[code] as string)
: undefined;
export const getConsoleRequest = (
code: keyof LanguageDefinition,
args?: LanguageDefinitionSnippetArguments
): string | undefined => {
if (code in consoleDefinition) {
const codeType = consoleDefinition[code];
switch (typeof codeType) {
case 'string':
return codeType as string;
case 'function':
if (args) {
return codeType(args) as string;
}
return undefined;
default:
return undefined;
}
}
};

View file

@ -16,10 +16,14 @@ import {
uiSettingsServiceMock,
themeServiceMock,
executionContextServiceMock,
applicationServiceMock,
fatalErrorsServiceMock,
httpServiceMock,
} from '@kbn/core/public/mocks';
import { GlobalFlyout } from '@kbn/es-ui-shared-plugin/public';
import { usageCollectionPluginMock } from '@kbn/usage-collection-plugin/server/mocks';
import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public';
import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
import { settingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
import { MAJOR_VERSION } from '../../../common';
import { AppContextProvider } from '../../../public/application/app_context';
@ -52,15 +56,23 @@ setUiMetricService(services.uiMetricService);
const appDependencies = {
services,
core: {
getUrlForApp: () => {},
getUrlForApp: applicationServiceMock.createStartContract().getUrlForApp,
executionContext: executionContextServiceMock.createStartContract(),
http: httpServiceMock.createSetupContract(),
application: applicationServiceMock.createStartContract(),
fatalErrors: fatalErrorsServiceMock.createSetupContract(),
},
plugins: {
usageCollection: usageCollectionPluginMock.createSetupContract(),
isFleetEnabled: false,
share: sharePluginMock.createStartContract(),
},
plugins: {},
// Default stateful configuration
config: {
enableLegacyTemplates: true,
enableIndexActions: true,
enableIndexStats: true,
enableIndexDetailsPage: false,
},
} as any;

View file

@ -76,6 +76,11 @@ export interface IndexDetailsPageTestBed extends TestBed {
indexStatsTabExists: () => boolean;
isWarningDisplayed: () => boolean;
};
overview: {
indexStatsContentExists: () => boolean;
indexDetailsContentExists: () => boolean;
addDocCodeBlockExists: () => boolean;
};
};
}
@ -116,6 +121,18 @@ export const setup = async (
return find('indexDetailsContent').text();
};
const overview = {
indexStatsContentExists: () => {
return exists('overviewTabIndexStats');
},
indexDetailsContentExists: () => {
return exists('overviewTabIndexDetails');
},
addDocCodeBlockExists: () => {
return exists('codeBlockControlsPanel');
},
};
const mappings = {
getCodeBlockContent: () => {
return find('indexDetailsMappingsCodeBlock').text();
@ -258,6 +275,7 @@ export const setup = async (
getActiveTabContent,
mappings,
settings,
overview,
clickBackToIndicesButton,
discoverLinkExists,
contextMenu,

View file

@ -186,9 +186,24 @@ describe('<IndexDetailsPage />', () => {
expect(header).toEqual(testIndexName);
});
it('defaults to overview tab', () => {
const tabContent = testBed.actions.getActiveTabContent();
expect(tabContent).toEqual('Overview');
describe('Overview tab', () => {
it('renders index details', () => {
expect(testBed.actions.overview.indexDetailsContentExists()).toBe(true);
expect(testBed.actions.overview.indexStatsContentExists()).toBe(true);
expect(testBed.actions.overview.addDocCodeBlockExists()).toBe(true);
});
it('hides index stats from detail panels if enableIndexStats===false', async () => {
await act(async () => {
testBed = await setup(httpSetup, {
config: { enableIndexStats: false },
});
});
testBed.component.update();
expect(testBed.actions.overview.indexDetailsContentExists()).toBe(true);
expect(testBed.actions.overview.indexStatsContentExists()).toBe(false);
});
});
it('documents tab', async () => {

View file

@ -19,7 +19,8 @@
"optionalPlugins": [
"security",
"usageCollection",
"fleet"
"fleet",
"cloud"
],
"requiredBundles": [
"kibanaReact",

View file

@ -18,10 +18,12 @@ import {
DocLinksStart,
IUiSettingsClient,
ExecutionContextStart,
HttpSetup,
} from '@kbn/core/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
import type { SharePluginStart } from '@kbn/share-plugin/public';
import type { SettingsStart } from '@kbn/core-ui-settings-browser';
import type { CloudSetup } from '@kbn/cloud-plugin/public';
import { ExtensionsService } from '../services';
import { UiMetricService, NotificationService, HttpService } from './services';
@ -33,10 +35,13 @@ export interface AppDependencies {
getUrlForApp: ApplicationStart['getUrlForApp'];
executionContext: ExecutionContextStart;
application: ApplicationStart;
http: HttpSetup;
};
plugins: {
usageCollection: UsageCollectionSetup;
isFleetEnabled: boolean;
share: SharePluginStart;
cloud?: CloudSetup;
};
services: {
uiMetricService: UiMetricService;

View file

@ -11,6 +11,7 @@ import { CoreSetup, CoreStart } from '@kbn/core/public';
import { ManagementAppMountParams } from '@kbn/management-plugin/public';
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import { CloudSetup } from '@kbn/cloud-plugin/public';
import { UIM_APP_NAME } from '../../common/constants';
import { PLUGIN } from '../../common/constants/plugin';
import { ExtensionsService } from '../services';
@ -57,6 +58,7 @@ export async function mountManagementSection({
enableLegacyTemplates = true,
enableIndexDetailsPage = false,
enableIndexStats = true,
cloud,
}: {
coreSetup: CoreSetup<StartDependencies>;
usageCollection: UsageCollectionSetup;
@ -68,6 +70,7 @@ export async function mountManagementSection({
enableLegacyTemplates?: boolean;
enableIndexDetailsPage?: boolean;
enableIndexStats?: boolean;
cloud?: CloudSetup;
}) {
const { element, setBreadcrumbs, history, theme$ } = params;
const [core, startDependencies] = await coreSetup.getStartServices();
@ -79,6 +82,7 @@ export async function mountManagementSection({
uiSettings,
executionContext,
settings,
http,
} = core;
const { url } = startDependencies.share;
@ -98,10 +102,13 @@ export async function mountManagementSection({
getUrlForApp: application.getUrlForApp,
executionContext,
application,
http,
},
plugins: {
usageCollection,
isFleetEnabled,
share: startDependencies.share,
cloud,
},
services: {
httpService,

View file

@ -30,6 +30,7 @@ import { DetailsPageError } from './details_page_error';
import { ManageIndexButton } from './manage_index_button';
import { DetailsPageStats } from './details_page_stats';
import { DetailsPageMappings } from './details_page_mappings';
import { DetailsPageOverview } from './details_page_overview';
import { DetailsPageSettings } from './details_page_settings';
export enum IndexDetailsSection {
@ -189,7 +190,7 @@ export const DetailsPage: React.FunctionComponent<
<Routes>
<Route
path={`/${Section.Indices}/${indexName}/${IndexDetailsSection.Overview}`}
render={() => <div>Overview</div>}
render={() => <DetailsPageOverview indexDetails={index} />}
/>
<Route
path={`/${Section.Indices}/${indexName}/${IndexDetailsSection.Documents}`}

View file

@ -0,0 +1,198 @@
/*
* 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, { useState, useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import {
EuiSpacer,
EuiPanel,
EuiFlexGroup,
EuiFlexItem,
EuiStat,
EuiTitle,
EuiText,
EuiTextColor,
} from '@elastic/eui';
import {
CodeBox,
LanguageDefinition,
LanguageDefinitionSnippetArguments,
getLanguageDefinitionCodeSnippet,
getConsoleRequest,
} from '@kbn/search-api-panels';
import type { Index } from '../../../../../../../common';
import { useAppContext } from '../../../../../app_context';
import { languageDefinitions, curlDefinition } from './languages';
interface Props {
indexDetails: Index;
}
export const DetailsPageOverview: React.FunctionComponent<Props> = ({ indexDetails }) => {
const {
name,
status,
documents,
documents_deleted: documentsDeleted,
primary,
replica,
aliases,
} = indexDetails;
const { config, core, plugins } = useAppContext();
const [selectedLanguage, setSelectedLanguage] = useState<LanguageDefinition>(curlDefinition);
const elasticsearchURL = useMemo(() => {
return plugins.cloud?.elasticsearchUrl ?? 'https://your_deployment_url';
}, [plugins.cloud]);
const codeSnippetArguments: LanguageDefinitionSnippetArguments = {
url: elasticsearchURL,
apiKey: 'your_api_key',
indexName: name,
};
return (
<>
<EuiFlexGroup>
{config.enableIndexStats && (
<EuiFlexItem data-test-subj="overviewTabIndexStats">
<EuiPanel>
<EuiFlexGroup>
<EuiFlexItem>
<EuiStat
title={status}
titleColor={status === 'open' ? 'success' : 'danger'}
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.statusLabel',
{
defaultMessage: 'Status',
}
)}
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiStat
title={documents}
titleColor="primary"
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.documentsLabel',
{
defaultMessage: 'Documents',
}
)}
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiStat
title={documentsDeleted}
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.documentsDeletedLabel',
{
defaultMessage: 'Documents deleted',
}
)}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
</EuiFlexItem>
)}
<EuiFlexItem data-test-subj="overviewTabIndexDetails">
<EuiPanel>
<EuiFlexGroup>
{primary && (
<EuiFlexItem>
<EuiStat
title={primary}
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.primaryLabel',
{
defaultMessage: 'Primaries',
}
)}
/>
</EuiFlexItem>
)}
{replica && (
<EuiFlexItem>
<EuiStat
title={replica}
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.replicaLabel',
{
defaultMessage: 'Replicas',
}
)}
/>
</EuiFlexItem>
)}
<EuiFlexItem>
<EuiStat
title={Array.isArray(aliases) ? aliases.length : aliases}
description={i18n.translate(
'xpack.idxMgmt.indexDetails.overviewTab.aliasesLabel',
{
defaultMessage: 'Aliases',
}
)}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer />
<EuiFlexGroup direction="column">
<EuiFlexItem>
<EuiTitle size="s">
<h2>
{i18n.translate('xpack.idxMgmt.indexDetails.overviewTab.addMoreDataTitle', {
defaultMessage: 'Add more data to this index',
})}
</h2>
</EuiTitle>
<EuiSpacer size="s" />
<EuiTextColor color="subdued">
<EuiText size="s">
<p>
{i18n.translate('xpack.idxMgmt.indexDetails.overviewTab.addMoreDataDescription', {
defaultMessage:
'Keep adding more documents to your already created index using the API',
})}
</p>
</EuiText>
</EuiTextColor>
</EuiFlexItem>
<EuiFlexItem>
<CodeBox
languages={languageDefinitions}
codeSnippet={getLanguageDefinitionCodeSnippet(
selectedLanguage,
'ingestDataIndex',
codeSnippetArguments
)}
selectedLanguage={selectedLanguage}
setSelectedLanguage={setSelectedLanguage}
assetBasePath={core.http.basePath.prepend(`/plugins/indexManagement/assets`)}
sharePlugin={plugins.share}
application={core.application}
consoleRequest={getConsoleRequest('ingestDataIndex', codeSnippetArguments)}
/>
</EuiFlexItem>
</EuiFlexGroup>
</>
);
};

View file

@ -0,0 +1,8 @@
/*
* 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 { DetailsPageOverview } from './details_page_overview';

View file

@ -0,0 +1,179 @@
/*
* 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 { Languages, LanguageDefinition } from '@kbn/search-api-panels';
import { i18n } from '@kbn/i18n';
const INDEX_NAME_PLACEHOLDER = 'index_name';
export const curlDefinition: LanguageDefinition = {
id: Languages.CURL,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.cURL', {
defaultMessage: 'cURL',
}),
iconType: 'curl.svg',
languageStyling: 'shell',
ingestDataIndex: ({ apiKey, indexName, url }) => `curl -X POST ${url}/_bulk?pretty \\
-H "Authorization: ApiKey ${apiKey}" \\
-H "Content-Type: application/json" \\
-d'
{ "index" : { "_index" : "${indexName ?? INDEX_NAME_PLACEHOLDER}" } }
{"name": "foo", "title": "bar" }
`,
};
export const javascriptDefinition: LanguageDefinition = {
id: Languages.JAVASCRIPT,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.javascript', {
defaultMessage: 'JavaScript',
}),
iconType: 'javascript.svg',
ingestDataIndex: ({
apiKey,
url,
indexName,
}) => `const { Client } = require('@elastic/elasticsearch');
const client = new Client({
node: '${url}',
auth: {
apiKey: '${apiKey}'
}
});
const dataset = [
{'name': 'foo', 'title': 'bar'},
];
// Index with the bulk helper
const result = await client.helpers.bulk({
datasource: dataset,
onDocument (doc) {
return { index: { _index: '${indexName ?? 'index_name'}' }};
}
});
console.log(result);
`,
};
export const goDefinition: LanguageDefinition = {
id: Languages.GO,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.go', {
defaultMessage: 'Go',
}),
iconType: 'go.svg',
ingestDataIndex: ({ apiKey, url, indexName }) => `import (
"context"
"fmt"
"log"
"strings"
"github.com/elastic/elasticsearch-serverless-go"
)
func main() {
cfg := elasticsearch.Config{
Address: "${url}",
APIKey: "${apiKey}",
}
es, err := elasticsearch.NewClient(cfg)
if err != nil {
log.Fatalf("Error creating the client: %s", err)
}
res, err := es.Bulk().
Index("${indexName}").
Raw(strings.NewReader(\`
{ "index": { "_id": "1"}}
{"name": "foo", "title": "bar"}\n\`)).
Do(context.Background())
fmt.Println(res, err)
}`,
};
export const pythonDefinition: LanguageDefinition = {
id: Languages.PYTHON,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.python', {
defaultMessage: 'Python',
}),
iconType: 'python.svg',
ingestDataIndex: ({ apiKey, url, indexName }) => `from elasticsearch import Elasticsearch
client = Elasticsearch(
"${url}",
api_key="${apiKey}"
)
documents = [
{"index": {"_index": "${indexName ?? INDEX_NAME_PLACEHOLDER}"}},
{"name": "foo", "title": "bar"},
]
client.bulk(operations=documents)
`,
};
export const phpDefinition: LanguageDefinition = {
id: Languages.PHP,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.php', {
defaultMessage: 'PHP',
}),
iconType: 'php.svg',
ingestDataIndex: ({ apiKey, url, indexName }) => `$client = ClientBuilder::create()
->setHosts(['${url}'])
->setApiKey('${apiKey}')
->build();
$params = [
'body' => [
[
'index' => [
'_index' => '${indexName ?? INDEX_NAME_PLACEHOLDER}',
'_id' => '1',
],
],
[
'name' => 'foo',
'title' => 'bar',
],
],
];
$response = $client->bulk($params);
echo $response->getStatusCode();
echo (string) $response->getBody();
`,
};
export const rubyDefinition: LanguageDefinition = {
id: Languages.RUBY,
name: i18n.translate('xpack.idxMgmt.indexDetails.languages.ruby', {
defaultMessage: 'Ruby',
}),
iconType: 'ruby.svg',
ingestDataIndex: ({ apiKey, url, indexName }) => `client = ElasticsearchServerless::Client.new(
api_key: '${apiKey}',
url: '${url}'
)
documents = [
{ index: { _index: '${
indexName ?? INDEX_NAME_PLACEHOLDER
}', data: {name: "foo", "title": "bar"} } },
]
client.bulk(body: documents)
`,
};
const languageDefinitionRecords: Partial<Record<Languages, LanguageDefinition>> = {
[Languages.CURL]: curlDefinition,
[Languages.PYTHON]: pythonDefinition,
[Languages.JAVASCRIPT]: javascriptDefinition,
[Languages.PHP]: phpDefinition,
[Languages.GO]: goDefinition,
[Languages.RUBY]: rubyDefinition,
};
export const languageDefinitions: LanguageDefinition[] = Object.values(languageDefinitionRecords);

View file

@ -0,0 +1,6 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M118.563 25.0671C115.713 25.0671 113.408 22.7575 113.408 19.9122C113.408 17.0628 115.713 14.7573 118.563 14.7573C121.408 14.7573 123.718 17.0628 123.718 19.9122C123.718 22.7575 121.408 25.0671 118.563 25.0671ZM67.3668 113.143C64.5174 113.143 62.2119 110.833 62.2119 107.988C62.2119 105.139 64.5174 102.833 67.3668 102.833C70.2122 102.833 72.5177 105.139 72.5177 107.988C72.5177 110.833 70.2122 113.143 67.3668 113.143ZM118.563 10.475C113.351 10.475 109.126 14.7004 109.126 19.9122C109.126 21.0243 109.406 22.0594 109.759 23.0497L65.4875 98.9283C61.2093 99.8253 57.9297 103.442 57.9297 107.988C57.9297 113.2 62.1551 117.425 67.3668 117.425C72.5745 117.425 76.7999 113.2 76.7999 107.988C76.7999 106.941 76.5198 105.983 76.2073 105.041L120.702 28.915C124.85 27.9205 128 24.3649 128 19.9122C128 14.7004 123.774 10.475 118.563 10.475Z" fill="#0C544C"/>
<path d="M79.9496 25.0671C77.1002 25.0671 74.7947 22.7575 74.7947 19.9122C74.7947 17.0628 77.1002 14.7573 79.9496 14.7573C82.795 14.7573 85.1005 17.0628 85.1005 19.9122C85.1005 22.7575 82.795 25.0671 79.9496 25.0671ZM28.7496 113.143C25.9043 113.143 23.5947 110.833 23.5947 107.988C23.5947 105.139 25.9043 102.833 28.7496 102.833C31.599 102.833 33.9045 105.139 33.9045 107.988C33.9045 110.833 31.599 113.143 28.7496 113.143ZM79.9496 10.475C74.7338 10.475 70.5125 14.7004 70.5125 19.9122C70.5125 21.0243 70.7926 22.0594 71.1457 23.0497L26.8744 98.9283C22.5922 99.8253 19.3125 103.442 19.3125 107.988C19.3125 113.2 23.5379 117.425 28.7496 117.425C33.9614 117.425 38.1868 113.2 38.1868 107.988C38.1868 106.941 37.9067 105.983 37.5942 105.041L82.0887 28.915C86.237 27.9205 89.3868 24.3649 89.3868 19.9122C89.3868 14.7004 85.1573 10.475 79.9496 10.475Z" fill="#073551"/>
<path d="M9.43713 40.8443C12.2825 40.8443 14.592 43.1539 14.592 45.9992C14.592 48.8446 12.2825 51.1541 9.43713 51.1541C6.58772 51.1541 4.28222 48.8446 4.28222 45.9992C4.28222 43.1539 6.58772 40.8443 9.43713 40.8443ZM9.43713 55.4363C14.6489 55.4363 18.8743 51.2109 18.8743 45.9992C18.8743 44.9561 18.5901 43.9941 18.2776 43.0524C17.0274 39.306 13.6016 36.5621 9.43713 36.5621C8.77145 36.5621 8.18696 36.8097 7.55782 36.9436C3.27966 37.8366 0 41.4532 0 45.9992C0 51.2109 4.22539 55.4363 9.43713 55.4363Z" fill="#073551"/>
<path d="M4.28222 78.9743C4.28222 76.1249 6.59179 73.8194 9.43713 73.8194C12.2825 73.8194 14.592 76.1249 14.592 78.9743C14.592 81.8197 12.2825 84.1252 9.43713 84.1252C6.59179 84.1252 4.28222 81.8197 4.28222 78.9743ZM18.8743 78.9743C18.8743 77.9271 18.5901 76.9692 18.2776 76.0275C17.0274 72.2811 13.6057 69.5372 9.43713 69.5372C8.77145 69.5372 8.18696 69.7848 7.55782 69.9147C3.27966 70.8117 0 74.4283 0 78.9743C0 84.182 4.22539 88.4115 9.43713 88.4115C14.6489 88.4115 18.8743 84.182 18.8743 78.9743Z" fill="#073551"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,11 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_693_142132)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66031 54.3916C9.41043 54.3916 9.34873 54.2661 9.47316 54.08L10.7822 52.3967C10.9056 52.2095 11.2182 52.0851 11.467 52.0851H33.7165C33.9664 52.0851 34.0281 52.2723 33.9037 52.4594L32.8445 54.08C32.7201 54.2661 32.4085 54.4533 32.2214 54.4533L9.66031 54.3916ZM0.249232 60.1244C0.000381008 60.1244 -0.0623457 60.001 0.0620796 59.8128L1.37112 58.1305C1.49554 57.9434 1.80712 57.8189 2.057 57.8189H30.4753C30.7242 57.8189 30.8496 58.0061 30.7869 58.1932L30.2882 59.6884C30.2265 59.9383 29.9766 60.0627 29.7277 60.0627L0.249232 60.1244ZM15.3304 65.8583C15.0816 65.8583 15.0199 65.6711 15.1443 65.484L16.0163 63.9261C16.1417 63.7389 16.3906 63.5528 16.6405 63.5528H29.1036C29.3534 63.5528 29.4779 63.7389 29.4779 63.9888L29.3545 65.484C29.3545 65.7338 29.1046 65.921 28.9174 65.921L15.3304 65.8583ZM80.0213 53.2697C76.0942 54.2672 73.4144 55.0147 69.551 56.0112C68.6153 56.2611 68.5536 56.3228 67.7433 55.388C66.8085 54.3289 66.1227 53.643 64.8147 53.0198C60.8875 51.0887 57.0859 51.6491 53.5341 53.9556C49.2964 56.6971 47.1154 60.7476 47.1771 65.7955C47.2388 70.7818 50.6672 74.895 55.5907 75.5809C59.8284 76.1413 63.3812 74.6451 66.1854 71.4677C66.7458 70.7818 67.2446 70.0342 67.8677 69.1612H55.8396C54.5316 69.1612 54.22 68.3509 54.656 67.2917C55.4663 65.3595 56.9615 62.1193 57.8335 60.4987C58.0216 60.1244 58.4576 59.5013 59.3924 59.5013H82.0769C81.9535 61.1846 81.9535 62.8669 81.7036 64.5503C81.0177 69.0368 79.3354 73.15 76.5929 76.7645C72.1054 82.6855 66.2481 86.3617 58.8309 87.3592C52.7238 88.1695 47.0527 86.9849 42.0674 83.2459C37.4555 79.7558 34.8384 75.1439 34.1526 69.4111C33.3422 62.6181 35.3361 56.5099 39.4494 51.1504C43.8742 45.3548 49.7325 41.6776 56.8998 40.3686C62.758 39.3094 68.3664 39.9953 73.4144 43.4226C76.7173 45.6037 79.0855 48.595 80.6434 52.2095C81.0177 52.771 80.7689 53.0826 80.0202 53.2687L80.0213 53.2697Z" fill="#00ACD7"/>
<path d="M100.649 87.7334C94.9782 87.608 89.8048 85.9884 85.4427 82.2484C81.7655 79.0709 79.46 75.0194 78.7124 70.2203C77.5905 63.1784 79.5217 56.9459 83.7604 51.4002C88.3096 45.4165 93.7936 42.3007 101.211 40.9917C107.567 39.8708 113.55 40.494 118.972 44.1702C123.895 47.5358 126.948 52.0851 127.759 58.0677C128.818 66.4814 126.388 73.3371 120.591 79.1954C116.478 83.3703 111.43 85.9884 105.635 87.172C103.952 87.4835 102.269 87.5463 100.649 87.7334ZM115.482 62.5553C115.42 61.745 115.42 61.1218 115.295 60.4987C114.174 54.3288 108.501 50.8387 102.582 52.2105C96.785 53.5185 93.046 57.1957 91.6753 63.054C90.5534 67.9148 92.9216 72.8384 97.4081 74.8323C100.836 76.3284 104.264 76.1413 107.567 74.459C112.49 71.9036 115.17 67.9148 115.482 62.5553Z" fill="#00ACD7"/>
</g>
<defs>
<clipPath id="clip0_693_142132">
<rect width="128" height="128" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -0,0 +1,11 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_693_142215)">
<path d="M0 0.000732422H128V128.001H0V0.000732422Z" fill="#F0DB4F"/>
<path d="M117.525 97.4728C116.587 91.6333 112.78 86.7284 101.5 82.1548C97.5823 80.3542 93.2141 79.0648 91.9125 76.0955C91.4503 74.3675 91.389 73.3941 91.6814 72.3481C92.5209 68.9534 96.573 67.8951 99.7847 68.8685C101.853 69.5618 103.811 71.1558 104.992 73.6988C110.516 70.1221 110.505 70.1456 114.361 67.6875C112.949 65.4984 112.196 64.4881 111.271 63.5515C107.949 59.8409 103.423 57.9298 96.1835 58.0761L92.4125 58.5638C88.799 59.4769 85.3553 61.3736 83.3358 63.9166C77.2765 70.7918 79.0045 82.8245 86.3777 87.7765C93.6415 93.2284 104.312 94.4687 105.675 99.5669C107.001 105.808 101.088 107.829 95.2111 107.111C90.8798 106.21 88.4708 104.009 85.8665 100.006C81.073 102.78 81.073 102.78 76.1446 105.614C77.3133 108.169 78.5414 109.326 80.5005 111.539C89.7724 120.944 112.975 120.482 117.136 106.247C117.305 105.758 118.426 102.498 117.525 97.4728ZM69.5853 58.8296H57.6129L57.5638 89.7826C57.5638 96.3654 57.9043 102.4 56.8338 104.25C55.0822 107.888 50.5434 107.437 48.4749 106.731C46.3696 105.697 45.299 104.225 44.0587 102.146C43.7182 101.548 43.4626 101.086 43.3767 101.051L33.6426 107.012C35.2612 110.334 37.6456 113.217 40.6998 115.09C45.2622 117.829 51.3941 118.668 57.8072 117.196C61.981 115.98 65.5822 113.462 67.4677 109.628C70.1937 104.603 69.6088 98.5198 69.5843 91.7918C69.6456 80.8153 69.5853 69.8409 69.5853 58.8296Z" fill="#323330"/>
</g>
<defs>
<clipPath id="clip0_693_142215">
<rect width="128" height="128" fill="white" transform="translate(0 0.000732422)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,3 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M64 31.4337C28.6551 31.4337 0 45.9551 0 63.8674C0 81.7798 28.6551 96.3011 64 96.3011C99.3449 96.3011 128 81.7798 128 63.8674C128 45.9551 99.3449 31.4337 64 31.4337ZM47.3468 70.1863C45.8195 71.6152 44.1235 72.205 42.2557 72.8126C40.3879 73.4212 38.0109 73.2955 35.1207 73.2955H28.5703L26.7548 83.7712H19.1066L25.9314 48.1539H40.6393C45.0642 48.1539 48.2917 49.4267 50.3209 51.7492C52.35 54.0716 52.9597 57.3683 52.151 61.5303C51.8168 63.2452 51.2543 64.8396 50.4602 66.2601C49.6374 67.7258 48.5864 69.0511 47.3468 70.1863ZM69.6715 73.2955L72.6896 58.1896C73.0332 56.4213 72.9074 55.1077 72.3114 54.4655C71.7143 53.8223 70.4446 53.3918 68.5035 53.3918H62.4381L58.5296 73.2955H50.941L57.7659 38.7259H65.3545L63.5401 48.1539H70.3001C74.5542 48.1539 77.4874 49.0077 79.1017 50.4911C80.716 51.9744 81.2 54.0067 80.5547 57.3296L77.3795 73.2955H69.6715ZM111.845 61.5858C111.512 63.3007 110.949 64.8679 110.156 66.2873C109.362 67.7089 108.325 69.0089 107.043 70.1863C105.516 71.6152 103.819 72.205 101.952 72.8126C100.086 73.4212 97.7065 73.2955 94.8163 73.2955H88.2658L86.4514 83.7712H78.8032L85.627 48.1539H100.336C104.761 48.1539 107.988 49.4267 110.016 51.7492C112.043 54.0716 112.654 57.4249 111.845 61.5858ZM97.4373 53.3918H92.1984L89.3417 68.0577H93.995C97.0769 68.0577 99.3753 67.7539 100.884 66.5911C102.394 65.4304 103.412 63.6286 103.941 60.9123C104.448 58.3028 104.217 56.2673 103.249 55.1946C102.28 54.1219 100.343 53.3918 97.4373 53.3918ZM37.7417 53.3918H32.5018L29.6451 68.0577H34.2973C37.3803 68.0577 39.6776 67.7539 41.1872 66.5911C42.6967 65.4304 43.7149 63.6286 44.2429 60.9123C44.7499 58.3028 44.5195 56.2673 43.5515 55.1946C42.5836 54.1219 40.6477 53.3918 37.7417 53.3918Z" fill="#6181B6"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,19 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_693_142103)">
<path d="M62.8491 0.00101407C57.628 0.0257468 52.6444 0.469698 48.2568 1.2463C35.334 3.52913 32.9893 8.30749 32.9893 17.121V28.7589H63.5256V32.6383H21.5282C12.6541 32.6383 4.88312 37.9719 2.4519 48.1222C-0.35279 59.7527 -0.476454 67.0118 2.4519 79.1567C4.62219 88.1978 9.80616 94.6382 18.6815 94.6382H29.1817V80.6865C29.1817 70.6067 37.9013 61.7165 48.2581 61.7165H78.7597C87.2504 61.7165 94.0271 54.7246 94.0271 46.1992V17.1222C94.0271 8.84542 87.0451 2.62886 78.7597 1.24754C73.5114 0.374478 68.0689 -0.022482 62.8491 0.00101407ZM46.3351 9.3611C49.4885 9.3611 52.0657 11.9791 52.0657 15.1993C52.0657 18.4058 49.4898 20.9991 46.3351 20.9991C43.1693 20.9991 40.6058 18.4058 40.6058 15.1993C40.6045 11.9791 43.1693 9.3611 46.3351 9.3611Z" fill="url(#paint0_linear_693_142103)"/>
<path d="M97.8345 46.1991C97.8345 56.7105 88.9208 65.5586 78.7582 65.5586H48.2566C39.9019 65.5586 32.9891 72.7101 32.9891 81.0772V110.157C32.9891 118.431 40.1838 123.3 48.2566 125.673C57.9221 128.513 67.1919 129.028 78.7582 125.673C86.4451 123.446 94.0257 118.966 94.0257 110.157V98.5174H63.5253V94.6369H109.296C118.17 94.6369 121.479 88.4475 124.566 79.1554C127.754 69.5901 127.616 60.3908 124.566 48.1209C122.372 39.2851 118.183 32.637 109.296 32.637H97.8345V46.1991ZM80.6787 106.276C83.8457 106.276 86.4092 108.869 86.4092 112.078C86.4092 115.296 83.8445 117.914 80.6787 117.914C77.5252 117.914 74.9493 115.296 74.9493 112.078C74.9493 108.869 77.5252 106.276 80.6787 106.276Z" fill="url(#paint1_linear_693_142103)"/>
</g>
<defs>
<linearGradient id="paint0_linear_693_142103" x1="-3.83328" y1="4.92313" x2="91.4068" y2="86.0397" gradientUnits="userSpaceOnUse">
<stop stop-color="#5A9FD4"/>
<stop offset="1" stop-color="#306998"/>
</linearGradient>
<linearGradient id="paint1_linear_693_142103" x1="94.1703" y1="101.039" x2="68.9126" y2="65.6196" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFD43B"/>
<stop offset="1" stop-color="#FFE873"/>
</linearGradient>
<clipPath id="clip0_693_142103">
<rect width="128" height="128" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,3 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0844 111.372L119.636 122.634C109.966 106.925 100.544 91.6174 91.0463 76.1852L35.0844 111.372ZM127.634 24.4188C125.136 28.0788 122.633 31.7358 120.139 35.3978C111.571 47.9724 103.007 60.5499 94.4476 73.1302C93.971 73.8307 93.353 74.3864 94.0246 75.4665C102.294 88.7908 110.499 102.154 118.724 115.506C120.022 117.615 121.335 119.716 123.013 121.739L128 24.5215L127.634 24.4188ZM14.7413 65.9642C15.1281 66.3215 16.0938 66.5299 16.5436 66.3135C24.4759 62.5095 32.4588 58.7901 40.2179 54.6731C42.7485 53.3313 44.6942 50.9256 46.8741 48.9748C54.0925 42.5154 61.2997 36.043 68.5037 29.5696C68.9442 29.1719 69.4662 28.7874 69.7293 28.2861C72.3167 23.3518 74.8597 18.3923 77.4924 13.2898C74.3531 12.1383 71.3768 11.0119 68.3634 9.98716C67.9548 9.84825 67.3111 10.1241 66.8685 10.3646C59.8935 14.1666 52.7875 17.7662 46.0343 21.9123C42.6557 23.9869 39.9032 27.044 36.9114 29.7065C32.0895 34.0006 27.2738 38.3048 22.522 42.6735C21.2542 43.8463 20.1172 45.1467 19.1299 46.5529C15.8802 51.1702 12.7275 55.8539 9.43032 60.6705C11.2728 62.5297 12.9482 64.3073 14.7413 65.9642ZM43.7327 59.6518L31.8109 108.797L87.8296 73.5791L43.7327 59.6518ZM122.789 24.5758L75.1785 32.3367L91.3362 70.6841C101.881 55.2237 112.217 40.0734 122.789 24.5758ZM44.395 56.325L87.6129 70.0147C82.1968 57.1403 76.9663 44.7159 71.6275 32.0287L44.395 56.325ZM15.3386 75.4494L0.21252 110.729L29.0214 109.898L15.3386 75.4494ZM29.3618 101.718L29.7188 101.641C33.1779 87.6081 36.6865 73.6717 40.2179 59.0901L17.1058 70.811C21.0457 80.8025 25.2466 91.3426 29.3618 101.718ZM116.977 22.2999C112.377 21.1111 107.777 19.9183 103.174 18.7375C96.5594 17.0404 89.9393 15.3644 83.3285 13.6522C82.5021 13.4378 81.9048 13.2979 81.4189 14.2692C79.0822 18.9399 76.6733 23.5753 74.2995 28.2288C74.2262 28.3727 74.2417 28.5589 74.185 28.9203L116.968 22.5938L116.977 22.2999ZM90.289 11.6762L127.782 21.7966L121.587 4.57367L90.3437 11.333L90.289 11.6762ZM32.5403 114.067C27.8969 113.544 23.1296 114.024 18.4201 114.104C14.5514 114.167 10.6827 114.311 6.81405 114.429C6.41583 114.441 6.01865 114.52 5.62146 114.938C37.6057 117.823 69.589 120.708 101.572 123.595L101.637 123.178L70.8785 119.081C58.1026 117.379 45.3483 115.507 32.5403 114.067ZM0.844922 99.9611C4.96637 90.6299 9.07027 81.2927 13.2082 71.9685C13.6219 71.0334 13.5899 70.3982 12.7801 69.6453C11.049 68.0378 9.44063 66.3054 7.54859 64.3848C4.99113 76.7056 2.49659 88.7214 0 100.736L0.279577 100.864C0.470433 100.565 0.703586 100.282 0.844922 99.9611ZM82.0771 9.21308C89.0273 7.46361 96.0787 6.09565 103.089 4.56964C103.543 4.46999 103.986 4.32403 104.433 4.19921L104.364 3.86502L74.2458 7.81895C77.0736 9.02385 79.2524 9.92374 82.0771 9.21308Z" fill="#D91404"/>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -45,7 +45,7 @@ export class IndexMgmtUIPlugin {
} = this.ctx.config.get<ClientConfigType>();
if (isIndexManagementUiEnabled) {
const { fleet, usageCollection, management } = plugins;
const { fleet, usageCollection, management, cloud } = plugins;
const kibanaVersion = new SemVer(this.ctx.env.packageInfo.version);
management.sections.section.data.registerApp({
id: PLUGIN.id,
@ -64,6 +64,7 @@ export class IndexMgmtUIPlugin {
enableLegacyTemplates,
enableIndexDetailsPage,
enableIndexStats,
cloud,
});
},
});

View file

@ -7,7 +7,8 @@
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import { ManagementSetup } from '@kbn/management-plugin/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public';
import { CloudSetup } from '@kbn/cloud-plugin/public';
import { ExtensionsSetup, PublicApiServiceSetup } from './services';
export interface IndexManagementPluginSetup {
@ -19,6 +20,8 @@ export interface SetupDependencies {
fleet?: unknown;
usageCollection: UsageCollectionSetup;
management: ManagementSetup;
share: SharePluginSetup;
cloud?: CloudSetup;
}
export interface StartDependencies {

View file

@ -36,6 +36,8 @@
"@kbn/core-ui-settings-browser",
"@kbn/kibana-utils-plugin",
"@kbn/core-http-browser",
"@kbn/search-api-panels",
"@kbn/cloud-plugin",
],
"exclude": [
"target/**/*",