Permalink
Browse files

add Select Instance to Events Tab

  • Loading branch information...
1 parent bc7dea6 commit cc6f4c162ab013b68534eff8729c7039bcf1ef2f @winebarrel winebarrel committed May 17, 2012
@@ -171,6 +171,11 @@ var ec2ui_InstancesTreeView = {
return document.getElementById('ec2ui.instances.search').value;
},
+ setSearchText: function(text) {
+ document.getElementById('ec2ui.instances.search').value = (text || '');
+ this.invalidate();
+ },
+
invalidate : function() {
var target = ec2ui_InstancesTreeView;
target.displayInstances(target.filterInstances(ec2ui_model.instances));
@@ -135,6 +135,16 @@ var ec2ui_ScheduledEventsTreeView = {
copyToClipboard(scheduledEvent[fieldName]);
},
+ selectInstance: function() {
+ var scheduledEvent = this.getSelectedScheduledEvent();
+ if (scheduledEvent == null) { return; }
+
+ ec2ui_InstancesTreeView.selectByInstanceId(scheduledEvent.instanceId);
+ ec2ui_InstancesTreeView.setSearchText(scheduledEvent.instanceId);
+ var tabPanel = document.getElementById("ec2ui.primary.tabs");
+ tabPanel.selectedIndex = 0;
+ },
+
displayScheduledEvents: function (scheduledEventList) {
if (!scheduledEventList) { scheduledEventList = []; }
@@ -10,6 +10,9 @@
<caption label="Instance Events" />
<popupset>
<menupopup id="ec2ui.scheduledevents.contextmenu">
+ <menuitem oncommand="ec2ui_ScheduledEventsTreeView.selectInstance();"
+ label="Select Instance" />
+ <menuseparator />
<menuitem oncommand="ec2ui_ScheduledEventsTreeView.copyToClipBoard('instanceId');"
label="Copy Instance ID" />
<menuitem oncommand="ec2ui_ScheduledEventsTreeView.copyToClipBoard('instanceName');"

0 comments on commit cc6f4c1

Please sign in to comment.