Skip to content

Commit

Permalink
Fix beats/apm page views
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline committed Sep 23, 2020
1 parent 8057843 commit 5152574
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 51 deletions.
22 changes: 9 additions & 13 deletions x-pack/plugins/monitoring/public/views/apm/instance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ uiRoutes.when('/apm/instances/:uuid', {
apm: 'APM server',
},
}),
telemetryPageViewTitle: 'apm_server_instance',
api: `../api/monitoring/v1/clusters/${globalState.cluster_uuid}/apm/${$route.current.params.uuid}`,
defaultData: {},
reactNodeId: 'apmInstanceReact',
Expand All @@ -63,21 +64,16 @@ uiRoutes.when('/apm/instances/:uuid', {
})
);
title($scope.cluster, `APM server - ${get(data, 'apmSummary.name')}`);
this.renderReact(data);
this.renderReact(
<ApmServerInstance
summary={data.apmSummary || {}}
metrics={data.metrics || {}}
onBrush={this.onBrush}
zoomInfo={this.zoomInfo}
/>
);
}
);
}

renderReact(data) {
const component = (
<ApmServerInstance
summary={data.apmSummary || {}}
metrics={data.metrics || {}}
onBrush={this.onBrush}
zoomInfo={this.zoomInfo}
/>
);
super.renderReact(component);
}
},
});
54 changes: 25 additions & 29 deletions x-pack/plugins/monitoring/public/views/apm/instances/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,33 @@ uiRoutes.when('/apm/instances', {
$scope.$watch(
() => this.data,
(data) => {
this.renderReact(data);
}
);
}
const { pagination, sorting, onTableChange } = this;

renderReact(data) {
const { pagination, sorting, onTableChange } = this;

const component = (
<SetupModeRenderer
scope={this.scope}
injector={this.injector}
productName={APM_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }) => (
<Fragment>
{flyoutComponent}
<ApmServerInstances
setupMode={setupMode}
apms={{
pagination,
sorting,
onTableChange,
data,
}}
/>
{bottomBarComponent}
</Fragment>
)}
/>
const component = (
<SetupModeRenderer
scope={this.scope}
injector={this.injector}
productName={APM_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }) => (
<Fragment>
{flyoutComponent}
<ApmServerInstances
setupMode={setupMode}
apms={{
pagination,
sorting,
onTableChange,
data,
}}
/>
{bottomBarComponent}
</Fragment>
)}
/>
);
this.renderReact(component);
}
);
super.renderReact(component);
}
},
});
9 changes: 3 additions & 6 deletions x-pack/plugins/monitoring/public/views/apm/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ uiRoutes.when('/apm', {
$scope.$watch(
() => this.data,
(data) => {
this.renderReact(data);
this.renderReact(
<ApmOverview {...data} onBrush={this.onBrush} zoomInfo={this.zoomInfo} />
);
}
);
}

renderReact(data) {
const component = <ApmOverview {...data} onBrush={this.onBrush} zoomInfo={this.zoomInfo} />;
super.renderReact(component);
}
},
});
1 change: 1 addition & 0 deletions x-pack/plugins/monitoring/public/views/beats/beat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ uiRoutes.when('/beats/beat/:beatUuid', {
beatName: pageData.summary.name,
},
}),
telemetryPageViewTitle: 'beats_instance',
getPageData,
$scope,
$injector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ uiRoutes.when('/beats/beats', {
pageTitle: i18n.translate('xpack.monitoring.beats.listing.pageTitle', {
defaultMessage: 'Beats listing',
}),
telemetryPageViewTitle: 'beats_listing',
storageKey: 'beats.beats',
getPageData,
reactNodeId: 'monitoringBeatsInstancesApp',
Expand All @@ -51,9 +52,6 @@ uiRoutes.when('/beats/beats', {
this.scope = $scope;
this.injector = $injector;

//Bypassing super.updateData, since this controller loads its own data
this._isDataInitialized = true;

$scope.$watch(
() => this.data,
() => this.renderComponent()
Expand Down

0 comments on commit 5152574

Please sign in to comment.