From 346595854cfa4fc6b00dfd0c3a124e4dcf4d9547 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 19 Jun 2014 23:04:04 -0400 Subject: [PATCH] Job detail page When UpdateDOM is enabled, the CPU melts. Experimenting with ways to updated the DOM without it being sucha drain. --- awx/ui/static/js/controllers/JobDetail.js | 8 ++++---- awx/ui/static/js/helpers/JobDetail.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index 95d446697f..80af9baf25 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -25,10 +25,10 @@ function JobDetailController ($rootScope, $scope, $compile, $routeParams, $log, scope.tasks = []; scope.hostResults = []; - scope.hostResultsMaxRows = 75; - scope.hostSummariesMaxRows = 75; - scope.tasksMaxRows = 75; - scope.playsMaxRows = 75; + scope.hostResultsMaxRows = 25; + scope.hostSummariesMaxRows = 25; + scope.tasksMaxRows = 25; + scope.playsMaxRows = 25; scope.search_all_tasks = []; scope.search_all_plays = []; diff --git a/awx/ui/static/js/helpers/JobDetail.js b/awx/ui/static/js/helpers/JobDetail.js index 5919465387..0246b47d6f 100644 --- a/awx/ui/static/js/helpers/JobDetail.js +++ b/awx/ui/static/js/helpers/JobDetail.js @@ -960,6 +960,10 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge keys; if (scope.activePlay) { keys = Object.keys(scope.jobData.plays[scope.activePlay].tasks); + keys.reverse(); + if (keys.length > scope.tasksMaxRows + 1) { + keys.splice(0, keys.length - (scope.taskMaxRows + 1)); + } keys.sort(); while (idx < keys.length && idx < scope.tasksMaxRows) { result.push(scope.jobData.plays[scope.activePlay].tasks[keys[idx]]); @@ -1006,11 +1010,11 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge DrawPlays({ scope: scope }); DrawTasks({ scope: scope }); - DrawHostResults({ scope: scope }); + // DrawHostResults({ scope: scope }); - if (scope.host_summary.total > 0) { - DrawGraph({ scope: scope, resize: true }); - } + //if (scope.host_summary.total > 0) { + // DrawGraph({ scope: scope, resize: true }); + //} }; }])