-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs UI] Allow Logs/ML integration result access with machine… (#55884)
This makes the "Log rate" and "Categories" tab visible on clusters with a suitable license for users which don't have the the `machine_learning_admin` role.
- Loading branch information
1 parent
7f63118
commit 16b4ff4
Showing
11 changed files
with
311 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
.../infra/public/components/logging/log_analysis_setup/missing_results_privileges_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiEmptyPrompt, EuiCode } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import React from 'react'; | ||
|
||
import euiStyled from '../../../../../../common/eui_styled_components'; | ||
import { UserManagementLink } from './user_management_link'; | ||
|
||
export const MissingResultsPrivilegesPrompt: React.FunctionComponent = () => ( | ||
<EmptyPrompt | ||
title={ | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.missingMlResultsPrivilegesTitle" | ||
defaultMessage="Additional Machine Learning privileges required" | ||
/> | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.missingMlResultsPrivilegesBody" | ||
defaultMessage="This feature makes use of Machine Learning jobs, which require at least the {machineLearningUserRole} role in order to access their status and results." | ||
values={{ | ||
machineLearningUserRole: <EuiCode>machine_learning_user</EuiCode>, | ||
}} | ||
/> | ||
</p> | ||
} | ||
actions={<UserManagementLink />} | ||
/> | ||
); | ||
|
||
const EmptyPrompt = euiStyled(EuiEmptyPrompt)` | ||
align-self: center; | ||
`; |
41 changes: 41 additions & 0 deletions
41
...ns/infra/public/components/logging/log_analysis_setup/missing_setup_privileges_prompt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiEmptyPrompt, EuiCode } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import React from 'react'; | ||
|
||
import euiStyled from '../../../../../../common/eui_styled_components'; | ||
import { UserManagementLink } from './user_management_link'; | ||
|
||
export const MissingSetupPrivilegesPrompt: React.FunctionComponent = () => ( | ||
<EmptyPrompt | ||
title={ | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.missingMlSetupPrivilegesTitle" | ||
defaultMessage="Additional Machine Learning privileges required" | ||
/> | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.missingMlSetupPrivilegesBody" | ||
defaultMessage="This feature makes use of Machine Learning jobs, which require the {machineLearningAdminRole} role in order to be set up." | ||
values={{ | ||
machineLearningAdminRole: <EuiCode>machine_learning_admin</EuiCode>, | ||
}} | ||
/> | ||
</p> | ||
} | ||
actions={<UserManagementLink />} | ||
/> | ||
); | ||
|
||
const EmptyPrompt = euiStyled(EuiEmptyPrompt)` | ||
align-self: center; | ||
`; |
18 changes: 18 additions & 0 deletions
18
...egacy/plugins/infra/public/components/logging/log_analysis_setup/user_management_link.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiButton, EuiButtonProps } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import React from 'react'; | ||
|
||
export const UserManagementLink: React.FunctionComponent<EuiButtonProps> = props => ( | ||
<EuiButton href="kibana#/management/security/users" color="primary" fill {...props}> | ||
<FormattedMessage | ||
id="xpack.infra.logs.analysis.userManagementButtonLabel" | ||
defaultMessage="Manage users" | ||
/> | ||
</EuiButton> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.