@@ -3092,8 +3092,8 @@ export class hdrobotsCtrl extends entitiesCtrl<unattendedclient> {
30923092 }
30933093}
30943094export 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