diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/List.js | 4 | ||||
-rw-r--r-- | src/components/Login.js | 2 | ||||
-rw-r--r-- | src/index.html | 4 | ||||
-rw-r--r-- | src/inject.js | 0 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/components/List.js b/src/components/List.js index 76270fa..43a9b3c 100644 --- a/src/components/List.js +++ b/src/components/List.js @@ -43,7 +43,7 @@ class List extends React.Component { queryString() { return [ `limit=${process.env.PER_PAGE}`, - `skip=${(this.state.page - 1) * process.env.PER_PAGE}`, + `skip=${(this.state.page - 1) * window.injectedEnv.PER_PAGE}`, this.filterString() ] .filter(x => x !== null) @@ -52,7 +52,7 @@ class List extends React.Component { // Fetch data from external source, update state getData() { - fetch(`${process.env.COLLECTOR_URL}/sc/v0/get?${this.queryString()}`, { + fetch(window.injectedEnv.COLLECTOR_URL + "/sc/v0/get?" + this.queryString(), { headers: { Authorization: "Bearer " + this.props.token } diff --git a/src/components/Login.js b/src/components/Login.js index bc4baec..d0507af 100644 --- a/src/components/Login.js +++ b/src/components/Login.js @@ -26,7 +26,7 @@ class Login extends React.Component { // NOTE: btoa() limits email, password to ASCII login(email, password) { - fetch(process.env.JWT_URL, { + fetch(window.injectedEnv.JWT_URL, { method: "POST", headers: { Authorization: "Basic " + btoa(email + ":" + password) } }) diff --git a/src/index.html b/src/index.html index d2c72ad..451fc50 100644 --- a/src/index.html +++ b/src/index.html @@ -6,8 +6,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" - /> - <script src="http://localhost:8097"></script> + /> + <script type="module" src="./inject.js"></script> <title>SOC Dashboard</title> </head> <body> diff --git a/src/inject.js b/src/inject.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/inject.js |