Created
January 13, 2016 03:44
-
-
Save vikingmute/056f1b8931bf16c63acc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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