2020-07-22 18:30:42 +00:00
|
|
|
export class NodeSelectorController {
|
2020-08-10 21:52:29 +00:00
|
|
|
/* @ngInject */
|
2020-07-22 18:30:42 +00:00
|
|
|
constructor(AgentService, Notifications) {
|
|
|
|
Object.assign(this, { AgentService, Notifications });
|
|
|
|
}
|
2018-05-06 07:15:57 +00:00
|
|
|
|
2020-07-22 18:30:42 +00: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');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|