Skip to content

Commit 9cb651d

Browse files
committed
add web and mobil heartbeat
1 parent 8d86b3b commit 9cb651d

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

OpenFlow/src/WebSocketServer.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ export class WebSocketServer {
8282
console.log(err);
8383
});
8484
}
85+
if (cli.clientagent == "webapp" || cli.clientagent == "aiotwebapp") {
86+
Config.db.db.collection("users").updateOne({ _id: cli.user._id },
87+
{ $set: { _webheartbeat: new Date(new Date().toISOString()), _heartbeat: new Date(new Date().toISOString()) } }).catch((err) => {
88+
console.log(err);
89+
});
90+
}
91+
if (cli.clientagent == "mobileapp" || cli.clientagent == "aiotmobileapp") {
92+
Config.db.db.collection("users").updateOne({ _id: cli.user._id },
93+
{ $set: { _webheartbeat: new Date(new Date().toISOString()), _mobilheartbeat: new Date(new Date().toISOString()), _heartbeat: new Date(new Date().toISOString()) } }).catch((err) => {
94+
console.log(err);
95+
});
96+
}
8597
else if (cli.consumers != null && cli.consumers.length > 0) {
8698
// Should proberly turn this a little down, so we dont update all online users every 10th second
8799
Config.db.db.collection("users").updateOne({ _id: cli.user._id }, { $set: { _heartbeat: new Date(new Date().toISOString()) } }).catch((err) => {

OpenFlow/src/public/Robots.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ <h1 translate lib="web">robots</h1>
3030
<th scope="col" ng-click="ctrl.ToggleOrder('name')"><b translate lib="web">name</b></th>
3131
<th scope="col" ng-click="ctrl.ToggleOrder('_rpaheartbeat')"><b translate lib="web">robot</b></th>
3232
<th scope="col" ng-click="ctrl.ToggleOrder('_noderedheartbeat')"><b translate lib="web">nodered</b></th>
33+
<th scope="col" ng-click="ctrl.ToggleOrder('_webheartbeat')"><b translate lib="web">web</b></th>
3334
<th scope="col" ng-click="ctrl.ToggleOrder('_heartbeat')"><b translate lib="web">heartbeat</b></th>
3435
<th scope="col" ng-click="ctrl.ToggleOrder('_lastopenrpaclientversion')"><b translate
3536
lib="web">lastclientversion</b>
@@ -47,9 +48,11 @@ <h1 translate lib="web">robots</h1>
4748
<timesince ng-model="model._rpaheartbeat" />
4849
</td>
4950
<td>
50-
5151
<timesince ng-model="model._noderedheartbeat" />
5252
</td>
53+
<td>
54+
<timesince ng-model="model._webheartbeat" />
55+
</td>
5356
<td>
5457
<timesince ng-model="model._heartbeat" />
5558
</td>

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.453
1+
0.0.454

0 commit comments

Comments
 (0)