mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
Clean up API calls in JS
This commit is contained in:
parent
2eef96e3d9
commit
396a36bf90
4 changed files with 27 additions and 17 deletions
|
@ -6,18 +6,20 @@ var range_x = [];
|
|||
var range_y = [];
|
||||
|
||||
// setup API
|
||||
var urlTimestamp = '';
|
||||
var urlTimestamp;
|
||||
var urlDetection;
|
||||
if (isLocalHost) {
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp?timestamp=' + Date.now();
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp';
|
||||
} else {
|
||||
urlTimestamp = '//' + host + '/api/timestamp?timestamp=' + Date.now();
|
||||
urlTimestamp = '//' + host + '/api/timestamp';
|
||||
}
|
||||
var urlDetection = '';
|
||||
if (isLocalHost) {
|
||||
urlDetection = '//' + host + ':3000/stash/detection?timestamp=' + Date.now();
|
||||
urlDetection = '//' + host + ':3000/stash/detection';
|
||||
} else {
|
||||
urlDetection = '//' + host + '/stash/detection?timestamp=' + Date.now();
|
||||
urlDetection = '//' + host + '/stash/detection';
|
||||
}
|
||||
urlTimestamp = urlTimestamp + '?timestamp=' + Date.now();
|
||||
urlDetection = urlDetection + '?timestamp=' + Date.now();
|
||||
|
||||
// setup plotly
|
||||
var layout = {
|
||||
|
|
|
@ -6,13 +6,13 @@ var range_x = [];
|
|||
var range_y = [];
|
||||
|
||||
// setup API
|
||||
var urlTimestamp = '';
|
||||
var urlTimestamp;
|
||||
var urlDetection;
|
||||
if (isLocalHost) {
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp?timestamp=';
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp';
|
||||
} else {
|
||||
urlTimestamp = '//' + host + '/api/timestamp?timestamp=';
|
||||
urlTimestamp = '//' + host + '/api/timestamp';
|
||||
}
|
||||
var urlDetection = '';
|
||||
if (isLocalHost) {
|
||||
urlDetection = '//' + host + ':3000/api/detection';
|
||||
} else {
|
||||
|
@ -23,6 +23,9 @@ if (isLocalHost) {
|
|||
} else {
|
||||
urlMap = '//' + host + urlMap;
|
||||
}
|
||||
urlTimestamp = urlTimestamp + '?timestamp=' + Date.now();
|
||||
urlDetection = urlDetection + '?timestamp=' + Date.now();
|
||||
urlMap = urlMap + '?timestamp=' + Date.now();
|
||||
|
||||
// setup plotly
|
||||
var layout = {
|
||||
|
|
|
@ -6,7 +6,8 @@ var range_x = [];
|
|||
var range_y = [];
|
||||
|
||||
// setup API
|
||||
var urlTimestamp = '';
|
||||
var urlTimestamp;
|
||||
var urlMap;
|
||||
if (isLocalHost) {
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp';
|
||||
} else {
|
||||
|
@ -17,6 +18,8 @@ if (isLocalHost) {
|
|||
} else {
|
||||
urlMap = '//' + host + '/stash/iqdata';
|
||||
}
|
||||
urlTimestamp = urlTimestamp + '?timestamp=' + Date.now();
|
||||
urlMap = urlMap + '?timestamp=' + Date.now();
|
||||
|
||||
// setup plotly
|
||||
var layout = {
|
||||
|
|
|
@ -4,18 +4,20 @@ var host = window.location.hostname;
|
|||
var isLocalHost = (host === "localhost" || host === "127.0.0.1" || host === "192.168.0.112");
|
||||
|
||||
// setup API
|
||||
var urlTimestamp = '';
|
||||
var urlTimestamp;
|
||||
var urlTiming;
|
||||
if (isLocalHost) {
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp?timestamp=' + Date.now();
|
||||
urlTimestamp = '//' + host + ':3000/api/timestamp';
|
||||
} else {
|
||||
urlTimestamp = '//' + host + '/api/timestamp?timestamp=' + Date.now();
|
||||
urlTimestamp = '//' + host + '/api/timestamp';
|
||||
}
|
||||
var urlDetection = '';
|
||||
if (isLocalHost) {
|
||||
urlDetection = '//' + host + ':3000/stash/detection?timestamp=' + Date.now();
|
||||
urlTiming = '//' + host + ':3000/stash/timing';
|
||||
} else {
|
||||
urlDetection = '//' + host + '/stash/timing?timestamp=' + Date.now();
|
||||
urlTiming = '//' + host + '/stash/timing';
|
||||
}
|
||||
urlTimestamp = urlTimestamp + '?timestamp=' + Date.now();
|
||||
urlTiming = urlTiming + '?timestamp=' + Date.now();
|
||||
|
||||
// setup plotly
|
||||
var layout = {
|
||||
|
|
Loading…
Reference in a new issue