1
This commit is contained in:
28
frontend/config.js
Executable file
28
frontend/config.js
Executable file
@@ -0,0 +1,28 @@
|
||||
// Frontend configuration (can be overridden by defining window.BenchConfig before loading this file)
|
||||
(function() {
|
||||
window.BenchConfig = window.BenchConfig || {};
|
||||
|
||||
const origin = window.location.origin;
|
||||
const protocol = window.location.protocol;
|
||||
const hostname = window.location.hostname;
|
||||
|
||||
if (!window.BenchConfig.frontendBaseUrl) {
|
||||
window.BenchConfig.frontendBaseUrl = origin;
|
||||
}
|
||||
|
||||
if (!window.BenchConfig.backendApiUrl) {
|
||||
window.BenchConfig.backendApiUrl = `${protocol}//${hostname}:8007/api`;
|
||||
}
|
||||
|
||||
if (!window.BenchConfig.benchScriptPath) {
|
||||
window.BenchConfig.benchScriptPath = '/scripts/bench.sh';
|
||||
}
|
||||
|
||||
if (!window.BenchConfig.apiTokenPlaceholder) {
|
||||
window.BenchConfig.apiTokenPlaceholder = 'YOUR_TOKEN';
|
||||
}
|
||||
|
||||
if (!window.BenchConfig.iperfServer) {
|
||||
window.BenchConfig.iperfServer = '10.0.1.97';
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user