mirror of https://github.com/portainer/portainer
fix edge heartbeat turn red when use search filter (#5683)
parent
1796545d2e
commit
483559af09
|
@ -35,10 +35,9 @@ class EndpointItemController {
|
|||
return false;
|
||||
}
|
||||
const checkInInterval = this.model.EdgeCheckinInterval;
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
|
||||
// give checkIn some wiggle room
|
||||
return now - this.model.LastCheckInDate <= checkInInterval * 2 + 20;
|
||||
return this.endpointInitTime - this.model.LastCheckInDate <= checkInInterval * 2;
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
|
|
|
@ -10,6 +10,7 @@ angular.module('portainer.app').component('endpointItem', {
|
|||
onEdit: '<',
|
||||
isAdmin: '<',
|
||||
tags: '<',
|
||||
endpointInitTime: '<',
|
||||
},
|
||||
controller: EndpointItemController,
|
||||
});
|
||||
|
|
|
@ -14,5 +14,6 @@ angular.module('portainer.app').component('endpointList', {
|
|||
isAdmin: '<',
|
||||
totalCount: '<',
|
||||
retrievePage: '<',
|
||||
endpointInitTime: '<',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
on-edit="($ctrl.editAction)"
|
||||
is-admin="$ctrl.isAdmin"
|
||||
tags="$ctrl.tags"
|
||||
endpoint-init-time="$ctrl.endpointInitTime"
|
||||
></endpoint-item>
|
||||
<endpoint-item
|
||||
ng-if="!$ctrl.hasBackendPagination()"
|
||||
|
@ -47,6 +48,7 @@
|
|||
on-edit="($ctrl.editAction)"
|
||||
is-admin="$ctrl.isAdmin"
|
||||
tags="$ctrl.tags"
|
||||
endpoint-init-time="$ctrl.endpointInitTime"
|
||||
></endpoint-item>
|
||||
<div ng-if="$ctrl.state.loading" class="text-center text-muted" data-cy="home-loadingEndpoints">
|
||||
Loading...
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
is-admin="isAdmin"
|
||||
total-count="totalCount"
|
||||
retrieve-page="getPaginatedEndpoints"
|
||||
endpoint-init-time="state.homepageLoadTime"
|
||||
></endpoint-list>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,6 +18,7 @@ angular
|
|||
) {
|
||||
$scope.state = {
|
||||
connectingToEdgeEndpoint: false,
|
||||
homepageLoadTime: '',
|
||||
};
|
||||
|
||||
$scope.goToEdit = function (id) {
|
||||
|
@ -92,6 +93,7 @@ angular
|
|||
}
|
||||
|
||||
async function initView() {
|
||||
$scope.state.homepageLoadTime = Math.floor(Date.now() / 1000);
|
||||
$scope.isAdmin = Authentication.isAdmin();
|
||||
|
||||
MotdService.motd().then(function success(data) {
|
||||
|
|
Loading…
Reference in New Issue