Skip to content

Commit 3a3e486

Browse files
committed
Access intranet service from intranet frontend
1 parent 15c2cc4 commit 3a3e486

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

dashboard/new-dashboard/src/configurators/ServerWithCompressConfigurator.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { injectOrError, serverUrlObservableKey } from "../shared/injectionKeys"
66

77
export class ServerWithCompressConfigurator implements ServerConfigurator {
88
static readonly DEFAULT_SERVER_URL = "https://ij-perf.labs.jb.gg"
9+
static readonly INTRANET_SERVER_URL = "https://ij-perf-api.labs.jb.gg"
910

1011
private readonly observable: Observable<null>
11-
private _serverUrl: string = ServerWithCompressConfigurator.DEFAULT_SERVER_URL
12+
private _serverUrl: string = this.determineServerUrl()
1213

1314
constructor(
1415
readonly db: string,
@@ -30,6 +31,14 @@ export class ServerWithCompressConfigurator implements ServerConfigurator {
3031
return this._serverUrl
3132
}
3233

34+
private determineServerUrl(): string {
35+
if (window.location.hostname === "ij-perf-api.labs.jb.gg") {
36+
return ServerWithCompressConfigurator.INTRANET_SERVER_URL
37+
} else {
38+
return ServerWithCompressConfigurator.DEFAULT_SERVER_URL
39+
}
40+
}
41+
3342
compressString(params: string): string {
3443
// eslint-disable-next-line @typescript-eslint/no-unnecessary-template-expression
3544
return `${getCompressor().compress(params)}`

0 commit comments

Comments
 (0)