Merge branch '1.23.X' into version-merge

# Conflicts:
#	package-lock.json
#	package.json
#	server/server.js
#	server/uptime-kuma-server.js
This commit is contained in:
Louis Lam
2023-12-13 01:54:08 +08:00
5 changed files with 69 additions and 36 deletions

View File

@@ -99,21 +99,20 @@ export default {
this.socket.initedSocketIO = true;
let protocol = (location.protocol === "https:") ? "wss://" : "ws://";
let protocol = location.protocol + "//";
let wsHost;
let url;
const env = process.env.NODE_ENV || "production";
if (env === "development" && isDevContainer()) {
wsHost = protocol + getDevContainerServerHostname();
url = protocol + getDevContainerServerHostname();
} else if (env === "development" || localStorage.dev === "dev") {
wsHost = protocol + location.hostname + ":3001";
url = protocol + location.hostname + ":3001";
} else {
wsHost = protocol + location.host;
// Connect to the current url
url = undefined;
}
socket = io(wsHost, {
transports: [ "websocket" ],
});
socket = io(url);
socket.on("info", (info) => {
this.info = info;