Sha256: 6b03451a4c146bbf92f21922f692c6a8233c8b84ff03afce24592f615fad9f71

Contents?: true

Size: 1.47 KB

Versions: 33

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 = _.map(result.features, 'name');
                return _.includes(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

33 entries across 33 versions & 1 rubygems

Version Path
katello-3.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.3.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js