Sha256: ef8d268238b50b33a4694dac57123139c4dfd5b38d024274ad19ef40624681fc
Contents?: true
Size: 1.85 KB
Versions: 25
Compression:
Stored size: 1.85 KB
Contents
/** * @ngdoc object * @name Bastion.gpgKeys.controller:GPGKeyDetailsInfoController * * @requires $scope * @requires GPGKey * @requires translate * * @description * Provides the functionality for the gpgKey details action pane. */ angular.module('Bastion.gpg-keys').controller('GPGKeyDetailsInfoController', ['$scope', 'GPGKey', 'translate', function ($scope, GPGKey, translate) { $scope.panel = $scope.panel || {loading: false}; $scope.progress = {uploading: false}; $scope.gpgKey = $scope.gpgKey || GPGKey.get({id: $scope.$stateParams.gpgKeyId}, function () { $scope.panel.loading = false; }); $scope.gpgKey.$promise.then(function () { $scope.uploadURL = '/katello/api/v2/gpg_keys/' + $scope.gpgKey.id + '/content'; }); $scope.uploadContent = function (content) { if (content && (content !== "Please wait...")) { if (content.status === 'success') { $scope.$parent.successMessages = [translate('GPG Key successfully uploaded')]; $scope.uploadStatus = 'success'; $scope.gpgKey.$get(); } else { $scope.$parent.errorMessages = [content.displayMessage]; $scope.uploadStatus = 'error'; } $scope.progress.uploading = false; } }; $scope.uploadError = function (error, content) { if (angular.isString(content) && content.indexOf("Request Entity Too Large")) { error = translate('File too large.'); } else { error = content; } $scope.$parent.errorMessages = [translate('Error during upload: ') + error]; $scope.uploadStatus = 'error'; $scope.progress.uploading = false; }; }] );
Version data entries
25 entries across 25 versions & 1 rubygems