Commit Graph

13 Commits

Author SHA1 Message Date
Richard Cox ae7eb102ad Pagination Alpha 2024-04-02 13:34:36 +01:00
Giuseppe Leo 01eeb0548f
Add recommended lint rules globally (#8997)
* Update configuration

* Create default config for eslint

* Restore plugin:vue/recommended

* Add exceptions and overrides

* Correct manually remaining issues

* Adding further picked exceptions groupped up

* Fix or disable specific cases manually and singularly

* Add naming linting exception

* Remove unused variable in component

* Move rules to default

* Autocorrect rancher/components linting issues

* Configure VSCode to use multiple files, to display linting for rancher components

* Disable jest lint hook restriction for string list component

* Autofix
2023-06-23 17:02:55 +02:00
Richard Cox aa34bd3e29 Fix churn issue
- Moving the store setting to enable/disable filtering in the store to a function in a computed property caused havoc for churn
- Make this much neater by moving flag to the setup stage for both ns filter
2023-05-18 14:28:28 +01:00
Richard Cox 9fada7f0b6 Remove richards-logger 2023-05-18 14:28:28 +01:00
Richard Cox 6fffc0d36a Fix linting 2023-05-18 14:28:28 +01:00
Richard Cox 281fb6672c Simplify forced filtering setting
- Given forced filtering is now not resource dependent have a high level utils function to determine if enabled
- This should have opened up the door to setting a nicer default then ALL_USER, however it's actually initially applied somewhere other than ns filter
- Fixed a bug where the all option [] was valid
2023-05-18 14:28:28 +01:00
Richard Cox 15bc1cd036 Changes following BE update and testing 2023-05-18 14:28:28 +01:00
Richard Cox 7e5ad5de34 Expand enforced namespace filtering to multiple namespaces and projects
> This uses a new endpoint that has yet to merge. See https://github.com/rancher/rancher/issues/40140

WIP
- Contains console.warns (via custom logger, can be disabled)
- Waiting for final BE endpoint changes to merge
- Contains TODOs to resolve on final enpoint changes delivered

Pertinent Points
- Incompatible with incremental loading / manual refresh
  - Harder to get counts (need to sum up from different namespaces)
  - Requires use of new steve pagination
- Enforced NS threshold has been removed
  - The threshold only applies to the primary resource. This has issues when loading a low count primary (daemon sets) which depends on a very high count secondary (pods)
  - Fixing this would involve knowing all secondary resources a list uses, which isn't currently possible (each resource is requested individually, need to know them all first)
- There is no way to subscribe to multiple namespaces (one or all)
  - We mock this in subscribe by only persisting changes to resources from within target namespaces
- Everything should work with Advanced Worker enabled
2023-05-18 14:28:28 +01:00
Alexandre Alves 84e260d95e
Manual Refresh Performance Option (#7904)
* update resource fetching on list views so that secondary resources follow the logic of manual refres
h and/or incremental loading if the main resource defines it

* Update resource-fetch logic to take into consideration the storeType for each individual request + fix logic regarding namespace for fetching resources + update missing resources logic (nodes and prov clusters)

* fix tipo

* reinstate hash system to handle requests for nodes and prov cluster lists

* revert mutation code + add check to register type if it doesnt exist on loadDataPage action

* fix issue with timeout that wasnt working properly for the update of live and delayed cols after manual refresh

* Take in to account the per resource count when calculating `limit`
- This means primary resources with a smaller amount don't restrict secondary resources with larger amounts

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-01-27 14:32:42 +00:00
Richard Cox b88ceb6e5a Fix project/namespace --> cluster manager blank page bug
- caused by circular dependency of
  - index.vue --> resource-fetch mixin --> resource-fetch-namespaced mixin --> index.vue
- not sure why the works on most pages... but bugs out for this one... but the fix makes sense
2022-12-23 11:34:12 +00:00
Richard Cox 762b3e4163 Updates following review
- Tweak settings text
- Use new filter icon
- Tweak "too many" text
- Allow only selecting a single namespace when in 'too many' mode
2022-12-02 12:37:35 +00:00
Richard Cox 8924b34888 Disable ns filtering for fleet / workspace world
- This might be possible (as fleet workspaces are similar to namespaces
- To address though would need to re-fetch resources when workspace changes
  - Currently when ns changes we always go to an invalid state first
  - Single NS (show list & fetch resources) --> Multiple NS (hide list) --> Single NS (show list & fetch resources)
  - For workspace we skip the middle part and don't fetch with latest
2022-12-02 12:30:13 +00:00
Richard Cox 75aa51fab9 Enforce Namespace Filter
- When there are over a configurable amount of resources to display in a list force the user to select a single namespace and use it to fetch resources related to the list
- Disabled by default, this can be enabled via the usual Global Settings --> Performance setting as usual

Functional Comments
- Gates for forcing the filter (count, resource type is namespaced, etc) apply only to the resources shown in the list.
  - For example PV's aren't namespaced, so no enforced filtering. However they fetch PVC's which are namespaced
  - For example we could have 10 resources to show in the list, but the resource types list component fetches 10000 other resources. The secondary resources are not taken in to account
- If we're under the threshold and have fetched all resources, if in that session we go over the threshold we won't fetch NS specific resources (because we have them all already)
- If we're over the threshold and have fetched namespaced resources, if in that session we go under the threshold we will fetch all resources
- If we're over the threshold and have fetched namespaced resources, going to a page that needs them all will result in us fetching them all (for instance from `events` to `cluster dashboard`)
- Deselecting a namespace and selecting it again should not kick off another http request

General Commit Comments
- The threshold to enforce the filter is set at 1500 as per manual fresh and incremental loading
- Optimised some code in ResourceList, resource-fetch and $loadingResources
2022-12-02 12:30:13 +00:00