Sha256: b22558acaae211c9b518a9f8aa2af2048289d9441fbbb7d87ff65a9408499cdb

Contents?: true

Size: 1.61 KB

Versions: 22

Compression:

Stored size: 1.61 KB

Contents

/**
 * @ngdoc service
 * @name  Bastion.hosts.factory:Host
 *
 * @requires BastionResource
 *
 * @description
 *   Provides a BastionResource for one or more hosts.
 */
angular.module('Bastion.hosts').factory('Host',
    ['BastionResource', function (BastionResource) {
        var resource = BastionResource('api/v2/hosts/:id/:action', {id: '@id'}, {
            postIndex: {method: 'POST', params: {action: 'post_index'}},
            update: {method: 'PUT'},
            updateHostCollections: {method: 'PUT', params: {action: 'host_collections'}},
            autocomplete: {method: 'GET', isArray: true, params: {id: 'auto_complete_search'}}
        });
        resource.prototype.hasContent = function () {
            return angular.isDefined(this.content_facet_attributes) && angular.isDefined(this.content_facet_attributes.uuid);
        };
        resource.prototype.hasSubscription = function () {
            return angular.isDefined(this.subscription_facet_attributes) && angular.isDefined(this.subscription_facet_attributes.uuid);
        };

        resource.prototype.isRpmEnabled = function() {
            return !this.isDebEnabled();
        };

        resource.prototype.isDebEnabled = function() {
            return _.isString(this.operatingsystem_name) && (this.operatingsystem_name.indexOf("Debian") >= 0 || this.operatingsystem_name.indexOf("Ubuntu") >= 0);
        };

        resource.prototype.rhelLifecycleExpireSoon = function() {
            return _.isString(this.rhel_lifecycle_status_label) && (this.rhel_lifecycle_status_label.indexOf("Approaching end of") >= 0);
        };

        return resource;
    }]
);

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-4.14.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.15.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.14.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.13.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.13.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.12.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.13.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.12.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.12.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.12.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.12.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.11.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js
katello-4.11.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/hosts/host.factory.js