Skip to content

Commit

Permalink
Fix #541 by wrapping the jolokia call in a setTimeout, now we go righ…
Browse files Browse the repository at this point in the history
…t back to the container list page
  • Loading branch information
gashcrumb committed Sep 16, 2013
1 parent debb0b6 commit 383b2e4
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions hawtio-web/src/main/webapp/app/fabric/js/createContainer.ts
Expand Up @@ -192,24 +192,27 @@ module Fabric {
json['profiles'] = $scope.selectedProfiles.map((p) => { return p.id; });
}

jolokia.execute(managerMBean, 'createContainers(java.util.Map)', angular.toJson(json), {
method: "post",
success: (response) => {
var error = false;
angular.forEach(response.value, function(value, key) {
error = true;
notification('error', "Creating container " + key + " failed: " + value);
});
if (!error) {
notification('success', "Successfully created containers");
setTimeout(() => {
jolokia.execute(managerMBean, 'createContainers(java.util.Map)', angular.toJson(json), {
method: "post",
success: (response) => {
var error = false;
angular.forEach(response.value, function(value, key) {
error = true;
notification('error', "Creating container " + key + " failed: " + value);
});
if (!error) {
notification('success', "Successfully created containers");
}
Core.$apply($scope);
},
error: (response) => {
notification('error', "Error creating containers: " + response.error);
Core.$apply($scope);
}
Core.$apply($scope);
},
error: (response) => {
notification('error', "Error creating containers: " + response.error);
Core.$apply($scope);
}
});
});
Core.$apply($scope);
}, 10);

notification('info', "Requesting that new container(s) be created");
$location.url('/fabric/containers');
Expand Down

0 comments on commit 383b2e4

Please sign in to comment.