Skip to content
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

Improve Agents preview page load when there are no agents #6185

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Added

- Support for Wazuh 4.7.2
- Improved Agents preview page load when there are no registered agents [#6185](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6185)

## Wazuh v4.7.1 - OpenSearch Dashboards 2.8.0 - Revision 01

Expand Down
14 changes: 14 additions & 0 deletions plugins/main/public/controllers/agent/components/agents-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
EuiToolTip,
EuiCard,
EuiLink,
EuiProgress,
} from '@elastic/eui';
import { AgentsTable } from './agents-table';
import { WzRequest } from '../../../react-services/wz-request';
Expand Down Expand Up @@ -219,6 +220,19 @@ export const AgentsPreview = compose(
render() {
const evolutionIsReady = this.props.resultState !== 'loading';

//This condition is because the angular template and the controller have a small delay to show the register agent component when there are no agents
//This condition must be removed when the controller is removed
if (
!this.state.agentStatusSummary.total ||
this.state.agentStatusSummary.total === '-'
) {
return (
<div class='md-padding md-padding-top-16'>
lucianogorza marked this conversation as resolved.
Show resolved Hide resolved
<EuiProgress size='xs' color='primary' />
</div>
);
}

return (
<EuiPage className='flex-column'>
<EuiFlexItem>
Expand Down
2 changes: 1 addition & 1 deletion plugins/main/public/templates/agents-prev/agents-prev.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
layout="column"
layout-align="start space-around"
>
<div class="registerAgent" ng-if="ctrl.addingNewAgent">
<div class="registerAgent" ng-show="ctrl.addingNewAgent">
<react-component
name="RegisterAgent"
props="ctrl.registerAgentsProps"
Expand Down
Loading