Skip to content

Commit

Permalink
rework test-domain check
Browse files Browse the repository at this point in the history
  • Loading branch information
caco3 authored Nov 7, 2023
1 parent 35d90cd commit 36c12b4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sd-card/html/common.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@

/* The UI can also be run locally, but you have to set the IP of your devide accordingly.
* And you also might have to disable CORS in your webbrowser! */
var domainname_for_testing = "192.168.1.151";
* And you also might have to disable CORS in your webbrowser!
* Keep empty to disable using it. Enabling it will break access through a forwared port, see
* https://github.com/jomjol/AI-on-the-edge-device/issues/2681 */
var domainname_for_testing = "";
//var domainname_for_testing = "192.168.1.151";


/* Returns the domainname with prepended protocol.
Eg. http://watermeter.fritz.box or http://192.168.1.5 */
function getDomainname(){
var host = window.location.hostname;
if (((host == "127.0.0.1") || (host == "localhost") || (host == ""))
// && ((window.location.port == "80") || (window.location.port == ""))
)

{
//console.log("Using pre-defined domainname for testing: " + domainname_for_testing);
if (domainname_for_testing != "") {
console.log("Using pre-defined domainname for testing: " + domainname_for_testing);
domainname = "http://" + domainname_for_testing
}
else
Expand Down

0 comments on commit 36c12b4

Please sign in to comment.