You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/agent/components/node-selector/nodeSelectorController.js

19 lines
471 B

export class NodeSelectorController {
/* @ngInject */
constructor(AgentService, Notifications) {
Object.assign(this, { AgentService, Notifications });
}
async $onInit() {
try {
const agents = await this.AgentService.agents(this.endpointId);
this.agents = agents;
if (!this.model) {
this.model = agents[0].NodeName;
}
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to load agents');
}
}
}