Sha256: 1e1bc2b5bfc17722965c4d2e09a79a8d97763e40e87d08d54b01149674db18d8

Contents?: true

Size: 1.54 KB

Versions: 147

Compression:

Stored size: 1.54 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.packages.controller:PackageController
 *
 * @requires $scope
 * @requires Package
 * @requires Host
 * @requires CurrentOrganization
 * @requires ApiErrorHandler
 *
 * @description
 *   Provides the functionality for the package page.
 */
angular.module('Bastion.packages').controller('PackageController',
    ['$scope', 'Package', 'Host', 'CurrentOrganization', 'ApiErrorHandler',
    function ($scope, Package, Host, CurrentOrganization, ApiErrorHandler) {
        $scope.panel = {
            error: false,
            loading: true
        };

        if ($scope.package) {
            $scope.panel.loading = false;
        }

        $scope.installedPackageCount = undefined;

        $scope.fetchHostCount = function() {
            Host.get({'per_page': 0, 'search': $scope.createSearchString('installed_package'), 'organization_id': CurrentOrganization}, function (data) {
                $scope.installedPackageCount = data.subtotal;
            });
        };

        $scope.createSearchString = function(field) {
            return field + '=' + $scope.package.name + '-' + $scope.package.version + '-' + $scope.package.release + '.' +
                            $scope.package.arch;
        };

        $scope.package = Package.get({id: $scope.$stateParams.packageId}, function () {
            $scope.panel.loading = false;
            $scope.fetchHostCount();
        }, function(response) {
            $scope.panel.loading = false;
            ApiErrorHandler.handleGETRequestErrors(response, $scope);
        });
    }
]);

Version data entries

147 entries across 147 versions & 1 rubygems

Version Path
katello-4.2.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.0.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.0.1.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-3.18.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.0.1.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.2.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.0.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-3.18.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.1.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-4.0.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js
katello-3.18.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/packages/details/package.controller.js