mirror of https://github.com/portainer/portainer
fix(endpoints): load endpoints and tags together (#4230)
parent
35fa9d6981
commit
7b77a92a2d
|
@ -97,20 +97,18 @@ angular
|
||||||
$scope.motd = data;
|
$scope.motd = data;
|
||||||
});
|
});
|
||||||
|
|
||||||
getPaginatedEndpoints(0, 100).then((data) => {
|
try {
|
||||||
const totalCount = data.totalCount;
|
const [{ totalCount, endpoints }, tags] = await Promise.all([getPaginatedEndpoints(0, 100), TagService.tags()]);
|
||||||
|
$scope.tags = tags;
|
||||||
|
|
||||||
$scope.totalCount = totalCount;
|
$scope.totalCount = totalCount;
|
||||||
if (totalCount > 100) {
|
if (totalCount > 100) {
|
||||||
$scope.endpoints = [];
|
$scope.endpoints = [];
|
||||||
} else {
|
} else {
|
||||||
$scope.endpoints = data.endpoints;
|
$scope.endpoints = endpoints;
|
||||||
}
|
}
|
||||||
});
|
} catch (err) {
|
||||||
|
Notifications.error('Failed loading page data', err);
|
||||||
try {
|
|
||||||
$scope.tags = await TagService.tags();
|
|
||||||
} catch (e) {
|
|
||||||
Notifications.error('Failed loading tags', e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue