Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
fix(health-check): Get endpoint from an endpoint group
Browse files Browse the repository at this point in the history
  • Loading branch information
brasseld authored and NicolasGeraud committed Oct 10, 2018
1 parent 4cf1a5f commit 1dcb9d7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/management/api/proxy/apis.proxy.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function apisProxyRouterConfig($stateProvider) {
}
})
.state('management.apis.detail.proxy.endpointhc', {
url: '/endpoints/:endpointName/healthcheck',
url: '/groups/:groupName/endpoints/:endpointName/healthcheck',
template: require('./backend/healthcheck/healthcheck-configure.html'),
controller: 'ApiHealthCheckConfigureController',
controllerAs: 'healthCheckCtrl',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ApiEndpointController {
this.api = this.$scope.$parent.apiCtrl.api;
this.tenants = resolvedTenants.data;

this.$scope.groupName = $stateParams.groupName;

this.group = _.find(this.api.proxy.groups, { 'name': $stateParams.groupName});
this.endpoint = _.find(this.group.endpoints, { 'name': $stateParams.endpointName});
this.initialEndpoints = _.cloneDeep(this.group.endpoints);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<section ng-if="endpointCtrl.creation === false">
<md-subheader class="md-primary" style="background-color: #fafafa">
Health-check
<ng-md-icon icon="settings" style="fill: rgba(0, 0, 0, 0.54);" ui-sref="management.apis.detail.proxy.endpointhc({endpointName: endpointCtrl.endpoint.name})"></ng-md-icon>
<ng-md-icon icon="settings" style="fill: rgba(0, 0, 0, 0.54);" ui-sref="management.apis.detail.proxy.endpointhc({groupName: groupName, endpointName: endpointCtrl.endpoint.name})"></ng-md-icon>
</md-subheader>
<div layout="column" layout-wrap layout-gt-sm="row">
<div flex-xs flex="50">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class ApiHealthCheckConfigureController {

if (this.$stateParams.endpointName !== undefined) {
// Health-check for specific endpoint
this.endpoint = _.find(this.api.proxy.endpoints, { 'name': $stateParams.endpointName });
let group = _.find(this.api.proxy.groups, { 'name': $stateParams.groupName});
this.endpoint = _.find(group.endpoints, { 'name': $stateParams.endpointName });
this.healthcheck = this.endpoint.healthcheck;
} else {
this.healthcheck = this.api.services && this.api.services['health-check'];
Expand Down Expand Up @@ -143,7 +144,8 @@ class ApiHealthCheckConfigureController {
}

backToEndpointConfiguration() {
this.$state.go('management.apis.detail.proxy.endpoint', {endpointName: this.endpoint.name});
this.$state.go('management.apis.detail.proxy.endpoint',
{groupName: this.$stateParams.groupName, endpointName: this.$stateParams.endpointName});
}

backToHealthcheck() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<br>

<div ng-show="healthCheckCtrl.healthcheck.inherit === false && healthCheckCtrl.healthcheck.enabled === true">
<div ng-show="!healthCheckCtrl.healthcheck.inherit && healthCheckCtrl.healthcheck.enabled === true">
<md-subheader class="md-primary" style="background-color: #fafafa">Trigger</md-subheader>
<md-content>
<form name="formApiHealthCheckTrigger" novalidate layout-gt-sm="row" flex="100">
Expand Down

0 comments on commit 1dcb9d7

Please sign in to comment.