Sha256: b674ec0ddef693d546aa25ad8434456cf62185b6153f049f4ed15821a07eae31

Contents?: true

Size: 1.98 KB

Versions: 9

Compression:

Stored size: 1.98 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.subscriptions.controller:SubscriptionDetailsController
 *
 * @requires $scope
 * @requires translate
 * @requires Subscription
 * @requires ApiErrorHandler
 *
 * @description
 *   Provides the functionality for the subscription details action pane.
 */
angular.module('Bastion.subscriptions').controller('SubscriptionDetailsController',
    ['$scope', 'translate', 'Subscription', 'ApiErrorHandler',
    function ($scope, translate, Subscription, ApiErrorHandler) {
        $scope.successMessages = [];
        $scope.errorMessages = [];

        $scope.panel = {
            error: false,
            loading: true
        };

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

        $scope.subscription = Subscription.get({id: $scope.$stateParams.subscriptionId}, function () {
            $scope.panel.loading = false;
        }, function (response) {
            $scope.panel.loading = false;
            ApiErrorHandler.handleGETRequestErrors(response, $scope);
        });

        $scope.subscriptionLimits = function (subscription) {
            var limits = [];

            if (subscription.sockets) {
                limits.push(translate("Sockets: %s").replace("%s", subscription.sockets));
            }
            if (subscription.cores) {
                limits.push(translate("Cores: %s").replace("%s", subscription.cores));
            }
            if (subscription.ram) {
                limits.push(translate("RAM: %s GB").replace("%s", subscription.ram));
            }

            if (limits.length > 0) {
                return limits.join(", ");
            }

            return "";
        };

        $scope.virtWhoToolTip = translate("If the virt-who field is Yes then the subscription requires the use of virt-who. Learn how to configure and use this tool in the <a href=\"https://access.redhat.com/documentation/en/red-hat-satellite/6.2/single/virtual-instances-guide/\">Virtual Instances Guide</a>.");
    }]
);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-3.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js
katello-3.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-details.controller.js