Skip to content

Instantly share code, notes, and snippets.

@tcosentino
Last active August 29, 2015 14:12
Show Gist options
  • Save tcosentino/2d690d9ede3f0f0357f8 to your computer and use it in GitHub Desktop.
Save tcosentino/2d690d9ede3f0f0357f8 to your computer and use it in GitHub Desktop.
Status icons
// From agentListServer
var statusIcon = "";
switch(Number(oObj.aData["OnlineStatus"])) {
case 0: if (oObj.aData["rCriticality"] === '0' || oObj.aData["rCriticality"] === '') { statusIcon = "GrayDot.png"; } else { statusIcon = "agentAlarm1.png"; } break;
case 1: if (oObj.aData["currentUser"] === "") { statusIcon = "GreenDot1.png"; } else { statusIcon = "BlueAgent1.png" } break;
case 2: if (oObj.aData["currentUser"] === "") { statusIcon = "GreenDot1.png"; } else { statusIcon = "YellowAgent1.png" } break;
case 198: statusIcon = "suspended.png"; break;
case 199: statusIcon = "FrongGlobe58.png"; break;
case -1: statusIcon = "agentAlarm-Recovery1.png"; break;
}
return '<span title="'+oObj.aData["DisplayName"]+'"><img class="agent-status" src="/gicore/giadmin/img/agentStatus/'+statusIcon+'">' + oObj.aData["DisplayName"] + '</span>';
// From ops
getStatusIcon: function () {
var statusIcon = "";
switch ( Number( this.get("agentOnline") ) ) {
case 0: statusIcon = !this.isPriority() ? "GrayDot.png" : "agentAlarm1.png"; break;
case 1: statusIcon = !this.get("loggedInUser") === "" ? "GreenDot1.png" : "BlueAgent1.png"; break; //bw
case 2: statusIcon = !this.get("loggedInUser") === "" ? "GreenDot1.png" : "YellowAgent1.png"; break; //bw
case 198: statusIcon = "suspended.png"; break;
case 199: statusIcon = "FrontGlobe58.png"; break;
case -1: statusIcon = "agentAlarm-Recovery1.png"; break;
}
return statusIcon;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment