X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fconfig%2Fenv.module.js;fp=sdnr%2Fwireless-transport%2Fcode-Carbon-SR1%2Fapps%2Fdlux%2Fdlux-web%2Fconfig%2Fenv.module.js;h=e4504d59bd76417fa28fee7b4e0d9bffea0019ac;hb=27fb2d06608fbb070ae2c15a5580a4f5b2423d15;hp=0000000000000000000000000000000000000000;hpb=60315525ab5e7c12a9f47c409092e8dba6ad656d;p=ccsdk%2Fapps.git diff --git a/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js new file mode 100644 index 00000000..e4504d59 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/apps/dlux/dlux-web/config/env.module.js @@ -0,0 +1,37 @@ +define(['angular'], function (angular) { + 'use strict'; + + var config = angular.module('config', []) + .constant('ENV', { + + baseURL: '@@baseURL', + adSalPort: '@@adSalPort', + mdSalPort: '@@mdSalPort', + mdSalSecuredPort: '@@mdSalSecuredPort', + configEnv: '@@configEnv', + getBaseURL: function (salType) { + if (salType !== undefined) { + var urlPrefix = ''; + if (this.configEnv === 'ENV_DEV') { + urlPrefix = this.baseURL; + } else { + urlPrefix = window.location.protocol + '//' + window.location.hostname + ':'; + } + + if (salType === 'AD_SAL') { + return urlPrefix + this.adSalPort; + } else if (salType === 'MD_SAL') { + var basePort = this.mdSalPort; + if (window.location.protocol === 'https:') { + basePort = this.mdSalSecuredPort; + } + return urlPrefix + basePort; + } + } + //default behavior + return ''; + } + }); + + return config; +});