diff --git a/ui/app/controllers/clients/index.js b/ui/app/controllers/clients/index.js index 2bffd56c9..2c1463c41 100644 --- a/ui/app/controllers/clients/index.js +++ b/ui/app/controllers/clients/index.js @@ -1,4 +1,5 @@ -import { alias } from '@ember/object/computed'; +import { alias, readOnly } from '@ember/object/computed'; +import { inject as service } from '@ember/service'; import Controller, { inject as controller } from '@ember/controller'; import { computed } from '@ember/object'; import { scheduleOnce } from '@ember/runloop'; @@ -11,6 +12,7 @@ export default Controller.extend( SortableFactory(['id', 'name', 'compositeStatus', 'datacenter']), Searchable, { + userSettings: service(), clientsController: controller('clients'), nodes: alias('model.nodes'), @@ -28,7 +30,7 @@ export default Controller.extend( }, currentPage: 1, - pageSize: 8, + pageSize: readOnly('userSettings.pageSize'), sortProperty: 'modifyIndex', sortDescending: true, diff --git a/ui/app/controllers/csi/volumes/index.js b/ui/app/controllers/csi/volumes/index.js index 3eb926864..d251ab1bc 100644 --- a/ui/app/controllers/csi/volumes/index.js +++ b/ui/app/controllers/csi/volumes/index.js @@ -1,5 +1,5 @@ import { inject as service } from '@ember/service'; -import { alias } from '@ember/object/computed'; +import { alias, readOnly } from '@ember/object/computed'; import Controller, { inject as controller } from '@ember/controller'; import SortableFactory from 'nomad-ui/mixins/sortable-factory'; @@ -13,6 +13,7 @@ export default Controller.extend( ]), { system: service(), + userSettings: service(), csiController: controller('csi'), isForbidden: alias('csiController.isForbidden'), @@ -24,12 +25,19 @@ export default Controller.extend( }, currentPage: 1, - pageSize: 10, + pageSize: readOnly('userSettings.pageSize'), sortProperty: 'id', sortDescending: true, listToSort: alias('model'), sortedVolumes: alias('listSorted'), + + // TODO: Remove once this page gets search capability + resetPagination() { + if (this.currentPage != null) { + this.set('currentPage', 1); + } + }, } ); diff --git a/ui/app/controllers/jobs/job/task-group.js b/ui/app/controllers/jobs/job/task-group.js index 6f8740ce0..3e1a5d9c7 100644 --- a/ui/app/controllers/jobs/job/task-group.js +++ b/ui/app/controllers/jobs/job/task-group.js @@ -1,4 +1,5 @@ -import { alias } from '@ember/object/computed'; +import { alias, readOnly } from '@ember/object/computed'; +import { inject as service } from '@ember/service'; import Controller from '@ember/controller'; import { computed } from '@ember/object'; import Sortable from 'nomad-ui/mixins/sortable'; @@ -6,6 +7,8 @@ import Searchable from 'nomad-ui/mixins/searchable'; import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, { + userSettings: service(), + queryParams: { currentPage: 'page', searchTerm: 'search', @@ -14,7 +17,7 @@ export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, { }, currentPage: 1, - pageSize: 10, + pageSize: readOnly('userSettings.pageSize'), sortProperty: 'modifyIndex', sortDescending: true, diff --git a/ui/app/templates/clients/index.hbs b/ui/app/templates/clients/index.hbs index f4d88052c..2bfc1fc73 100644 --- a/ui/app/templates/clients/index.hbs +++ b/ui/app/templates/clients/index.hbs @@ -66,12 +66,13 @@ {{/t.body}} {{/list-table}}
+ {{page-size-select onChange=(action resetPagination)}}
diff --git a/ui/app/templates/csi/volumes/index.hbs b/ui/app/templates/csi/volumes/index.hbs index 45a9cfa94..5ca706e94 100644 --- a/ui/app/templates/csi/volumes/index.hbs +++ b/ui/app/templates/csi/volumes/index.hbs @@ -41,12 +41,13 @@ {{/t.body}} {{/list-table}}
+ {{page-size-select onChange=(action resetPagination)}}
diff --git a/ui/app/templates/jobs/job/task-group.hbs b/ui/app/templates/jobs/job/task-group.hbs index fdfa5d001..c4e3f66b8 100644 --- a/ui/app/templates/jobs/job/task-group.hbs +++ b/ui/app/templates/jobs/job/task-group.hbs @@ -81,12 +81,13 @@ {{/t.body}} {{/list-table}}
+ {{page-size-select onChange=(action resetPagination)}}