Mercurial > hg > thermostat-ng > web-client
changeset 177:97e433c06ff8
Fix loading of pfListView in jvm-list
PR3444
Reviewed-by: aazores
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-August/024787.html
author | Alex Macdonald <almacdon@redhat.com> |
---|---|
date | Thu, 31 Aug 2017 14:54:11 -0400 |
parents | 6c3ce29d353f |
children | 4c0492488b9c |
files | src/app/components/jvm-list/jvm-list.controller.js src/app/components/jvm-list/jvm-list.html |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/app/components/jvm-list/jvm-list.controller.js Wed Aug 30 14:21:56 2017 -0400 +++ b/src/app/components/jvm-list/jvm-list.controller.js Thu Aug 31 14:54:11 2017 -0400 @@ -33,7 +33,6 @@ class JvmListController { constructor (jvmListService, systemInfoService, $scope, $location, $timeout, $translate) { 'ngInject'; - this.scope = $scope; this.jvmListService = jvmListService; this.systemInfoService = systemInfoService; this.scope = $scope; @@ -42,6 +41,7 @@ this.translate = $translate; this.systemsOpen = {}; + $scope.pageConfig = { showPaginationControls: false }; $scope.sortConfig = {}; $scope.filterConfig = {}; $scope.listConfig = { @@ -114,7 +114,6 @@ resp => { this.showErr = false; this.systems = resp.data.response; - for (let i = 0; i < this.systems.length; i++) { let system = this.systems[i]; this.systemsOpen[system.systemId] = false; @@ -129,15 +128,19 @@ } ); } - if (this.systems.length === 1) { this.systemsOpen[this.systems[0].systemId] = true; } + this.scope.pageConfig.numTotalItems = this.scope.allItems.length; + this.scope.pageConfig.pageSize = this.scope.allItems.length; + this.scope.pageConfig.pageNumber = 1; this.scope.listConfig.itemsAvailable = true; this.scope.toolbarConfig.filterConfig.resultsCount = this.systems.length; }, () => { this.scope.listConfig.itemsAvailable = false; + this.scope.pageConfig.pageSize = 0; + this.scope.pageConfig.pageNumber = 0; this.showErr = true; } );
--- a/src/app/components/jvm-list/jvm-list.html Wed Aug 30 14:21:56 2017 -0400 +++ b/src/app/components/jvm-list/jvm-list.html Thu Aug 31 14:54:11 2017 -0400 @@ -15,6 +15,7 @@ <div class="pfListView col-md-12"> <pf-list-view config="listConfig" items="items" + page-config="pageConfig" empty-state-config="emptyStateConfig"> <div class="list-view-pf-left"> <span class="pficon pficon-screen list-view-pf-icon-med"></span>