diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/404.html | 2 | ||||
| -rw-r--r-- | src/index.html | 4 | ||||
| -rw-r--r-- | src/scripts/controllers/connection/socket.ts | 2 | ||||
| -rw-r--r-- | src/scripts/splash.entry.ts | 4 | ||||
| -rw-r--r-- | src/scripts/user.ts | 17 |
5 files changed, 8 insertions, 21 deletions
diff --git a/src/404.html b/src/404.html index 84182341..10f79525 100644 --- a/src/404.html +++ b/src/404.html @@ -20,7 +20,7 @@ </div> <div class="code-block"></div> <div class="sub-title">Got lost?<span class="cursor">_</span></div> - <a class="home-btn" href="https://opendc.ewi.tudelft.nl">GET ME BACK TO OPENDC</a> + <a class="home-btn" href="SERVER_BASE_URL">GET ME BACK TO OPENDC</a> </div> </div> diff --git a/src/index.html b/src/index.html index 8ea4ce49..c58aaf01 100644 --- a/src/index.html +++ b/src/index.html @@ -11,8 +11,8 @@ <!-- OpenGraph meta tags --> <meta property="og:title" content="OpenDC: Collaborative Datacenter Simulation and Exploration for Everybody"> <meta property="og:type" content="website"> - <meta property="og:image" content="https://opendc.ewi.tudelft.nl/img/opendc-splash.png"> - <meta property="og:url" content="https://opendc.ewi.tudelft.nl"> + <meta property="og:image" content="SERVER_BASE_URL/img/opendc-splash.png"> + <meta property="og:url" content="SERVER_BASE_URL"> <meta property="og:description" content="OpenDC provides collaborative online datacenter modeling, diverse and effective datacenter simulation, and exploratory datacenter performance feedback."> diff --git a/src/scripts/controllers/connection/socket.ts b/src/scripts/controllers/connection/socket.ts index c23495f1..91a0f9e4 100644 --- a/src/scripts/controllers/connection/socket.ts +++ b/src/scripts/controllers/connection/socket.ts @@ -15,7 +15,7 @@ export class SocketController { this.callbacks = {}; this._cacheController = new CacheController(); - this._socket = io.connect('https://opendc.ewi.tudelft.nl:443'); + this._socket = io.connect('SERVER_BASE_URL'); this._socket.on('connect', onConnect); this._socket.on('response', (jsonResponse: string) => { diff --git a/src/scripts/splash.entry.ts b/src/scripts/splash.entry.ts index 700f52bb..6abd9518 100644 --- a/src/scripts/splash.entry.ts +++ b/src/scripts/splash.entry.ts @@ -119,7 +119,7 @@ window["renderButton"] = () => { // Calculate token expiration time (in seconds since epoch) const expirationTime = (new Date()).getTime() / 1000 + googleUser.getAuthResponse().expires_in - 5; - $.post('https://opendc.ewi.tudelft.nl/tokensignin', { + $.post('SERVER_BASE_URL/tokensignin', { idtoken: id_token }, (data: any) => { // Save user information in session storage for later use on other pages @@ -146,7 +146,7 @@ window["renderButton"] = () => { }); }, 'onfailure': () => { - console.log("Oops, something went wrong with your Google signin... Try again?") + console.log("Oops, something went wrong with your Google signin... Try again?"); } }); }; diff --git a/src/scripts/user.ts b/src/scripts/user.ts index 66e44b21..e9d13091 100644 --- a/src/scripts/user.ts +++ b/src/scripts/user.ts @@ -2,24 +2,11 @@ import * as $ from "jquery"; -const LOCAL_MODE = (document.location.hostname === "localhost"); - // Redirect the user to the splash page, if not signed in -if (!LOCAL_MODE && localStorage.getItem("googleToken") === null) { +if (localStorage.getItem("googleToken") === null) { window.location.replace("/"); } -// Fill session storage with mock data during LOCAL_MODE -if (LOCAL_MODE) { - localStorage.setItem("googleToken", ""); - localStorage.setItem("googleTokenExpiration", "2000000000"); - localStorage.setItem("googleName", "John Doe"); - localStorage.setItem("googleEmail", "john@doe.com"); - localStorage.setItem("userId", "2"); - localStorage.setItem("simulationId", "1"); - localStorage.setItem("simulationAuthLevel", "OWN"); -} - // Set the username in the navbar $("nav .user .username").text(localStorage.getItem("googleName")); @@ -59,7 +46,7 @@ window["gapiSigninButton"] = () => { }, 'onfailure': () => { window.location.href = "/"; - console.log("Oops, something went wrong with your Google signin... Try again?") + console.log("Oops, something went wrong with your Google signin... Try again?"); } }); }; |
