Sha256: aec89a0bf8d2e897e9f6f8d702e1ef07554ddb314a17f6d96f187625212885d7

Contents?: true

Size: 1.47 KB

Versions: 29

Compression:

Stored size: 1.47 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-hosts.controller:ContentHostRegisterController
 *
 * @requires $scope
 * @requires $location
 * @requires Capsule
 * @requires Organization
 * @requires CurrentOrganization
 * @requires BastionConfig
 *
 * @description
 *     Provides values to populate the code commands for registering a content host.
 */
angular.module('Bastion.content-hosts').controller('ContentHostRegisterController',
    ['$scope', '$location', 'Capsule', 'Organization', 'CurrentOrganization', 'BastionConfig',
    function ($scope, $location, Capsule, Organization, CurrentOrganization, BastionConfig) {

        $scope.organization = Organization.get({id: CurrentOrganization});
        $scope.consumerCertRPM = BastionConfig.consumerCertRPM;
        $scope.katelloHostname = $location.host();
        $scope.noCapsulesFound = true;

        $scope.capsules = Capsule.queryUnpaged(function (data) {
            var defaultCapsule = _.filter(data.results, function (result) {
                var featureNames = _.pluck(result.features, 'name');
                return _.contains(featureNames, 'Pulp');
            });

            $scope.noCapsulesFound = _.isEmpty(data.results);
            $scope.selectedCapsule = _.isEmpty(defaultCapsule) ? data.results[0] : defaultCapsule[0];
        });


        $scope.hostname = function (url) {
            if (url) {
                url = url.split('://')[1].split(':')[0];
            }

            return url;
        };

    }]
);

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
katello-3.2.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.2.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.1.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.1.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.1.0.rc2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-2.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.1.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-2.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.0.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-2.4.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.0.0.rc7 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.0.0.rc5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-2.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js