From 3e8786aab40201a8b064b979caeafce0dfbe6c6d Mon Sep 17 00:00:00 2001 From: Umit Coskun Aydinoglu Date: Thu, 12 Oct 2023 08:40:37 +0000 Subject: [PATCH] eslint fixes --- api/utils/countly-request/index.js | 17 +++++++++-------- .../public/javascripts/countly.views.js | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/api/utils/countly-request/index.js b/api/utils/countly-request/index.js index de3c2119a60..1e16659cba3 100755 --- a/api/utils/countly-request/index.js +++ b/api/utils/countly-request/index.js @@ -5,7 +5,7 @@ const got = require('got'); const FormData = require('form-data'); const plugins = require('../../../plugins/pluginManager.js'); -const {HttpsProxyAgent,HttpProxyAgent} = require('hpagent'); +const {HttpsProxyAgent, HttpProxyAgent} = require('hpagent'); var initParams = function(uri, options, callback) { @@ -33,21 +33,21 @@ var initParams = function(uri, options, callback) { params.callback = callback || params.callback; var config = plugins.getConfig("security"); - + if (config && config.proxy_hostname) { if (!params.options) { params.options = {}; // Create options object if it's undefined } - + const proxyType = config.proxy_type || "https"; const proxyUrlBase = `${proxyType}://${config.proxy_hostname}:${config.proxy_port}`; - + let proxyUrl = proxyUrlBase; - + if (config.proxy_username && config.proxy_password) { proxyUrl = `${proxyType}://${config.proxy_username}:${config.proxy_password}@${config.proxy_hostname}:${config.proxy_port}`; } - + const agentOptions = { keepAlive: true, keepAliveMsecs: 1000, @@ -56,12 +56,13 @@ var initParams = function(uri, options, callback) { scheduling: 'lifo', proxy: proxyUrl, }; - + if (proxyType === "https") { params.options.agent = { https: new HttpsProxyAgent(agentOptions) }; - } else { + } + else { params.options.agent = { http: new HttpProxyAgent(agentOptions) }; diff --git a/plugins/plugins/frontend/public/javascripts/countly.views.js b/plugins/plugins/frontend/public/javascripts/countly.views.js index 8f68f11bb1a..93ea744d098 100644 --- a/plugins/plugins/frontend/public/javascripts/countly.views.js +++ b/plugins/plugins/frontend/public/javascripts/countly.views.js @@ -1119,14 +1119,14 @@ app.configurationsView.registerInput("security.proxy_password", {input: "el-input", attrs: {type: "textarea", rows: 1}}); - app.configurationsView.registerInput("security.proxy_type",{ - input : "el-select", + app.configurationsView.registerInput("security.proxy_type", { + input: "el-select", attrs: {}, list: [ - {value: 'https',label:'https'}, - {value: 'http',label:'http'} + {value: 'https', label: 'https'}, + {value: 'http', label: 'http'} ] - }) + }); app.configurationsView.registerInput("api.reports_regenerate_interval", {