Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
debuggy committed Jul 3, 2019
1 parent 1bbc7c3 commit a0bb119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/webportal/src/app/env.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ window.ENV = {
promScrapeTime: '${PROM_SCRAPE_TIME}',
authnMethod: '${AUTHN_METHOD}',
pylonAddress: '${PYLON_ADDRESS}',
webHDFS: '${WEBHDFS_URI}',
webHDFSUri: '${WEBHDFS_URI}',
};

window.PAI_PLUGINS = [${WEBPORTAL_PLUGINS}][0] || [];
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ export const DataComponent = React.memo((props) => {
const envsubRegex = /^\${.*}$/; // the template string ${xx} will be reserved in envsub if not provide value
let hdfsHost;
let port;
if (!config.webHDFS || envsubRegex.test(config.webHDFS)) {
let apiPath;
if (!config.webHDFSUri || envsubRegex.test(config.webHDFSUri)) {
hdfsHost = window.location.hostname;
port = 80;
apiPath = '/webhdfs/api/v1';
} else {
// add webHDFS to .env for local debug
hdfsHost = getHostNameFromUrl(config.webHDFS);
port = getPortFromUrl(config.webHDFS);
// add WEBHDFS_URI to .env for local debug
hdfsHost = getHostNameFromUrl(config.webHDFSUri);
port = getPortFromUrl(config.webHDFSUri);
}
const hdfsClient = new WebHDFSClient(hdfsHost, undefined, undefined, port);
const hdfsClient = new WebHDFSClient(hdfsHost, undefined, undefined, port, apiPath);
const {onChange} = props;
const [teamConfigs, setTeamConfigs] = useState();
const [defaultTeamConfigs, setDefaultTeamConfigs] = useState();
Expand Down

0 comments on commit a0bb119

Please sign in to comment.