jgoz commented on a change in pull request #10597:
URL: https://github.com/apache/druid/pull/10597#discussion_r527812621



##########
File path: web-console/src/components/show-log/show-log.tsx
##########
@@ -17,13 +17,12 @@
  */
 
 import { AnchorButton, Button, ButtonGroup, Intent, Switch } from 
'@blueprintjs/core';
-import axios from 'axios';
 import copy from 'copy-to-clipboard';
 import React from 'react';
 
 import { Loader } from '../../components';
-import { AppToaster } from '../../singletons/toaster';
-import { UrlBaser } from '../../singletons/url-baser';
+import { Api, AppToaster } from '../../singletons';
+import { UrlBaser } from '../../singletons';

Review comment:
       Minor: these imports can be merged

##########
File path: web-console/src/entry.ts
##########
@@ -69,16 +67,23 @@ if (typeof consoleConfig.title === 'string') {
   window.document.title = consoleConfig.title;
 }
 
+const apiConfig: AxiosRequestConfig = {
+  headers: {},
+};
+
 if (consoleConfig.baseURL) {
-  axios.defaults.baseURL = consoleConfig.baseURL;
+  apiConfig.baseURL = consoleConfig.baseURL;
   UrlBaser.baseUrl = consoleConfig.baseURL;
 }
 if (consoleConfig.customHeaderName && consoleConfig.customHeaderValue) {
-  axios.defaults.headers.common[consoleConfig.customHeaderName] = 
consoleConfig.customHeaderValue;
+  apiConfig.headers.common[consoleConfig.customHeaderName] = 
consoleConfig.customHeaderValue;
 }
 if (consoleConfig.customHeaders) {
-  Object.assign(axios.defaults.headers, consoleConfig.customHeaders);
+  Object.assign(apiConfig.headers, consoleConfig.customHeaders);
 }
+
+Api.initialize(apiConfig);

Review comment:
       👍 nice

##########
File path: web-console/src/components/show-json/show-json.tsx
##########
@@ -17,13 +17,12 @@
  */
 
 import { Button, ButtonGroup, Intent, TextArea } from '@blueprintjs/core';
-import axios from 'axios';
 import copy from 'copy-to-clipboard';
 import React from 'react';
 
 import { useQueryManager } from '../../hooks';
-import { AppToaster } from '../../singletons/toaster';
-import { UrlBaser } from '../../singletons/url-baser';
+import { Api, AppToaster } from '../../singletons';
+import { UrlBaser } from '../../singletons';

Review comment:
       Minor: these imports can be merged

##########
File path: web-console/src/views/load-data-view/load-data-view.tsx
##########
@@ -121,8 +120,8 @@ import {
   upgradeSpec,
 } from '../../druid-models';
 import { getLink } from '../../links';
-import { AppToaster } from '../../singletons/toaster';
-import { UrlBaser } from '../../singletons/url-baser';
+import { Api, AppToaster } from '../../singletons';
+import { UrlBaser } from '../../singletons';

Review comment:
       Minor: merged




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to