-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Fleet] Agent activity #140510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
juliaElastic
merged 19 commits into
elastic:main
from
juliaElastic:feat/agent-activity-rebased
Sep 15, 2022
Merged
[Fleet] Agent activity #140510
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
04be4c9
WIP: agent activity flyout
juliaElastic 8772f73
added missing info to action_status api and UI
juliaElastic 8dc3e56
refactored action status api to use aggs for action results
juliaElastic 835e197
Merge branch 'main' into feat/agent-activity-rebased
juliaElastic 8c7f449
made flyout button visible on selection, refactor
juliaElastic 0c0348d
added tour around Agent activity button
juliaElastic efa630b
formatted texts
juliaElastic 7607e2e
query failed actions, review comments
juliaElastic aed77b2
catch errors
juliaElastic 60f86d3
Merge branch 'main' into feat/agent-activity-rebased
juliaElastic f8538db
updated empty prompt
juliaElastic cba25e1
fix test
juliaElastic 290327c
added flyout footer
juliaElastic ea7cfbc
fix test
juliaElastic 67b4621
fix test
juliaElastic cd41522
updated in progress activity
juliaElastic bb71297
updated failed activity with started time
juliaElastic 8bc0266
added openapi spec, added nbAgentsFailed to action status
juliaElastic e0055ee
small tweak of in progress display and upgrade toast
juliaElastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
64 changes: 64 additions & 0 deletions
64
x-pack/plugins/fleet/common/openapi/paths/agents@action_status.yaml
This file contains hidden or 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,64 @@ | ||
| get: | ||
| summary: Agents - Action status | ||
| parameters: | ||
| - $ref: ../components/parameters/page_size.yaml | ||
| - $ref: ../components/parameters/page_index.yaml | ||
| responses: | ||
| '200': | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| items: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| actionId: | ||
| type: string | ||
| status: | ||
| type: string | ||
| enum: | ||
| - COMPLETE | ||
| - EXPIRED | ||
| - CANCELLED | ||
| - FAILED | ||
| - IN_PROGRESS | ||
| nbAgentsActioned: | ||
| type: number | ||
| nbAgentsActionCreated: | ||
| type: number | ||
| nbAgentsAck: | ||
| type: number | ||
| nbAgentsFailed: | ||
| type: number | ||
| version: | ||
| type: string | ||
| startTime: | ||
| type: string | ||
| type: | ||
| type: string | ||
| expiration: | ||
| type: string | ||
| completionTime: | ||
| type: string | ||
| cancellationTime: | ||
| type: string | ||
| newPolicyId: | ||
| type: string | ||
| creationTime: | ||
| type: string | ||
| required: | ||
| - actionId | ||
| - complete | ||
| - nbAgentsActioned | ||
| - nbAgentsActionCreated | ||
| - nbAgentsAck | ||
| - nbAgentsFailed | ||
| - status | ||
| - creationTime | ||
| required: | ||
| - items | ||
| operationId: agents-action-status |
This file contains hidden or 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
81 changes: 81 additions & 0 deletions
81
...c/applications/fleet/sections/agents/agent_list_page/components/agent_activity_button.tsx
This file contains hidden or 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,81 @@ | ||
| /* | ||
| * 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 { EuiButtonEmpty, EuiText, EuiTourStep } from '@elastic/eui'; | ||
| import React, { useEffect, useState } from 'react'; | ||
| import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
|
||
| import { useStartServices } from '../../../../hooks'; | ||
|
|
||
| export const AgentActivityButton: React.FC<{ | ||
| onClickAgentActivity: () => void; | ||
| showAgentActivityTour: { isOpen: boolean }; | ||
| }> = ({ onClickAgentActivity, showAgentActivityTour }) => { | ||
| const { uiSettings } = useStartServices(); | ||
|
|
||
| const [agentActivityTourState, setAgentActivityTourState] = useState(showAgentActivityTour); | ||
|
|
||
| const isTourHidden = uiSettings.get('hideAgentActivityTour', false); | ||
|
|
||
| const setTourAsHidden = () => uiSettings.set('hideAgentActivityTour', true); | ||
|
|
||
| useEffect(() => { | ||
| setAgentActivityTourState(showAgentActivityTour); | ||
| }, [showAgentActivityTour, setAgentActivityTourState]); | ||
|
|
||
| const button = ( | ||
juliaElastic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <EuiButtonEmpty | ||
| onClick={() => { | ||
| onClickAgentActivity(); | ||
| setAgentActivityTourState({ isOpen: false }); | ||
| }} | ||
| data-test-subj="agentActivityButton" | ||
| iconType="clock" | ||
| > | ||
| <FormattedMessage | ||
| id="xpack.fleet.agentList.agentActivityButton" | ||
| defaultMessage="Agent activity" | ||
| /> | ||
| </EuiButtonEmpty> | ||
| ); | ||
|
|
||
| const onFinish = () => { | ||
| setAgentActivityTourState({ isOpen: false }); | ||
| setTourAsHidden(); | ||
| }; | ||
|
|
||
| return isTourHidden ? ( | ||
| button | ||
| ) : ( | ||
| <EuiTourStep | ||
| content={ | ||
| <EuiText> | ||
| <FormattedMessage | ||
| id="xpack.fleet.agentActivityButton.tourContent" | ||
| defaultMessage="Review in progress, completed, and scheduled agent action activity history here anytime." | ||
| /> | ||
| </EuiText> | ||
| } | ||
| isStepOpen={agentActivityTourState.isOpen} | ||
| onFinish={() => setAgentActivityTourState({ isOpen: false })} | ||
| minWidth={360} | ||
| maxWidth={360} | ||
| step={1} | ||
| stepsTotal={1} | ||
| title={ | ||
| <FormattedMessage | ||
| id="xpack.fleet.agentActivityButton.tourTitle" | ||
| defaultMessage="Agent activity history" | ||
| /> | ||
| } | ||
| anchorPosition="upCenter" | ||
| footerAction={<EuiButtonEmpty onClick={onFinish}>OK</EuiButtonEmpty>} | ||
| > | ||
| {button} | ||
| </EuiTourStep> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.