Add cancel action for active app tasks
This commit is contained in:
@@ -189,6 +189,12 @@ app.filter('installError', function () {
|
||||
};
|
||||
});
|
||||
|
||||
app.filter('activeTask', function () {
|
||||
return function (app) {
|
||||
return app.taskId !== null;
|
||||
};
|
||||
});
|
||||
|
||||
app.filter('installSuccess', function () {
|
||||
return function (app) {
|
||||
return app.installationState === ISTATES.INSTALLED;
|
||||
@@ -324,6 +330,47 @@ app.filter('installationStateLabel', function() {
|
||||
};
|
||||
});
|
||||
|
||||
// this appears when task is getting canceled
|
||||
app.filter('installationStateCancelTask', function() {
|
||||
return function(app) {
|
||||
switch (app.installationState) {
|
||||
case ISTATES.PENDING_INSTALL: return 'installing';
|
||||
case ISTATES.PENDING_CLONE: return 'cloning';
|
||||
case ISTATES.PENDING_CONFIGURE: return 'configuring';
|
||||
case ISTATES.PENDING_UNINSTALL: return 'uninstalling';
|
||||
case ISTATES.PENDING_RESTORE: return 'restoring';
|
||||
case ISTATES.PENDING_UPDATE: return 'updating';
|
||||
case ISTATES.PENDING_BACKUP: return 'backing up';
|
||||
case ISTATES.INSTALLED: {
|
||||
if (app.runState === 'pending_start') return 'starting';
|
||||
else if (app.runState === 'pending_stop') return 'stopping';
|
||||
}
|
||||
}
|
||||
|
||||
return app.installationState;
|
||||
};
|
||||
});
|
||||
|
||||
app.filter('installationStateCancelTooltip', function() {
|
||||
return function(app) {
|
||||
switch (app.installationState) {
|
||||
case ISTATES.PENDING_INSTALL: return 'install';
|
||||
case ISTATES.PENDING_CLONE: return 'clone';
|
||||
case ISTATES.PENDING_CONFIGURE: return 'configure';
|
||||
case ISTATES.PENDING_UNINSTALL: return 'uninstall';
|
||||
case ISTATES.PENDING_RESTORE: return 'restore';
|
||||
case ISTATES.PENDING_UPDATE: return 'update';
|
||||
case ISTATES.PENDING_BACKUP: return 'backup';
|
||||
case ISTATES.INSTALLED: {
|
||||
if (app.runState === 'pending_start') return 'start';
|
||||
else if (app.runState === 'pending_stop') return 'stop';
|
||||
}
|
||||
}
|
||||
|
||||
return app.installationState;
|
||||
};
|
||||
});
|
||||
|
||||
app.filter('readyToUpdate', function () {
|
||||
return function (apps) {
|
||||
return apps.every(function (app) {
|
||||
|
||||
Reference in New Issue
Block a user