2020-04-10 21:54:53 +00:00
|
|
|
angular.module('portainer.docker').controller('DashboardClusterAgentInfoController', [
|
|
|
|
'AgentService',
|
|
|
|
'Notifications',
|
|
|
|
function (AgentService, Notifications) {
|
|
|
|
var ctrl = this;
|
2018-05-06 07:15:57 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
this.$onInit = function () {
|
2022-11-02 11:29:26 +00:00
|
|
|
AgentService.agents(ctrl.endpointId)
|
2020-04-10 21:54:53 +00:00
|
|
|
.then(function success(data) {
|
|
|
|
ctrl.agentCount = data.length;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve agent information');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
},
|
|
|
|
]);
|