mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Disable cancel button after initial click
This commit is contained in:
parent
e3f0246f4c
commit
207ea901ab
@ -77,6 +77,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
|
||||
|
||||
if (project.status === 'failed' && project.summary_fields.last_update && project.summary_fields.last_update.status === 'canceled') {
|
||||
project.statusTip = i18n._('Canceled. Click for details');
|
||||
project.scm_type_class = "btn-disabled";
|
||||
}
|
||||
|
||||
if (project.status === 'running' || project.status === 'updating') {
|
||||
@ -247,8 +248,9 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
|
||||
});
|
||||
});
|
||||
|
||||
$scope.cancelUpdate = function(id, name) {
|
||||
Rest.setUrl(GetBasePath("projects") + id);
|
||||
$scope.cancelUpdate = function(project) {
|
||||
project.pending_cancellation = true;
|
||||
Rest.setUrl(GetBasePath("projects") + project.id);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
if (data.related.current_update) {
|
||||
|
@ -120,10 +120,11 @@ export default ['i18n', function(i18n) {
|
||||
dataPlacement: 'top'
|
||||
},
|
||||
cancel: {
|
||||
ngClick: "cancelUpdate(project.id, project.name)",
|
||||
ngClick: "cancelUpdate(project)",
|
||||
awToolTip: i18n._('Cancel the SCM update'),
|
||||
ngShow: "(project.status == 'updating' || project.status == 'running' || project.status == 'pending') && project.summary_fields.user_capabilities.start",
|
||||
dataPlacement: 'top'
|
||||
dataPlacement: 'top',
|
||||
ngDisabled: "project.pending_cancellation || project.status == 'canceled'"
|
||||
}
|
||||
}
|
||||
};}];
|
||||
|
Loading…
Reference in New Issue
Block a user