Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
add updateInstanceStatuses / getInstanceStatuses
Browse files Browse the repository at this point in the history
  • Loading branch information
Genki Sugawara committed Jan 8, 2012
1 parent 85017fb commit b268fd6
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion ec2ui/content/ec2ui/model.js
Expand Up @@ -708,7 +708,7 @@ var ec2ui_model = {
}
return this.loadbalancer;
},

updateInstanceHealth : function(list) {
if (!this.instances) {
ec2ui_session.controller.describeInstances();
Expand Down Expand Up @@ -738,5 +738,38 @@ var ec2ui_model = {
ec2ui_session.controller.describeInstanceHealth();
}
return this.InstanceHealth;
},

updateInstanceStatuses : function(list) {
if (!this.instances) {
ec2ui_session.controller.describeInstances();
}

this.instanceStatuses = list;

if (this.instances && list) {
var instanceNames = new Object();

for (var i = 0; i < this.instances.length; i++) {
var instance = this.instances[i];
instanceNames[instance.id] = instance.name;
}

for (var i = 0; i < list.length; i++) {
var instanceStatus = list[i];
instanceStatus.instanceName = instanceNames[instanceStatus.instanceId];
}
}

// XXX:
//this.notifyComponents("scheduledEvents");
},

getInstanceStatuses : function() {
if (this.instanceStatuses == null) {
ec2ui_session.controller.describeInstanceStatus();
}

return this.instanceStatuses;
}
}

0 comments on commit b268fd6

Please sign in to comment.