|
|
|
@ -13,8 +13,7 @@ angular
|
|
|
|
|
EndpointProvider,
|
|
|
|
|
StateManager,
|
|
|
|
|
ModalService,
|
|
|
|
|
MotdService,
|
|
|
|
|
SettingsService
|
|
|
|
|
MotdService
|
|
|
|
|
) {
|
|
|
|
|
$scope.state = {
|
|
|
|
|
connectingToEdgeEndpoint: false,
|
|
|
|
@ -83,7 +82,7 @@ angular
|
|
|
|
|
var groups = data.groups;
|
|
|
|
|
EndpointHelper.mapGroupNameToEndpoint(endpoints, groups);
|
|
|
|
|
EndpointProvider.setEndpoints(endpoints);
|
|
|
|
|
deferred.resolve({ endpoints: decorateEndpoints(endpoints), totalCount: data.endpoints.totalCount });
|
|
|
|
|
deferred.resolve({ endpoints: endpoints, totalCount: data.endpoints.totalCount });
|
|
|
|
|
})
|
|
|
|
|
.catch(function error(err) {
|
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve endpoint information');
|
|
|
|
@ -99,15 +98,14 @@ angular
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const [{ totalCount, endpoints }, tags, settings] = await Promise.all([getPaginatedEndpoints(0, 100), TagService.tags(), SettingsService.settings()]);
|
|
|
|
|
const [{ totalCount, endpoints }, tags] = await Promise.all([getPaginatedEndpoints(0, 100), TagService.tags()]);
|
|
|
|
|
$scope.tags = tags;
|
|
|
|
|
$scope.defaultEdgeCheckInInterval = settings.EdgeAgentCheckinInterval;
|
|
|
|
|
|
|
|
|
|
$scope.totalCount = totalCount;
|
|
|
|
|
if (totalCount > 100) {
|
|
|
|
|
$scope.endpoints = [];
|
|
|
|
|
} else {
|
|
|
|
|
$scope.endpoints = decorateEndpoints(endpoints);
|
|
|
|
|
$scope.endpoints = endpoints;
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
Notifications.error('Failed loading page data', err);
|
|
|
|
@ -115,10 +113,4 @@ angular
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initView();
|
|
|
|
|
|
|
|
|
|
function decorateEndpoints(endpoints) {
|
|
|
|
|
return endpoints.map((endpoint) => {
|
|
|
|
|
return { ...endpoint, EdgeCheckinInterval: endpoint.EdgeAgentCheckinInterval || $scope.defaultEdgeCheckInInterval };
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|