mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-01-24 07:16:55 -06:00
Merge branch 'master' of https://github.com/Spiritreader/uptime-kuma
This commit is contained in:
commit
02230930c5
@ -50,7 +50,6 @@ let needSetup = false;
|
|||||||
version,
|
version,
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('a user connected');
|
|
||||||
totalClient++;
|
totalClient++;
|
||||||
|
|
||||||
if (needSetup) {
|
if (needSetup) {
|
||||||
@ -59,7 +58,6 @@ let needSetup = false;
|
|||||||
}
|
}
|
||||||
|
|
||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
console.log('user disconnected');
|
|
||||||
totalClient--;
|
totalClient--;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@ export default {
|
|||||||
window.addEventListener('resize', this.onResize);
|
window.addEventListener('resize', this.onResize);
|
||||||
|
|
||||||
let wsHost;
|
let wsHost;
|
||||||
if (localStorage.dev === "dev") {
|
const env = process.env.NODE_ENV || "production";
|
||||||
|
if (env === "development" || localStorage.dev === "dev") {
|
||||||
wsHost = ":3001"
|
wsHost = ":3001"
|
||||||
} else {
|
} else {
|
||||||
wsHost = ""
|
wsHost = ""
|
||||||
@ -45,6 +46,10 @@ export default {
|
|||||||
transports: ['websocket']
|
transports: ['websocket']
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on("connect_error", (err) => {
|
||||||
|
console.error(`Failed to connect to the backend. Socket.io connect_error: ${err.message}`);
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('info', (info) => {
|
socket.on('info', (info) => {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
});
|
});
|
||||||
@ -158,7 +163,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getSocket() {
|
getSocket() {
|
||||||
return socket;
|
return socket;
|
||||||
},
|
},
|
||||||
|
|
||||||
toastRes(res) {
|
toastRes(res) {
|
||||||
|
Loading…
Reference in New Issue
Block a user