Commit Graph

239 Commits

Author SHA1 Message Date
Richard Cox 0dfe5d5ccd Beef up validation 2024-04-30 11:04:06 +01:00
Richard Cox 01781a3940 Lint / test / fixes 2024-04-30 11:04:06 +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
codyrancher e5b79e556b
Merge pull request #10727 from codyrancher/no-auth-extensions
Adding noAuth extension loading
2024-04-29 14:16:59 -07:00
Phillip Rak 71471be1e3 Fix issue with `t` component in i18n plugin
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:23:12 -07:00
Phillip Rak 6383d1ed0c Reintroduce implicit plugin loading & print deprecation messages
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:56 -07:00
Phillip Rak e8b51b62d5 Keep `directiveSsr`, but mark as deprecated
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:55 -07:00
Phillip Rak 46fcb4c3d6 Reintroduce comments
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:55 -07:00
Phillip Rak 8e35a20feb Fix hook functions in i18n plugin
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:55 -07:00
Phillip Rak 9021eaee15 Use relative path in i18n plugin
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:55 -07:00
Phillip Rak 2fa472afbd Refactor i18n plugin to use install function
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-04-25 08:18:55 -07:00
Giuseppe Leo 793f7c6023
Initial migration of Vue3 for compatible fixes (#10858)
* Correct file naming and small TS issues

Correct TS related issues

* Manual replacement of :is on standard HTML tags

* Add missing required in the code dependencies

* Correct SCSS import

* Correct test file naming

* Correct typo in markup

* Use alias for types import
2024-04-23 20:16:46 +02:00
Cody Jackson 5595aeebbf Adding noAuth extension loading
https://github.com/rancher/dashboard/issues/9814
2024-04-22 13:04:00 -07:00
Alexandre Alves 7be2f2e81a
add mgmt cluster description to prov cluster description as fallback in home cluster list and main side nav clusters (#10782)
* add mgmt cluster description to prov cluster description as fallbacks in home cluster list and main side nav clusters

* address pr comments

* add e2e to test description for rke1 cluster in home page

* address pr comments
2024-04-20 10:03:18 +01:00
Richard Cox e80fd7f063 Fix post merge 2024-04-02 14:22:31 +01:00
Richard Cox 0862b80433 Changes following review
- General changes following review comments
- Fix issue where in local cluster the systen classed namespace associated with a project would get muddled with selecting user resources in mathing project
  - Part of this is a big refacture, most of the code to create pag filter params is now in a helper filer
  - Added much improved typing
- Fixed issue where the dynamic namespaces (c-, p-, etc) weren't correctly hidden
- Move user to previous page if last entry on last page deleted (and there is a previous page)
- Fix confusing preference to hide dynamic namespaces (c-, p-, etc)
2024-04-02 14:22:24 +01:00
Richard Cox 487263f4e8 fix tests, getter name change haveAllPaginated --> havePaginatedPage 2024-04-02 13:34:36 +01:00
Richard Cox de131f8a26 Remove paginationEquals from store, and move steve compare to generic utils file 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 cce0808559 Fix lint 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 7f97317630 Better logging for failed plugin loads 2024-03-26 17:45:19 +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 7ee02dd10c Add unit tests 2024-03-26 16:00:08 +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 230ad4d8f0 Handle resources that cannot be watched
- examples metrics.k8s.io.podmetrics, metrics.k8s.io.nodemetrics, componentstatus
- change 1
  - when these are watched the BE now sends an error... which we ignore and try to watch again
  - so handle the error
- change 2
  - avoid this scenario though by stopping watches that don't have the watch verb
  - because of this change 1 can only be tested by changing code
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
Francesco Torchia 7653fbfa73
Fix vue-js-modal shell plugin
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-03-25 15:07:48 +01:00
Francesco Torchia e4a437f227
Revert vue-js-modal removal as required in Harvester
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-03-25 10:34:21 +01:00
Cody Jackson 9e5cce37da Factoring plugin installation out of index.js.
One of a series of changes to simplify the bootstrapping and authentication code.
2024-03-20 12:37:11 -07:00
Phillip Rak 4a9ce08614
Merge pull request #10591 from rak-phillip/feature/8207-modal-replace
Replace `vue-js-modal` with `app-modal`
2024-03-13 09:58:02 -07:00
Phillip Rak 15de4b701c Remove `vue-js-modal` dependency
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-12 15:37:44 -07:00
codyrancher b0d2dcbeb4
Vue 3 Nuxtism Removal (#10533)
* Removing everything related to scrollTrigger.

The latest vue router seems to behave exactly as it does with the modified scrollBehavior so it can all be removed.

* Removing unused $nuxt.{suffixes} that I found
- routeChanged  (didn't find any watches of this event)
- nbFetching (The only place reading this was a computed property which wasn't used anywhere)

* Replace the use of Vue[installKey]

* Removing some ssr rehydration code since we're not doing ssr

* Remove the remaining $nuxt.$on,$off,$emit and replace with the use of our primary store which already had related code

* Replacing usages of the .$nuxt on vue instances with globalApp references

* Removing SSR dead code

* Fixing an issue where extensions could still be referencing window.$nuxt. This now provides a deprecation warning.

* Migrating another $nuxt over to the window.$globalApp

* Removed the usage of Vue.config.$nux

* Removed the usage of Vue.util.defineReactive

- Saw that the Nuxt component wasn't needed any longer so I removed it instead of trying to work around Vue.util.defineReactive

* Re-run missing check

---------

Co-authored-by: cnotv <giuseppe.leo@suse.com>
2024-03-11 18:38:25 +01:00
Richard Cox 5ba075f891 Changes following review
- better comments
- improved tests
- handle trailing url `/`
2024-03-08 11:25:32 +00:00
Richard Cox 4fe1557511 Fix lint 2024-03-07 18:32:55 +00:00
Richard Cox e6f10b9924 Fix issue where on resource.error too old lots of resource watch events still happened
- caused because
  - resource.stop is sent alongside resource.error
  - on resource.error we set the state of the watch to errored
    - this was just using the root type as key and nothing else
  - on resource.stop we call resource.start
  - on resource.start we check for inError and bail if so
    - this didn't happen, as we checked the inError using more than just root type
- fix is to make sure setInError useds same key process as inError getter
  - this follows other places it's used
2024-03-07 18:06:25 +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 1fe8f7368d Add unit tests 2024-03-04 14:30:41 +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 48d5695359 Improve getGroups performances
- Improve performance of allTypes fn
  - This consumed the majority of time within getGroups
  - Reduced execution time by a half
  - Change from running allTypes products * modes times, run it once per product
- Reduce the amount of times getGroups is called
2024-02-09 15:47:33 +00:00
Richard Cox b161ed7c6b
Merge pull request #10387 from richard-cox/fix-incremental-loading
Fix incremental loading
2024-02-08 09:42:34 +00:00