Sha256: e2a2a8eb967b9b34fc95cba78c84cfcb7158e27e58181be1f795a7c19af0de95

Contents?: true

Size: 1.5 KB

Versions: 96

Compression:

Stored size: 1.5 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.hideSwitcher = true;

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

            return url;
        };

    }]
);

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
katello-4.0.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.1.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.0.rc3.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.2.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.17.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.18.1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-3.17.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js
katello-4.0.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/content-host-register.controller.js