Sha256: 838ae99544be89eb04ca48df8a9054d8389e0e1a885d0b12a6b6478fddba54ff

Contents?: true

Size: 1.72 KB

Versions: 160

Compression:

Stored size: 1.72 KB

Contents

/**
 * @ngdoc service
* @name  Bastion.repository.service:httpProxyPolicy
*
* @requires translate
* @requires globalContentProxy
*
* @description
*   Provides HTTP Proxy policy and name display
*/
angular.module('Bastion.repositories').service('HttpProxyPolicy',
    ['translate', 'globalContentProxy', function (translate, globalContentProxy) {

        this.globalContentProxyName = "";

        if (globalContentProxy) {
            this.globalContentProxyName = translate("Global Default") + " (" + globalContentProxy + ")";
        } else {
            this.globalContentProxyName = translate("Global Default (None)");
        }

        this.policies = [ {name: this.globalContentProxyName, label: 'global_default_http_proxy'},
                            {name: translate("No HTTP Proxy"), label: 'none'},
                            {name: translate("Use specific HTTP Proxy"), label: 'use_selected_http_proxy'}];

        this.displayHttpProxyPolicyName = function (policy) {
            var policies = {
              'global_default_http_proxy': this.globalContentProxyName,
              'none': translate("No HTTP Proxy"),
              'use_selected_http_proxy': translate("Use specific HTTP Proxy")
            };
            return policies[policy];
        };

        this.displayHttpProxyName = function (proxies, proxyId) {
            var findProxy = function(proxy) {
                return proxy.id === this.id;
            };

            var foundProxy = proxies.find(findProxy, { id: proxyId });

            if (proxies.length === 0) {
                return translate("No HTTP Proxies found");
            }

            if (foundProxy) {
                return foundProxy.name;
            }

            return "";
        };
    }]
);

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
katello-4.14.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.15.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.14.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.13.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.13.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.12.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.13.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.12.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.12.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.12.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.12.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.11.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js
katello-4.11.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/http-proxy-service.js