Update Requests
Make use of server-side pagination and filtering in places where ad-hoc requests are made.
There may be places where an extension fetches all of a resource type. When there is likely to be a lot of that resource type the extension should be updated to filter down the number of resources to a manageable count.
Server-side pagination is a feature that is on by default but can be disabled. When disabled not all API functionality is available. In v2.12.0 and until the ability to disable the feature both old and new approaches need to be supported.
Additionally server-side pagination may be enabled but not currently supported for a resource type.
To determine if server-side pagination is supported for a resource type use the
paginationEnabledaction. For example
this.$store.getters['cluster/paginationEnabled'](POD);
this.$store.getters['management/paginationEnabled'](MANAGEMENT.CLUSTER);
General Filtering
Places that dispatch the findAll action should be supplemented with findPage.
If server-side pagination is not enabled use findAll as before, it enabled use the new findPage action
The findPage action unlocks a number of different filtering options. For details see shell/types/store/pagination.types.ts FilterArgs and inline comments. For details on what these represent see Steve API docs (NOTE - The steve api is internal and liable to change without notice)
Examples
- rancher/dashboard shell/edit/serviceaccount.vue- filterSecretsByApimethod
- the UI fetches secrets
- server-side pagination
- enabled - the UI fetches only secretsmatching a specific type
- disabled - the UI fetches all secrets
 
- enabled - the UI fetches only 
 
- rancher/dashboard shell/detail/node.vue- fetchmethod
- the UI fetches podsin a specificnode
- server-side pagination
- enabled - the UI fetches only podsmatching thenode
- disabled - the UI fetches all pods
 
- enabled - the UI fetches only 
 
- rancher/dashboard shell/pages/home.vue- fetchSecondaryResources- only runs when server-side pagination is disabled i.e. it's param opts.canPaginateis false
- fetches all resources
 
- only runs when server-side pagination is disabled i.e. it's param 
- fetchPageSecondaryResources- only runs when server-side pagination is enabled i.e. it's param opts.canPaginateis false
- fetches resources associated with the current page
 
- only runs when server-side pagination is enabled i.e. it's param