Skip to content

Instantly share code, notes, and snippets.

@vikingmute
Created January 13, 2016 03:44
Show Gist options
  • Save vikingmute/056f1b8931bf16c63acc to your computer and use it in GitHub Desktop.
Save vikingmute/056f1b8931bf16c63acc to your computer and use it in GitHub Desktop.
statusAgents: computed('search', 'isLoaded', 'agents', {
get() {
let agents = this.get('agents');
return agents.map(function(agent) {
if (agent.get('connected')) {
if (agent.get('currentJob')) {
agent.set('stauts', 'online');
} else {
agent.set('status', 'ready');
}
} else {
if (agent.get('currentJob')) {
agent.set('status', 'offline');
} else {
agent.set('status', 'dead');
}
}
return agent;
});
}
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment