Skip to content

Commit a81e3e0

Browse files
committed
add search on more forms
1 parent f996aed commit a81e3e0

9 files changed

Lines changed: 82 additions & 25 deletions

File tree

OpenFlow/src/public/CommonControllers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ module openflow {
537537
if (this.models.length > 100) {
538538
console.warn("Disabling auto refresh, result has more than 100 entries");
539539
} else {
540-
if (this.autorefreshpromise == null) {
540+
if (this.autorefreshpromise == null && this.searchstring === "") {
541+
//if (this.autorefreshpromise == null) {
541542
this.autorefreshpromise = this.$interval(() => {
542543
this.loadData();
543544
}, this.autorefreshinterval);

OpenFlow/src/public/Controllers.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ module openflow {
9494
this.collection = "openrpa";
9595
this.basequery = { _type: "workflow" };
9696
this.baseprojection = { _type: 1, type: 1, name: 1, _created: 1, _createdby: 1, _modified: 1 };
97+
this.postloadData = this.processdata;
9798
WebSocketClient.onSignedin((user: TokenUser) => {
9899
this.loadData();
99100
});
100101
}
101-
async loadData(): Promise<void> {
102+
async processdata() {
102103
this.loading = true;
103104
this.charts = [];
104-
var chart: chartset = null;
105-
this.models = await this.api.Query(this.collection, this.basequery, null, null);
106105
if (!this.$scope.$$phase) { this.$scope.$apply(); }
106+
var chart: chartset = null;
107107
for (var i = 0; i < this.models.length; i++) {
108108
var workflow = this.models[i] as any;
109109
var d = new Date();
@@ -137,15 +137,6 @@ module openflow {
137137
return reducedValue;
138138
}, { _type: "workflowinstance", WorkflowId: workflow._id, "_created": { "$gte": new Date(d.toISOString()) } }, { inline: 1 }, null);
139139

140-
141-
142-
// // {$where : function() { return this.date.getMonth() == 11} }
143-
// var q = { _type: "workflowinstance", WorkflowId: workflow._id, "_created": { "$gte": new Date(d.toISOString()) } };
144-
// // var q = { _type: "workflowinstance", WorkflowId: workflow._id, "_created": { "$gte": new Date("2010-04-30T00:00:00.000Z") } };
145-
146-
// workflow.instances = await this.api.Query("openrpa_instances", q, null, null, 100);
147-
148-
149140
chart = new chartset();
150141
chart.charttype = "line"
151142
chart.data = [];
@@ -1302,6 +1293,7 @@ module openflow {
13021293
this.autorefresh = true;
13031294
this.autorefreshinterval = 5000;
13041295
console.debug("jslogCtrl");
1296+
this.searchfields = ["_createdby", "host", "message"];
13051297
this.collection = "jslog";
13061298
this.basequery = {};
13071299
this.orderby = { _created: -1 };

OpenFlow/src/public/Forms.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
<div class="starter-template">
2-
<h1 translate lib="web">entities</h1>
1+
<div class="row">
2+
<h1 translate lib="web">forms</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
13+
414
<div class="row">
515
<div class=" col-md-6 text-right">
616
<a ng-href="#/EditForm" class="btn btn-info" translate lib="web">addform</a>

OpenFlow/src/public/Providers.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
2-
<h1 translate lib="web">Providers</h1>
1+
<div class="row">
2+
<h1 translate lib="web">providers</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<div class="col-sm-12 text-right">
514
<a href="#/Provider" class="btn btn-info" translate lib="web">addprovider</a>

OpenFlow/src/public/RPAWorkflows.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
1+
<div class="row">
22
<h1 translate lib="web">rpaworkflows</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<div class="row">
514
<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">

OpenFlow/src/public/Roles.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
2-
<h1>Roles</h1>
1+
<div class="row">
2+
<h1 translate lib="web">roles</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<div class="col-sm-12 text-right">
514
<a href="#/Role" class="btn btn-info" translate lib="web">addrole</a>

OpenFlow/src/public/Users.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
2-
<h1>Users</h1>
1+
<div class="row">
2+
<h1 translate lib="web">users</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<div class="col-sm-12 text-right">
514
<a href="#/User" class="btn btn-info" translate lib="web">Adduser</a>

OpenFlow/src/public/Workflows.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
1+
<div class="row">
22
<h1 translate lib="web">workflows</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<div class="row">
514
<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">

OpenFlow/src/public/jslog.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
<div class="starter-template">
2-
<h1 translate lib="web">entities</h1>
1+
<div class="row">
2+
<h1 translate lib="web">jslog</h1>
3+
<p class="col-md-5 lead"></p>
4+
<div class="form-group col-sm-3 form-horizontal">
5+
<label class="sr-only">Filter</label>
6+
<div class="input-group unframed-addons">
7+
<div class="input-group-addon"><i class="fas fa-search"></i></div>
8+
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
9+
ng-model-options="{debounce: 400}" />
10+
</div>
11+
</div>
312
</div>
413
<button type="button" ng-click="ctrl.loadData()" ng-disabled="ctrl.loading" translate lib="web">reload</button>
514
<button type="button" ng-click="ctrl.DeleteMany()" ng-disabled="ctrl.loading" translate lib="web">empty</button>

0 commit comments

Comments
 (0)