2020-07-22 21:30:42 +03:00
|
|
|
export class NodeSelectorController {
|
2020-08-11 00:52:29 +03:00
|
|
|
/* @ngInject */
|
2020-07-22 21:30:42 +03:00
|
|
|
constructor(AgentService, Notifications) {
|
|
|
|
Object.assign(this, { AgentService, Notifications });
|
|
|
|
}
|
2018-05-06 09:15:57 +02:00
|
|
|
|
2020-07-22 21:30:42 +03:00
|
|
|
async $onInit() {
|
|
|
|
try {
|
2022-11-02 13:29:26 +02:00
|
|
|
const agents = await this.AgentService.agents(this.endpointId);
|
2020-07-22 21:30:42 +03:00
|
|
|
this.agents = agents;
|
|
|
|
if (!this.model) {
|
|
|
|
this.model = agents[0].NodeName;
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
this.Notifications.error('Failure', err, 'Unable to load agents');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|