diff --git a/src/js/client.js b/src/js/client.js index 360be69ea..ecd4c4d60 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -12,6 +12,7 @@ var ISTATES = { PENDING_CONFIGURE: 'pending_configure', PENDING_UNINSTALL: 'pending_uninstall', PENDING_RESTORE: 'pending_restore', + PENDING_IMPORT: 'pending_import', PENDING_UPDATE: 'pending_update', PENDING_BACKUP: 'pending_backup', PENDING_RECREATE_CONTAINER: 'pending_recreate_container', // env change or addon change diff --git a/src/js/index.js b/src/js/index.js index a14488dc6..0396acc1b 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -291,6 +291,7 @@ app.filter('installationStateLabel', function () { return 'Migrating data' + waiting; case ISTATES.PENDING_UNINSTALL: return 'Uninstalling' + waiting; case ISTATES.PENDING_RESTORE: return 'Restoring' + waiting; + case ISTATES.PENDING_IMPORT: return 'Importing' + waiting; case ISTATES.PENDING_UPDATE: return 'Updating' + waiting; case ISTATES.PENDING_BACKUP: return 'Backing up' + waiting; case ISTATES.PENDING_START: return 'Starting' + waiting; @@ -328,6 +329,7 @@ app.filter('taskName', function () { case ISTATES.PENDING_DATA_DIR_MIGRATION: return 'data migration'; case ISTATES.PENDING_UNINSTALL: return 'uninstall'; case ISTATES.PENDING_RESTORE: return 'restore'; + case ISTATES.PENDING_IMPORT: return 'import'; case ISTATES.PENDING_UPDATE: return 'update'; case ISTATES.PENDING_BACKUP: return 'backup'; case ISTATES.PENDING_START: return 'start app'; diff --git a/src/views/activity.js b/src/views/activity.js index 8ef198fa8..ff18d7d5e 100644 --- a/src/views/activity.js +++ b/src/views/activity.js @@ -92,6 +92,7 @@ angular.module('Application').controller('ActivityController', ['$scope', '$loca var ACTION_APP_CONFIGURE = 'app.configure'; var ACTION_APP_INSTALL = 'app.install'; var ACTION_APP_RESTORE = 'app.restore'; + var ACTION_APP_IMPORT = 'app.import'; var ACTION_APP_UNINSTALL = 'app.uninstall'; var ACTION_APP_UPDATE = 'app.update'; var ACTION_APP_UPDATE_FINISH = 'app.update.finish'; @@ -253,6 +254,13 @@ angular.module('Application').controller('ActivityController', ['$scope', '$loca if (data.backupId) details += ' using backup ' + data.backupId; return details; + case ACTION_APP_IMPORT: + if (!data.app) return ''; + details = data.app.manifest.title + ' was imported at ' + (data.app.fqdn || data.app.location); + if (data.toManifest) details += ' to version ' + data.toManifest.version; + if (data.backupId) details += ' using backup ' + data.backupId; + return details; + case ACTION_APP_UNINSTALL: if (!data.app) return ''; return data.app.manifest.title + ' (package v' + data.app.manifest.version + ') was uninstalled at ' + (data.app.fqdn || data.app.location); diff --git a/src/views/app.js b/src/views/app.js index 2aff97392..8adcbacb1 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -1372,7 +1372,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' }); } - if (errorState === ISTATES.PENDING_RESTORE) { + if (errorState === ISTATES.PENDING_RESTORE || errorState === ISTATES.PENDING_IMPORT) { Client.getAppBackups($scope.app.id, function (error, backups) { if (error) return Client.error(error); @@ -1418,6 +1418,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' // this also happens for import faliures. this UI can only show backup listing. use CLI for arbit id/config case ISTATES.PENDING_RESTORE: + case ISTATES.PENDING_IMPORT: if ($scope.repair.backups.length === 0) { // this can happen when you give some invalid backup via CLI and restore via UI repairFunc = Client.repairApp.bind(null, $scope.app.id, {}); // this will trigger a re-install } else {