1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 05:49:40 +02:00
portainer/app/agent/components/node-selector/nodeSelectorController.js

18 lines
438 B
JavaScript
Raw Normal View History

export class NodeSelectorController {
constructor(AgentService, Notifications) {
Object.assign(this, { AgentService, Notifications });
}
2018-05-06 09:15:57 +02:00
async $onInit() {
try {
const agents = await this.AgentService.agents();
this.agents = agents;
if (!this.model) {
this.model = agents[0].NodeName;
}
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to load agents');
}
}
}