Sha256: c78489966d1755a805cf5fb04e596574eda26c64f5b0ec19a030d6bc1ca9f2c1

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.subscriptions.controller:SubscriptionContentHostsController
 *
 * @requires $scope
 * @requires translate
 * @requires Subscription
 * @requires ContentHostsHelper
 *
 * @description
 *   Provides the functionality for the subscription details for content hosts.
 */
angular.module('Bastion.subscriptions').controller('SubscriptionContentHostsController',
    ['$scope', 'translate', 'Subscription', 'ContentHostsHelper',
    function ($scope, translate, Subscription, ContentHostsHelper) {

        if ($scope.contentHosts) {
            $scope.working = false;
        } else {
            $scope.working = true;
        }

        $scope.table = {};

        Subscription.get({id: $scope.$stateParams.subscriptionId}, function (subscription) {
            $scope.contentHosts = subscription.systems;
            $scope.working = false;
        });

        $scope.getHostStatusIcon = ContentHostsHelper.getHostStatusIcon;

        $scope.memory = ContentHostsHelper.memory;

        $scope.convertMemToGB = function (memoryValue) {
            return (memoryValue / 1048576).toFixed(2);
        };

        $scope.virtual = function (facts) {
            if (angular.isUndefined(facts.virt) || angular.isUndefined(facts.virt['is_guest'])) {
                return false;
            }
            return (facts.virt['is_guest'] === true || facts.virt['is_guest'] === 'true');
        };
    }]
);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
katello-3.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-content-hosts.controller.js
katello-3.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/details/subscription-content-hosts.controller.js