1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

fix(edge/stacks): show correct status for env [EE-3374] (#7466)

This commit is contained in:
Chaim Lev-Ari 2022-08-12 04:20:36 +03:00 committed by GitHub
parent a247db7e93
commit 29f0daa7ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 21 deletions

View file

@ -56,8 +56,8 @@
ng-class="{ active: item.Checked }"
>
<td>{{ item.Name }}</td>
<td>{{ $ctrl.statusMap[item.Status.Type] || 'Pending' }}</td>
<td>{{ item.Status.Error ? item.Status.Error : '-' }}</td>
<td>{{ $ctrl.endpointStatusLabel(item.Id) }}</td>
<td>{{ $ctrl.endpointStatusError(item.Id) }}</td>
</tr>
<tr ng-if="$ctrl.state.loading">
<td colspan="5" class="text-center text-muted">Loading...</td>

View file

@ -39,6 +39,22 @@ export class EdgeStackEndpointsDatatableController {
this.onTextFilterChange = onTextFilterChange;
}
getEndpointStatus(endpointId) {
return this.endpointsStatus[endpointId];
}
endpointStatusLabel(endpointId) {
const status = this.getEndpointStatus(endpointId);
return status ? this.statusMap[status.Type] : 'Pending';
}
endpointStatusError(endpointId) {
const status = this.getEndpointStatus(endpointId);
return status && status.Error ? status.Error : '-';
}
$onInit() {
this.setDefaults();
this.prepareTableFromDataset();

View file

@ -12,5 +12,7 @@ angular.module('portainer.edge').component('edgeStackEndpointsDatatable', {
orderBy: '@',
reverseOrder: '<',
retrievePage: '<',
edgeStackId: '<',
endpointsStatus: '<',
},
});