Sha256: af3f28a78a6648515dbfb8ec27b20f4e1b065b0daa91667c556105dc06e34623
Contents?: true
Size: 1.56 KB
Versions: 18
Compression:
Stored size: 1.56 KB
Contents
/** * @ngdoc object * @name Bastion.gpg-keys.controller:GPGKeyDetailsController * * @requires $scope * @requires GPGKey * @requires $q * @requires translate * @requires ApiErrorHandler * * @description * Provides the functionality for the gpgKey details action pane. */ angular.module('Bastion.gpg-keys').controller('GPGKeyDetailsController', ['$scope', 'GPGKey', '$q', 'translate', 'ApiErrorHandler', function ($scope, GPGKey, $q, translate, ApiErrorHandler) { $scope.errorMessages = []; $scope.successMessages = []; $scope.panel = $scope.panel || {error: false, loading: false}; $scope.gpgKey = GPGKey.get({id: $scope.$stateParams.gpgKeyId}, function () { $scope.panel.error = false; $scope.panel.loading = false; }, function (response) { $scope.panel.loading = false; ApiErrorHandler.handleGETRequestErrors(response, $scope); }); $scope.save = function (gpgKey) { var deferred = $q.defer(); gpgKey.$update(function (response) { deferred.resolve(response); $scope.successMessages.push(translate('GPG Key updated')); }, function (response) { deferred.reject(response); $scope.errorMessages = [response.data.displayMessage]; }); return deferred.promise; }; $scope.removeGPGKey = function (gpgKey) { gpgKey.$delete(function () { $scope.transitionTo('gpg-keys'); }); }; }] );
Version data entries
18 entries across 18 versions & 1 rubygems