Skip to content

Commit

Permalink
webdash: don't refresh node/task list/info in background
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Buchanan committed May 31, 2018
1 parent 157d8c8 commit b96926a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
15 changes: 15 additions & 0 deletions webdash/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ app.controller("NodeListController", function($rootScope, $scope, $http, $timeou
$scope.nodes = [];

function refresh() {
if (document.hidden) {
stop = $timeout(refresh, 2000);
return
}

$http.get($scope.url).then(function(response) {
$scope.$applyAsync(function() {
$scope.nodes = response.data.nodes;
Expand Down Expand Up @@ -434,6 +439,11 @@ app.controller("TaskInfoController", function($rootScope, $scope, $http, $routeP
}

function refresh() {
if (document.hidden) {
stop = $timeout(refresh, 2000);
return
}

if (!$scope.isDone($scope.task)) {
$http.get($scope.url + "?view=FULL")
.success(function(data, status, headers, config) {
Expand Down Expand Up @@ -479,6 +489,11 @@ app.controller("NodeInfoController", function($rootScope, $scope, $http, $routeP
}

function refresh() {
if (document.hidden) {
stop = $timeout(refresh, 2000);
return
}

$http.get($scope.url)
.success(function(data, status, headers, config) {
$scope.node = data;
Expand Down
24 changes: 12 additions & 12 deletions webdash/web.go

Large diffs are not rendered by default.

0 comments on commit b96926a

Please sign in to comment.