fix api ip address detect
This commit is contained in:
parent
00be81e18b
commit
11428ab3dd
|
@ -1,10 +1,13 @@
|
||||||
const hostname = window.location.hostname;
|
const hostname = window.location.hostname;
|
||||||
console.log("Current hostname:", hostname);
|
console.log("Current hostname:", hostname);
|
||||||
|
var tailscaleIP = import.meta.env.VITE_IP_TAILSCALE;
|
||||||
|
var localIP = import.meta.env.VITE_IP_LOCAL;
|
||||||
|
|
||||||
let API_MODE: "tailscale" | "local" | "ip";
|
let API_MODE: "tailscale" | "local" | "ip";
|
||||||
|
|
||||||
if (hostname.includes("ts.net")) {
|
if (hostname.includes(tailscaleIP)) {
|
||||||
API_MODE = "tailscale";
|
API_MODE = "tailscale";
|
||||||
} else if (hostname === "localhost") {
|
} else if (hostname === localIP) {
|
||||||
API_MODE = "local";
|
API_MODE = "local";
|
||||||
} else {
|
} else {
|
||||||
API_MODE = "ip";
|
API_MODE = "ip";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user