show message when too many events come back for a job detail view

This commit is contained in:
John Mitchell 2017-01-10 14:48:48 -05:00
parent b8ce360227
commit c0bbc4a9dd
4 changed files with 48 additions and 9 deletions

View File

@ -162,6 +162,7 @@
.JobResultsStdOut-stdoutColumn {
padding-left: 20px;
padding-right: 20px;
padding-top: 2px;
padding-bottom: 2px;
color: @default-interface-txt;
@ -171,6 +172,11 @@
width:100%;
}
.JobResultsStdOut-stdoutColumn--tooMany {
font-weight: bold;
text-transform: uppercase;
}
.JobResultsStdOut-stdoutColumn {
cursor: pointer;
}

View File

@ -31,6 +31,13 @@
</div>
</div>
<div class="JobResultsStdOut-stdoutContainer">
<div class="JobResultsStdOut-aLineOfStdOut"
ng-show="tooManyEvents">
<div class="JobResultsStdOut-lineNumberColumn">
<span class="JobResultsStdOut-lineExpander"> </span>
</div>
<div class="JobResultsStdOut-stdoutColumn JobResultsStdOut-stdoutColumn--tooMany">The standard out based on the current filter is too large to display. Please use additional filters to view results.</div>
</div>
<div id="topAnchor" class="JobResultsStdOut-topAnchor"></div>
<div class="JobResultsStdOut-numberColumnPreload"></div>
<div id='lineAnchor' class="JobResultsStdOut-lineAnchor"></div>

View File

@ -383,7 +383,11 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
// making rest calls for next pages/etc. (you can see context is
// also passed into getEvents and processEvent and similar checks
// exist in these functions)
if (context !== currentContext) {
//
// also, if the page doesn't contain results (i.e.: the response
// returns an error), don't process the page
if (context !== currentContext || events === undefined ||
events.results === undefined) {
return;
}
@ -441,7 +445,16 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
$( ".JobResultsStdOut-aLineOfStdOut.not_skeleton" ).remove();
$scope.hasSkeleton.promise.then(() => {
processPage(val, context);
if (val.count > parseInt(val.maxEvents)) {
$(".header_task").hide();
$(".header_play").hide();
$scope.tooManyEvents = true;
} else {
$(".header_task").show();
$(".header_play").show();
$scope.tooManyEvents = false;
processPage(val, context);
}
});
}));

View File

@ -147,20 +147,33 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear
Wait('start');
this.url = `${endpoint}${this.encodeQueryset(params)}`;
Rest.setUrl(this.url);
return Rest.get()
.success(this.success.bind(this))
.error(this.error.bind(this))
.finally(Wait('stop'));
.then(function(response) {
Wait('stop');
if (response
.headers('X-UI-Max-Events') !== null) {
response.data.maxEvents = response.
headers('X-UI-Max-Events');
}
return response;
})
.catch(function(response) {
Wait('stop');
this.error(response.data, response.status);
return response;
}.bind(this));
},
error(data, status) {
ProcessErrors($rootScope, data, status, null, {
hdr: 'Error!',
msg: 'Call to ' + this.url + '. GET returned: ' + status
});
},
success(data) {
return data;
},
}
};
}
];