Navigation Menu

Skip to content

Commit

Permalink
Make installing/uninstalling features feel a bit more responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Nov 7, 2013
1 parent e9eb709 commit 3d042de
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hawtio-web/src/main/webapp/app/karaf/js/features.ts
Expand Up @@ -58,10 +58,21 @@ module Karaf {
}, onSuccess(render));
}

$scope.triggerRefresh = () => {
jolokia.request({
type: 'read',
method: 'POST',
mbean: featuresMBean
}, onSuccess(render));
};

$scope.install = (feature) => {
//$('.popover').remove();
notification('info', 'Installing feature ' + feature.Name);
installFeature(workspace, jolokia, feature.Name, feature.Version, () => {
notification('success', 'Installed feature ' + feature.Name);
$scope.installedFeatures.add(feature);
$scope.triggerRefresh();
Core.$apply($scope);
}, (response) => {
log.error('Failed to install feature ', feature.Name, ' due to ', response.error);
Expand All @@ -72,8 +83,11 @@ module Karaf {

$scope.uninstall = (feature) => {
//$('.popover').remove();
notification('info', 'Uninstalling feature ' + feature.Name);
uninstallFeature(workspace, jolokia, feature.Name, feature.Version, () => {
notification('success', 'Uninstalled feature ' + feature.Name);
$scope.installedFeatures.remove(feature);
$scope.triggerRefresh();
Core.$apply($scope);
}, (response) => {
log.error('Failed to uninstall feature ', feature.Name, ' due to ', response.error);
Expand Down

0 comments on commit 3d042de

Please sign in to comment.