Skip to content

Commit 4d06bb6

Browse files
committed
add better filter to client page
1 parent a325fc6 commit 4d06bb6

3 files changed

Lines changed: 31 additions & 14 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,10 @@ export class Message {
10521052
user._lastopenrpaclientversion = cli.clientversion;
10531053
UpdateDoc.$set["_lastopenrpaclientversion"] = cli.clientversion;
10541054
}
1055+
if (cli.clientagent == "webapp") {
1056+
user._lastopenrpaclientversion = cli.clientversion;
1057+
UpdateDoc.$set["_lastwebappclientversion"] = cli.clientversion;
1058+
}
10551059
if (cli.clientagent == "nodered") {
10561060
user._lastnoderedclientversion = cli.clientversion;
10571061
UpdateDoc.$set["_lastnoderedclientversion"] = cli.clientversion;

OpenFlow/src/public/Clients.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ <h1 translate lib="web">robots</h1>
1919
<!-- <a ng-href="#/Entity/{{ctrl.collection}}" class="btn btn-info" translate lib="web">addentity</a> -->
2020
<input type="checkbox" ng-model="ctrl.showinactive" ng-change="ctrl.loadData()"> <span translate
2121
lib="web">showinactive</span>
22-
<input type="checkbox" ng-model="ctrl.showall" ng-change="ctrl.loadData()"> <span translate lib="web">showall</span>
22+
<input type="radio" name="show" value="openrpa" ng-model="ctrl.show" ng-change="ctrl.loadData()"> <span translate
23+
lib="web">openrpa</span>
24+
<input type="radio" name="show" value="nodered" ng-model="ctrl.show" ng-change="ctrl.loadData()"> <span translate
25+
lib="web">nodered</span>
26+
<input type="radio" name="show" value="webapp" ng-model="ctrl.show" ng-change="ctrl.loadData()"> <span translate
27+
lib="web">web</span>
28+
<input type="radio" name="show" value="all" ng-model="ctrl.show" ng-change="ctrl.loadData()"> <span translate
29+
lib="web">showall</span>
2330
<!-- <a ng-href="#/Entity/{{ctrl.collection}}" class="btn btn-info"><i class="az-add-lg"></i></a> -->
31+
<br> {{ctrl.showall}} / {{ctrl.show}}
2432
</div>
2533
</div>
2634
<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
@@ -58,7 +66,12 @@ <h1 translate lib="web">robots</h1>
5866
<!-- <td>
5967
<timesince ng-model="model._heartbeat" />
6068
</td> -->
61-
<td>{{model._lastopenrpaclientversion}}</td>
69+
<td>
70+
<div ng-show="ctrl.show == 'openrpa'">{{model._lastopenrpaclientversion}}</div>
71+
<div ng-show="ctrl.show == 'nodered'">{{model._lastnoderedclientversion}}</div>
72+
<div ng-show="ctrl.show == 'webapp'">{{model._lastwebappclientversion}}</div>
73+
<div ng-show="ctrl.show == 'all'">{{model._lastclientversion}}</div>
74+
</td>
6275
<td class="btn-cell">
6376
<a href ng-click="ctrl.ShowWorkflows(model)" class="table-btn">workflows</a>
6477
</td>

OpenFlow/src/public/Controllers.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,8 +3092,8 @@ export class hdrobotsCtrl extends entitiesCtrl<unattendedclient> {
30923092
}
30933093
}
30943094
export class ClientsCtrl extends entitiesCtrl<unattendedclient> {
3095-
public showall: boolean = true;
30963095
public showinactive: boolean = false;
3096+
public show: string = "all";
30973097
constructor(
30983098
public $scope: ng.IScope,
30993099
public $location: ng.ILocationService,
@@ -3112,17 +3112,17 @@ export class ClientsCtrl extends entitiesCtrl<unattendedclient> {
31123112
this.preloadData = () => {
31133113
const dt = new Date(new Date().toISOString());
31143114
if (this.showinactive) {
3115-
if (this.showall) {
3116-
this.basequery = { _heartbeat: { "$exists": true } };
3117-
} else {
3118-
this.basequery = { _rpaheartbeat: { "$exists": true } };
3119-
}
3120-
} else if (this.showall) {
3121-
dt.setMinutes(dt.getMinutes() - 1);
3122-
this.basequery = { _heartbeat: { "$gte": dt } };
3115+
if (this.show == "openrpa") this.basequery = { "_rpaheartbeat": { "$exists": true } };
3116+
if (this.show == "nodered") this.basequery = { "_noderedheartbeat": { "$exists": true } };
3117+
if (this.show == "webapp") this.basequery = { "_webheartbeat": { "$exists": true } };
3118+
if (this.show == "all") this.basequery = { _heartbeat: { "$exists": true } };
31233119
} else {
31243120
dt.setMinutes(dt.getMinutes() - 1);
3125-
this.basequery = { _rpaheartbeat: { "$gte": dt } };
3121+
this.basequery = { "$or": [] };
3122+
if (this.show == "openrpa") this.basequery = { "_rpaheartbeat": { "$gte": dt } };
3123+
if (this.show == "nodered") this.basequery = { "_noderedheartbeat": { "$gte": dt } };
3124+
if (this.show == "webapp") this.basequery = { "_webheartbeat": { "$gte": dt } };
3125+
if (this.show == "all") this.basequery = { _heartbeat: { "$gte": dt } };
31263126
}
31273127
};
31283128
if (this.userdata.data.ClientsCtrl) {
@@ -3133,7 +3133,7 @@ export class ClientsCtrl extends entitiesCtrl<unattendedclient> {
31333133
this.searchstring = this.userdata.data.ClientsCtrl.searchstring;
31343134
this.basequeryas = this.userdata.data.ClientsCtrl.basequeryas;
31353135
this.showinactive = this.userdata.data.ClientsCtrl.showinactive;
3136-
this.showall = this.userdata.data.ClientsCtrl.showall;
3136+
this.show = this.userdata.data.ClientsCtrl.show;
31373137
}
31383138
WebSocketClientService.onSignedin((user: TokenUser) => {
31393139
this.loadData();
@@ -3148,7 +3148,7 @@ export class ClientsCtrl extends entitiesCtrl<unattendedclient> {
31483148
this.userdata.data.ClientsCtrl.searchstring = this.searchstring;
31493149
this.userdata.data.ClientsCtrl.basequeryas = this.basequeryas;
31503150
this.userdata.data.ClientsCtrl.showinactive = this.showinactive;
3151-
this.userdata.data.ClientsCtrl.showall = this.showall;
3151+
this.userdata.data.ClientsCtrl.show = this.show;
31523152

31533153
for (let i = 0; i < this.models.length; i++) {
31543154
const model: any = this.models[i];

0 commit comments

Comments
 (0)