-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from scs/feature/improvements
Feature/improvements * Rename reader to meter (only code, not .ini config) * Web frontend enhancements (SMT-27) * Frontend: Restart datacollector when pressing deploy button
- Loading branch information
Showing
7 changed files
with
97 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
frontend/smartmeter-datacollector-configurator/src/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
const devMode = process.env.NODE_ENV === "development"; | ||
const devBaseUrl = "http://localhost:8000/api"; | ||
const devApiPort = 8000; | ||
const prodApiPort = 8000; | ||
const apiPath = "/api"; | ||
const grafanaPort = 3000; | ||
|
||
function getBaseHostUrl() { | ||
function getApiUrl() { | ||
if (devMode) { | ||
return devBaseUrl; | ||
return `http://${location.hostname}:${devApiPort}${apiPath}`; | ||
} | ||
return `http://${location.host}/api`; | ||
return `http://${location.hostname}:${prodApiPort}${apiPath}`; | ||
} | ||
|
||
export { getBaseHostUrl }; | ||
function getGrafanaUrl() { | ||
return `http://${location.hostname}:${grafanaPort}`; | ||
} | ||
|
||
export { getApiUrl, getGrafanaUrl }; |