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,6 +155,8 @@ 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;
if (event_id) {
// find and show the selected event // find and show the selected event
data.every(function(row, idx) { data.every(function(row, idx) {
if (parseInt(row.id,10) === parseInt(event_id,10)) { if (parseInt(row.id,10) === parseInt(event_id,10)) {
@@ -163,6 +165,10 @@ angular.module('EventViewerHelper', ['ModalDialog', 'Utilities', 'EventsViewerFo
} }
return true; 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
}); });