implement uptime

This commit is contained in:
LouisLam
2021-07-01 13:11:16 +08:00
parent 82afddcfd6
commit 84c21b71c0
7 changed files with 145 additions and 49 deletions

View File

@@ -17,18 +17,11 @@ export default {
},
allowLoginDialog: false, // Allowed to show login dialog, but "loggedIn" have to be true too. This exists because prevent the login dialog show 0.1s in first before the socket server auth-ed.
loggedIn: false,
monitorList: [
],
heartbeatList: {
},
importantHeartbeatList: {
},
avgPingList: {
}
monitorList: { },
heartbeatList: { },
importantHeartbeatList: { },
avgPingList: { },
uptimeList: { }
}
},
@@ -85,6 +78,10 @@ export default {
this.avgPingList[monitorID] = data
});
socket.on('uptime', (monitorID, type, data) => {
this.uptimeList[`${monitorID}_${type}`] = data
});
socket.on('importantHeartbeatList', (monitorID, data) => {
if (! (monitorID in this.importantHeartbeatList)) {
this.importantHeartbeatList[monitorID] = data;