Skip to content

Commit

Permalink
Fixed tomcat plugin to update web page asap when showing applications…
Browse files Browse the repository at this point in the history
… and sessions pages.
  • Loading branch information
davsclaus committed Mar 26, 2013
1 parent ebe2c06 commit e4ffc7d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
6 changes: 0 additions & 6 deletions hawtio-web/src/main/webapp/app/jboss/js/connectors.ts
Expand Up @@ -72,12 +72,6 @@ module JBoss {
Core.$apply($scope);
};

// function to trigger reloading page
$scope.onResponse = function (response) {
//console.log("got response: " + response);
loadData();
};

$scope.$watch('workspace.tree', function () {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
Expand Down
21 changes: 2 additions & 19 deletions hawtio-web/src/main/webapp/app/tomcat/js/sessions.ts
Expand Up @@ -104,7 +104,6 @@ module Tomcat {
response = Tomcat.filerTomcatOrCatalina(response);

$scope.sessions = [];
$scope.mbeanIndex = {};

function onAttributes(response) {
var obj = response.value;
Expand All @@ -123,13 +122,8 @@ module Tomcat {
obj.path = "";
}

var idx = $scope.mbeanIndex[mbean];
if (angular.isDefined(idx)) {
$scope.sessions[mbean] = obj;
} else {
$scope.sessions[mbean] = $scope.sessions.length;
$scope.sessions.push(obj);
}
$scope.sessions.push(obj);
Core.$apply($scope);
}
}
}
Expand All @@ -143,17 +137,6 @@ module Tomcat {
Core.$apply($scope);
};

// function to trigger reloading page
$scope.onLastResponse = function (response) {
$scope.onResponse(response);
// we only want to force updating the data on the last response
loadData();
};

$scope.onResponse = function (response) {
//console.log("got response: " + response);
};

$scope.$watch('workspace.tree', function () {
// if the JMX tree is reloaded its probably because a new MBean has been added or removed
// so lets reload, asynchronously just in case
Expand Down
3 changes: 3 additions & 0 deletions hawtio-web/src/main/webapp/app/tomcat/js/tomcat.ts
Expand Up @@ -76,6 +76,9 @@ module Tomcat {
$scope.mbeanIndex[mbean] = $scope.webapps.length;
$scope.webapps.push(obj);
}

// ensure web page is updated
Core.$apply($scope);
}
}
}
Expand Down

0 comments on commit e4ffc7d

Please sign in to comment.