Fix some busted job stdout end-line calculation under certain

conditions.  Make it to where the ui re-uses the endpoint from the last
stdout request cycle instead of adding one to it since we are not
left-inclusive on list slicing.
This commit is contained in:
Matthew Jones 2014-07-25 14:53:50 -04:00
parent f8d70f03ea
commit e19984d6db
2 changed files with 2 additions and 2 deletions

View File

@ -534,7 +534,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
else:
start_actual = int(start_line)
if end_line is not None:
end_actual = min(int(start_line)+int(end_line), len(stdout_lines))
end_actual = min(int(end_line), len(stdout_lines))
else:
end_actual = len(stdout_lines)
return return_buffer, start_actual, end_actual, absolute_end

View File

@ -237,7 +237,7 @@ function JobStdoutController ($log, $rootScope, $scope, $compile, $routeParams,
function getNextSection() {
// get the next range of data from the API
var start = loaded_sections[loaded_sections.length - 1].end + 1, url;
var start = loaded_sections[loaded_sections.length - 1].end, url;
url = stdout_url + '?format=json&start_line=' + start + '&end_line=' + (start + page_size);
$('#stdoutMoreRowsBottom').fadeIn();
Rest.setUrl(url);