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

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Genki Sugawara committed Nov 3, 2012
1 parent 135295e commit dccb695
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ec2ui/content/ec2ui/dialog_attach_eni.js
Expand Up @@ -7,13 +7,23 @@ var ec2_DialogAttachENI = {

var instances = ec2ui_session.model.getInstances();
var list = document.getElementById('ec2ui.attacheni.instanceIds');
var labels = [];
var h_name_id = {};

for (var i = 0; i < instances.length; i++) {
var instance = instances[i];
if (instance.subnetId != eni.subnetId) { continue; }

var label = (instance.name || '(no name)') + '@' + instance.id;
list.appendItem(label, instance.id);
labels.push(label);
h_name_id[label] = instance.id;
}

labels.sort();

for (var i = 0; i < labels.length; i++) {
var label = labels[i];
list.appendItem(label, h_name_id[label]);
}

return true;
Expand Down

0 comments on commit dccb695

Please sign in to comment.