mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
show loading indicator while enable/disable package
This commit is contained in:
parent
6c380f63a7
commit
2aec52daed
1 changed files with 56 additions and 14 deletions
|
|
@ -59,23 +59,65 @@
|
|||
init();
|
||||
|
||||
$scope.enable = function(name, artifact) {
|
||||
$http.post(baseUrlSrv.getRestApiBase() + '/helium/enable/' + name, artifact).
|
||||
success(function(data, status) {
|
||||
getAllPackageInfo();
|
||||
}).
|
||||
error(function(data, status) {
|
||||
console.log('Failed to enable package %o %o', name, artifact);
|
||||
});
|
||||
var confirm = BootstrapDialog.confirm({
|
||||
closable: false,
|
||||
closeByBackdrop: false,
|
||||
closeByKeyboard: false,
|
||||
title: '',
|
||||
message: 'Enable ' + name + '?',
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
confirm.$modalFooter.find('button').addClass('disabled');
|
||||
confirm.$modalFooter.find('button:contains("OK")')
|
||||
.html('<i class="fa fa-circle-o-notch fa-spin"></i> Enabling');
|
||||
$http.post(baseUrlSrv.getRestApiBase() + '/helium/enable/' + name, artifact).
|
||||
success(function(data, status) {
|
||||
getAllPackageInfo();
|
||||
confirm.close();
|
||||
}).
|
||||
error(function(data, status) {
|
||||
confirm.close();
|
||||
console.log('Failed to enable package %o %o', name, artifact);
|
||||
BootstrapDialog.show({
|
||||
title: 'Error on enabling ' + name,
|
||||
message: data.message
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.disable = function(name) {
|
||||
$http.post(baseUrlSrv.getRestApiBase() + '/helium/disable/' + name).
|
||||
success(function(data, status) {
|
||||
getAllPackageInfo();
|
||||
}).
|
||||
error(function(data, status) {
|
||||
console.log('Failed to disable package %o', name);
|
||||
});
|
||||
var confirm = BootstrapDialog.confirm({
|
||||
closable: false,
|
||||
closeByBackdrop: false,
|
||||
closeByKeyboard: false,
|
||||
title: '',
|
||||
message: 'Disable ' + name + '?',
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
confirm.$modalFooter.find('button').addClass('disabled');
|
||||
confirm.$modalFooter.find('button:contains("OK")')
|
||||
.html('<i class="fa fa-circle-o-notch fa-spin"></i> Disabling');
|
||||
$http.post(baseUrlSrv.getRestApiBase() + '/helium/disable/' + name).
|
||||
success(function(data, status) {
|
||||
getAllPackageInfo();
|
||||
confirm.close();
|
||||
}).
|
||||
error(function(data, status) {
|
||||
confirm.close();
|
||||
console.log('Failed to disable package %o', name);
|
||||
BootstrapDialog.show({
|
||||
title: 'Error on disabling ' + name,
|
||||
message: data.message
|
||||
});
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue