Event viewer

Fixed issue that occurred while launching event viewer from host event viewer. For a given host event on the host event viewer dialog, click the status link. The event viewer dialog failed to appear if there was only a single event.
This commit is contained in:
Chris Houseknecht
2014-07-29 14:49:23 -04:00
parent 69dc0a10ca
commit a2ddeb1f22

View File

@@ -155,14 +155,20 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
scope.removeEventReady = scope.$on('EventReady', function(e, data) { scope.removeEventReady = scope.$on('EventReady', function(e, data) {
var btns; var btns;
scope.events = data; scope.events = data;
// find and show the selected event
data.every(function(row, idx) { if (event_id) {
if (parseInt(row.id,10) === parseInt(event_id,10)) { // find and show the selected event
current_event = idx; data.every(function(row, idx) {
return false; if (parseInt(row.id,10) === parseInt(event_id,10)) {
} current_event = idx;
return true; return false;
}); }
return true;
});
}
else {
current_event = 0;
}
showEvent(current_event); showEvent(current_event);
btns = []; btns = [];
@@ -248,8 +254,11 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
}); });
}); });
url += (/\/$/.test(url)) ? '?' : '&';
url += (parent_id) ? 'parent=' + parent_id + '&page_size=50&order_by=id' : 'page_size=50&order_by=id';
GetEvent({ GetEvent({
url: url + '?parent=' + parent_id + '&page_size=50&order_by=id', url: url,
scope: scope scope: scope
}); });