diff --git a/frontend/app/index.html b/frontend/app/index.html index fd8df0c4c8..669cc171ca 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -140,6 +140,7 @@ + diff --git a/frontend/app/scripts/components/common/datalist-header.component.js b/frontend/app/scripts/components/common/datalist-header.component.js new file mode 100644 index 0000000000..3376537620 --- /dev/null +++ b/frontend/app/scripts/components/common/datalist-header.component.js @@ -0,0 +1,15 @@ +(function () { + 'use strict'; + + angular.module('theHiveComponents') + .component('datalistHeader', { + controller: function () { }, + controllerAs: '$ctrl', + templateUrl: 'views/components/common/datalist-header.component.html', + bindings: { + title: '@', + list: '<', + total: '<' + } + }); +})(); diff --git a/frontend/app/scripts/services/api/TagSrv.js b/frontend/app/scripts/services/api/TagSrv.js index 23918abc87..abf893ae77 100644 --- a/frontend/app/scripts/services/api/TagSrv.js +++ b/frontend/app/scripts/services/api/TagSrv.js @@ -21,7 +21,7 @@ { _name: 'filter', _ne: { '_field': 'colour', '_value': defaultColour } } ], { params: { - name: 'list-tags' + name: 'freetags-cache' } }) }) diff --git a/frontend/app/scripts/services/common/data/PaginatedQuerySrv.js b/frontend/app/scripts/services/common/data/PaginatedQuerySrv.js index 827c058de3..0a863d8fe5 100644 --- a/frontend/app/scripts/services/common/data/PaginatedQuerySrv.js +++ b/frontend/app/scripts/services/common/data/PaginatedQuerySrv.js @@ -35,6 +35,8 @@ this.extraData = options.extraData || undefined; this.name = options.name || undefined; this.config = options.config || {}; + this.loading = false; + this.loadingCount = false; this.operations = options.operations; @@ -134,6 +136,7 @@ var filters = self.getFilter(); // Get the list + this.loading = true; QuerySrv.call(this.version, this.operations, { filter: filters, sort: self.getSort(), @@ -141,24 +144,29 @@ config: self.config, withParent: false, name: self.name - }).then(function (data) { - if (self.loadAll) { - self.allValues = data; - - self.total = data.length; - - self.changePage(); - } else { - self.values = data; - if (angular.isFunction(self.onUpdate)) { - self.onUpdate(updates); + }) + .then(function (data) { + if (self.loadAll) { + self.allValues = data; + + self.total = data.length; + + self.changePage(); + } else { + self.values = data; + if (angular.isFunction(self.onUpdate)) { + self.onUpdate(updates); + } } - } - }).catch(function (err) { - if (self.onFailure) { - self.onFailure(err); - } - }); + }) + .catch(function (err) { + if (self.onFailure) { + self.onFailure(err); + } + }) + .finally(function () { + self.loading = false; + }); // get the total if not cached var hash = $filter('md5')(JSON.stringify(this.filter)); @@ -166,6 +174,7 @@ this.filterHash = hash; // Compute the total again + self.loadingCount = true; QuerySrv.count('v1', this.operations, { filter: filters, name: self.name, @@ -173,6 +182,8 @@ limitedCount: self.limitedCount }).then(function (total) { self.total = total; + }).finally(function () { + self.loadingCount = false; }); } diff --git a/frontend/app/views/components/common/datalist-header.component.html b/frontend/app/views/components/common/datalist-header.component.html new file mode 100644 index 0000000000..dcd0e59398 --- /dev/null +++ b/frontend/app/views/components/common/datalist-header.component.html @@ -0,0 +1,11 @@ + + {{$ctrl.title}} + ({{$ctrl.list.total | limitedCount}} + ( + of {{$ctrl.total}}) + of ) + Fetching + data... + Counting records... + diff --git a/frontend/app/views/components/org/custom-tags/tag-list.html b/frontend/app/views/components/org/custom-tags/tag-list.html index 481d50066b..f94d46638d 100644 --- a/frontend/app/views/components/org/custom-tags/tag-list.html +++ b/frontend/app/views/components/org/custom-tags/tag-list.html @@ -8,7 +8,8 @@

- List of custom tags ({{$vm.list.total | limitedCount}} of {{$vm.freetagsCount}}) + +

@@ -19,11 +20,11 @@

-
+
No records
-
+
diff --git a/frontend/app/views/directives/psearch.html b/frontend/app/views/directives/psearch.html index 03c0512f66..dbcbeb9cd9 100644 --- a/frontend/app/views/directives/psearch.html +++ b/frontend/app/views/directives/psearch.html @@ -1,3 +1,13 @@ -
-
    -
    +
    +
    +
      +
    +
    + +
    +
      +
      +
      diff --git a/frontend/app/views/partials/alert/list.html b/frontend/app/views/partials/alert/list.html index e8fda587f3..553dc6c736 100644 --- a/frontend/app/views/partials/alert/list.html +++ b/frontend/app/views/partials/alert/list.html @@ -2,7 +2,9 @@
      -

      List of alerts ({{$vm.list.total | limitedCount}} of {{$vm.alertCountAll}})

      +

      + +

      @@ -23,11 +25,12 @@

      List of alerts ({{$vm.list.total | limitedCount}} of {{$vm
      -
      + +
      No records
      -
      +

      @@ -156,12 +159,14 @@

      List of alerts ({{$vm.list.total | limitedCount}} of {{$vm

      {{event.caseId ? + ng-click="$vm.addFilterValue('imported', !!event.caseId)">{{event.caseId + ? 'Imported' : 'New'}} {{event.read ? 'Read' : + ng-click="$vm.addFilterValue('read', !!event.read)">{{event.read ? + 'Read' : 'Unread'}} diff --git a/frontend/app/views/partials/case/case.list.html b/frontend/app/views/partials/case/case.list.html index 46ecede4b0..2c67c8ed7f 100644 --- a/frontend/app/views/partials/case/case.list.html +++ b/frontend/app/views/partials/case/case.list.html @@ -2,7 +2,9 @@