Commit Graph

80 Commits

Author SHA1 Message Date
Richard Cox be6e6c9a74
Merge pull request #15341 from richard-cox/pagination-list-clear-on-save
Ensure we don't clear list pages when saving a resource from one
2025-10-15 11:42:23 +01:00
Richard Cox a90029638a
Re-enable vai support for side nav and home page cluster lists (#15262)
* generic changes from https://github.com/rancher/dashboard/pull/14492/files

* VERY WIP
- move out watch event stuff into own file
- improve typing
- start resolving core unwatch & unwatchIncompatible of side nav cluster watches (not going to store) being seen as incompatible with find cluster action that does go into store

* very wip, vaguely working

* starting to tidy up

* more tidying

* wip - pre-pivot

* maybe...

instead of upfront unwatch with lots of complicated logic... only do it if we hit the issue (i.e. no page entry into page )

* tidying up

* asd

* Remove now uneeded sideNavCache

* big refactor, untested

* tidying up

* tidying

* more tidying

* more tidying

* add some super basic unit tests, fix another

* remove debug logger and last todos

* more unit test fixes

* Fix two bugs, and fix e2e tests
- we don't always have the mgmt cluster, so take this into account
  - i've checked all usages of `['management/byId'](MANAGEMENT.CLUSTER`

* more e2e fixes

* Tidying up following review
- more comments
- rename of method to something more sensisble

* Disable support for ssp in side bar and clusters
2025-10-06 09:47:58 +01:00
Richard Cox bdeb202594 Wire in invalidatePageCache to find used in conflict handling 2025-09-11 11:54:46 +01:00
Richard Cox 1c402501d2
Improve support with Vai on and Rancher HA - Lite (#15134)
* wip

* tests - wip

* wip - tidying

* wip

* wip

* tweaks

* fix and expand sub tests

* backoff tests

* tidying up

* more tidying up

* WIP

* address backoff find wiping findPage res after nav from detail to list

* add more docs

* fixes

* comments and logs updates

* remove debug
2025-08-14 15:11:50 +01:00
Richard Cox cdcefd1df9 Two improvements
- remove `get` function
- ensure that find action will watch if resource already in store
2025-08-05 14:39:32 +01:00
Richard Cox 28c58ad5a1
Merge pull request #14674 from richard-cox/fix-stale-ns-filter
Ensure ns filter selection is updated when stale entries are removed
2025-07-04 09:47:04 +01:00
Richard Cox 2800ae04ec Ensure ns filter selection is updated when stale entries are removed
- when we calculate the value of a filter we remove entries that no longer exist
- ensure that this new version of the filter is persisted
- this means whilst on vai supported lists it correctly kicks off a http request
  - this also avoids removed namespaces being used in filters if the list changes

Also
- improved some comments
2025-07-03 15:15:29 +01:00
Richard Cox ce70f83265 Primary change - Fix and improve labelSelectors and vai auto updates
- labelSelector has two primary applicators
  - matching utils function
    - this should normally NOT be cached and not receive updates over sockets
    - this is done by stipulating transient = true
  - findLabelSelector
    - this should normally be cached and receive updates
    - this is done by stipulating transient = false
    - when applicable (workload and services detail page) we want live updates whilst we're on the page
      - we don't when we leave, so unwatch
- fix and align these two and their usages
  - ensure each input (transient) is correct for context
  - ensure response is in the correct format and handled correctly
- improved typing

Additionally
- Improve labelling for network policy ingress/egress label selectors
- Replace empty table with 'no details' in cis report detail page's list's sub row
- On services page handle the very weird use case of no visibility on pods
- Fix issue where extension catalog was not showing when refreshing on extension catalog page list
- Fixed an issue where we would ALWAYS show false positive invalid field warning in console
- Bump up default page size from 10k to 100k
  - this is for requests we make to the new vai cache outside of pages
  - it matches the default they use when proxying requests to target kube cluster
2025-07-03 14:25:37 +01:00
Richard Cox 30fd00bf0c When leaving a list, if we're paginated, forget it (clear cache, stop watches) 2025-06-20 10:23:45 +01:00
Richard Cox 75afc17979
Handle new vai-on updates to resources (#13150)
* port of wip

* asdassad

* Update vai / sql cache based api filtering to match latest changes

* Revert "Pin Rancher version to v2.11-2053ce644a31cd8053d1f58e2487154b0b8513b6-head for e2e tests"

This reverts commit 60f62107e7.

* sdfdsf

* dsfdsf

* asdsad

* fix dynamic hide local cluster changes

* improvements

* aaaa

* Working through todo's/tidys

* Remove debug / tidy up

* resolving todos

* remove some debug

* Tidying up #1

* Make manual refresh and auto-refresh visible on perf setting, disabled by default

* Remove dev stuff

* Fix some e2e tests

* Updated comment

* Wire in resource.changes debounce, clearer label for feature `listAutoRefreshToggle`

* Temporarily disable all watches when vai enable
- remove once rancher/rancher#40773 is resolved, which will then finally fix #12734

* Revert "Temporarily disable all watches when vai enable"

This reverts commit c708f468e4.

* Fix nextResourceVersion
- Ensure it handles resource revisions (in both LIST or individual resources) that are strings
- add unit tests

* Update after review
2025-06-11 18:11:35 +01:00
Richard Cox c446b7aff6 Merge remote-tracking branch 'upstream/master' into pagination-depaginate 2025-05-28 12:10:49 +01:00
Richard Cox 7bc66ab90d fix tests, more lint fixes 2025-05-28 12:05:48 +01:00
Richard Cox 980d4b06d9
Integrate new label select filtering (#12919)
* Test / Wire in new label filtering to limited places

- Wired in to
  - Workload detail page - pods and services (broken due to reverse selector)
  - Service Detail - Pods List
  - Service create/edit - Pod selector tab
- Also
  - Fix showPodRestarts in random location
- TODOs
  - Lots of testing / validation required
  - reverse deployment --> service selector (not services given deployment, but for each service contains pods from deployment)
  - workload model usages of pods getter
  - services model usages of pods getter
  - many many more....

* wired in, NOT tested

* improvement

* sdfdsf

* ryrty

* werer

* The great test off begins

* testing and tidying

* testing and tidying

* First good run

* tests, fixes and improvements

* updates

* Tidying up

* Fixes (namespace orientated), tweaks, updates

* Fix unit test

* Fixes for vai off

* Re-write `matching`
- handle namespaces better (given if the resource is namespaced
- better align with legacy matching fn (given specific scenarios that should return none or all)

* Lots of fixes, but mainly vai off --> pods list --> deployment detail --> pods list updates correctly

* fix lint, unit test

* e2e fix

* Fix weird plugins build validation failure (TS error on expected param for JS method with a default)

* Fix workload services

* changes following mini code review

* Only show pods tab if workload type supports it, always show pod resource table if tab is shown
2025-05-28 11:17:25 +01:00
Richard Cox 20e7af3e59 Merge remote-tracking branch 'upstream/master' into pagination-depaginate 2025-05-28 11:09:25 +01:00
Richard Cox c11db5c4a4 Updates following PR review
- gate incremental page by page number on is steve url + is steve cache enabled
- update incremental object property names, document
- remove fix for event lister errors
- add generic getters to help determine if steve behaviour should be used (getters will also be used in future PR)
2025-05-12 16:35:04 +01:00
Richard Cox 6fcc30a3bb Fix initial quickLoadCount query param 2025-05-12 13:59:25 +01:00
Richard Cox 573a6f630c Handle de-pagination, plus mimic non-vai default `limit` and avoid unlimited response count
- steve depaginate is used by cluster and project bindings, snapshots
2025-05-08 17:33:47 +01:00
Richard Cox 072afc8401 Remove undeeded e2e step, don't use page pagination if norman enabled 2025-05-07 17:51:12 +01:00
Richard Cox b47b48ddcf Support incremental loading when vai cache is enabled 2025-05-07 14:42:41 +01:00
Richard Cox 760bf41d3f tweaks 2025-04-10 10:35:34 +01:00
Richard Cox f0638e8aab Initial commit 2025-04-09 17:06:16 +01:00
Richard Cox b614082ce1
Add server-side pagination to home page cluster list (#11663)
* Server-side pagination for home page clusters list and side bar clusters

- Functional Changes
  - SSP now works after vue3 bump
  - Home Page Clusters list now uses server-side pagination
  - Side Bar clusters list now uses server-side pagination
  - Wire in now supported sorting / filtering by id and name used for table columns
  - Allow pagination to be enabled given a specific context
  - Call findPage without persisting to store

- New Pagination Tools
  - PaginatedResourceTable - Convenience Component, wraps ResourceTable with pagination specific props
  - PaginationWrapper - Convenience class to handle requests for resources and updates to them (avoiding store)

- Regressions
  - Side Nav menu ready state was `mgmtCluster.isReady && !pCluster?.hasError`, now ???

* Iteration

Note - prov clusters is broken (only fetches local) due to blocking pr. breals
- notPinned list

* Fix dupe inStore
- remove from resource list, put in resource-fetch (used also by pag res table)

* Two fixes
- changes namespaces kicked of side nav cluster requests (thought pinnedIds changed)
- fix generic lists re-fetching given ns filter changes (they don't have namespaced arg)

* remove comment, backport fix

* test fixes

* E2E: Ensure we wait for cluster entries to exist before clicking on them

* backport fix for local/api filtering

* Remove debug code

* Changes after review

* e2e fixes / debugging

* More e2e fixes

* More e2e fixes

* More e2e fixes

* Fix generic pages that filter on pagination

* Attempt to fix flaky vai test

* Fix after merge from master

* Updates following new indexed files

* Fix lint and test

* Changes given real cluster tests
- general fixes
- correct issue were sorting prov clusters on mgmt cluster props (issue in master as well...)
- bit the bullet, we now don't fetch all mgmt clusters on dashboard visit.
  - there could be knock on affects, but we'd need to remove it sometime in 2.11....

* Fix issues with diplaying rke1 data in home page
- includes https://github.com/rancher/dashboard/pull/12881

* Fix unit tests
2025-01-03 15:34:28 +00:00
Richard Cox 08f05e229a Paginated Label Select Fixes
### No Options Shown
- Ensure all ResourceLabeledSelect attributes reach LabelSelect component
- This worked at some point, but $attrs now does not contain values that are defined as component props

### Cannot `Load More` options
- `Pages` param Missing in API response
- This has been removed, work around added

### Search term isn't matching partial results
- ensure exact filter matching is off
2024-07-23 12:10:53 +01:00
Richard Cox ac4abfacc7 Fix norman cases which were attempting to call fetchResourceFields, revert type caps change 2024-06-12 13:22:21 +01:00
Richard Cox 3c84d2c0d7 Add conditional depagination by native api, apply to bindings
We could just set depaginate to true, however this would break management of members both explorer and cluster management side at scale.
Hopefully in 2.10.0 there'll be a permanent fix for this (server-side pagination)


Main change
- change depaginate type setting from boolean to boolean || function
- depaginate function will conditionally be true
- currently condition only supports limited depagination by a pre-defined count

In addition / supporint changes
- fix lookup of norman types settings (case sensative)
- fix currentProduct(resource) lookups for norman cluster and project roles
2024-06-12 12:42:07 +01:00
Richard Cox f0c397c001 Update Node list to support server-side pagination
- Setup pagination headers for the node type
- Define a pattern for fetching custom list secondary resources
- Major improvements to the way pagination settings are defined and created
- Lots of docs improvements
- Handle calling fetch again once fetch is in progress (nuxt caches running request)
- Validate filter fields (not all are supported by the vai cache
- General pagination fixes
2024-04-30 11:04:06 +01:00
Richard Cox e80fd7f063 Fix post merge 2024-04-02 14:22:31 +01:00
Richard Cox 487263f4e8 fix tests, getter name change haveAllPaginated --> havePaginatedPage 2024-04-02 13:34:36 +01:00
Richard Cox 1929122124 Split out findPage concept form findAll 2024-04-02 13:34:36 +01:00
Richard Cox d25ec477ae Update comments 2024-04-02 13:34:36 +01:00
Richard Cox 09614b0136 Server-side pagination
Polish and fixes from alpha
2024-04-02 13:34:36 +01:00
Richard Cox ae7eb102ad Pagination Alpha 2024-04-02 13:34:36 +01:00
Neil MacDougall f6c80b295f
Add root product to improve performance of nav change within inExplorer products (#10447)
* Fix race condition in loadCluster

* Revert new error and comments

* Improve navigation performance for products within the explorer product

* Remove unused getter

* Fix issue with not loading nwe cluster when changing clusters

* Fix bug where sidenav take a short time to update (was using queueUpdate)

* Fix lint issues

* Address PR feedback
2024-03-28 09:28:23 +00:00
Richard Cox d6122779a2
Merge pull request #10669 from richard-cox/fix-node-spam
Handle resources that cannot be watched
2024-03-27 11:03:52 +00:00
Richard Cox 89d4eab4ca
Merge pull request #10455 from richard-cox/fix-dup-mgmt-setting-requests
Remove duplicate calls to mgmt settings on fresh load
2024-03-27 11:03:21 +00:00
Richard Cox a91f0303db Revert fixes for list vs individual watch handling
- 9318936c72
- BUG 1
  - Navigating from nodes list to a node detail page unwatches nodes list but doesn't watch new resources
  - Node's list destroy has a forgetType node
    - this removes entries from store and unwatches nodes list watch
    - we clear the fact we're watching the node list once we receieve a resource.stop from socket
  - There's a race condition, the node we're going to is still in the store... but the find action for this doesn't kick off a watch for the rsource
  - This was resolved by the change in the find action
- BUG 2
  - Refreshing on the detail page results in a watch for that specific node
  - Navigating to the list starts a watch for all nodes, but doesn't stop the individual watch
  - This was resolved by the change in subscribe
- HOWEVER
  - These fixes could impact how what we watch in other cases where we might call find all and find specific in the same context
  - Safer to address later
2024-03-26 16:59:14 +00:00
Richard f4416cc647 Fix two more watch related node watch related bugs
1. Switching from a detail page with a watch on a specific resource to the list page where we watch all resources did not unwatch on the specific one
2. Switching to a detail page of a resource that's already in the store should ensure we're watching it
2024-03-26 16:00:08 +00:00
Richard Cox 64e3e923f6
Merge pull request #10480 from richard-cox/fix-pod-cache
Ensure pods loaded by incremental loadDataPage make it to the pod by namespace cache
2024-03-26 15:32:45 +00:00
Richard Cox 5ba075f891 Changes following review
- better comments
- improved tests
- handle trailing url `/`
2024-03-08 11:25:32 +00:00
Richard Cox 01683ae8f4 Ensure `too old` messages for watches in individual resources are handled correctly
- also fix issue where `find` on `resyncWatch` didn't work with namespaced resources
2024-03-07 11:18:54 +00:00
Richard Cox 08f612eab7 Ensure pods loaded by incremental loadDataPage make it to the pod by namespace cached
- Also address a possible race condition made more likely by change
2024-03-04 14:30:41 +00:00
Neil MacDougall 3faa4ad729
Fix race condition in loadCluster (#10445)
* Fix race condition in loadCluster

* Revert new error and comments
2024-03-04 12:55:48 +00:00
Richard Cox 097a220225 Fix new, revealed issues. See PR for description 2024-02-29 17:30:26 +00:00
Richard Cox b464d15ee0
Integrate new schemaDefinitions endpoint (#10141)
* resource edit AS yaml

* fix cruresource (yaml from form)
- lazy load the schemaDefinitions when needed, avoids sync all to createYaml before we have an async chance to fetch schemaDefinitions

* Fix questions
- there are only four places we use questions, none of which use schema, this is just to be safe

* cluster scan, plugins/fieldsForDriver, defaultFor, validationErrors

* pathExistsInSchema
- used to optionally show conditions tab/list in resource detail view
- logs of things in ingress list/edit

* createPopulated / defaultFor
defaultFor requires resourceFields, it's only used by createPopulated in one place to support machine configs without components

* wip

* WIP MONITORING.SPOOFED
- these aren't spoofed types, but secondary schemas
- testing fix blocked, primary schema's have resourceFields

* Move steve specific (resourceField) code to steve models
- create models for steve schemas and apply to cluster and management stores
- move resoureField based validationto steve model
- move pathExistsInSchema to steve store getter
- don't fetch schemaDefinitions on start up when saving prefs (not needed and blocking)

* comments / improvements

* (untested) refactoring

* Fix alertmanager definitions, add retry definition fetch

* Fix pathExistsInSchema for path length > 2

* Fix questions that accept schemas
- tested by adding Questions to random page and the node schema

* Fix to saving configmap part 1
- the save works but doesn't show data. the yaml is the same as before. debug info added

* Validation by resourceFields is a norman specific thing, so make it such

* small refactor

* Tidying up

* Remove rebase junk

* fix linting and unit tests

* fix unit tests

* fix linting from fix for test....

* Tidying up, fix alertmanagerconfig

* Remove unit test todos

* add unit tests for resource fields

* sdssdf

* Add unit tests for pathExistsInSchema

* JS --> TS

* Store schemas in local singleton cache to avoid hitting store

* fix minor changes from review

* cruresource changes following review
- improvement - remove spurious canDiff
- createResourceYaml - pass in resource to use instead of calc in code

* WIP changes to parseType

* Fix generic cloud credential and node driver forms

* handle missing reactivity given schema definitions not in store

* fix and add unit tests for `parseType`

* Fix create-yaml test

* Changes following review
- improved comments
- SchemaDefinitionCache is now per store (and is reset as such)
- typeRef now uses parseType

* Fix dep loop by moving route based helps in auth out to utils file

* fix unit tests

* Changes following review
2024-02-28 17:08:35 +00:00
Richard Cox e90eb2a01b
Merge pull request #10413 from richard-cox/fix-label-selector
Fix issue where labelSelector param was incorrectly applied to filter param
2024-02-14 16:05:12 +00:00
Richard Cox d69fefc867 Fix issue where labelSelector param was incorrectly applied to filter param
- the two fixes are small
- add unit tests to ensure
  - findMatching action calls urlFor with correct args
  - urlOptions getter create correct url given labelSelector
2024-02-06 17:17:16 +00:00
Richard Cox ba2ae401db - Incremental should be applied
- UI makes two requests
  - the initial incremental loading request (limit is 100 to show something quickly)
  - one more for actual incremental processing (limit is 1/4 of total). should be followed by another 3 requests for remaining resources
- What currently happens
  - url contains duplicated `?` in url leading to limit being ignored
  - both requests will fetch ALL resources
  - so x2 requests to fetch ALL resources
- what should happen
  - first request of 100 returns quickly, shows stuff on page
  - next request gets the first `next` url to iterate through pages
  - next three requests iterate through pages
2024-02-02 14:32:15 +00:00
Richard Cox ab5b0cf90b Avoid duplicate / surplus requests to fetch mgmt clusters
- loadManagement and loadCluster run in parallel
- both make requests to fetch mgmt clusters
- normally this is fine (loadManagement fetch finishes first, loadCluster requests then use that result)
- however in scenarios where there are a lot of clusters multiple requests are made
- we now wait for the loadManagmeent request to finish

Additionally
- make requests to correct (though harmless) url path (cluster --> clusters)
2024-01-17 15:51:10 +00:00
Richard Cox fd9285ea4d Remove use of findAll secrets - Monitoring Chart
- Contributes to #9964
- Monitorign chart fetched all secrets, then all usages of it filtered down to a single namespace
- So we now only fetch

Related
- Fix scenario where fetching all then fetching namespaced would return all results

Improvement
Also improve spacingin a placeholder
2023-11-17 17:58:43 +00:00
Sean-McQ 2c81742693
add "exludeFields" option on findAll, unit tests. (#9300)
* add "exludeFields" option on findAll, unit tests.

* fix e2e

* lint fix and e2e test

* updated action unit test and fixed cy.intercepts

* deleted urloptions and test, converted unit tests to ts, removed lodash

* deleted unused urloptions and test
* converted unit tests to ts
* removed lodash

* lint fix

* Added comment with issue for updating query parameters for steve

* Updated based on feedback

* added partial flag to mutations

* pulled out partial flag, excludeOptions logic now entirely within getter

* fixed tests after ripping out partial flag

* Fixed e2e test as 'find' action behavior changed but is still valid
2023-07-18 09:23:26 -04:00