From f4d44b76264c32b23d48bb8a3ed728b39d515854 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Tue, 25 Jan 2022 15:39:14 +0100 Subject: Dockerize the whole thing. --- src/components/List.js | 4 ++-- src/components/Login.js | 2 +- src/index.html | 4 ++-- src/inject.js | 0 4 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 src/inject.js (limited to 'src') 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 @@ - + /> + SOC Dashboard diff --git a/src/inject.js b/src/inject.js new file mode 100644 index 0000000..e69de29 -- cgit v1.1